运维随录实战(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.hqwc.cn/news/512115.html

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

相关文章

稀碎从零算法笔记Day7-LeetCode:罗马数字转整数

题型&#xff1a;字符串转化、找规律 链接&#xff1a;13. 罗马数字转整数 - 力扣&#xff08;LeetCode&#xff09; 来源&#xff1a;LeetCode 题目描述 给定一个数组 prices &#xff0c;它的第 i 个元素 prices[i] 表示一支给定股票第 i 天的价格。 你只能选择 某一天 …

【深圳五兴科技】Java后端面经

本文目录 写在前面试题总览1、java集合2、创建线程的方式3、对spring的理解4、Spring Boot 和传统 Spring 框架的一些区别5、springboot如何解决循环依赖6、对mybatis的理解7、缓存三兄弟8、接口响应慢的处理思路9、http的状态码 写在前面 关于这个专栏&#xff1a; 本专栏记录…

抖音视频下载软件|视频批量采集工具

便捷操作&#xff0c;高效采集 在快节奏的数字化时代&#xff0c;我们的视频下载软件提供了简单便捷的操作流程&#xff0c;让用户能够高效地采集所需视频内容。用户只需输入关键词并点击开始抓取&#xff0c;系统会自动搜索指定关键词下的抖音视频数据&#xff0c;并将待解析视…

C语言第三十五弹---文件操作(上)

✨个人主页&#xff1a; 熬夜学编程的小林 &#x1f497;系列专栏&#xff1a; 【C语言详解】 【数据结构详解】 文件操作 1、为什么使用文件&#xff1f; 2、什么是文件&#xff1f; 2.1、程序文件 2.2、数据文件 2.3、文件名 3、二进制文件和文本文件 4、文件的打开和…

折线图 温度变化曲线图

代码详情介绍 导入必要的库&#xff1a; matplotlib.pyplot&#xff1a;用于绘图。 matplotlib.font_manager&#xff1a;用于设置中文字体。 datetime&#xff1a;用于处理日期和时间。 random&#xff1a;用于生成随机数。 numpy&#xff1a;用于生成arange函数的刻度。 设置…

Linux系统使用宝塔面板安装MySQL服务并实现公网远程访问本地数据库【内网穿透】

文章目录 前言1.Mysql服务安装2.创建数据库3.安装cpolar3.2 创建HTTP隧道 4.远程连接5.固定TCP地址5.1 保留一个固定的公网TCP端口地址5.2 配置固定公网TCP端口地址 前言 宝塔面板的简易操作性,使得运维难度降低,简化了Linux命令行进行繁琐的配置,下面简单几步,通过宝塔面板cp…

【C语言】Leetcode 876. 链表的中间节点

主页&#xff1a;17_Kevin-CSDN博客 专栏&#xff1a;《Leetcode》 题目 通过题目的要求可以判断出有两种示例要解决&#xff0c;一种是偶数节点的链表&#xff0c;一种是奇数节点的链表&#xff0c;应对这两种情况我们需要使程序对二者都可以兼容。 解决思路 struct ListNode…

微服务相关的核心概念及技术

RPC框架&#xff1a; 在微服务架构中&#xff0c;服务与服务之间要实现接口的调用我们肯定要通过相关的RPC(Remote Procedure Call)框架来实现。 常用的RPC框架有:Dubbo&#xff0c;Google的GRPC&#xff0c;Apache的Thrift&#xff0c;微博的Motan&#xff0c;京东的EasyRPC等…

解密Lawnchair:打造个性化极致的Android桌面体验

解密Lawnchair&#xff1a;打造个性化极致的Android桌面体验 1. 简介 Lawnchair是一款知名的Android桌面定制工具&#xff0c;旨在为用户提供个性化极致的桌面体验。作为一个开源项目&#xff0c;Lawnchair融合了简洁、灵活和强大的特点&#xff0c;让用户能够自由定制其Andro…

低代码平台开发——基于React(文末送书)

目录 小程一言适用对象本书达成 书籍介绍作者简介内容介绍书籍目录阅读指导 小程送书 小程一言 《低代码平台开发——基于React》这本书主要围绕低代码平台和React技术的结合展开&#xff0c;为读者提供了关于低代码平台开发的理论和实践知识。 ## 书中内容简介 书中内容分为…

消息队列-Kafka-基础架构

基础架构 官网地址 上面这张图类比RocketMQ 相当于对一个主题进行了分区&#xff08;类似于RockeMQ 消息队列&#xff09;&#xff0c;每个分区存储到不同的Broker。在发送消息的时候都是发送到主分区。如果一台Broker由于其它节点备份了挂掉节点的数据&#xff0c;所以可以…

文心一言 VS 讯飞星火 VS chatgpt (208)-- 算法导论15.4 5题

五、设计一个 O( n 2 n^2 n2) 时间的算法&#xff0c;求一个 n 个数的序列的最长单调递增子序列。要写代码的时候&#xff0c;请用go语言。 文心一言&#xff0c;抛panic&#xff1a; 在 Go 语言中设计一个 O(n^2) 时间复杂度的算法来求一个 n 个数的序列的最长单调递增子序列…