apiVersion: apps/v1 #指定API版本标签 kind: StatefulSet #定义资源的类型/角色,deployment为控制器,service,endpoints metadata: #定义资源的元数据信息 name: etgo #定义资源的名称,在同一个namespace空间中必须是唯一的 namespace: lk #默认default labels: #定义资源标签 app: yaml-etgo spec: replicas: 2 selector: #定义选择器 matchLabels: #匹配上边的标签 app: yaml-etgo #名称 serviceName: etgo-svc template: #定义模板 metadata: labels: app: yaml-etgo spec: containers: - name: yaml-etgo #容器名,与标签名要相同 image: registry.ngaiot.com/local/git-etgo:34 imagePullPolicy: IfNotPresent ports: - containerPort: 50001 name: tcp-50001 - containerPort: 50000 name: tcp-50000 - containerPort: 40000 name: tcp-40000 volumeMounts: - name: config subPath: config.yaml mountPath: /app/config.yaml volumes: # volumes和container处于同一层级,别搞错了 - name: config configMap: name: config-etgo --- apiVersion: v1 kind: Service metadata: name: etgo-svc namespace: lk spec: ports: - name: tcp-50001 port: 50001 targetPort: 50001 - name: tcp-50000 port: 50000 targetPort: 50000 - name: tcp-40000 port: 40000 targetPort: 40000 selector: app: yaml-etgo type: ClusterIP --- apiVersion: v1 kind: ConfigMap metadata: name: config-etgo namespace: lk data: config.yaml: | kafka: groupId: local_et_go brokers: - 10.8.30.160:30992 topics: data_theme: native_theme data_raw: go_RawData data_agg: native_agg alarm_iota: Alert alarm_anxinyun: native_alarm redis: address: 10.8.30.160:30379 es: enable: true addresses: - http://10.8.30.160:30092 user: "" pwd: "" index: raw: go_native_raws vib: go_native_vbraws theme: go_native_themes group: go_native_group_themes influxDB: enable: false address: http://10.8.30.160:30086 token: EJcUCii65nAWBivWjV_7ro-V1yAiarPD41iuxJgRPZBRqXst4hSPt7L8VEhUoY_hdR0kvmPHFN5lv1wlX12t-A== organization: dongjiang buckets: raw: raw vib: vib theme: theme #设备数据指标 prometheus: port: 50001 #测点数据推送 push: mqtt: enable: false host: 10.8.30.160 port: 30883 clientIdPrefix: push_et_go kafka: enable: false groupId: push_et_go1 brokers: - 10.8.30.160:30992 #节点信息 master: port: 50000 hostNameTag: "etgo-0" #k8s多状态副本 master 节点的 hostName 标记 node: remoteMasterHost: etgo-0.etgo-svc.lk.svc.cluster.local #用于 node Register -> master hostIpPrefix: 10.1. #多网卡筛选ip网段 port: 40000