运维随录实战(2)之k8s部署应用

一, 创建.gitlab-ci.yml文件

架构流程

文件内容

stages: #设置流水线模版- build # 编译- source2img- deploy # 发布variables: # 设置全局变量MAVEN_PATH:  .m2MAVEM_IMAGE: maven:3.8.5-openjdk-17-slim  # maven 打包使用的镜像MAVEN_CLI_OPTS: "-s $MAVEN_PATH/settings.xml --batch-mode"MAVEN_OPTS: "-Dmaven.repo.local=$MAVEN_PATH/repository"IMAGE: shuinfo-docker-images-registry.cn-shanghai.cr.aliyuncs.com/jbs/ods-poc:${CI_PIPELINE_IID}KUBECONFIG: /root/.kube/configcache: # 设置缓存paths:- $MAVEN_PATH/repository/- target/build:#  needs:#    - check-style#    - unit-test#    - static-checkartifacts:paths:- starbucks-ods-webflux-poc/target/*.jarexpire_in: 1 weekstage: buildimage: "$MAVEM_IMAGE"before_script:- mkdir -p $MAVEN_PATH- echo $SETTING > $MAVEN_PATH/settings.xmlscript:- mvn  $MAVEN_CLI_OPTS  clean install package  -Dmaven.test.skip=trueonly:- "/^develop/.*$/"- develop- release- "/^release/.*$/"- mastersource2img:stage: source2imgimage: sp0cket/kaniko-executor:debugbefore_script:- echo $DOCKER_AUTH_CONFIG > /kaniko/.docker/config.jsonscript:- ls- pwd- echo $DOCKER_AUTH_CONFIG- echo ${IMAGE}- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $IMAGEonly:- /^develop/.*$/- develop- release- /^release/.*$/- masterdeploy:prod:needs:- source2imgstage: deployimage: sp0cket/kubectl:v1.20.4when: manualbefore_script:- mkdir -p /root/.kube- echo $ODS_SHUINFO_ACK- echo "$ODS_SHUINFO_ACK" > $KUBECONFIGscript:- envsubst '${IMAGE}' < deployment_prod.yaml > dp.yaml- kubectl apply -f ./dp.yaml -n default  --insecure-skip-tls-verifyonly:- masterdeploy:test:needs:- source2imgstage: deployimage: sp0cket/kubectl:v1.20.4before_script:- mkdir -p /root/.kube- echo ${ODS_SHUINFO_ACK}- echo "$ODS_SHUINFO_ACK" > $KUBECONFIGscript:- envsubst '${IMAGE}' < deployment_test.yaml > dp.yaml- kubectl apply -f ./dp.yaml -n default  --insecure-skip-tls-verifyonly:- /^release/.*$/- releasedeploy:uat:needs:- source2imgstage: deployimage: sp0cket/kubectl:v1.20.4when: manualbefore_script:- mkdir -p /root/.kube- echo ${ODS_SHUINFO_ACK}- echo "$ODS_SHUINFO_ACK" > $KUBECONFIGscript:- envsubst '${IMAGE}' < deployment_uat.yaml > dp.yaml- kubectl apply -f ./dp.yaml -n default  --insecure-skip-tls-verifyonly:- /^release/.*$/- releasedeploy:dev:needs:- source2imgstage: deployimage: sp0cket/kubectl:v1.20.4artifacts:paths:- starbucks-ods-webflux-poc/expire_in: 1 weekbefore_script:- mkdir -p /root/.kube- echo "$ODS_SHUINFO_ACK" > $KUBECONFIGscript:- envsubst '${IMAGE}' < deployment_dev.yaml > dp.yaml- kubectl apply -f ./dp.yaml  -n default  --insecure-skip-tls-verifyonly:- develop- /^develop/.*$/

, 创建Dockerfile文件

文件内容

FROM eclipse-temurin:17-jreADD  ./target/ods-poc-0.0.1-SNAPSHOT.jar /home/app/app.jarWORKDIR /home/appENV TZ Asia/ShanghaiENTRYPOINT  ["java","-jar","/home/app/app.jar"]EXPOSE 8083

, 创建deployment_dev.yaml文件

