TIL

타샤's 월드·2025년 5월 22일

192.168.8.49가 아니라 192.168.8.31로 세팅되어 되어서 쿠버네티스 안 돌아가고 ssh 안되는 이슈 발생.....

알고보니 netplan 에 게이트웨이를 실제 게이트웨이 주소인 192.168.1.1. 이 아닌0.1로 써놓음... 그리고 서버는 dhclient 으로 들어감

그래서 결국 가장 중요한 조치 3가지
✅ 정확한 게이트웨이 설정 (192.168.1.1)

✅ /run/systemd/resolve/resolv.conf 심볼릭 링크 생성
원래는 /etc/resolv.conf에 되어 있음

✅ .31 IP 제거 → .49 단일 IP로 정리 + GARP 전송

오답노트

문제1: Utilize the official Calico definition file, available at:

https://raw.githubusercontent.com/projectcalico/calico/v3.29.3/manifests/tigera-operator.yaml

to deploy the Calico CNI on the cluster.Make sure to configure the CIDR to 172.17.0.0/16After the CNI installation, verify that pods can successfully communicate.

해설:
1. 칼리코 오퍼레이터를 먼저 설치한다
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.29.2/manifests/tigera-operator.yaml

  1. 커스텀 파일을 다운 받는다
    curl https://raw.githubusercontent.com/projectcalico/calico/v3.29.2/manifests/custom-resources.yaml -O

  2. cidr 을 172.17.0.0/16 로 바꾼다

  3. k apply -f custom-resources.yaml

문제2: Identify the starting pod CIDR network of the Kubernetes cluster. This information is crucial for configuring the CNI plugin during installation. Output the pod CIDR network to a file at /root/pod-cidr.txt.

해답: kubectl cluster-info dump | grep "podCIDR"

문제3: One application, webpage-server-01, is deployed on the Kubernetes cluster by the Helm tool. Now, the team wants to deploy a new version of the application by replacing the existing one. A new version of the helm chart is given in the /root/new-version directory on the terminal. Validate the chart before installing it on the Kubernetes cluster.

helm lint . helm install new . helm uninstall webpage-server-01

문제 4:
Task
We have created a new deployment called nginx-deploy. Scale the deployment to 3 replicas. Has the number of replicas increased? Troubleshoot and fix the issue.

Solution
Use the command kubectl scale to increase the replica count to 3.

kubectl scale deploy nginx-deploy --replicas=3

The controller-manager is responsible for scaling up pods of a replicaset. If you inspect the control plane components in the kube-system namespace, you will see that the controller-manager is not running.

kubectl get pods -n kube-system

The command running inside the controller-manager pod is incorrect.
After fix all the values in the file and wait for controller-manager pod to restart.

Alternatively, you can run sed command to change all values at once:

sed -i 's/kube-contro1ler-manager/kube-controller-manager/g' /etc/kubernetes/manifests/kube-controller-manager.yaml

This will fix the issues in controller-manager yaml file.

At last, inspect the deployment by using below command, you should see 3/3 under READY if the fix above was properly performed. Example:

controlplane ~ ➜ kubectl get deploy
NAME READY UP-TO-DATE AVAILABLE AGE
nginx-deploy 3/3 3 3 6m2s

5번 파드가 떠야 하는데 안뜨면 컨트롤러-매니저

컨트롤러 매니저 매니페스트 파일 확인필요

profile
그때 그때 꽂힌것 하는 개발블로그

0개의 댓글