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

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

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

1.1 mall-auth-server

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:name: mall-auth-servernamespace: sangomalllabels:app: mall-auth-server
spec:replicas: 1selector:matchLabels:app: mall-auth-servertemplate:metadata:labels:app: mall-auth-serverspec:containers:- name: mall-auth-serverimage: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latestimagePullPolicy: Alwaysports:- name: tcp-30000containerPort: 30000protocol: TCPresources:limits:cpu: 1000mmemory: 500Mirequests:cpu: 10mmemory: 10Mi---
kind: Service
apiVersion: v1
metadata:name: mall-auth-servernamespace: sangomalllabels:app: mall-auth-server
spec:ports:- name: httpprotocol: TCPport: 30000targetPort: 30000selector:app: mall-auth-server

1.2 mall-cart

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:name: mall-cartnamespace: sangomalllabels:app: mall-cart
spec:replicas: 1selector:matchLabels:app: mall-carttemplate:metadata:labels:app: mall-cartspec:containers:- name: mall-cartimage: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latestimagePullPolicy: Alwaysports:- name: tcp-22200containerPort: 22200protocol: TCPresources:limits:cpu: 1000mmemory: 500Mirequests:cpu: 10mmemory: 10Mi---
kind: Service
apiVersion: v1
metadata:name: mall-cartnamespace: sangomalllabels:app: mall-cart
spec:ports:- name: httpprotocol: TCPport: 22200targetPort: 22200selector:app: mall-cart

1.3 mall-coupon

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:name: mall-couponnamespace: sangomalllabels:app: mall-coupon
spec:replicas: 1selector:matchLabels:app: mall-coupontemplate:metadata:labels:app: mall-couponspec:containers:- name: mall-couponimage: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latestimagePullPolicy: Alwaysports:- name: tcp-8010containerPort: 8010protocol: TCPresources:limits:cpu: 1000mmemory: 500Mirequests:cpu: 10mmemory: 10Mi---
kind: Service
apiVersion: v1
metadata:name: mall-couponnamespace: sangomalllabels:app: mall-coupon
spec:ports:- name: httpprotocol: TCPport: 8010targetPort: 8010selector:app: mall-coupon

1.4 mall-gateway

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:name: mall-gatewaynamespace: sangomalllabels:app: mall-gateway
spec:replicas: 1selector:matchLabels:app: mall-gatewaytemplate:metadata:labels:app: mall-gatewayspec:containers:- name: mall-gatewayimage: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latestimagePullPolicy: Alwaysports:- name: tcp-8072containerPort: 8072protocol: TCPresources:limits:cpu: 1000mmemory: 1024Mirequests:cpu: 10mmemory: 512Mi
---
kind: Service
apiVersion: v1
metadata:name: mall-gatewaynamespace: sangomalllabels:app: mall-gateway
spec:ports:- name: httpprotocol: TCPport: 8072targetPort: 8072selector:app: mall-gateway

1.5 mall-member

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:name: mall-membernamespace: sangomalllabels:app: mall-member
spec:replicas: 1selector:matchLabels:app: mall-membertemplate:metadata:labels:app: mall-memberspec:containers:- name: mall-memberimage: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latestimagePullPolicy: Alwaysports:- name: tcp-20300containerPort: 20300protocol: TCPresources:limits:cpu: 1000mmemory: 500Mirequests:cpu: 10mmemory: 10Mi
---
kind: Service
apiVersion: v1
metadata:name: mall-membernamespace: sangomalllabels:app: mall-member
spec:ports:- name: httpprotocol: TCPport: 20300targetPort: 20300selector:app: mall-member

1.6 mall-order

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:name: mall-ordernamespace: sangomalllabels:app: mall-order
spec:replicas: 1selector:matchLabels:app: mall-ordertemplate:metadata:labels:app: mall-orderspec:containers:- name: mall-orderimage: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latestimagePullPolicy: Alwaysports:- name: tcp-8030containerPort: 8030protocol: TCPresources:limits:cpu: 1000mmemory: 500Mirequests:cpu: 10mmemory: 10Mi---
kind: Service
apiVersion: v1
metadata:name: mall-ordernamespace: sangomalllabels:app: mall-order
spec:ports:- name: httpprotocol: TCPport: 8030targetPort: 8030selector:app: mall-order

