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.
46 lines
2.7 KiB
46 lines
2.7 KiB
3 years ago
|
apiVersion: apps/v1 #指定API版本标签
|
||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints
|
||
|
metadata: #定义资源的元数据信息
|
||
|
name: et-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的
|
||
|
namespace: lk #默认default
|
||
|
labels: #定义资源标签
|
||
|
app: yaml-et-d
|
||
|
spec:
|
||
|
replicas: 1 #定义副本数量
|
||
|
selector: #定义选择器
|
||
|
matchLabels: #匹配上边的标签
|
||
|
app: yaml-et-d #名称
|
||
|
template: #定义模板
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: yaml-et-d
|
||
|
spec:
|
||
|
containers: #定义容器信息
|
||
|
- name: yaml-et #容器名,与标签名要相同
|
||
|
image: repository.anxinyun.cn/local/et:latest #容器使用的镜像以及版本
|
||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像
|
||
|
command: ['java','-cp','et.jar','et.main.singleton','db.url=jdbc:postgresql://pg-service:5432/axy','db.user=postgres','db.pwd=example','iota.api.proxy="iota-proxy-service:8091/_iota_api"','redis.host=redis-service','redis.port=6379' ,'kafka.brokers=kafka-service:9092','es.cluster.nodes=es-service:9200']
|
||
|
#command: ['java -cp et.jar et.main.singleton db.url=jdbc:postgresql://pg-service:5432/axy db.user=postgres db.pwd=example iota.api.proxy="iota-proxy-service:8091/_iota_api" redis.host=redis-service redis.port=6379 kafka.brokers=kafka-service:9092 es.cluster.nodes=es-service:9200']
|
||
|
volumeMounts: #改容器内无法修改hosts 挂载出来修改
|
||
|
- name: vol-etc #挂载设备的名字,与volumes[*].name 需要对应
|
||
|
mountPath: /etc/hosts # 容器的数据目录
|
||
|
volumes: # volumes和container处于同一层级,别搞错了
|
||
|
- name: vol-etc
|
||
|
hostPath:
|
||
|
path: /etc/hosts # 宿主机目录 覆盖容器内目录 间接统一hosts
|
||
|
|
||
|
---
|
||
|
#ET不对外提供服务 不启用service
|
||
|
# apiVersion: v1 #指定API版本标签
|
||
|
# kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints
|
||
|
# metadata: #定义资源的元数据信息
|
||
|
# name: et-service #定义资源的名称,在同一个namespace空间中必须是唯一的
|
||
|
# namespace: lk #默认default
|
||
|
# labels: #定义资源标签
|
||
|
# app: et-s
|
||
|
# spec:
|
||
|
# selector:
|
||
|
# app: yaml-et-d #deployment标签
|
||
|
# type: ClusterIP
|
||
|
|