본문 바로가기
cloud/k8s(문제풀이)

[cka]kodekloud-kubeconfig (마지막문제 ..)

by mozi2 2022. 6. 27.
반응형

1.Where is the default kubeconfig file located in the current environment?

  Find the current home directory by looking at the HOME environment variable.

ls -al
cd ./kube
pwd

A) /root/.kube/config

 

2. How many clusters are defined in the default kubeconfig file?

k config view

A) 1 

 

3. How many Users are defined in the default kubeconfig file?

k config view

A) 1

4. How many contexts are defined in the default kubeconfig file?

k config view

A) 1 

5. What is the user configured in the current context?

k config view

A) kubernetes-admin

6. What is the name of the cluster configured in the default kubeconfig file?

 

A) kubernetes

 

7. A new kubeconfig file named my-kube-config is created. It is placed in the /root directory. How many clusters are defined in that kubeconfig file?

cat my-kube-config

A)4

8. How many contexts are configured in the my-kube-config file?

cat my-kube-config

A)4

 

9. What user is configured in the research context?

cat my-kube-config

A) dev-user

 

10. What is the name of the client-certificate file configured for the aws-user?

cat my-kube-config

A) aws-user.crt

 

11.What is the current context set to in the my-kube-config file?

 

A) test-user@development

 

12.I would like to use the dev-user to access test-cluster-1. Set the current context to the right one so I can do that.

Once the right context is identified, use the kubectl config use-context command.

  • Current context set
kubectl config --kubeconfig=/root/my-kube-config use-context research

13.We don't want to have to specify the kubeconfig file option on each command. Make the my-kube-config file the default kubeconfig.

  • Default kubeconfig file configured

 

14.With the current-context set to research, we are trying to access the cluster. However something seems to be wrong. Identify and fix the issue.

Try running the kubectl get pods command and look for the error. All users certificates are stored at /etc/kubernetes/pki/users.

 

이거 머르겟댱.... 몰까..?? 멀 수정하라는데.. 후하 ...

 

 

 

 

 

 

 

 

 

 

728x90
반응형

'cloud > k8s(문제풀이)' 카테고리의 다른 글

[cka] kodekloud-cluster Roles  (0) 2022.06.28
[cka]kodekloud-Based Access controls  (0) 2022.06.28
[cka]kodekloud-certificates API  (0) 2022.06.27
[cka]kodekloud-CERTIFICATE DETAILS  (0) 2022.06.27
[cka] kodekloud-Backup and Restore  (0) 2022.06.22