文件内容

   apiVersion: apps/v1kind: Deploymentmetadata:name: starbucks-ods-webflux-poclabels:app: ods-pocspec:replicas: 1selector:matchLabels:app: starbucks-ods-webflux-poctemplate:metadata:labels:app: starbucks-ods-webflux-pocspec:imagePullSecrets:- name: repo-keynodeSelector:app: "app"containers:- name: starbucks-ods-webflux-pocimage: ${IMAGE}resources:limits: # 限制资源大小memory: "4096Mi"cpu: "2"ports:- containerPort: 8083env:- name: "JAVAAGENT_OPS"value: ""- name: "spring.profiles.active"value: "dev"#            - name: "loader.path"#              value: "/home/app/lib"---apiVersion: v1kind: Servicemetadata:name: starbucks-ods-webflux-poc-svclabels:app: ods-pocspec:ports:- name: apiport: 8083protocol: TCPtargetPort: 8083selector:app: starbucks-ods-webflux-poc

, gitlab设置项目受保护分支

settings -> Repository -> Protected branches -> expand

进行设置需要发布的分支为受保护分支

, 设置全局变量

设置settings.xml

<?xml version="1.0" encoding="UTF-8"?><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"><mirrors><mirror><id>mirror</id><mirrorOf>central,jcenter,!rdc-releases,!rdc-snapshots</mirrorOf><name>mirror</name><url>https://maven.aliyun.com/nexus/content/groups/public</url></mirror></mirrors><servers><server><id>rdc-releases</id><username>619c5ce2ebd22e300e389f29</username><password>NMSPLZC03=66</password></server><server><id>rdc-snapshots</id><username>619c5ce2ebd22e300e389f29</username><password>NMSPLZC03=66</password></server></servers><profiles><profile><id>rdc</id><properties><altReleaseDeploymentRepository>rdc-releases::default::https://packages.aliyun.com/maven/repository/2178480-release-UPz05J/</altReleaseDeploymentRepository><altSnapshotDeploymentRepository>rdc-snapshots::default::https://packages.aliyun.com/maven/repository/2178480-snapshot-AVBxKP/</altSnapshotDeploymentRepository></properties><repositories><repository><id>central</id><url>https://maven.aliyun.com/nexus/content/groups/public</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></repository><repository><id>snapshots</id><url>https://maven.aliyun.com/nexus/content/groups/public</url><releases><enabled>false</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository><repository><id>rdc-releases</id><url>https://packages.aliyun.com/maven/repository/2178480-release-UPz05J/</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></repository><repository><id>rdc-snapshots</id><url>https://packages.aliyun.com/maven/repository/2178480-snapshot-AVBxKP/</url><releases><enabled>false</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository></repositories><pluginRepositories><pluginRepository><id>central</id><url>https://maven.aliyun.com/nexus/content/groups/public</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></pluginRepository><pluginRepository><id>snapshots</id><url>https://maven.aliyun.com/nexus/content/groups/public</url><releases><enabled>false</enabled></releases><snapshots><enabled>true</enabled></snapshots></pluginRepository><pluginRepository><id>rdc-releases</id><url>https://packages.aliyun.com/maven/repository/2178480-release-UPz05J/</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></pluginRepository><pluginRepository><id>rdc-snapshots</id><url>https://packages.aliyun.com/maven/repository/2178480-snapshot-AVBxKP/</url><releases><enabled>false</enabled></releases><snapshots><enabled>true</enabled></snapshots></pluginRepository></pluginRepositories></profile></profiles><activeProfiles><activeProfile>rdc</activeProfile></activeProfiles></settings>

