apiVersion: apps/v1 kind: Deployment metadata: name: tongweb spec: selector: matchLabels: app: tongweb replicas: 1 template: metadata: labels: app: tongweb spec: containers: - name: tongweb image: 168.1.1.18:9999/library/tongweb-cloud imagePullPolicy: "IfNotPresent" env: - name: webApp_kuang_config value: context-root=/kuang2 - name: CONFIG_REMOTE_ENABLE value: "false" - name: CONFIG_REMOTE_TYPE value: "nacos" - name: CONFIG_SERVER value: "127.0.0.1:8848" - name: LOG_NACOS_DATA_ID value: "logging" - name: APP_NACOS_DATA_ID value: "application" - name: TONGWEB_NACOS_DATA_ID value: "tongweb" - name: NACOS_GROUP value: "DEFAULT_GROUP" - name: ENV_TYPE value: "cloud" - name: POD_NAME valueFrom: fieldRef: fieldPath: metadata.name - name: MEM_REQUEST valueFrom: resourceFieldRef: resource: requests.memory - name: MEM_LIMIT valueFrom: resourceFieldRef: resource: limits.memory ports: - name: port-http containerPort: 8088 - name: port-https containerPort: 8443 volumeMounts: - name: log-volume mountPath: /opt/TongWeb/kernel/logs - name: auto-volume mountPath: /opt/TongWeb/kernel/autodeploy - name: tongweb-volume mountPath: /opt/TongWeb/kernel/conf/tongweb.xml subPath: tongweb.xml volumes: - name: log-volume hostPath: path: /home/work/logs type: DirectoryOrCreate - name: auto-volume hostPath: path: /home/liqiang/a type: DirectoryOrCreate - name: tongweb-volume configMap: name: tongweb
标签:opt,name,tongweb,示例,NACOS,value,volume,挂载,k8s From: https://www.cnblogs.com/rerise/p/17650841.html