k8s集群中部署服务之部署描述文件准备

news2024/11/20 18:46:48

微服务部署描述文件Deploy.yaml

一、各微服务创建部署描述文件

1.1 mall-auth-server

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mall-auth-server
  namespace: sangomall
  labels:
    app: mall-auth-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mall-auth-server
  template:
    metadata:
      labels:
        app: mall-auth-server
    spec:
      containers:
      - name: mall-auth-server
        image: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latest
        imagePullPolicy: Always
        ports:
        - name: tcp-30000
          containerPort: 30000
          protocol: TCP
        resources:
          limits:
            cpu: 1000m
            memory: 500Mi
          requests:
            cpu: 10m
            memory: 10Mi

---
kind: Service
apiVersion: v1
metadata:
  name: mall-auth-server
  namespace: sangomall
  labels:
    app: mall-auth-server
spec:
  ports:
  - name: http
    protocol: TCP
    port: 30000
    targetPort: 30000
  selector:
    app: mall-auth-server

1.2 mall-cart

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mall-cart
  namespace: sangomall
  labels:
    app: mall-cart
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mall-cart
  template:
    metadata:
      labels:
        app: mall-cart
    spec:
      containers:
      - name: mall-cart
        image: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latest
        imagePullPolicy: Always
        ports:
        - name: tcp-22200
          containerPort: 22200
          protocol: TCP
        resources:
          limits:
            cpu: 1000m
            memory: 500Mi
          requests:
            cpu: 10m
            memory: 10Mi

---
kind: Service
apiVersion: v1
metadata:
  name: mall-cart
  namespace: sangomall
  labels:
    app: mall-cart
spec:
  ports:
    - name: http
      protocol: TCP
      port: 22200
      targetPort: 22200
  selector:
    app: mall-cart

1.3 mall-coupon

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mall-coupon
  namespace: sangomall
  labels:
    app: mall-coupon
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mall-coupon
  template:
    metadata:
      labels:
        app: mall-coupon
    spec:
      containers:
      - name: mall-coupon
        image: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latest
        imagePullPolicy: Always
        ports:
        - name: tcp-8010
          containerPort: 8010
          protocol: TCP
        resources:
          limits:
            cpu: 1000m
            memory: 500Mi
          requests:
            cpu: 10m
            memory: 10Mi

---
kind: Service
apiVersion: v1
metadata:
  name: mall-coupon
  namespace: sangomall
  labels:
    app: mall-coupon
spec:
  ports:
    - name: http
      protocol: TCP
      port: 8010
      targetPort: 8010
  selector:
    app: mall-coupon

1.4 mall-gateway

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mall-gateway
  namespace: sangomall
  labels:
    app: mall-gateway
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mall-gateway
  template:
    metadata:
      labels:
        app: mall-gateway
    spec:
      containers:
      - name: mall-gateway
        image: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latest
        imagePullPolicy: Always
        ports:
          - name: tcp-8072
            containerPort: 8072
            protocol: TCP
        resources:
          limits:
            cpu: 1000m
            memory: 1024Mi
          requests:
            cpu: 10m
            memory: 512Mi
---
kind: Service
apiVersion: v1
metadata:
  name: mall-gateway
  namespace: sangomall
  labels:
    app: mall-gateway
spec:
  ports:
  - name: http
    protocol: TCP
    port: 8072
    targetPort: 8072
  selector:
    app: mall-gateway

1.5 mall-member

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mall-member
  namespace: sangomall
  labels:
    app: mall-member
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mall-member
  template:
    metadata:
      labels:
        app: mall-member
    spec:
      containers:
      - name: mall-member
        image: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latest
        imagePullPolicy: Always
        ports:
        - name: tcp-20300
          containerPort: 20300
          protocol: TCP
        resources:
          limits:
            cpu: 1000m
            memory: 500Mi
          requests:
            cpu: 10m
            memory: 10Mi
---
kind: Service
apiVersion: v1
metadata:
  name: mall-member
  namespace: sangomall
  labels:
    app: mall-member
spec:
  ports:
    - name: http
      protocol: TCP
      port: 20300
      targetPort: 20300
  selector:
    app: mall-member

1.6 mall-order

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mall-order
  namespace: sangomall
  labels:
    app: mall-order
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mall-order
  template:
    metadata:
      labels:
        app: mall-order
    spec:
      containers:
      - name: mall-order
        image: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latest
        imagePullPolicy: Always
        ports:
        - name: tcp-8030
          containerPort: 8030
          protocol: TCP
        resources:
          limits:
            cpu: 1000m
            memory: 500Mi
          requests:
            cpu: 10m
            memory: 10Mi

---
kind: Service
apiVersion: v1
metadata:
  name: mall-order
  namespace: sangomall
  labels:
    app: mall-order
