Skip to content

Instantly share code, notes, and snippets.

@sumanthkumarc
Created October 17, 2020 06:27
Show Gist options
  • Select an option

  • Save sumanthkumarc/305123fad6e998018b8ce0812a98c895 to your computer and use it in GitHub Desktop.

Select an option

Save sumanthkumarc/305123fad6e998018b8ce0812a98c895 to your computer and use it in GitHub Desktop.
service to select single pod in statefulset
apiVersion: v1
kind: Service
metadata:
name: mongodb-0
labels:
app.kubernetes.io/name: mongodb
app.kubernetes.io/component: mongodb
spec:
type: ClusterIP
clusterIP: None
publishNotReadyAddresses: true
ports:
- name: mongodb
port: 27017
targetPort: mongodb
selector:
app.kubernetes.io/name: mongodb
app.kubernetes.io/component: mongodb
statefulset.kubernetes.io/pod-name: mongodb-0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment