0
votes

I have a Kubernetes service for jenkins-agent.

But as I can see there is no pod created for that service. How can I initiate pod creation from the existing service?

This is how my service configuration looks like:

Name:              ci-jenkins-agent
Namespace:         ci
Labels:            app=ci-jenkins
                   chart=jenkins-0.35.1
                   component=ci-jenkins-master
Annotations:       <none>
Selector:          component=ci-jenkins-master
Type:              ClusterIP
IP:                199.62.116.92
Port:              slavelistener  50000/TCP
TargetPort:        50000/TCP
Endpoints:         <none>
Session Affinity:  None
Events:            <none>
1
You need to appply a pod yaml to create a pod - Arghya Sadhu
@ArghyaSadhu The problem is that I do not have a pod yaml file (since this setup is already working like this - I am debugging it). Any chance that I can export pod configuration from kubectl somehow? I thought the configuration will be under service somewhere. - Bob

1 Answers

1
votes

The pods behind a service is decided by matching Selector of service with label of pods. So you need to get the existing pods with the label component=ci-jenkins-master

kubectl get pods -l component=ci-jenkins-master -n ci -o yaml > pod.yaml

But looking at the service Endpoints does not have any Pod IP which means service does not have any backend pod probably because there is no pod running with label component=ci-jenkins-master