0

I have a simple StatefulSet here that has replicas = 2 but it's creating 4 pods:

service-0
service-1
service-bf28b090c-0
service-44adf4asd-0

statefulset.yaml

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: service
  namespace: {{ .Release.Namespace }}
  labels:
    app: service
    tier: web
spec:
  serviceName: service
  replicas: 2
  selector:
    matchLabels:
      app: service
      tier: web
[...]

Can someone help me wrap my head around that?

3
  • Very weird indeed. Can you check for any Deployment or DaemonSet ressource across all namespaces ? In my opinion the service-bf28b090c-0 and service-44adf4asd-0 are not part of the StatefulSet you created above since their naming do not respect the convention (see kubernetes.io/docs/tutorials/stateful-application/…). Can you check if they also have the label statefulset.kubernetes.io/pod-name ? Otherwise they might be Pods you manually deployed for some reason, or remainders from previous stuff.
    – ABWassim
    Commented Dec 19, 2023 at 13:08
  • Can you elaborate on the naming convention? The service-0 and service-1 seem to be compliant with this convention. I deleted all the manifests/helm releases from the cluster and redeploy the very same StatefulSet and it does the same thing. I think it's a bug with Openshift TBH...
    – martin8768
    Commented Dec 20, 2023 at 12:43
  • 1
    Indeed, service-0 and service-1 are compliant to the convention, which is why my guess is that the service-bf28b090c-0 and service-44adf4asd-0 are the extras. When you delete the service StatefulSet, do these Pods disappear ?
    – ABWassim
    Commented Dec 20, 2023 at 14:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.