设置kubeconfig

  apiVersion: v1clusters:cluster:server: https://172.16.101.130:6443certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURUakNDQWphZ0F3SUJBZ0lVUU12OFpEUXJ6MXpPdzJhSzZjYjBrVnIrZThRd0RRWUpLb1pJaHZjTkFRRUwKQlFBd1BqRW5NQThHQTFVRUNoTUlhR0Z1WjNwb2IzVXdGQVlEVlFRS0V3MWhiR2xpWVdKaElHTnNiM1ZrTVJNdwpFUVlEVlFRREV3cHJkV0psY201bGRHVnpNQ0FYRFRJeU1EUXhOREEwTXpFd01Gb1lEekl3TlRJd05EQTJNRFF6Ck1UQXdXakErTVNjd0R3WURWUVFLRXdob1lXNW5lbWh2ZFRBVUJnTlZCQW9URFdGc2FXSmhZbUVnWTJ4dmRXUXgKRXpBUkJnTlZCQU1UQ210MVltVnlibVYwWlhNd2dnRWlNQTBHQ1NxR1NJYjNEUUVCQVFVQUE0SUJEd0F3Z2dFSwpBb0lCQVFDenVIZ1M1eExOY0gyVDJJYW50WVNXRWlETG1HSG9YREttSFNLeVBXTFgreVJWblVYZDRsaFNTSGYrCjNNSzRMb2dTNTNHd01hUlNyVExlbjVzdVhoNUFUemZTQ013ckRzUzBHNUFST0l3UGU3Y0xTW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9dcurrent-context: 222275036955515715-ccf933127c22540f9a1b59e3f24ab8e9dkind: Configpreferences: {}users:name: "222275036955515715"user:client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUQvakNDQXVhZ0F3SUJBZ0lEWEVoSE1BMEdDU3FHU0liM0RRRUJDd1VBTUdveEtqQW9CZ05WQkFvVElXTmoKWmprek16RXlOMk15TWpVME1HWTVZVEZpTlRsbE0yWXlOR0ZpT0dVNVpERVFNQTRHQTFVRUN4TUhaR1ZtWVhWcwpkREVxTUNnR0ExVUVBeE1oWTJObU9UTXpNVEkzWXpJeU5UUXdaamxoTVdJMU9XVXpaakkwWVdJNFpUbGtNQjRYCkRUSXlNRFF4TkRBME16QXdNRm9YRFRJMU1EUXhNekEwTXpVMU9Wb3dTakVWTUJNR0ExVUVDaE1NYzNsemRHVnQKT25WelpYSnpNUWt3QndZRFZRUUxFd0F4SmpBa0JnTlZCQU1USFRJeU1qSTNOVEF6TmprMU5UVXhOVGN4TlMweApOalE1T1RFd09UVTVNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTgxVUhKMHZCClBsVVdiY0VaZXAyVzVpRG5sei83ZFVzTjVrdU0xSTlyOWhrRjFSTS9QZ2ZQQnlMNGo5bGVLY3RKVmlocFFiUkcKRE1ZRFJ2UWVJVENwWnBsajRzQXdGb3RlMzg4UnY3RzNPRVhXeW9DUXVpdGtPdzluaFBYT3RLdG9RTDhwYURQMwovb09hUG00QW4ya1RSMkVvempxQnVrZ3JIcGthQW1hRnBwblh5RjdnTUFnNVdpUk5GSzRtdk5VcTV1MmJubC9aCk5vYTFpM3lXaUpWcVBpOHkvVnFmTHRCZ2w2RjJPdmdlZmVva3V5TTE5eVpnZ0pSVnpBWVo4ZnhWVWg3L3daZksKMFFZSjMvVmw0N0taY1ZVQnpuV2JhV3NwcU1URFU2NHFNL2htYkgxdS9xbDdDZXdXUUNmNTV5ZWV6Q3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I2YzdJSkxISHJmVDJFYWtrR0VTSjQKQkpxY2UvUkNoK21NOWlKUUdpYlg0UUpqVWEzeFZ0TENuVDdreXoxZFZ1NTNlMVF5Sk0xaFRiMUNLdmNhYjlGOQowSE16ZWs1KzZrVWVVU3RVbjR4bW9GNkdJS0JERHRpVEFDL2txNnBmbExGbHFZSzhpaE5ETG0vWG5HOWgrallDCnFldTcyT2lxSGkxUHU4cDQ1SHV4QVFLQmdDUDRFY1ZKZGZRV040NWtDZGNYSDRQUng2dVlFSUtpNGxPMVk3cnEKS0xWYkw2S1FTRUlYQzYzcWFLRWFleWM3N2hLSDgreHR2aWNQamgrZWNqMzYydmt2aWNyK3FjclBHeitjd2p1aQpkTXBkZUQrUGMyRFYvUEdwVFlBQXd3eWxUaEkweUYzSDc4SmE0SjVOYklPUGJUM2tacFpQMzgweUxjOGdLNzJJCjcxOGhBb0dBYTd2RjFVUXRmZEt0SHBTRkppejRWSVRYY1BOcjhMYy9xc2F4NEwvV1paaWw3YWpRL1VWTEZ1YVMKWk1WU2VtK3ZzY1pGWUFmNGtEdENCeTlWZXRyMnRvdW5EVUYyRHhlTDBnWFpQWEUzeCtFVlVTbEVzQ3NIN1JLMQppK1NIYmVwMFZZRFFFZ3o2Ukx3K2JReTIvUXZiZlFkcms5U2ZFK2VTTlQrT2sveDdzVkU9Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==

, 绑定域名

对于需要供外部服务或客户端访问的系统一般需要配置绑定域名,即需要在Ingress中绑定

