Wrong Answer in Deploy Node App on Kubernetes Task

I have tried 3 times with the same task, but the task still failed. Anybody can help me?

thor@jump_host ~$ kubectl describe deployment --namespace node-namespace-datacenter
Name: node-deployment-datacenter
Namespace: node-namespace-datacenter
CreationTimestamp: Wed, 19 Jul 2023 12:15:27 +0000
Labels:
Annotations: deployment.kubernetes.io/revision: 1
Selector: app=node-app-datacenter
Replicas: 2 desired | 2 updated | 2 total | 2 available | 0 unavailable
StrategyType: RollingUpdate
MinReadySeconds: 0
RollingUpdateStrategy: 25% max unavailable, 25% max surge
Pod Template:
Labels: app=node-app-datacenter
Containers:
node-container-datacenter:
Image: Google Cloud console
Port: 80/TCP
Host Port: 0/TCP
Environment:
Mounts:
Volumes:
Conditions:
Type Status Reason


Available True MinimumReplicasAvailable
Progressing True NewReplicaSetAvailable
OldReplicaSets:
NewReplicaSet: node-deployment-datacenter-868b948f74 (2/2 replicas created)
Events:
Type Reason Age From Message


Normal ScalingReplicaSet 71s deployment-controller Scaled up replica set node-deployment-datacenter-868b948f74 to 2
thor@jump_host ~$ kubectl describe svc --namespace node-namespace-datacenter
Name: node-service-datacenter
Namespace: node-namespace-datacenter
Labels:
Annotations:
Selector: app=node-app-datacenter
Type: NodePort
IP: 10.96.138.51
Port: 80/TCP
TargetPort: 8080/TCP
NodePort: 30012/TCP
Endpoints: 10.244.0.5:8080,10.244.0.6:8080
Session Affinity: None
External Traffic Policy: Cluster
Events:

The task:

  1. Create a deployment using gcr.io/kodekloud/centos-ssh-enabled:node image, replica count must be 2.
  2. Create a service to expose this app, the service type must be NodePort, targetPort must be 8080 and nodePort should be 30012.
  3. Make sure all the pods are in Running state after the deployment.
  4. You can check the application by clicking on NodeApp button on top bar.

You can use any labels as per your choice.

Note: The kubectl on jump_host has been configured to work with the kubernetes cluster.

The NodeApp success show the app, but the task still failed.

Hi @vebrian,
Thanks for highlighting this. Please provide us sometime to check this issue.

Regards,

okay, please update asap Rana. thanks a lot.

Hi @vebrian,
I tested the task and it worked for me without any problem. You are creating these resources in the namespace node-namespace-datacenter, and I didn’t see it asked in the question.

Regards,

Ah my bad, thanks Rana for the help. Have a nice day.

vi /tmp/node.yaml

to create yaml file. you can copy form below github link

kubectl apply -f /tmp/node.yaml

Wait for deployment & pods to get running status
kubectl get pods
kubectl get service
kubectl get deploy