root layout

패스트캠퍼스

Project 9.쿠버네티스 활용 MSA 기반 SNS 프로젝트 Ch 2. 02 16:05 문의드립니다.

2025.01.16 15:11 수정

Project 9.쿠버네티스 활용 MSA 기반 SNS 프로젝트 Ch 2. 02 16:05 문의드립니다.


강사님의 경우 feed-deeply.yaml, feed-service.yaml 적용하시고나서 status가 두개 다 1/1로 확인되는데 제 경우 한개만 1/1 뜨고 하나는 계속 Pending 상태입니다.

여러가지 명령어로 확인해보다 중간쯤에 아래 메세지가 보이는데 cpu자원이 모자란다는 의미일까요? (강좌와 동일하게 셋팅했는데 왜 이럴까요..)

설정의 어느 부분을 확인해보아야 할까요?

  Warning  FailedScheduling  0s (x2 over 5m10s)  default-scheduler  0/2 nodes are available: 2 Insufficient cpu. preemption: 0/2 nodes are available: 2 No preemption victims found for incoming pod.


PS C:\dev_study\sns\part3-feed-server-test> kubectl -n sns get pods

NAME                           READY   STATUS    RESTARTS   AGE

feed-server-6fb44cf67f-4nsm9   1/1     Running   0          6m27s

feed-server-6fb44cf67f-m89qp   0/1     Pending   0          6m27s

PS C:\dev_study\sns\part3-feed-server-test> kubectl describe pod feed-server-6fb44cf67f-4nsm9 -n sns

Name:             feed-server-6fb44cf67f-4nsm9

Namespace:        sns

Priority:         0

Service Account:  default

Node:             ip-172-31-31-170.ap-northeast-2.compute.internal/172.31.31.170

Start Time:       Thu, 16 Jan 2025 13:58:20 +0900

Labels:           app=feed-server

                  pod-template-hash=6fb44cf67f

Annotations:      <none>

Status:           Running

IP:               172.31.19.165

IPs:

  IP:           172.31.19.165

Controlled By:  ReplicaSet/feed-server-6fb44cf67f

Containers:

  feed-container:

    Container ID:   containerd://f82622220724777d711cc596cfecebd2bc3e6b69f0ca5fe2ae5dc16dbeb0b67e

    Image:          232416793008.dkr.ecr.ap-northeast-2.amazonaws.com/feed-server:0.0.1

    Image ID:       232416793008.dkr.ecr.ap-northeast-2.amazonaws.com/feed-server@sha256:97cf5ca2dc7e82659920b00cf64ebb30d429c4f868b5b143d43fc4014839b99a

    Port:           <none>

    Host Port:      <none>

    State:          Running

      Started:      Thu, 16 Jan 2025 13:58:21 +0900

    Ready:          True

    Restart Count:  0

    Limits:

      cpu:     1

      memory:  1Gi

    Requests:

      cpu:      500m

      memory:   512Mi

    Liveness:   http-get http://:8080/healthcheck/live delay=30s timeout=1s period=1s #success=1 #failure=7

    Readiness:  http-get http://:8080/healthcheck/ready delay=30s timeout=1s period=1s #success=1 #failure=3

      mysql-config  ConfigMap  Optional: false

      mysql-secret  Secret     Optional: false

    Environment:

      SPRING_PROFILES_ACTIVE:  dev

    Mounts:

      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-68742 (ro)

Conditions:

  Type                        Status

  PodReadyToStartContainers   True

  Initialized                 True

  Ready                       True

  ContainersReady             True

  PodScheduled                True

Volumes:

  kube-api-access-68742:

    Type:                    Projected (a volume that contains injected data from multiple sources)

    TokenExpirationSeconds:  3607

    ConfigMapName:           kube-root-ca.crt

    ConfigMapOptional:       <nil>

    DownwardAPI:             true

QoS Class:                   Burstable

Node-Selectors:              <none>

Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s

                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s

Events:

  Type    Reason     Age    From               Message

  ----    ------     ----   ----               -------

  Normal  Scheduled  4m52s  default-scheduler  Successfully assigned sns/feed-server-6fb44cf67f-4nsm9 to ip-172-31-31-170.ap-northeast-2.compute.internal

  Normal  Pulling    4m51s  kubelet            Pulling image "232416793008.dkr.ecr.ap-northeast-2.amazonaws.com/feed-server:0.0.1"

  Normal  Pulled     4m51s  kubelet            Successfully pulled image "232416793008.dkr.ecr.ap-northeast-2.amazonaws.com/feed-server:0.0.1" in 382ms (382ms including waiting). Image size: 305641191 bytes.

  Normal  Created    4m51s  kubelet            Created container feed-container

  Normal  Started    4m51s  kubelet            Started container feed-container

