Search code examples
kuberneteskubernetes-pod

Command terminated with exit code 7


I have 3 node K8S cluster, I have created 3 replica pods on which application - app1 is running on all the pods, I have established service by running service yaml file and I can see my cluster-Ip created by running kubectl get service

When I try to do curl from one of the node I am getting " curl: (7) Failed to connect - failed to connect" when I try to curl inside the pod I am getting ... "command terminated with exit code 7"

Commands Ran:

kubectl run kubia --image=kubia --port=8080 --generator=run/v1

kubectl scale rc kubia --replicas=3

Manifest file used:

apiVersion: v1
kind: Service
metadata:
name: kubia
spec: ports:
- port: 80
targetPort: 8080.
selector: app: kubia

Can any body help me on this. Thanks


Solution

  • Solution : In yaml file - selector should be run: kubia instead of app: kubia, deleted the old service and again created new service , I am able to do curl on the internal ip from the pod. Thanks.