<p>I've just started learning kubernetes and was playing around in katakoda platform. I created a statefulset for mysql. It is just a test so i didnt declare any pvc and mount any volumes. It's declaration and the service's declaration in yml:</p>

<pre><code>
---

apiVersion: v1
kind: Service
metadata:
  name: mysql-headless
  labels:
    run: mysql-sts-demo
spec:
  ports:
  - port: 3306
    name: db
  selector:
    run: mysql-sts-demo

---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mysql-sts-demo
spec:
  serviceName: "mysql-headless"
  replicas: 1
  selector:
    matchLabels:
      run: mysql-sts-demo
  template:
    metadata:
      labels:
        run: mysql-sts-demo
    spec:
      containers:
      - name: mysql
        image: mysql:5.7.8
        env:
          - name: MYSQL_ROOT_PASSWORD
            valueFrom:
              secretKeyRef:
                name: mysql-secrets
                key: ROOT_PASSWORD
          - name: MYSQL_DATABASE
            valueFrom:
              secretKeyRef:
                name: mysql-secrets
                key: DBNAME
          - name: MYSQL_USER
            valueFrom:
              secretKeyRef:
                name: mysql-secret
                key: USER
          - name: MYSQL_PASSWORD
            valueFrom:
              secretKeyRef:
                name: mysql-secrets
                key: PASSWORD


</code></pre>

<p>it creates those resources successfully , but when I type kubectl get statefulsets , my ss is always being displayed as not ready. What may the issue be? Btw I need it for using with a spring petclinic app which I declared and launched previously as a deployment .</p>

Ivan Koblyk
<p>can you paste the logs for statefulsets 
or an output of <code>kubectl get events</code> and <code>kubectl describe &lt;your stateful-set name&gt;</code></p>

<p>now coming to secrets can you check whether those secrets which you are using in your stateful-sets definitions are already present using <code>kubectl get secrets</code> </p>
