apiVersion: apps/v1 kind: Deployment metadata: name: wms-hub-center-server namespace: {{NAMESPACE}} spec: replicas: 1 selector: matchLabels: app: wms-hub-center-server template: metadata: labels: app: wms-hub-center-server spec: volumes: - name: logpath hostPath: path: /nfsdata containers: - name: wms-hub-center-server image: {{IMAGE_URL}} imagePullPolicy: IfNotPresent ports: - containerPort: 12008 env: - name: HOSTNAME valueFrom: fieldRef: apiVersion: v1 fieldPath: status.hostIP - name: DOCKER_CONSUL_HOST valueFrom: fieldRef: apiVersion: v1 fieldPath: status.hostIP - name: HOST_IP valueFrom: fieldRef: apiVersion: v1 fieldPath: status.hostIP - name: HOST_NAME valueFrom: fieldRef: apiVersion: v1 fieldPath: spec.nodeName - name: POD_IP valueFrom: fieldRef: apiVersion: v1 fieldPath: status.podIP - name: POD_NAME valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.name - name: ITWORK_ENV_CODE valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.namespace resources: requests: memory: 1000Mi cpu: 500m limits: memory: 5000Mi cpu: 1000m volumeMounts: - name: logpath mountPath: /data/log
标签:fieldRef,name,v1,valueFrom,apiVersion,fieldPath,yaml,deployment From: https://www.cnblogs.com/quemengqio/p/17007944.html