spec:
  ports:
    - name: http
      protocol: TCP
      port: 8030
      targetPort: 8030
  selector:
    app: mall-order

1.7 mall-product

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mall-product
  namespace: sangomall
  labels:
    app: mall-product
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mall-product
  template:
    metadata:
      labels:
        app: mall-product
    spec:
      containers:
      - name: mall-product
        image: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latest
        imagePullPolicy: Always
        ports:
          - name: tcp-8040
            containerPort: 8040
            protocol: TCP
        resources:
          limits:
            cpu: 1000m
            memory: 500Mi
          requests:
            cpu: 10m
            memory: 10Mi

---
kind: Service
apiVersion: v1
metadata:
  name: mall-product
  namespace: sangomall
  labels:
    app: mall-product
spec:
  ports:
    - name: http
      protocol: TCP
      port: 8040
      targetPort: 8040
  selector:
    app: mall-product

1.8 mall-search

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mall-search
  namespace: sangomall
  labels:
    app: mall-search
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mall-search
  template:
    metadata:
      labels:
        app: mall-search
    spec:
      containers:
        - name: mall-search
          image: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latest
          imagePullPolicy: Always
          ports:
          - name: tcp-8090
            containerPort: 8090
            protocol: TCP
          resources:
            limits:
              cpu: 1000m
              memory: 500Mi
            requests:
              cpu: 10m
              memory: 10Mi

---
kind: Service
apiVersion: v1
metadata:
  name: mall-search
  namespace: sangomall
  labels:
    app: mall-search
spec:
  ports:
    - name: http
      protocol: TCP
      port: 8090
      targetPort: 8090
  selector:
    app: mall-search

1.9 mall-seckill

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mall-seckill
  namespace: sangomall
  labels:
    app: mall-seckill
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mall-seckill
  template:
    metadata:
      labels:
        app: mall-seckill
    spec:
      containers:
        - name: mall-seckill
          image: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latest
          imagePullPolicy: Always
          ports:
          - name: tcp-9601
            containerPort: 9601
            protocol: TCP
          resources:
            limits:
              cpu: 1000m
              memory: 500Mi
            requests:
              cpu: 10m
              memory: 10Mi

---
kind: Service
apiVersion: v1
metadata:
  name: mall-seckill
  namespace: sangomall
  labels:
    app: mall-seckill
spec:
  ports:
    - name: http
      protocol: TCP
      port: 9601
      targetPort: 9601
  selector:
    app: mall-seckill

1.10 mall-third-party

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mall-third-party
  namespace: sangomall
  labels:
    app: mall-third-party
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mall-third-party
  template:
    metadata:
      labels:
        app: mall-third-party
    spec:
      containers:
        - name: mall-third-party
          image: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latest
          imagePullPolicy: Always
          ports:
          - name: tcp-8100
            containerPort: 8100
            protocol: TCP
          resources:
            limits:
              cpu: 1000m
              memory: 500Mi
            requests:
              cpu: 10m
              memory: 10Mi

---
kind: Service
apiVersion: v1
metadata:
  name: mall-third-party
  namespace: sangomall
  labels:
    app: mall-third-party
spec:
  ports:
    - name: http
      protocol: TCP
      port: 8100
      targetPort: 8100
  selector:
    app: mall-third-party

1.11 mall-ware

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mall-ware
  namespace: sangomall
  labels:
    app: mall-ware
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mall-ware
  template:
    metadata:
      labels:
        app: mall-ware
    spec:
      containers:
        - name: mall-ware
          image: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latest
          imagePullPolicy: Always
          ports:
          - name: tcp-8050
            containerPort: 8050
            protocol: TCP
          resources:
            limits:
              cpu: 1000m
              memory: 500Mi
            requests:
              cpu: 10m
              memory: 10Mi


---
kind: Service
apiVersion: v1
metadata:
  name: mall-ware
  namespace: sangomall
  labels:
    app: mall-ware
spec:
  ports:
    - name: http
      protocol: TCP
      port: 8050
      targetPort: 8050
  selector:
    app: mall-ware

1.12 renren-fast-master [renren-fast]

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: renren-fast
  namespace: sangomall
  labels:
    app: renren-fast
spec:
  replicas: 1
  selector:
    matchLabels:
      app: renren-fast
  template:
    metadata:
      labels:
        app: renren-fast
    spec:
      containers:
      - name: renren-fast
        image: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latest
        imagePullPolicy: Always
        ports:
        - name: tcp-8093
          containerPort: 8093
          protocol: TCP
        resources:
          limits:
            cpu: 1000m
            memory: 500Mi
          requests:
            cpu: 10m
            memory: 10Mi
---
kind: Service
apiVersion: v1
metadata:
  name: renren-fast
  namespace: sangomall
  labels:
    app: renren-fast
