We have created a new deployment called nginx-deploy
. scale the deployment to 3 replicas. Has the replica's increased? Troubleshoot the issue and fix it.
kubectl scale --replicas=3 deployment/nginx-deploy
k describe deployments.apps
---
Name: nginx-deploy
Namespace: default
CreationTimestamp: Tue, 31 Jan 2023 01:37:30 -0500
Labels: app=nginx-deploy
Annotations: deployment.kubernetes.io/revision: 1
Selector: app=nginx-deploy
Replicas: 3 desired | 1 updated | 1 total | 1 available | 0 unavailable
StrategyType: RollingUpdate
MinReadySeconds: 0
RollingUpdateStrategy: 25% max unavailable, 25% max surge
Pod Template:
Labels: app=nginx-deploy
Containers:
nginx:
Image: nginx
Port: <none>
Host Port: <none>
Environment: <none>
Mounts: <none>
Volumes: <none>
Conditions:
Type Status Reason
---- ------ ------
Available True MinimumReplicasAvailable
Progressing True NewReplicaSetAvailable
OldReplicaSets: <none>
NewReplicaSet: nginx-deploy-5f6bb8887f (1/1 replicas created)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ScalingReplicaSet 10m deployment-controller Scaled up replica set nginx-deploy-5f6bb8887f to 1
kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
default nginx-deploy-5f6bb8887f-bw8vn 1/1 Running 0 17m
default np-test-1 1/1 Running 0 27m
kube-system coredns-787d4945fb-6vjd4 1/1 Running 0 51m
kube-system coredns-787d4945fb-c9gtk 1/1 Running 0 51m
kube-system etcd-controlplane 1/1 Running 0 51m
kube-system kube-apiserver-controlplane 1/1 Running 0 51m
kube-system kube-contro1ler-manager-controlplane 0/1 ImagePullBackOff 0 13m
kube-system kube-proxy-4dwnk 1/1 Running 0 51m
kube-system kube-proxy-st4vk 1/1 Running 0 51m
kube-system kube-scheduler-controlplane 1/1 Running 0 51m
kube-system weave-net-2qlnk 2/2 Running 0 51m
kube-system weave-net-qpr4z 2/2 Running 1 (51m ago) 51m
노드 컨트롤러: 노드가 다운되었을 때 통지와 대응에 관한 책임을 가진다.
잡 컨트롤러: 일회성 작업을 나타내는 잡 오브젝트를 감시한 다음, 해당 작업을 완료할 때까지 동작하는 파드를 생성한다.
엔드포인트 컨트롤러: 엔드포인트 오브젝트를 채운다(즉, 서비스와 파드를 연결시킨다.)
서비스 어카운트 & 토큰 컨트롤러: 새로운 네임스페이스에 대한 기본 계정과 API 접근 토큰을 생성한다.
위에 파드 이름이 이상한걸 확인했으니까 파드 이름을 바꿔 준다
~~
sed -i 's/kube-contro1ler-manager/kube-controller-manager/g' /etc/kubernetes/manifests/kube-controller-manager.yaml
kubectl scale --replicas=3 deployment/nginx-deploy
참고 vi 편집기에서 ctrl + h >> r