PS C:\dev_study\sns\part3-feed-server-test> kubectl describe pod feed-server-6fb44cf67f-m89qp -n sns

Name:             feed-server-6fb44cf67f-m89qp

Namespace:        sns

Priority:         0

Service Account:  default

Node:             <none>

Labels:           app=feed-server

                  pod-template-hash=6fb44cf67f

Annotations:      <none>

Status:           Pending

IP:

IPs:              <none>

Controlled By:    ReplicaSet/feed-server-6fb44cf67f

Containers:

  feed-container:

    Image:      232416793008.dkr.ecr.ap-northeast-2.amazonaws.com/feed-server:0.0.1

    Port:       <none>

    Host Port:  <none>

    Limits:

      cpu:     1

      memory:  1Gi

    Requests:

      cpu:      500m

      memory:   512Mi

    Liveness:   http-get http://:8080/healthcheck/live delay=30s timeout=1s period=1s #success=1 #failure=7

    Readiness:  http-get http://:8080/healthcheck/ready delay=30s timeout=1s period=1s #success=1 #failure=3

    Environment Variables from:

      mysql-config  ConfigMap  Optional: false

      mysql-secret  Secret     Optional: false

    Environment:

      SPRING_PROFILES_ACTIVE:  dev

    Mounts:

      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-rz7d7 (ro)

Conditions:

  Type           Status

  PodScheduled   False

Volumes:

  kube-api-access-rz7d7:

    Type:                    Projected (a volume that contains injected data from multiple sources)

    TokenExpirationSeconds:  3607

    ConfigMapName:           kube-root-ca.crt

    ConfigMapOptional:       <nil>

    DownwardAPI:             true

QoS Class:                   Burstable

Node-Selectors:              <none>

Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s

                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s

Events:

  Type     Reason            Age                 From               Message

  ----     ------            ----                ----               -------

  Warning  FailedScheduling  0s (x2 over 5m10s)  default-scheduler  0/2 nodes are available: 2 Insufficient cpu. preemption: 0/2 nodes are available: 2 No preemption victims found for incoming pod.

[cloudshell-user@ip-10-130-5-46 ~]$ kubectl get pods -A

NAMESPACE NAME READY STATUS RESTARTS AGE

infra kafka-controller-0 1/1 Running 10 (6m45s ago) 45h

infra kafka-controller-1 1/1 Running 9 (8m26s ago) 45h

infra kafka-controller-2 1/1 Running 9 (11m ago) 45h

infra redis-master-0 1/1 Running 0 45h

kube-system aws-node-2jk9b 2/2 Running 0 47h

kube-system aws-node-p5hm4 2/2 Running 0 47h

kube-system coredns-9b5bc9468-mptmf 1/1 Running 0 47h

kube-system coredns-9b5bc9468-mscwv 1/1 Running 0 47h

kube-system efs-csi-controller-c76cc5547-4dj49 3/3 Running 0 46h

kube-system efs-csi-controller-c76cc5547-mdzw8 3/3 Running 0 46h

kube-system efs-csi-node-9m6cx 3/3 Running 0 46h

kube-system efs-csi-node-rqs62 3/3 Running 0 46h

kube-system eks-node-monitoring-agent-m9cq9 1/1 Running 0 47h

kube-system eks-node-monitoring-agent-ts7bw 1/1 Running 0 47h

kube-system eks-pod-identity-agent-89h74 1/1 Running 0 47h

kube-system eks-pod-identity-agent-qmfn9 1/1 Running 0 47h

kube-system kube-proxy-8tdn8 1/1 Running 0 47h

kube-system kube-proxy-t6s2n 1/1 Running 0 47h

kube-system metrics-server-c996b895d-2r25b 1/1 Running 0 47h

kube-system metrics-server-c996b895d-fh94l 1/1 Running 0 47h

sns feed-server-6fb44cf67f-4nsm9 1/1 Running 0 8m44s

sns feed-server-6fb44cf67f-m89qp 0/1 Pending 0 8m44s




답변 

연관 질문

커뮤니티 질문보기