web-dev-qa-db-ja.com

kubectlコンテキストとクラスター

Kubectlとkubernetes configの世界で、コンテキストとクラスターの違いは何ですか?たとえば、次のコマンドが表示されます。

Available Commands:
  current-context Displays the current-context
  delete-cluster  Delete the specified cluster from the kubeconfig
  delete-context  Delete the specified context from the kubeconfig
  get-clusters    Display clusters defined in the kubeconfig
  get-contexts    Describe one or many contexts
  rename-context  Renames a context from the kubeconfig file.
  set             Sets an individual value in a kubeconfig file
  set-cluster     Sets a cluster entry in kubeconfig
  set-context     Sets a context entry in kubeconfig

そして.kube/configに私が見る:

- context:
    cluster: arn:aws:eks:us-west-2:91XXXXXXX71:cluster/ignitecluster
    namespace: ignite
    user: arn:aws:eks:us-west-2:91XXXXXXX71:cluster/ignitecluster
  name: arn:aws:eks:us-west-2: 91XXXXXXX71:cluster/ignitecluster
7
user7898461

https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl#kubeconfig から:

A context is a group of access parameters.
Each context contains a Kubernetes cluster, a user, and a namespace.
The current context is the cluster that is currently the default for kubectl:
all kubectl commands run against that cluster

したがって、contextX = {clusterX、userX、namespaceX}

1