spec:
  ports:
    - name: http
      protocol: TCP
      port: 8093
      targetPort: 8093
  selector:
    app: renren-fast

1.13 renren-generator-master [renren-generator]

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: renren-generator
  namespace: sangomall
  labels:
    app: renren-generator
spec:
  replicas: 1
  selector:
    matchLabels:
      app: renren-generator
  template:
    metadata:
      labels:
        app: renren-generator
    spec:
      containers:
      - name: renren-generator
        image: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latest
        imagePullPolicy: Always
        ports:
          - name: tcp-80
            containerPort: 80
            protocol: TCP
        resources:
          limits:
            cpu: 1000m
            memory: 500Mi
          requests:
            cpu: 10m
            memory: 10Mi


---
kind: Service
apiVersion: v1
metadata:
  name: renren-generator
  namespace: sangomall
  labels:
    app: renren-generator
spec:
  ports:
    - name: http
      protocol: TCP
      port: 80
      targetPort: 80
  selector:
    app: renren-generator

二、部署描述文件使用

本案例通过流水线方式执行部署描述文件,在流水线中讲解。

# kubectl apply -f deploy.yml

在这里插入图片描述

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

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

相关文章

生产消费者模型的介绍以及其的模拟实现

目录 生产者消费者模型的概念 生产者消费者模型的特点 基于阻塞队列BlockingQueue的生产者消费者模型 对基于阻塞队列BlockingQueue的生产者消费者模型的模拟实现 ConProd.c文件的整体代码 BlockQueue.h文件的整体代码 对【基于阻塞队列BlockingQueue的生产者消费者模型…

css 清除浮动方案

清除浮动的三种方案 1. 第一种方案&#xff08;overflow: hidden&#xff09;2. 第二种方案&#xff08;clear&#xff1a;both&#xff09;3. 第三种方案&#xff08;为元素&#xff09; 1. 第一种方案&#xff08;overflow: hidden&#xff09; <style>.container {bac…

以AI对抗AI,大模型安全的“进化论”

点击关注 文丨刘雨琦&#xff0c;编&#xff5c;王一粟 “互联网时代&#xff0c;我们是更危险&#xff0c;还是更安全&#xff1f;” 2016年&#xff0c;互联网正值高速发展之际&#xff0c;电梯广告经常出现这几个大字&#xff0c;两行标语&#xff0c;从病毒木马到网络诈骗…

焕发生机|嵌入式存储eMMC原理解析

1.EMMC背景回顾 EMMC存储的发展历史可以追溯到1997年&#xff0c;当时该技术是为了解决移动设备中存储器的问题而提出的。当时移动设备的存储器主要是NOR flash&#xff0c;这种存储器虽然读写速度快&#xff0c;但是造价高、容量小&#xff0c;不适合大规模应用。而EMMC的出现…

JWT安全及案例实战

文章目录 JWT 安全1. Cookie2. Session3. Token4. JWT4.1 JWT概述4.1.1 JWT头4.1.2 有效载荷4.1.3 签名哈希4.1.4 通信流程 4.2 JWT 漏洞描述4.3 JWT 漏洞原理4.4 JWT 安全防御 5. WebGoat 靶场实验5.1 第四关5.2 第五关5.3 第七关 越权与逻辑漏洞 Web漏洞点只有一个入口&#…

Vue开发小注意点

改bug 更改了配置项啥的&#xff0c;保存刷新发现没变&#xff0c;那就重启项目&#xff01;&#xff01;&#xff01;&#xff01; binding.value 和 e.target.value binding.value Day5 指令的值 e.target.value Day4 表单组件封装 binding.value 和 e.target.valu…

hiredis在vs2010上编译不通过

下载源代码 https://github.com/redis/hiredis 然后单独创建pro文件&#xff0c;将相应的.c和.h文件加进去。 然后使用vs2010&#xff08;带有qt插件&#xff09;打开.pro文件&#xff0c;编译报错 上面的为C99语法&#xff0c;而vs2010不支持。只能选择 https://github.com/…

API原理概念篇(六)玩转正则表达式等常用API

一 玩转正则表达式等常用API ① 正则 1、openresty存在两套正则表达式规范1) lua自身独有的正则规范 备注&#xff1a;大约有5%&#xff5e;15%性能损耗损耗原因&#xff1a;表达式compile成pattern,并不会被缓存,每次都会被重新compile编译2) nginx的符合POSIX规范的PCR…

[Hadoop] start-dfs.sh ssh报错

