运维随录实战(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.mzph.cn/news/721299.shtml

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

相关文章

红帆OA 多处 SQL注入漏洞复现

0x01 产品简介 红帆iOffice.net从最早满足医院行政办公需求(传统OA),到目前融合了卫生主管部门的管理规范和众多行业特色应用,是目前唯一定位于解决医院综合业务管理的软件,是最符合医院行业特点的医院综合业务管理平台,是成功案例最多的医院综合业务管理软件。 0x02 漏…

java中开源json处理库介绍

在Java生态系统中&#xff0c;有几个常用的开源库用于处理JSON数据。这些库各有特点&#xff0c;适用于不同的场景。下面我将介绍几个流行的Java JSON处理库&#xff0c;包括它们的基本情况、主要特点和核心API。 Jackson 基本情况 Jackson是一个流行的Java库&…

【李沐论文精读】Transformer精读

论文&#xff1a;Attention is All You Need 参考&#xff1a;李沐视频【Transformer论文逐段精读】、Transformer论文逐段精读【论文精读】、李沐视频精读系列 一、摘要 主流的序列转换(sequence transduction)模型都是基于复杂的循环或卷积神经网络&#xff0c;这个模型包含一…

java实现文件上传到本地

很多时候我们都需要进行文件上传和下载的操作&#xff0c;具体怎么实现网上的代码其实也是挺多的&#xff0c;刚好我的项目中也遇到了文件上传和下载的需求&#xff0c;本篇博文具体讲解上传操作&#xff0c;下篇博文讲解下载操作。 我们具体来想一想要将一个从前端传来的文件…

Servlet快速入门

什么是Servlet? Servlet可以用很多方式来描述&#xff0c;这取决于上下文。 是一种技术&#xff0c;它被用来创建一个Web应用程序。 是一个API&#xff0c;它提供了许多接口和类&#xff0c;包括文档。 是一个接口&#xff0c;创建任何Serwlet都必须实现这个接口。 是一个扩展…

Python影像变化监测-跟踪大盐湖的萎缩

使用 Google Colab 中的 Python 分析 Landsat-8 图像(2014-2023)以创建大盐湖表面区域的时间序列 目录 🌅大盐湖萎缩问题简介💾下载 Landsat-8 图像📈统计文件中的大盐湖地区时间序列⚙️处理 Landsat-8 图像🗺️大盐湖图像的可视化🎥 大盐湖缩小的延时摄影📉大盐…

通过联合部署DDoS高防和WAF提升网站防护能力

如果您的网站遭受的攻击既有流量型攻击&#xff0c;又混杂精巧的Web应用层攻击时&#xff08;例如SQL注入、跨站脚本攻击、命令注入等&#xff09;时&#xff0c;推荐您组合使用阿里云DDoS高防和Web 应用防火墙 WAF&#xff08;Web Application Firewall&#xff09;&#xff0…

C语言文件操作,linux文件操作,文件描述符,linux下一切皆文件,缓冲区,重定向

目录 C语言文件操作 如何打开文件以及打开文件方式 读写文件 关闭文件 Linux系统下的文件操作 open 宏标志位 write&#xff0c;read&#xff0c;close&#xff0c;lseek接口 什么是当前路径&#xff1f; linux下一切皆文件 文件描述符 文件描述符排序 C语言文件操…

【音视频开发好书推荐1】《RTC程序设计:实时音视频权威指南》

1、WebRTC概述 WebRTC&#xff08;Web Real-Time Communication&#xff09;是一个由Google发起的实时音视频通讯C开源库&#xff0c;其提供了音视频采集、编码、网络传输&#xff0c;解码显示等一整套音视频解决方案&#xff0c;我们可以通过该开源库快速地构建出一个音视频通…

牛客练习赛122

D:圆 正着求删除的最小代价不好做&#xff0c;采用逆向思维&#xff0c;求选择一些不相交的线段使得构成一个圆的代价尽量大&#xff0c;最后答案就是所有线段权值之和减去最大代价。 那么如何求这个最大代价呢&#xff1f;显然区间DP 老套路&#xff1a;破环成链&#xff0…

详解Java中集合的List接口实现的ArrayList方法 | Set接口实现的HashSet方法

集合的概念 当我们需要保存一组一样&#xff08;类型相同&#xff09;的元素的时候&#xff0c;我们应该使用一个容器来存储&#xff0c;数组就是这样一个容器。 ● 数组的特点&#xff1a; 数组是一组数据类型相同的元素集合&#xff1b; 创建数组时&#xff0c;必须给定…

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;…

【Python】新手入门(2):避免将关键字作为标识符

Python新手入门&#xff08;2&#xff09;&#xff1a;避免将关键字作为标识符 &#x1f308; 个人主页&#xff1a;高斯小哥 &#x1f525; 高质量专栏&#xff1a;Matplotlib之旅&#xff1a;零基础精通数据可视化、Python基础【高质量合集】、PyTorch零基础入门教程&#x1…

保护模式笔记九 中断门和IDT(中断描述符表)

段选择子&#xff1a; 先直观认识一下GDT和段选择子在逻辑地址转换为线性地址中的作用&#xff0c;例如&#xff1a; 给出逻辑地址&#xff1a;21h:12345678h&#xff0c;需要将其转换为线性地址 a. 选择子SEL21h0000000000100 0 01b&#xff0c;他代表的意思是&#xff1a…

Ruoyi框架上传文件

axios资料&#xff1a;axios中文文档|axios中文网 | axios axiosjson 默认情况下&#xff0c;axios将JavaScript对象序列化为JSON。 submit(data) {if (data && this.definitionId) {// 启动流程并将表单数据加入流程变量startProcess(this.definitionId, JSON.string…

数据可视化原理-腾讯-3D热力图

在做数据分析类的产品功能设计时&#xff0c;经常用到可视化方式&#xff0c;挖掘数据价值&#xff0c;表达数据的内在规律与特征展示给客户。 可是作为一个产品经理&#xff0c;&#xff08;1&#xff09;如果不能够掌握各类可视化图形的含义&#xff0c;就不知道哪类数据该用…

代码随想录刷题笔记-Day29

1. N皇后 51. N 皇后https://leetcode.cn/problems/n-queens/ 按照国际象棋的规则&#xff0c;皇后可以攻击与之处在同一行或同一列或同一斜线上的棋子。 n 皇后问题 研究的是如何将 n 个皇后放置在 nn 的棋盘上&#xff0c;并且使皇后彼此之间不能相互攻击。 给你一个整数…

【Sql Server】C#通过拼接代码的方式组合添加sql语句,会出现那些情况,参数化的作用

欢迎来到《小5讲堂》&#xff0c;大家好&#xff0c;我是全栈小5。 这是《Sql Server》系列文章&#xff0c;每篇文章将以博主理解的角度展开讲解&#xff0c; 特别是针对知识点的概念进行叙说&#xff0c;大部分文章将会对这些概念进行实际例子验证&#xff0c;以此达到加深对…

JavaWeb JSP

JSP&#xff08;Java Server Page&#xff09;是J2EE的功能模块&#xff0c;是Java服务器页面&#xff0c;由Web服务器执行&#xff0c;作用就是降低动态网页开发难度&#xff0c;将Java代码与HTML分离&#xff0c;降低开发难度&#xff0c;本质就是Servlet。 Servlet的缺点&a…

pandas数据分析42——读取和写入stata和spss的数据格式

python就是胶水语言&#xff0c;啥文件基本都能读取&#xff0c;而且pandas作为数据分析最好用的包&#xff0c;其功能自然也很多&#xff0c;可以读取各种数据文件。 本次就来演示一下怎么读取stata文件&#xff0c;和spss文件&#xff0c;他们不仅储存了数据和变量&#xff…