ameya agashe:
Hi,
I have question on the kodekloud lab as per below:
Create a new pod called custom-nginx using the nginx image and expose it on container port 8080.
I did as below:
k run custom-nginx --image=nginx
pod/custom-nginx created
controlplane ~ ✖ k expose pod custom-nginx --port=8080
service/custom-nginx exposed
controlplane ~ ➜ k get po
NAME READY STATUS RESTARTS AGE
nginx-pod 1/1 Running 0 8m41s
redis 1/1 Running 0 6m42s
webapp-7b59bf687d-9vxfb 1/1 Running 0 2m33s
webapp-7b59bf687d-fsqqr 1/1 Running 0 2m33s
webapp-7b59bf687d-kgsz4 1/1 Running 0 2m33s
custom-nginx 1/1 Running 0 79s
controlplane ~ ➜ k get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.43.0.1 <none> 443/TCP 39m
redis-service ClusterIP 10.43.168.75 <none> 6379/TCP 5m44s
custom-nginx ClusterIP 10.43.47.186 <none> 8080/TCP 2m33s
controlplane ~ ➜ k describe svc custom-nginx
Name: custom-nginx
Namespace: default
Labels: run=custom-nginx
Annotations: <none>
Selector: run=custom-nginx
Type: ClusterIP
IP Family Policy: SingleStack
IP Families: IPv4
IP: 10.43.47.186
IPs: 10.43.47.186
Port: <unset> 8080/TCP
TargetPort: 8080/TCP
Endpoints: 10.42.0.14:8080
Session Affinity: None
Events: <none>
But when I click on “Check” I get Error. I am wondering why?