https://kubernetes.io/ko/docs/concepts/configuration/organize-cluster-access-kubeconfig/
A kubeconfig file called super.kubeconfig
has been created under /root/CKA
. There is something wrong with the configuration. Troubleshoot and fix it.
controlplane ~/CKA ➜ kubectl config view
---
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: DATA+OMITTED
server: https://controlplane:6443
name: kubernetes
contexts:
- context:
cluster: kubernetes
user: kubernetes-admin
name: kubernetes-admin@kubernetes
current-context: kubernetes-admin@kubernetes
kind: Config
preferences: {}
users:
- name: kubernetes-admin
user:
client-certificate-data: DATA+OMITTED
client-key-data: DATA+OMITTED
in vi editor. Change the 9999 port to 6443 and run the below command to verify: 왜냐면 kubectl config view 값이랑 맞춰 줘야 하니까 kubectl cluster-info --kubeconfig=/root/CKA/super.kubeconfigkubectl cluster-info -h
Display addresses of the control plane and services with label
kubernetes.io/cluster-service=true. To further debug and diagnose cluster
problems, use 'kubectl cluster-info dump'.
Examples:
# Print the address of the control plane and cluster services
kubectl cluster-info
Available Commands:
dump Dump relevant information for debugging and diagnosis
Usage:
kubectl cluster-info [flags] [options]
Use "kubectl <command> --help" for more information about a given command.
Use "kubectl options" for a list of global command-line options (applies to all
commands).
--kubeconfig='':
Path to the kubeconfig file to use for CLI requests.