You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
3.4 KiB
70 lines
3.4 KiB
3 years ago
|
apiVersion: apps/v1 #指定API版本标签
|
||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints
|
||
|
metadata: #定义资源的元数据信息
|
||
|
name: webconsole-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的
|
||
|
namespace: lk #默认default
|
||
|
labels: #定义资源标签
|
||
|
app: yaml-webconsole-d
|
||
|
spec:
|
||
|
replicas: 1 #定义副本数量
|
||
|
selector: #定义选择器
|
||
|
matchLabels: #匹配上边的标签
|
||
|
app: yaml-webconsole-d #名称
|
||
|
template: #定义模板
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: yaml-webconsole-d
|
||
|
spec:
|
||
|
containers: #定义容器信息
|
||
|
- name: yaml-webconsole #容器名,与标签名要相同
|
||
|
image: repository.anxinyun.cn/anxinyun/console-web:75.21-06-10
|
||
|
#image: repository.anxinyun.cn/anxinyun/console:latest #容器使用的镜像以及版本
|
||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像
|
||
|
env: #环境变量
|
||
|
- name: ANXINCLOUD_API
|
||
|
value: http://webapi-service:8092
|
||
|
- name: ANXINCLOUD_IOTA_API
|
||
|
value: http://iota-webapi-service:9080
|
||
|
- name: ANXINCLOUD_HDFS_HTTP
|
||
|
value: http://10.8.30.155:50070
|
||
|
- name: ANXINCLOUD_QINIU_AK
|
||
|
value: 5XrM4wEB9YU6RQwT64sPzzE6cYFKZgssdP5Kj3uu
|
||
|
- name: ANXINCLOUD_QINIU_SK
|
||
|
value: w6j2ixR_i-aelc6I7S3HotKIX-ukMzcKmDfH6-M5
|
||
|
- name: ANXINCLOUD_QINIU_BUCKET_RESOURCE
|
||
|
value: anxinyun-test
|
||
|
- name: ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE
|
||
|
value: http://test.resources.anxinyun.cn
|
||
|
- name: "ANXINCLOUD_IOTA_AUTH"
|
||
|
value: "MGU0MmFmZTZlNzEwNTVjZWEyNWZjMDA4M2Q4MTY0MjZjNTg2N2I4OTozNWUwYWRmMGEzMDM0NWEzMTA0YTA2YmI4YTY0ODQwMGQ5NGE5YzIw"
|
||
|
ports:
|
||
|
- containerPort: 8080 #定义容器的端口
|
||
|
name: tcp-8080
|
||
|
command: ['node','server.js','-p','8080']
|
||
|
volumeMounts: #改容器内无法修改hosts 挂载出来修改
|
||
|
- name: vol-hosts #挂载设备的名字,与volumes[*].name 需要对应
|
||
|
mountPath: /etc/hosts # 容器的数据目录
|
||
|
volumes: # volumes和container处于同一层级,别搞错了
|
||
|
- name: vol-hosts
|
||
|
hostPath:
|
||
|
path: /etc/hosts # 宿主机目录 覆盖容器内目录 间接统一hosts
|
||
|
|
||
|
---
|
||
|
apiVersion: v1 #指定API版本标签
|
||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints
|
||
|
metadata: #定义资源的元数据信息
|
||
|
name: webconsole-service #定义资源的名称,在同一个namespace空间中必须是唯一的
|
||
|
namespace: lk #默认default
|
||
|
labels: #定义资源标签
|
||
|
app: webconsole-s
|
||
|
spec:
|
||
|
selector:
|
||
|
app: yaml-webconsole-d #deployment标签
|
||
|
type: NodePort
|
||
|
ports:
|
||
|
- protocol: TCP
|
||
|
port: 8072 # 集群内访问
|
||
|
targetPort: 8080 #集群内 容器内端口
|
||
|
name: tcp-8080
|
||
|
nodePort: 30872 #集群外访问 范围30000-32767
|