Exercise 9.4: Use Labels to Manage Resources

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

  2. system=secondary Label을 가진 모든 Pod 삭제

    kubectl delete pods -l system=secondary --all-namespaces
  3. accounting Namespace에 있는 Pod 목록 확인

    kubectl -n accounting get pods
  4. accounting Namespace에 있는 Deployment 목록 및 부여된 Label 확인

    kubectl -n accounting get deploy --show-labels
  5. accounting Namespace에 있는 Deployment 중에서 system=secondary Label을 가진 Deployment 삭제

    kubectl -n accounting delete deploy -l system=secondary
  6. 노드에 부여된 Label 확인

    kubectl get node --show-labels
  7. Worker 노드에 부여된 Label 중에서 키값이 system 인 Label 삭제

    kubectl label node worker system-
  8. 리소스 삭제

    {
        kubectl delete deploy nginx
        kubectl delete svc nginx
        kubectl delete svc nginx-one -n accounting
        kubectl delete ns accounting
    }

Last updated