<p>I have created Persistence Volume, Persistence Volume Claim and used the same for Redis Deployment with 3 replicas (YAML shared below)</p>
<p>It allows me to set and get the data.</p>
<p>However POD1 is not able to fetch data set by POD2 and vice-a-versa</p>
<p>I want to fix this issue so that POD1-POD2-POD3 can exchange the data from same PV</p>
<p>redis-pv-volume.yaml</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: redis-volume
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: &quot;/home/dev/redis_data&quot;

</code></pre>
<p>redis-pv-claim.yaml</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: redis-pv-claim
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 3Gi

</code></pre>
<p>Here is my deployment file
redis_deployment.yaml</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
spec:
  replicas: 3
  selector:
    matchLabels:
      name: redis
  template:
    metadata:
      labels:
        name: redis
    spec:
      volumes:
      - name: redis-data-store
        persistentVolumeClaim:
          claimName: redis-pv-claim
      containers:
      - name: redis
        image: redis
        ports:
        - containerPort: 6379
        volumeMounts:
        - mountPath: &quot;/data&quot;
          name: redis-data-store
</code></pre>
<p>And Services for CLusterIP &amp; NodePort for external use</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: redis-service
spec:
  type: NodePort
  ports:
    - targetPort: 6379
      port: 6379
      nodePort: 30379
  selector:
    name: redis
</code></pre>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: redis-cluster-service
spec:
  type: ClusterIP
  ports:
    - targetPort: 6379
      port: 6379
      protocol: TCP
  selector:
    name: redis

</code></pre>
<p>All the data is getting stored on my local storage but pods are not able to fetch the data with GET KEY command for values SET by other PODS</p>
<p>For Ex
<a href="https://i.stack.imgur.com/5NBqC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5NBqC.png" alt="enter image description here" /></a></p>

NIket
<p>First, here you are missing the concept of <strong>Redis</strong> clustering and networking.</p>
<p>Just starting the 3 replicas won't resolve your issue, and they won't interact with each other.</p>
<p>What you are trying to do is replication or clustering across the PODs.</p>
<p><strong>Second issue :</strong></p>
<p>You have mentioned</p>
<pre><code>accessModes:
    - ReadWriteOnce
</code></pre>
<p>in PVC and PV due to this your all PODs cannot be attached to single PV or PVC.</p>
<p>You have to use the <code>ReadWriteMany</code> or services like <strong>NFS</strong> or <strong>EFS</strong> to create PV, PVC and attach single PV, PVC behind all PODs.</p>
<p><strong>Third issue :</strong></p>
<blockquote>
<p>Redis Pod with 3 replicas and Persistence Storage not providing data
all the time</p>
</blockquote>
<p>You are just running the image without any type of backup or snapshot configuration</p>
<pre><code>- name: redis
  image: redis
</code></pre>
<p>Start AOF &amp; RDB</p>
<pre><code>image: redislabs/redis
args: [&quot;--requirepass&quot;, &quot;admin&quot;, &quot;--appendonly&quot;, &quot;yes&quot;, &quot;--save&quot;, &quot;900&quot;, &quot;1&quot;, &quot;--save&quot;, &quot;30&quot;, &quot;2&quot;]
</code></pre>
<p>Redis support 2 types of backup support to persiste the data.</p>
<p><strong>AOF &amp; RDB</strong> you can read more at : <a href="https://redis.io/topics/persistence" rel="nofollow noreferrer">https://redis.io/topics/persistence</a></p>
<p><strong>Final answer :</strong></p>
<p>Instead of trying to configure the Redis and Replication, i would suggest using the <strong>Helm</strong> chart which will create the Statefulsets and <strong>PVC</strong> by own without doing many configurations and you can run the <strong>HA Redis cluster</strong> with persistence <strong>data</strong>.</p>
<p>Helm chart link : <a href="https://docs.bitnami.com/tutorials/deploy-redis-sentinel-production-cluster/" rel="nofollow noreferrer">https://docs.bitnami.com/tutorials/deploy-redis-sentinel-production-cluster/</a></p>
<p>Chart YAML : <a href="https://github.com/bitnami/charts/tree/master/bitnami/redis" rel="nofollow noreferrer">https://github.com/bitnami/charts/tree/master/bitnami/redis</a></p>
<p>This is the Redis HA cluster with <strong>sentinel</strong> configuration.</p>
<p>Read more about the sentinel at :</p>
<ul>
<li><a href="https://stackoverflow.com/a/70271427/5525824">https://stackoverflow.com/a/70271427/5525824</a></li>
<li><a href="https://github.com/bitnami/charts/tree/master/bitnami/redis#master-replicas-with-sentinel" rel="nofollow noreferrer">https://github.com/bitnami/charts/tree/master/bitnami/redis#master-replicas-with-sentinel</a></li>
</ul>
