Exercise 7.4: Working with DaemonSets

  1. CP 노드에 연결된 터미널로 이동

  2. DaemonSet 생성

    cat <<EOF | kubectl create -f -
    apiVersion: apps/v1
    kind: DaemonSet
    metadata:
      name: ds-one
      labels:
        system: DaemonSetOne
    spec:
      selector:
        matchLabels:
          system: DaemonSetOne
      template:
        metadata:
          labels:
            system: DaemonSetOne
        spec:
          containers:
          - name: nginx
            image: nginx:1.15.1
            ports:
            - containerPort: 80
    EOF
  3. DaemonSet 및 Pod 확인

    kubectl get ds,pod -l system=DaemonSetOne -o wide
  4. 생성된 Pod의 컨테이너 이미지 확인

    kubectl get pod -l system=DaemonSetOne \
    -o=custom-columns=NAME:.metadata.name,IMAGE:.spec.containers[*].image

Last updated