文件内容

apiVersion: networking.k8s.io/v1kind: Ingressmetadata:name: ingress-nginxnamespace: defaultuid: 136b1e73-f3ca-469c-b710-914807bc1162resourceVersion: '13945489'generation: 1creationTimestamp: '2022-04-19T05:10:25Z'annotations:nginx.ingress.kubernetes.io/service-weight: ''managedFields:- manager: ACK-Console Apache-HttpClientoperation: UpdateapiVersion: networking.k8s.io/v1time: '2022-04-19T05:10:25Z'fieldsType: FieldsV1fieldsV1:f:metadata:f:annotations:.: {}f:nginx.ingress.kubernetes.io/service-weight: {}f:spec:f:rules: {}- manager: nginx-ingress-controlleroperation: UpdateapiVersion: networking.k8s.io/v1time: '2022-04-19T05:10:31Z'fieldsType: FieldsV1fieldsV1:f:status:f:loadBalancer:f:ingress: {}selfLink: /apis/networking.k8s.io/v1/namespaces/default/ingresses/ingress-nginxstatus:loadBalancer:ingress:- ip: 172.16.101.133spec:ingressClassName: nginxrules:- host: starbucks-ods.shuinfo.techhttp:paths:- path: /pathType: ImplementationSpecificbackend:service:name: starbucks-ods-webflux-poc-svcport:number: 8083     

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/269483.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

R语言安装和简单入门HelloWorld用法

R语言安装和简单入门HelloWorld用法 #R语言安装地址 https://www.r-project.org/ click->CRAN mirror->选择China下列表&#xff1a; https://mirrors.tuna.tsinghua.edu.cn/CRAN/ 选择Download R for Windows 选择base Download R-4.3.2 for Windows 下载文件R-4.3.2-…

身份证识别系统(安卓)

设计内容与要求&#xff1a; 通过手机摄像头捕获身份证信息&#xff0c;将身份证上的姓名、性别、出生年月、身份证号码保存在数据库中。1&#xff09;所开发Apps软件至少需由3-5个以上功能性界面组成。要求&#xff1a;界面美观整洁、方便应用&#xff1b;可以使用Android原生…

【Unity】使用Unity实现双屏显示

引言 在使用Unity的时候&#xff0c;有时候会需要使用双屏显示 简单来说就是需要在两个显示器中显示游戏画面 双屏显示注意点&#xff1a; ①双屏显示需要电脑有两个显示 ②双屏显示只能用于PC端 ③不仅仅可以双屏&#xff0c;Unity最大支持8屏显示 1.相机设置 ①我们打开Un…

VMwareWorkstation17.0虚拟机安装搭建PcDos2000虚拟机(完整图文详细步骤教程)

VMwareWorkstation17.0虚拟机安装搭建PcDos2000虚拟机&#xff08;完整图文详细步骤教程&#xff09; 一、PcDos20001.PcDos2000简介2.PcDos2000下载 二、创建PcDos2000虚拟机1.新建虚拟机2.类型配置3.类型配置4.选择版本5.命名、存位置6.磁盘容量7.调整虚拟配置7.1 调整虚拟配…

【python】堆排序

堆的概念 堆&#xff1a;一种特殊完全二叉树&#xff0c;也就是二叉树必须全部是满的&#xff0c;但是最后一排可以从右向左缺失。 大根堆&#xff1a;每个节点都比他的子节点大 小根堆&#xff1a;每个节点都比子节点小 堆在代码中的形式 堆在代码中实际上就是列表&#…

蓝桥杯倒计时 41天 - KMP 算法

KMP算法 KMP算法是一种字符串匹配算法&#xff0c;用于匹配模式串P在文本串S中出现的所有位置。 例如S“ababac&#xff0c;P“aba”&#xff0c;那么出现的所有位置是13。 在初学KMP时&#xff0c;我们只需要记住和学会使用模板即可&#xff0c;对其原理只需简单理解&#xff…

一文搞懂Stable Diffusion中的提示词

欢迎来到Stable Diffusion的世界&#xff0c;这里是AI和创意的交汇点。在这里&#xff0c;我们将一起探索如何通过精心设计的提示词&#xff0c;指引这一强大的AI工具创造出令人叹为观止的图像。无论你是技术爱好者&#xff0c;还是对AI艺术充满好奇的初学者&#xff0c;这里都…

excel数值无法左对齐

右键&#xff0c;单元格格式 修改为常规 解决

力扣--动态规划64.最小路径和

