|
@@ -2,25 +2,25 @@ kind: Deployment |
|
|
apiVersion: apps/v1 |
|
|
apiVersion: apps/v1 |
|
|
# 元数据 |
|
|
# 元数据 |
|
|
metadata: |
|
|
metadata: |
|
|
name: advertisement |
|
|
|
|
|
namespace: advertisement |
|
|
|
|
|
|
|
|
name: egg-admin |
|
|
|
|
|
namespace: egg |
|
|
labels: |
|
|
labels: |
|
|
app: advertisement |
|
|
|
|
|
|
|
|
app: egg-admin |
|
|
annotations: |
|
|
annotations: |
|
|
kubesphere.io/creator: dengbiao |
|
|
kubesphere.io/creator: dengbiao |
|
|
kubesphere.io/description: advertisement |
|
|
|
|
|
|
|
|
kubesphere.io/description: egg-admin |
|
|
# deployment主要部分 |
|
|
# deployment主要部分 |
|
|
spec: |
|
|
spec: |
|
|
replicas: 1 |
|
|
replicas: 1 |
|
|
selector: |
|
|
selector: |
|
|
matchLabels: |
|
|
matchLabels: |
|
|
# 名称与上面的labels对应 |
|
|
# 名称与上面的labels对应 |
|
|
app: advertisement |
|
|
|
|
|
|
|
|
app: egg-admin |
|
|
template: |
|
|
template: |
|
|
metadata: |
|
|
metadata: |
|
|
labels: |
|
|
labels: |
|
|
# 名称与上面的matchLabels对应 |
|
|
# 名称与上面的matchLabels对应 |
|
|
app: advertisement |
|
|
|
|
|
|
|
|
app: egg-admin |
|
|
spec: |
|
|
spec: |
|
|
# 声明挂载卷(将外部已存在的pvc、config等挂载进来) |
|
|
# 声明挂载卷(将外部已存在的pvc、config等挂载进来) |
|
|
volumes: |
|
|
volumes: |
|
@@ -30,41 +30,41 @@ spec: |
|
|
path: /etc/localtime |
|
|
path: /etc/localtime |
|
|
type: '' |
|
|
type: '' |
|
|
# 将前面创建的configMap也挂载进来 |
|
|
# 将前面创建的configMap也挂载进来 |
|
|
- name: advertisement-cfg |
|
|
|
|
|
|
|
|
- name: egg-admin-cfg |
|
|
configMap: |
|
|
configMap: |
|
|
# 这里的名字就是前面创建的configMap的名字 |
|
|
# 这里的名字就是前面创建的configMap的名字 |
|
|
name: advertisement-cfg |
|
|
|
|
|
|
|
|
name: egg-admin-cfg |
|
|
defaultMode: 420 |
|
|
defaultMode: 420 |
|
|
# pvc |
|
|
# pvc |
|
|
- name: advertisement-pvc # 在该部署中的名称,后面使用改名称挂载 |
|
|
|
|
|
|
|
|
- name: egg-admin # 在该部署中的名称,后面使用改名称挂载 |
|
|
persistentVolumeClaim: |
|
|
persistentVolumeClaim: |
|
|
claimName: advertisement-pvc # pvc的名称 |
|
|
|
|
|
|
|
|
claimName: egg-admin # pvc的名称 |
|
|
# Nginx配置 |
|
|
# Nginx配置 |
|
|
- name: advertisement-nginx |
|
|
|
|
|
|
|
|
- name: egg-admin-nginx |
|
|
configMap: |
|
|
configMap: |
|
|
name: advertisement-nginx # 外部configMap的名称 |
|
|
|
|
|
|
|
|
name: egg-admin-nginx # 外部configMap的名称 |
|
|
items: |
|
|
items: |
|
|
- key: go.conf |
|
|
- key: go.conf |
|
|
path: default.conf |
|
|
path: default.conf |
|
|
containers: |
|
|
containers: |
|
|
# 主容器 |
|
|
# 主容器 |
|
|
- name: advertisement-container |
|
|
|
|
|
|
|
|
- name: egg-admin-container |
|
|
# 镜像地址(提前打包好并推送的镜像仓库) |
|
|
# 镜像地址(提前打包好并推送的镜像仓库) |
|
|
image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/advertisement:0.0.1' |
|
|
|
|
|
|
|
|
image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/egg-admin:20241205-01' |
|
|
ports: |
|
|
ports: |
|
|
- name: ad-1002 |
|
|
|
|
|
|
|
|
- name: egg-admin-4010 |
|
|
# 容器端口号(注意与golang web server启动的端口一致) |
|
|
# 容器端口号(注意与golang web server启动的端口一致) |
|
|
containerPort: 1002 |
|
|
|
|
|
|
|
|
containerPort: 4010 |
|
|
protocol: TCP |
|
|
protocol: TCP |
|
|
# 将前面volume声明的需要用到的pvc、config挂载上来 |
|
|
# 将前面volume声明的需要用到的pvc、config挂载上来 |
|
|
volumeMounts: |
|
|
volumeMounts: |
|
|
- name: host-time |
|
|
- name: host-time |
|
|
readOnly: true |
|
|
readOnly: true |
|
|
mountPath: /etc/localtime |
|
|
mountPath: /etc/localtime |
|
|
- name: advertisement-cfg # 该名字对应前面volumes声明的名字 |
|
|
|
|
|
|
|
|
- name: egg-admin-cfg # 该名字对应前面volumes声明的名字 |
|
|
readOnly: true |
|
|
readOnly: true |
|
|
# 挂载到容器的哪个路径 |
|
|
# 挂载到容器的哪个路径 |
|
|
mountPath: /var/zyos |
|
|
|
|
|
|
|
|
mountPath: /var/egg |
|
|
imagePullPolicy: Always |
|
|
imagePullPolicy: Always |
|
|
# Nginx 容器 |
|
|
# Nginx 容器 |
|
|
- name: nginx |
|
|
- name: nginx |
|
@@ -79,9 +79,9 @@ spec: |
|
|
readOnly: true |
|
|
readOnly: true |
|
|
mountPath: /etc/localtime |
|
|
mountPath: /etc/localtime |
|
|
# 存储卷 用于存放前端代码 |
|
|
# 存储卷 用于存放前端代码 |
|
|
- name: advertisement-pvc # 前面volumes声明的名称 |
|
|
|
|
|
|
|
|
- name: egg-admin # 前面volumes声明的名称 |
|
|
mountPath: /usr/share/nginx/html |
|
|
mountPath: /usr/share/nginx/html |
|
|
- name: advertisement-nginx # Nginx 配置 |
|
|
|
|
|
|
|
|
- name: egg-admin-nginx # Nginx 配置 |
|
|
readOnly: true |
|
|
readOnly: true |
|
|
mountPath: /etc/nginx/conf.d/default.conf |
|
|
mountPath: /etc/nginx/conf.d/default.conf |
|
|
subPath: default.conf |
|
|
subPath: default.conf |
|
|