<p>Previously I had been experimenting with this command on Docker for Desktop Kubernetes</p>
<pre><code>helm install my-release --set password=password bitnami/redis
</code></pre>
<p>I had issued the command <code>helm uninstall my-release</code>.</p>
<p>Now I am trying to make my todolistclient work inside (Docker for Desktop) Kubernetes with redis:</p>
<pre><code>kubectl run redis --image=bitnami/redis:latest --replicas=1 --port=6379 --labels=&quot;ver=1,app=todo,env=proto&quot; --env=&quot;REDIS_PASSWORD=password&quot; --env=&quot;REDIS_REPLICATION_MODE=master&quot; --env=&quot;REDIS_MASTER_PASSWORD=password&quot;
kubectl run todolistclient --image=siegfried01/todolistclient:latest --replicas=3 --port=5000 --labels=&quot;ver=1,app=todo,env=proto&quot;
</code></pre>
<p>When I look at the log for ToDoListClient, I see a stack trace indicating that it is failing to connect to the redis server with this error message:</p>
<pre><code>System.AggregateException: One or more errors occurred. (No connection is available to service this operation: EVAL; SocketFailure on my-release-redis-master.default.svc.cluster.local:6379/Subscription, origin: Error, input-buffer: 0, outstanding: 0, last-read: 0s ago, last-write: 0s ago, unanswered-write: 9760s ago, keep-alive: 60s, pending: 0, state: Connecting, last-heartbeat: never, last-mbeat: -1s ago, global: 0s ago)
</code></pre>
<p>What is this <code>my-release-redis-master.default.svc.cluster.local</code>? This has been uninstalled and I'm not running that any more.</p>
<p>My C# code is connecting to Redis with</p>
<pre><code>.AddDistributedRedisCache(options =&gt; { options.InstanceName = &quot;OIDCTokens&quot;; options.Configuration = &quot;redis,password=password&quot;; }) 
</code></pre>
<p>Just to be certain that I was indeed using the above code and specifically &quot;redis&quot;, I recompiled my code and pushed to DockerHub again and I am getting the same error again.</p>
<p>So apparently there is something left over from the helm version of redis that is translating &quot;redis&quot; into &quot;my-release-redis-master&quot;. How do I remove this so I can connect to my current redis?</p>
<p>Thanks</p>
<p>Siegfried</p>

Siegfried
<p>In the todolistclient application you are using <code>my-release-redis-master.default.svc.cluster.local:6379/Subscription</code>. This is the url of a <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">service</a> exposing redis pod. This is automatically created by helm release.</p>
<p>If that is not desired then you need to change that url in todolistclient  application to your redis service.
You have deployed redis but have not created any service to expose redis, Hence you can not use a service url to connect to it unless you create it.</p>
<p>So you have two options</p>
<ol>
<li>Use redis pod IP in the todolistclient application. This is not recomended because Pod IP changes when restarted.</li>
<li>Create a service and then use that service url in todolistclient application.</li>
</ol>
<hr />
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: redis-master
  labels:
    run: redis
spec:
  ports:
  - port: 6379
    targetPort: 6379
  selector:
    run: redis
</code></pre>
<p>Here is a <a href="https://kubernetes.io/docs/tutorials/stateless-application/guestbook/" rel="nofollow noreferrer">guide</a> on how to deploy a guestbook application on kubernetes and connect to redis.</p>
<p>One suggestion don't use same labels for both todolistclient and redis</p>
