k 8 sコンテナ環境変数

2479 ワード

https://kubernetes.io/zh/docs/concepts/containers/container-environment-variables/
apiVersion: apps/v1
kind: Deployment
metadata:
  name: testEnv
  labels:
    app: testEnv
spec:
  replicas: 1
  selector:
    matchLabels:
      app: testEnv
  template:
    metadata:
      labels:
        app: testEnv
    spec:
      containers:
        env:
        - name: EUREKA_CLIENT_SERVICE_URL_defaultZone
          value: "http://eureka-1/eureka/,http://eureka-2/eureka/"
        - name: SERVER_PORT
          value: "80"
        - name: CONF_ENV
          value: "pre"
        - name: LOG_LEVEL
          value: "WARN"
        - name: APPNAME
          value: "eureka"
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name