## configmap
apiVersion: v1
kind: ConfigMap
metadata:
  name: test-cm
data:
  kube.config: |-
    # ~/.kube/config
    apiVersion: v1
    clusters:
...
      name: kubernetes
    contexts:

          command: ncp-iam-authenticator
  ncloud.config: |-
    # ~/.ncloud/configure
    [DEFAULT]
    ncloud_access_key_id = G
    ncloud_secret_access_key = d
    ncloud_api_url = https://n
    
    
    
    ## deployment
    spec:
  replicas: 1
  selector:
    matchLabels:
      app: test-app
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: test-app
    spec:
      containers:
      - env:
      ...
        volumeMounts:
        - mountPath: /home/default/.kube/config
          name: kubeconfigcm
          subPath: kube.config
        - mountPath: /home/default/.ncloud/configure
          name: kubeconfigcm
          subPath: ncloud.config
          restartPolicy: Always
      volumes:
      - configMap:
          defaultMode: 420
          items:
          - key: kube.config
            path: kube.config
          - key: ncloud.config
            path: ncloud.config
          name: test-cm
        name: kubeconfigcm

 

+ Recent posts