CKA (Certified Kubernetes Administrator)/Kode Kloud

10.Troubleshooting - Troubleshoot Network

seulseul 2022. 2. 4. 15:16
LABS – CERTIFIED KUBERNETES ADMINISTRATOR WITH PRACTICE TESTS > TROUBLESHOOTING
Troubleshooting

01. Application Failure
02. Control Plane Failure
03. Worker Node Failure
04. Troubleshoot Network

 

**Troubleshooting Test 1:** 

A simple 2 tier application is deployed in the triton namespace. It must display a green web page on success.

Click on the app tab at the top of your terminal to view your application. It is currently failed.

Troubleshoot and fix the issue.


Stick to the given architecture.

Use the same names and port numbers as given in the below architecture diagram.

Feel free to edit, delete or recreate objects as necessary.

간단한 2계층 애플리케이션이 triton 네임스페이스에 배포됩니다. 성공 시 녹색 웹 페이지를 표시해야 합니다.

터미널 상단의 앱 탭을 클릭하여 애플리케이션을 봅니다. 현재는 실패했습니다.

문제를 해결하고 수정합니다.


주어진 아키텍처를 고수하십시오.

아래 아키텍처 다이어그램에 제공된 것과 동일한 이름과 포트 번호를 사용하십시오.

필요에 따라 개체를 자유롭게 편집, 삭제 또는 다시 생성할 수 있습니다.

 

  • DB Service working?
  • WebApp Service working?

 

 

 

Do the services in triton namespace have a valid endpoint? If they do, check the kube-proxy and the weave logs.
Does the cluster have a Network Addon installed?

Install Weave using the link: https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#pod-network

For example: kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"

 

**Troubleshooting Test 2:** 

The same 2 tier application is having issues again. It must display a green web page on success.

Click on the app tab at the top of your terminal to view your application. It is currently failed.

Troubleshoot and fix the issue.


Stick to the given architecture. Use the same names and port numbers as given in the below architecture diagram.

Feel free to edit, delete or recreate objects as necessary.

 
  • Fix Issue

/var/lib/kube-proxy/kubeconfig.conf

 

The kube-proxy pods are not running. As a result the rules needed to allow connectivity to the services have not been created.

Check the logs of the kube-proxy pods kubectl -n kube-system logs <name_of_the_kube_proxy_pod>

The configuration file /var/lib/kube-proxy/configuration.conf is not valid. The configuration path does not match the data in the ConfigMap. kubectl -n kube-system describe configmap kube-proxy shows that the file name used is config.conf which is mounted in the kube-proxy damonset pods at the path /var/lib/kube-proxy/config.conf

However in the DaemonSet for kube-proxy, the command used to start the kube-proxy pod makes use of the path /var/lib/kube-proxy/configuration.conf.

Correct this path to /var/lib/kube-proxy/config.conf as per the ConfigMap and recreate the kube-proxy pods.

Here is the snippet of the command to be run by the kube-proxy pods:

pec:
      containers:
      - command:
        - /usr/local/bin/kube-proxy
        - --config=/var/lib/kube-proxy/config.conf
        - --hostname-override=$(NODE_NAME)
This should get the kube-proxy pods back in a running state.