"K8s configMapKeyRef"의 두 판 사이의 차이

10번째 줄: 10번째 줄:
spec:
spec:
   containers:
   containers:
    - name: test-container
  - name: test-container
      image: k8s.gcr.io/busybox
    image: k8s.gcr.io/busybox
      command: [ "/bin/echo", "$(SPECIAL_LEVEL_KEY) $(SPECIAL_TYPE_KEY)" ]
    command: [ "/bin/echo", "$(SPECIAL_LEVEL_KEY) $(SPECIAL_TYPE_KEY)" ]
      env:
    env:
        - name: SPECIAL_LEVEL_KEY
    - name: SPECIAL_LEVEL_KEY
          valueFrom:
      valueFrom:
            configMapKeyRef:
        configMapKeyRef:
              name: special-config
          name: special-config
              key: SPECIAL_LEVEL
          key: SPECIAL_LEVEL
        - name: SPECIAL_TYPE_KEY
    - name: SPECIAL_TYPE_KEY
          valueFrom:
      valueFrom:
            configMapKeyRef:
        configMapKeyRef:
              name: special-config
          name: special-config
              key: SPECIAL_TYPE
          key: SPECIAL_TYPE
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang='yaml'>
<syntaxhighlight lang='yaml'>

2022년 10월 4일 (화) 01:47 판

1 개요

k8s configMapKeyRef
apiVersion: v1
kind: Pod
metadata:
  name: dapi-test-pod
spec:
  containers:
  - name: test-container
    image: k8s.gcr.io/busybox
    command: [ "/bin/echo", "$(SPECIAL_LEVEL_KEY) $(SPECIAL_TYPE_KEY)" ]
    env:
    - name: SPECIAL_LEVEL_KEY
      valueFrom:
        configMapKeyRef:
          name: special-config
          key: SPECIAL_LEVEL
    - name: SPECIAL_TYPE_KEY
      valueFrom:
        configMapKeyRef:
          name: special-config
          key: SPECIAL_TYPE
apiVersion: v1
kind: ConfigMap
metadata:
  name: special-config
  namespace: default
data:
  SPECIAL_LEVEL: very
  SPECIAL_TYPE: charm

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}