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

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

架构流程

文件内容

stages: #设置流水线模版

  - build # 编译

  - source2img

  - deploy # 发布

variables: # 设置全局变量

  MAVEN_PATH:  .m2

  MAVEM_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/config

cache: # 设置缓存

  paths:

    - $MAVEN_PATH/repository/

    - target/

build:

  #  needs:

  #    - check-style

  #    - unit-test

  #    - static-check

  artifacts:

    paths:

      - starbucks-ods-webflux-poc/target/*.jar

    expire_in: 1 week

  stage: build

  image: "$MAVEM_IMAGE"

  before_script:

    - mkdir -p $MAVEN_PATH

    - echo $SETTING > $MAVEN_PATH/settings.xml

  script:

    - mvn  $MAVEN_CLI_OPTS  clean install package  -Dmaven.test.skip=true

  only:

    - "/^develop/.*$/"

    - develop

    - release

    - "/^release/.*$/"

    - master

source2img:

  stage: source2img

  image: sp0cket/kaniko-executor:debug

  before_script:

    - echo $DOCKER_AUTH_CONFIG > /kaniko/.docker/config.json

  script:

    - ls

    - pwd

    - echo $DOCKER_AUTH_CONFIG

    - echo ${IMAGE}

    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $IMAGE

  only:

    - /^develop/.*$/

    - develop

    - release

    - /^release/.*$/

    - master

deploy:prod:

  needs:

    - source2img

  stage: deploy

  image: sp0cket/kubectl:v1.20.4

  when: manual

  before_script:

    - mkdir -p /root/.kube

    - echo $ODS_SHUINFO_ACK

    - echo "$ODS_SHUINFO_ACK" > $KUBECONFIG

  script:

    - envsubst '${IMAGE}' < deployment_prod.yaml > dp.yaml

    - kubectl apply -f ./dp.yaml -n default  --insecure-skip-tls-verify

  only:

    - master

deploy:test:

  needs:

    - source2img

  stage: deploy

  image: sp0cket/kubectl:v1.20.4

  before_script:

    - mkdir -p /root/.kube

    - echo ${ODS_SHUINFO_ACK}

    - echo "$ODS_SHUINFO_ACK" > $KUBECONFIG

  script:

    - envsubst '${IMAGE}' < deployment_test.yaml > dp.yaml

    - kubectl apply -f ./dp.yaml -n default  --insecure-skip-tls-verify

  only:

    - /^release/.*$/

    - release

deploy:uat:

  needs:

    - source2img

  stage: deploy

  image: sp0cket/kubectl:v1.20.4

  when: manual

  before_script:

    - mkdir -p /root/.kube

    - echo ${ODS_SHUINFO_ACK}

    - echo "$ODS_SHUINFO_ACK" > $KUBECONFIG

  script:

    - envsubst '${IMAGE}' < deployment_uat.yaml > dp.yaml

    - kubectl apply -f ./dp.yaml -n default  --insecure-skip-tls-verify

  only:

    - /^release/.*$/

    - release

deploy:dev:

  needs:

    - source2img

  stage: deploy

  image: sp0cket/kubectl:v1.20.4

  artifacts:

    paths:

      - starbucks-ods-webflux-poc/

    expire_in: 1 week

  before_script:

    - mkdir -p /root/.kube

    - echo "$ODS_SHUINFO_ACK" > $KUBECONFIG

  script:

    - envsubst '${IMAGE}' < deployment_dev.yaml > dp.yaml

    - kubectl apply -f ./dp.yaml  -n default  --insecure-skip-tls-verify

  only:

    - develop

    - /^develop/.*$/

, 创建Dockerfile文件

文件内容

FROM eclipse-temurin:17-jre

ADD  ./target/ods-poc-0.0.1-SNAPSHOT.jar /home/app/app.jar

WORKDIR /home/app

ENV TZ Asia/Shanghai

ENTRYPOINT  ["java","-jar","/home/app/app.jar"]

EXPOSE 8083

, 创建deployment_dev.yaml文件

文件内容

   apiVersion: apps/v1

kind: Deployment

metadata:

  name: starbucks-ods-webflux-poc

  labels:

    app: ods-poc

spec:

  replicas: 1

  selector:

    matchLabels:

      app: starbucks-ods-webflux-poc

  template:

    metadata:

      labels:

        app: starbucks-ods-webflux-poc

    spec:

      imagePullSecrets:

        - name: repo-key

      nodeSelector:

        app: "app"

      containers:

        - name: starbucks-ods-webflux-poc

          image: ${IMAGE}

          resources:

            limits: # 限制资源大小

              memory: "4096Mi"

              cpu: "2"

          ports:

            - containerPort: 8083

          env:

            - name: "JAVAAGENT_OPS"

              value: ""

            - name: "spring.profiles.active"

              value: "dev"

#            - name: "loader.path"

#              value: "/home/app/lib"

---

apiVersion: v1

kind: Service

metadata:

  name: starbucks-ods-webflux-poc-svc

  labels:

    app: ods-poc

spec:

  ports:

    - name: api

      port: 8083

      protocol: TCP

      targetPort: 8083

  selector:

    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: v1

cl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EdBMVVkRGdRV0JCVHFPYVFmM1Zud0F5WG82Ti8vaGhWQzF4czZTVEFOCkJna3Foa2lHOXcwQkFRc0ZBQU9DQVFFQWxTSWlHUUhnc3RWb2JIZFI3MTkxTE1GSGZnRFljcm5KdVljNVY4RE4KTGp1SzZ2dmhJQTJFbUc5YmYxZWtCaktqNTZzNWs3dGNKeVhhYWUxTEFLbVk1dGMwY0lUNW1OYWdaNmhWbEdUbAozU3Zwc0NEQUF0dUc1WVZJL2JSRTBhYVQzcm9WaGNiS0prcUxPM0V2bkoxR1NRd2lrMzcwK3N2QWdlTElrWU15Cno3ekJoVlBzUldOWG56dkVJR0NEYk9VL01OdW5lQWxrdnlOM29nVkF2MTlhcjNFb2ZvTEJkUjRXUnVyYVZJVDMKQ1J2OTBUdlZIU0VOc3NkM1YyYStabE9zRjg1WVkxelpURHIrTFlZN2NVUHQzV29kd1JKdWRRU2VoWWZDdklRZQpGdjZTMHFjSkpoNlZWUm5xT2JYWlk0VFZNRFpSR0MyenlFUXdlQ0NTQzd0b0hRPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=

 name: kubernetes

 contexts:

context:
 cluster: kubernetes

 user: "222275036955515715"

 name: 222275036955515715-ccf933127c22540f9a1b59e3f24ab8e9d

 current-context: 222275036955515715-ccf933127c22540f9a1b59e3f24ab8e9d

 kind: Config

 preferences: {}

 users:

name: "222275036955515715"
 user:

 client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUQvakNDQXVhZ0F3SUJBZ0lEWEVoSE1BMEdDU3FHU0liM0RRRUJDd1VBTUdveEtqQW9CZ05WQkFvVElXTmoKWmprek16RXlOMk15TWpVME1HWTVZVEZpTlRsbE0yWXlOR0ZpT0dVNVpERVFNQTRHQTFVRUN4TUhaR1ZtWVhWcwpkREVxTUNnR0ExVUVBeE1oWTJObU9UTXpNVEkzWXpJeU5UUXdaamxoTVdJMU9XVXpaakkwWVdJNFpUbGtNQjRYCk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TXBkZUQrUGMyRFYvUEdwVFlBQXd3eWxUaEkweUYzSDc4SmE0SjVOYklPUGJUM2tacFpQMzgweUxjOGdLNzJJCjcxOGhBb0dBYTd2RjFVUXRmZEt0SHBTRkppejRWSVRYY1BOcjhMYy9xc2F4NEwvV1paaWw3YWpRL1VWTEZ1YVMKWk1WU2VtK3ZzY1pGWUFmNGtEdENCeTlWZXRyMnRvdW5EVUYyRHhlTDBnWFpQWEUzeCtFVlVTbEVzQ3NIN1JLMQppK1NIYmVwMFZZRFFFZ3o2Ukx3K2JReTIvUXZiZlFkcms5U2ZFK2VTTlQrT2sveDdzVkU9Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==

, 绑定域名

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

文件内容

apiVersion: networking.k8s.io/v1

kind: Ingress

metadata:

  name: ingress-nginx

  namespace: default

  uid: 136b1e73-f3ca-469c-b710-914807bc1162

  resourceVersion: '13945489'

  generation: 1

  creationTimestamp: '2022-04-19T05:10:25Z'

  annotations:

    nginx.ingress.kubernetes.io/service-weight: ''

  managedFields:

    - manager: ACK-Console Apache-HttpClient

      operation: Update

      apiVersion: networking.k8s.io/v1

      time: '2022-04-19T05:10:25Z'

      fieldsType: FieldsV1

      fieldsV1:

        f:metadata:

          f:annotations:

            .: {}

            f:nginx.ingress.kubernetes.io/service-weight: {}

        f:spec:

          f:rules: {}

    - manager: nginx-ingress-controller

      operation: Update

      apiVersion: networking.k8s.io/v1

      time: '2022-04-19T05:10:31Z'

      fieldsType: FieldsV1

      fieldsV1:

        f:status:

          f:loadBalancer:

            f:ingress: {}

  selfLink: /apis/networking.k8s.io/v1/namespaces/default/ingresses/ingress-nginx

status:

  loadBalancer:

    ingress:

      - ip: 172.16.101.133

spec:

  ingressClassName: nginx

  rules:

    - host: starbucks-ods.shuinfo.tech

      http:

        paths:

          - path: /

            pathType: ImplementationSpecific

            backend:

              service:

                name: starbucks-ods-webflux-poc-svc

                port:

                  number: 8083     

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【观点】区块链的未来:分布式商业;企业的未来:分布式商业生态战略

本文内容摘自思二勋所著的《分布式商业生态战略》一书。 近两年&#xff0c;商业经济环境的不确定性越来越明显&#xff0c;市场经济受到疫情、技术、政策等多方因素影响越来越难以预测&#xff0c;黑天鹅事件时有发生。在国内外经济方面&#xff0c;国际的地缘政治对商业经济…

基于R语言实现线性回归模型及测试应用

基于R语言实现线性回归模型及测试应用 mpgB0B1*dartE 调用R语言函数 >data(mtcars) >head(mtcars) > mod <- lm(formula mpg ~ drat, data mtcars) > summary(mod) > # 画出拟合的线 >abline(mod, col "blue") >points(mtcars$drat, mt…

【Linux命令】fuser

fuser 使用文件或文件结构识别进程。 详细 fuser命令用于报告进程使用的文件和网络套接字。fuser命令列出了本地进程的进程号&#xff0c;哪些本地进程使用file&#xff0c;参数指定的本地或远程文件。 每个进程号后面都跟随一个字母&#xff0c;该字母指示进程如何使用该文…

14-RPC-自研微服务框架

RPC RPC 框架是分布式领域核心组件&#xff0c;也是微服务的基础。 RPC &#xff08;Remote Procedure Call&#xff09;全称是远程过程调用&#xff0c;相对于本地方法调用&#xff0c;在同一内存空间可以直接通过方法栈实现调用&#xff0c;远程调用则跨了不同的服务终端&a…

智能通用平台(Intelligent General-purpose Platform)

根据2024年的最新人工智能技术发展趋势&#xff0c;我为您提出的项目需求表如下&#xff1a; 项目名称&#xff1a;智能通用平台&#xff08;Intelligent General-purpose Platform&#xff09;项目概述&#xff1a;结合最新的生成式人工智能、多模态学习和量子计算技术&#…

Redis基础---Java客户端应用

目录 一、介绍 二、Jedis的使用 三、SpringDataRedis的使用 创建&#xff1a; 一、介绍 在Redis官网&#xff0c;提供了多种编程语言的客户端&#xff0c;如Java、C等&#xff0c;官网地址&#xff1a;Clients | Redis 而对于Java的客户端有很多&#xff0c;但是用的最多的就是…

判定MySQL是否开机自启

在Linux系统中&#xff0c;判断MySQL是否设置为开机自动启动&#xff0c;可以通过以下几种方式来确认&#xff1a; 使用systemd&#xff1a; 如果你的Linux发行版使用systemd作为其初始化系统&#xff08;大多数现代Linux发行版如Ubuntu、CentOS 7&#xff09;&#xff0c;可以…

【Web前端入门学习】——HTML

目录 HTML简介HTML文件结构常用文本标签标题标签段落标签有序列表和无序列表表格标签 HTML属性a标签—超链接标签图片标签 HTML区块块元素与行内元素 HTML表单 HTML简介 HTML全称是Hypertext Markup Language超文本标记语言。 HTML的作用&#xff1a; 为网页提供结构&#xff…

自动驾驶感知面试-coding应用题

感知面试手撕代码&#xff1a;这个博主总结的很好&#xff0c;尤其是关于叉积的计算 双线性插值 双线性插值公式记忆方法和Python实现 NMS算法 #include<iostream> #include<vector> #include<algorithm>using namespace std; struct Box {int x1,x2,y1,…

【代码】Python3|无GUI环境中使用Seaborn作图的学习路线及代码(阴影折线图)

我有个需求是需要画图&#xff0c;让GPT帮我生成了一下学习计划。 学习路线依照GPT的来的&#xff0c;使用的Prompt工具是https://github.com/JushBJJ/Mr.-Ranedeer-AI-Tutor。 文章目录 PrerequisiteMain Curriculum1.1 Seaborn介绍Seaborn基础保存图形为文件练习 1.2 单变量数…

什么是Vue的服务端渲染(SSR)?它有什么作用?

Vue的服务端渲染&#xff08;SSR&#xff09;是指将Vue组件在服务器端进行渲染&#xff0c;然后将已经渲染好的页面返回给浏览器&#xff0c;相比于传统的客户端渲染&#xff0c;SSR可以更好地优化SEO和加速首屏加载速度。在传统的客户端渲染中&#xff0c;浏览器需要加载所有的…

【Spring云原生】Spring官宣,干掉原生JVM,推出 Spring Native!整体提升性能!Native镜像技术在Spring中的应用

&#x1f389;&#x1f389;欢迎光临&#x1f389;&#x1f389; &#x1f3c5;我是苏泽&#xff0c;一位对技术充满热情的探索者和分享者。&#x1f680;&#x1f680; &#x1f31f;特别推荐给大家我的最新专栏《Spring 狂野之旅&#xff1a;从入门到入魔》 &#x1f680; 本…

Linux——MySQL主从复制与读写分离

实验环境 虚拟机 3台 centos7.9 网卡NAT模式 数量 1 组件包mysql-5.6.36.tar.gz cmake-2.8.6.tar.gz 设备 IP 备注 Centos01 192.168.223.123 Amoeba Centos02 192.168.223.124 Master Centos03 192.168.223.125 Slave MySQL安装 主从同时操作 安装所需要的…

【探索AI】二十二 深度学习之第5周:生成对抗网络(GAN)

生成对抗网络&#xff08;GAN&#xff09; GAN的基本原理与结构常见的GAN模型&#xff08;如DCGAN、StyleGAN等&#xff09;图像生成与风格迁移任务实践&#xff1a;使用GAN进行图像生成或风格迁移任务 GAN的基本原理与结构 生成对抗网络&#xff08;GAN&#xff09;的基本原理…

【经验】f-string 的一些点

【经验】f-string 的一些点 省几个字别数错了对齐它现在几点 省几个字 让 f-string 给你写表达式&#xff0c;在 f-string 中使用 来自动打印表达式 a 10 b 25 print(f"{a b }") >>> a b 35别数错了 对于过大的数字难以一眼看出来它的数量级&#xf…

Android 中get请求网络数据 详细举例

请求链接 https://api.bilibili.com/x/web-interface/ranking 1.添加网络权限 依赖等 implementation com.squareup.okhttp3:okhttp:4.9.3 implementation com.google.code.gson:gson:2.8.92.写请求类network package com.example.myapplication;import android.graphics.Bi…

现代信号处理学习笔记(三)信号检测

通过观测数据判断信号是否存在&#xff0c;这一问题称为信号检测。 目录 前言 一、统计假设检验 1、信号检测的基本概念 2、信号检测理论测度 比率测度 概率测度 3、决策理论空间 二、概率密度函数与误差函数 1、概率密度函数 2、误差函数与补余误差函数 三、检测概…

TypeError: the JSON object must be str, bytes or bytearray, not dict

参考文章&#xff1a;https://blog.csdn.net/yuan2019035055/article/details/124934362 Python基础系列&#xff08;一&#xff09;搞懂json数据解析与字典之间的关系 代码&#xff1a; 报错信息: TypeError: the JSON object must be str, bytes or bytearray, not dict …

Python字符串中%d,%.f的用法

在字符串中&#xff0c;我们经常需要改变其中的一些几个字符&#xff0c;比如 第一个d%就是epoch1&#xff0c;会随着epoch的变化而变化。同理&#xff0c;后面的也是。打印出的结果就是 其中&#xff0c;epoch迭代了3次&#xff0c;从0开始。会发现 d%&#xff0c;是整数&…

.NET高级面试指南专题十四【 观察者模式介绍,最常用的设计模式之一】

简介&#xff1a; 观察者模式&#xff08;Observer Pattern&#xff09;是一种行为型设计模式&#xff0c;其目的是定义了一种一对多的依赖关系&#xff0c;当一个对象的状态发生变化时&#xff0c;所有依赖于它的对象都会得到通知并自动更新。 原理&#xff1a; 在观察者模式中…