1.7 mall-product

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:name: mall-productnamespace: sangomalllabels:app: mall-product
spec:replicas: 1selector:matchLabels:app: mall-producttemplate:metadata:labels:app: mall-productspec:containers:- name: mall-productimage: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latestimagePullPolicy: Alwaysports:- name: tcp-8040containerPort: 8040protocol: TCPresources:limits:cpu: 1000mmemory: 500Mirequests:cpu: 10mmemory: 10Mi---
kind: Service
apiVersion: v1
metadata:name: mall-productnamespace: sangomalllabels:app: mall-product
spec:ports:- name: httpprotocol: TCPport: 8040targetPort: 8040selector:app: mall-product

1.8 mall-search

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:name: mall-searchnamespace: sangomalllabels:app: mall-search
spec:replicas: 1selector:matchLabels:app: mall-searchtemplate:metadata:labels:app: mall-searchspec:containers:- name: mall-searchimage: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latestimagePullPolicy: Alwaysports:- name: tcp-8090containerPort: 8090protocol: TCPresources:limits:cpu: 1000mmemory: 500Mirequests:cpu: 10mmemory: 10Mi---
kind: Service
apiVersion: v1
metadata:name: mall-searchnamespace: sangomalllabels:app: mall-search
spec:ports:- name: httpprotocol: TCPport: 8090targetPort: 8090selector:app: mall-search

1.9 mall-seckill

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:name: mall-seckillnamespace: sangomalllabels:app: mall-seckill
spec:replicas: 1selector:matchLabels:app: mall-seckilltemplate:metadata:labels:app: mall-seckillspec:containers:- name: mall-seckillimage: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latestimagePullPolicy: Alwaysports:- name: tcp-9601containerPort: 9601protocol: TCPresources:limits:cpu: 1000mmemory: 500Mirequests:cpu: 10mmemory: 10Mi---
kind: Service
apiVersion: v1
metadata:name: mall-seckillnamespace: sangomalllabels:app: mall-seckill
spec:ports:- name: httpprotocol: TCPport: 9601targetPort: 9601selector:app: mall-seckill

1.10 mall-third-party

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:name: mall-third-partynamespace: sangomalllabels:app: mall-third-party
spec:replicas: 1selector:matchLabels:app: mall-third-partytemplate:metadata:labels:app: mall-third-partyspec:containers:- name: mall-third-partyimage: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latestimagePullPolicy: Alwaysports:- name: tcp-8100containerPort: 8100protocol: TCPresources:limits:cpu: 1000mmemory: 500Mirequests:cpu: 10mmemory: 10Mi---
kind: Service
apiVersion: v1
metadata:name: mall-third-partynamespace: sangomalllabels:app: mall-third-party
spec:ports:- name: httpprotocol: TCPport: 8100targetPort: 8100selector:app: mall-third-party

1.11 mall-ware

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:name: mall-warenamespace: sangomalllabels:app: mall-ware
spec:replicas: 1selector:matchLabels:app: mall-waretemplate:metadata:labels:app: mall-warespec:containers:- name: mall-wareimage: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latestimagePullPolicy: Alwaysports:- name: tcp-8050containerPort: 8050protocol: TCPresources:limits:cpu: 1000mmemory: 500Mirequests:cpu: 10mmemory: 10Mi---
kind: Service
apiVersion: v1
metadata:name: mall-warenamespace: sangomalllabels:app: mall-ware
spec:ports:- name: httpprotocol: TCPport: 8050targetPort: 8050selector:app: mall-ware

1.12 renren-fast-master [renren-fast]

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:name: renren-fastnamespace: sangomalllabels:app: renren-fast
spec:replicas: 1selector:matchLabels:app: renren-fasttemplate:metadata:labels:app: renren-fastspec:containers:- name: renren-fastimage: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latestimagePullPolicy: Alwaysports:- name: tcp-8093containerPort: 8093protocol: TCPresources:limits:cpu: 1000mmemory: 500Mirequests:cpu: 10mmemory: 10Mi
---
kind: Service
apiVersion: v1
metadata:name: renren-fastnamespace: sangomalllabels:app: renren-fast
spec:ports:- name: httpprotocol: TCPport: 8093targetPort: 8093selector:app: renren-fast

1.13 renren-generator-master [renren-generator]

在这里插入图片描述

---
apiVersion: apps/v1
kind: Deployment
metadata:name: renren-generatornamespace: sangomalllabels:app: renren-generator
spec:replicas: 1selector:matchLabels:app: renren-generatortemplate:metadata:labels:app: renren-generatorspec:containers:- name: renren-generatorimage: $REGISTRY/$DOCKERHUB_NAMESPACE/$PROJECT_NAME:latestimagePullPolicy: Alwaysports:- name: tcp-80containerPort: 80protocol: TCPresources:limits:cpu: 1000mmemory: 500Mirequests:cpu: 10mmemory: 10Mi---
kind: Service
apiVersion: v1
metadata:name: renren-generatornamespace: sangomalllabels:app: renren-generator
spec:ports:- name: httpprotocol: TCPport: 80targetPort: 80selector:app: renren-generator