Permission denied (publickey 决解方案 相关命令 cd ~/.sshssh-keygen -t rsa -p""cat id_rsa.pub >> authorized_keyschmod 0600 authorized_keys 相关链接Hadoop: start-dfs.sh permission denied - Stack Overflow Java HotSpot(TM) Server VM warning…

分享!JetBrains IDE中的GitLab支持

GitLab是流行的基于git的软件开发和部署平台之一&#xff0c;虽然很长一段时间以来&#xff0c;所有基本git操作都已经可以通过GitLab实现&#xff0c;但GitLab集成仍是JetBrains社区的一大最热门请求。为此&#xff0c;JetBrains团队今年与GitLab联手提供了这种类型的集成。 …

【问题记录】解决Git上传文件到GitHub时收到 “GH001: Large files detected” 错误信息!

环境 Windows 11 家庭中文版git version 2.41.0.windows.1GitHub 问题情况 在命令行中使用git上传pdf文件到GitHub服务器时&#xff0c;提示了如下警告信息&#xff1a; 原因是 GitHub 有一个文件大小限制&#xff0c;通常为 100 MB。 如果尝试上传大于此限制的文件&#xff0c…

EMANE中olsrd的调试

1 调试目的 本着学习的态度&#xff0c;对emane tutorial中的示例程序进行重现&#xff0c;以加深对EMANE的理解和掌握。在示例程序0(见https://github.com/adjacentlink/emane-tutorial/wiki/Demonstration-0)中介绍了使用olsrlinkview.py脚本来通过可视化界面观察olsr节点的链…

Marin说PCB之封装设计系列---(01)--非金属化孔的设计总结

提到封装设计小编我刚刚开始学习的时候也是一头雾水&#xff0c;在网上各种找视频学习怎么建封装。在这里小编我也推荐一波凡亿PCB商城上是有封装课程的&#xff0c;我当时就是买的凡亿的封装设计课程自己跟着老师学习的&#xff0c;效果还是挺好的。小编我免费给他们做一波推广…

集合减法【新思路】

#include<stdio.h> int main() {int n,m,flag0;int x;int a[100001]{0},b[100001]{0};scanf("%d %d",&n,&m);以集合A所有元素作为数组下标映射值成1 for (int i 0; i < n; i) {scanf("%d", &x);a[x] 1; }以集合B所有元素作为数组下…

Fuxploider:一款针对文件上传漏洞的安全检测与研究工具

Fuxploider:一款针对文件上传漏洞的安全检测与研究工具 1.概述2. 工具使用1.概述 Fuxploider是一款功能强大的开源渗透测试工具,该工具专门针对文件上传漏洞而设计,可以帮助广大研究人员以自动化的方式检测和利用目标站点文件上传表单中的安全问题 由于该工具基于Python 3…

用ChatGPT自动生成流程图

我们看别人代码时&#xff0c;总希望有流程图&#xff0c;这样可以一目了然&#xff0c;不过自己写的代码&#xff0c;又不想花几个小时去画流程图。有没有更好的方法呢&#xff1f; 方法就是用ChatGPT等大模型自动生成流程图&#xff0c;并用python等语言实现自动输出流程图。…

第13篇:ESP32 idf wifi联网使用SNTP同步网络时间LCD ST7920液晶屏显示

第1篇:Arduino与ESP32开发板的安装方法 第2篇:ESP32 helloword第一个程序示范点亮板载LED 第3篇:vscode搭建esp32 arduino开发环境 第4篇:vscodeplatformio搭建esp32 arduino开发环境 ​​​​​​第5篇:doit_esp32_devkit_v1使用pmw呼吸灯实验 第6篇:ESP32连接无源喇叭播…

什么是Jmeter?Jmeter使用的原理步骤是什么?

1.1 什么是 JMeter Apache JMeter 是 Apache 组织开发的基于 Java 的压力测试工具。用于对软件做压力测试&#xff0c;它最初被设计用于 Web 应用测试&#xff0c;但后来扩展到其他测试领域。 它可以用于测试静态和动态资源&#xff0c;例如静态文件、Java 小服务程序、CGI 脚…

贝叶斯分位数回归、lasso和自适应lasso贝叶斯分位数回归分析免疫球蛋白、前列腺癌数据...

原文链接&#xff1a;http://tecdat.cn/?p22702 贝叶斯回归分位数在最近的文献中受到广泛关注&#xff0c;本文实现了贝叶斯系数估计和回归分位数&#xff08;RQ&#xff09;中的变量选择&#xff0c;带有lasso和自适应lasso惩罚的贝叶斯&#xff08;点击文末“阅读原文”获取…

K8S集群中部署服务之应用环境配置

微服务项目sangomall应用环境配置说明 一、应用环境配置文件创建 可以创建多个application.properties或application.yml文件,通过关键配置进行激活使用&#xff0c;例如测试环境和生产环境等。 1.1 创建开发环境&#xff08;dev&#xff09; 名称&#xff1a;application-…