思路分析&#xff1a; 基本思路&#xff1a; 本算法采用动态规划的思想&#xff0c;通过构建一个额外的二维矢量 dp 来存储每个位置的最小路径和。最终目标是求得右下角位置的最小路径和&#xff0c;即整个网格的最小路径和。 初始化&#xff1a; 初始化矢量的行数和列数&…

【AI视野·今日Sound 声学论文速览 第五十一期】Mon, 4 Mar 2024

AI视野今日CS.Sound 声学论文速览 Mon, 4 Mar 2024 Totally 6 papers &#x1f449;上期速览✈更多精彩请移步主页 Daily Sound Papers VoxGenesis: Unsupervised Discovery of Latent Speaker Manifold for Speech Synthesis Authors Weiwei Lin, Chenhang He, Man Wai Mak, …

Stable Diffusion——Animate Diff一键AI图像转视频

前言 AnimateDiff 是一个实用框架&#xff0c;可以对文本生成图像模型进行动画处理&#xff0c;无需进行特定模型调整&#xff0c;即可为大多数现有的个性化文本转图像模型提供动画化能力。而Animatediff 已更新至 2.0 版本和3.0两个版本&#xff0c;相较于 1.0 版本&#xff…

【学位论文】上海交通大学 研究生学位论文 本地保存

上海交大研究生学位论文网&#xff1a;http://thesis.lib.sjtu.edu.cn/ &#xff08;只能校内访问或SJTU VPN访问&#xff09; 如果希望下载论文&#xff0c;需要参考&#xff1a;https://github.com/olixu/SJTU_Thesis_Crawler 安装过程 安装过程的几个坑&#xff1a; &a…

RabbitMQ-TTL/死信队列/延迟队列高级特性

文章目录 TTL死信队列消息成为死信的三种情况队列如何绑定死信交换机 延迟队列RabbitMQ如何实现延迟队列 总结来源B站黑马程序员 TTL TTLTTL(Time To Live):存活时间/过期时间当信息到达存活时间后&#xff0c;还没有被消费&#xff0c;会被自动清除。RabbitMQ可以对消息设置过…

vue修改打包后静态资源路径的修改

不得不说&#xff0c;ai是真的强大&#xff0c;直接自己生成。

【AI Agent系列】【MetaGPT多智能体学习】3. 开发一个简单的多智能体系统,兼看MetaGPT多智能体运行机制

本系列文章跟随《MetaGPT多智能体课程》&#xff08;https://github.com/datawhalechina/hugging-multi-agent&#xff09;&#xff0c;深入理解并实践多智能体系统的开发。 本文为该课程的第四章&#xff08;多智能体开发&#xff09;的第一篇笔记。主要记录下多智能体的运行…

[Flutter get_cli] 配置 sub_folder:false报错

flutter get_cli 配置 get_cli:sub_folder:false报错如下 Because getx_cli_learn01 depends on get_cli from unknown source "sub_folder", version solving failed. 原因是在 pubspec.yaml文件中, get_cli:sub_folder:false要和 dependencies: xxx dev_depe…

HTML---表单验证

文章目录 目录 本章目标 一.表单验证概述 二.表单选择器 属性过滤选择器 三.表单验证 表单验证的方法 总结 本章目标 掌握String对象的用法会使用表单选择器的选择页面元素会使用JQuery事件进行表单验证Ajax的概念和作用 一.表单验证概述 前端中的表单验证是在用户提交表…

vs2022 qt 关于lnk2001和2019同时报错的问题

需要像qt中添加模块&#xff0c;这里&#xff0c;缺少qtopenglwidgets模块

Discuz IIS上传附件大于28M失败报错Upload Failed.修改maxAllowedContentLength(图文教程)

下图&#xff1a;Discuz X3.5的系统信息&#xff0c;上传许可为1024MB(1GB) 论坛为局域网论坛&#xff0c;仅供内部同事交流使用&#xff01; 使用官方最新的Discuz! X3.5 Release 20231221 UTF-8 下图&#xff1a;选择上传附件&#xff08;提示可以最大上传100M&#xff09;…

01. Nginx入门-Nginx简介

Web基础知识 Web协议通信原理 Web协议通信过程 浏览器本身是一个客户端&#xff0c;当输入URL后&#xff0c;首先浏览器会请求DNS服务器&#xff0c;通过DNS获取相应的域名对应的IP。通过IP地址找到对应的服务器后&#xff0c;监理TCP连接。等浏览器发送完HTTP Request&…