<p>I need to deploy pod with Persistent volume claim support and at the same time, I also need support for modification of pod(edit any configuration) and also rollback to the previous version of the previous container image version.</p>
<p>I went through docs, but everywhere they included service in statefulset.yaml file.</p>
<p>I don't want service here, it should just deploy statefulset pod with rollback support.
Can you help me giving any sample statefulset YAML file</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
  name: redis
  namespace: default
......................
.................
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: redis
spec:
</code></pre>
<p><a href="https://i.stack.imgur.com/suo08.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/suo08.png" alt="enter image description here" /></a></p>

<p><code>spec.serviceName</code> in statefulset is required as per the API. Hence you have to have it.</p>
<pre><code>kubectl explain statefulset.spec.serviceName
KIND:     StatefulSet
VERSION:  apps/v1

FIELD:    serviceName &lt;string&gt;

DESCRIPTION:
     serviceName is the name of the service that governs this StatefulSet. This
     service must exist before the StatefulSet, and is responsible for the
     network identity of the set. Pods get DNS/hostnames that follow the
     pattern: pod-specific-string.serviceName.default.svc.cluster.local where
     &quot;pod-specific-string&quot; is managed by the StatefulSet controller.
</code></pre>
<p>As you can see above <strong>This service must exist before the StatefulSet</strong>.</p>