二、部署描述文件使用

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

# kubectl apply -f deploy.yml

在这里插入图片描述

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

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

相关文章

算法通过村第七关-树(递归/二叉树遍历)白银笔记|递归实战

文章目录 前言1. 深入理解前中后序遍历从小到大递推分情况讨论,明确结束条件组合出完整的方法:从大到小 画图推演 总结 前言 提示:没有客观公正的记忆这回事,所有的记忆都是偏见,都是为自己的存活而重组过的经验。--国…

springboot 自动装配原理

一.原理解释 Spring Boot的自动配置是Spring框架的一个重要特性,它旨在简化应用程序的开发和部署过程。自动配置通过基于类路径中的依赖关系和配置文件内容来预先配置Spring应用程序的各种组件和功能。这样,我们可以在无需显式配置大量参数的情况下&…

慢查询SQL如何优化

一.什么是慢SQL? 慢SQL指的是Mysql中执行比较慢的SQL,排查慢SQL最常用的方法是通过慢查询日志来查找慢SQL。Mysql的慢查询日志是Mysql提供的一种日志记录,它用来记录Mysql中响应时间超过long_query_time值的sql,long_query_time的默认时间为10s. 二.查看慢SQL是否…

机器学习——贝叶斯(三种分布)/鸢尾花分类分界图/文本分类应用

0、前言: 机器学习中的贝叶斯的理论基础是数学当中的贝叶斯公式。这篇博客强调使用方法,至于理论未作深究。机器学习中三种类型的贝叶斯公式:高斯分布(多分类)、多项式分布(文本分类)、伯努利分…

Spring的 webFlux 和 webMVC

看到一个测评文章,并发在300的时候webMVC 和 webFlux的处理能力不相上下, 当并发达到3000的时候, webFlux明显优于webMVC, 有图有真相, 我信了. webMVC 是 one-request-one thread 堵塞模式, flux是非阻塞模式, 是spring家族系列…

分布式运用之rsync远程同步

一、rsync的相关知识 1.1 rsync简介 rsync(Remote Sync,远程同步)是一个开源的快速备份工具,可以在不同主机之间镜像同步整个目录树,支持增量备份,并保持链接和权限,且采用优化的同步算法&am…

GaussDB(DWS)云原生数仓技术解析:湖仓一体,体验与大数据互联互通

文章目录 前言一、关于数据仓库需求场景分类二、数据仓库线下部署场景2.1、线下部署场景介绍及优劣势说明2.2、线下部署场景对应的客户需求 三、数据仓库公有云部署场景3.1、公有云部署场景介绍及优劣势说明3.2、公有云部署场景对应的客户需求 四、为何重视数据共享&#xff08…

Python编程指南:利用HTTP和HTTPS适配器实现智能路由

嗨,爬虫大佬们!今天我要为大家分享一篇关于如何利用HTTP和HTTPS适配器来实现智能路由的Python编程指南。在现代互联网应用中,路由功能起着至关重要的作用,而利用Python编程语言实现智能路由则可以为我们的应用带来更高的灵活性和性…

一阶微分方程

目录 可分离变量的方程 齐次微分方程 一阶线性微分方程 伯努科方程 全微分方程 可分离变量的方程 可分离变量的方程是一种常见的一阶常微分方程类型,其特点是可以通过将变量分离到方程的两侧,从而可以分别对各自变量进行积分。一般形式的可分离变量…

企业架构LNMP学习笔记45

失效机制(了解) 1)如果key过期了,value会及时删除么?空间会及时清理么? 2)如果分配的存储空间,写满了,还允许写么? -m可以配置内存大小。 memcached 内部不…

第14章_瑞萨MCU零基础入门系列教程之QSPI

本教程基于韦东山百问网出的 DShanMCU-RA6M5开发板 进行编写,需要的同学可以在这里获取: https://item.taobao.com/item.htm?id728461040949 配套资料获取:https://renesas-docs.100ask.net 瑞萨MCU零基础入门系列教程汇总: ht…

火山引擎边缘云助力智能科技赋予生活更多新意

当下,先进的科学技术使得我们的日常生活变得快捷、舒适。大到上百层智能大厦、高端公共场所、社会智能基础设施,小到智能家居监控、指纹密码锁等,在这个充满想象力的时代,科技以更加智能化的方式改变和守护我们的生活。 引入智能…