pod has unbound immediate PersistentVolumeClaims when when i create a statefulset

Viewed 101

I have created a statefulset using the following manifest,

the issue is that my statefulset is created correctly

but its replicas never get to run.


I hope you can help me, thanks

    Name:         phponcio
    Namespace:    default
    Priority:     0
    Node:         juanaraque-worknode/10.0.0.2
    Start Time:   Wed, 01 Jun 2022 13:49:08 +0200
    Labels:       run=phponcio
    Annotations:  cni.projectcalico.org/containerID: 768caa8f4e9b0683033e279aa259d6673d81fe38b62a2ea06c7d256805d522f0
                  cni.projectcalico.org/podIP: 192.168.240.69/32
                  cni.projectcalico.org/podIPs: 192.168.240.69/32
    Status:       Running
    IP:           192.168.240.69
    IPs:
      IP:  192.168.240.69
    Containers:
      phponcio:
        Container ID:   docker://75f90344ada396be965f0ae5c33bb7ea8c110d9ea1e014b75f36263b9cd72504
        Image:          84d3f7ba5876/php-apache-mysql
        Image ID:       docker-pullable://84d3f7ba5876/php-apache-mysql@sha256:bf0cd01ae4b77cca146dcd54d8a447ba8b6c7f5a9e11d6dab6d19f429fb111d1
        Port:           <none>
        Host Port:      <none>
        State:          Running
          Started:      Wed, 01 Jun 2022 14:31:53 +0200
        Last State:     Terminated
          Reason:       Error
          Exit Code:    255
          Started:      Wed, 01 Jun 2022 13:54:26 +0200
          Finished:     Wed, 01 Jun 2022 14:30:44 +0200
        Ready:          True
        Restart Count:  2
        Environment:    <none>
        Mounts:
          /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-bld5b (ro)
    Conditions:
      Type              Status
      Initialized       True 
      Ready             True 
      ContainersReady   True 
      PodScheduled      True 
    Volumes:
      kube-api-access-bld5b:
        Type:                    Projected (a volume that contains injected data from multiple sources)
        TokenExpirationSeconds:  3607
        ConfigMapName:           kube-root-ca.crt
        ConfigMapOptional:       <nil>
        DownwardAPI:             true
    QoS Class:                   BestEffort
    Node-Selectors:              <none>
    Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
    Events:                      <none>
    Name:               phponcio
    Namespace:          default
    CreationTimestamp:  Thu, 02 Jun 2022 10:35:08 +0200
    Selector:           app=phponcio
    Labels:             <none>
    Annotations:        <none>
    Replicas:           3 desired | 1 total
    Update Strategy:    RollingUpdate
      Partition:        0
    Pods Status:        0 Running / 1 Waiting / 0 Succeeded / 0 Failed
    Pod Template:
      Labels:  app=phponcio
      Containers:
       phponcio:
        Image:        84d3f7ba5876/php-apache-mysql
        Port:         80/TCP
        Host Port:    0/TCP
        Environment:  <none>
        Mounts:
          /usr/share from slow (rw)
      Volumes:  <none>
    Volume Claims:
      Name:          slow
      StorageClass:  slow
      Labels:        <none>
      Annotations:   <none>
      Capacity:      1Gi
      Access Modes:  [ReadWriteOnce]
    Events:          <none>
    apiVersion: v1
    kind: Service
    metadata:
      name: phponcio
      labels:
        app: phponcio
    spec:
      ports:
      - port: 80
        name: web
      clusterIP: None
      selector:
        app: phponcio
    ---
    apiVersion: apps/v1
    kind: StatefulSet
    metadata:
      name: phponcio
    spec:
      selector:
        matchLabels:
          app: phponcio # tiene que coincidir con .spec.template.metadata.labels
      serviceName: phponcio
      replicas: 3 # por defecto es 1
      template:
        metadata:
          labels:
            app: phponcio # tiene que coincidir con .spec.selector.matchLabels
        spec:
          terminationGracePeriodSeconds: 10
          containers:
          - name: phponcio
            image: 84d3f7ba5876/php-apache-mysql
            ports:
            - containerPort: 80
              name: phponcio
            volumeMounts:
            - name: slow
              mountPath: /usr/share
      volumeClaimTemplates:
      - metadata:
          name: slow
        spec:
          accessModes: [ "ReadWriteOnce" ]
          storageClassName: slow
          resources:
            requests:
              storage: 1Gi
0 Answers
Related