[bitnami/redis] How to expose the redis cluster in k8s from other network ( outside of k8s)
Name and Version
bitnami/redis:7.4.0-debian-12-r2
What architecture are you using?
amd64
What steps will reproduce the bug?
Not sure
What is the expected behavior?
We installed redis on our on prem k8s cluster and all pods are running. But I want to expose this to outside of k8s so that application can use this redis.
What do you see instead?
I am unable to see any document to expose the redis from outside of k8s
Additional information
We installed redis on our on prem k8s cluster and all pods are running. But I want to expose this to outside of k8s so that application can use this redis.
Hi,
Did you set the *.service.type values to LoadBalancer?
Hi,
I did not set anything in values.yaml file for load balancer. below are existing services for redis
yipee-kiya-redis-headless ClusterIP None <none> 6379/TCP 35h
yipee-kiya-redis-master ClusterIP 10.43.195.16 <none> 6379/TCP 35h
yipee-kiya-redis-replicas ClusterIP 10.43.54.63 <none> 6379/TCP 35h
You need to set the adequate service type for your use case, see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
Hi,
I configured redis service with type "load balancer" but I am getting the below error while typing any command using redis-cli
redis.k8s.abcdef.com:443> ping
Error: Protocol error, got "H" as reply type byte
below is my redis-service yaml file:
apiVersion: v1
kind: Service
metadata:
name: redis-service
spec:
selector:
app.kubernetes.io/name: redis
type: LoadBalancer
ports:
- protocol: TCP
port: 443
targetPort: 6379
selector:
app: redis
Are you using TLS? Can you provide more information about the deployment (e.g. Helm chart values)?
And are you sure that there's not an HTTP(S) loadbalancer in front of the whole thing? Port 443 looks suspicious.
Hi,
I am not using TLS, I just tried to send request from out side to port 443 and then internally it goes to 6379. In our environment we cant open 6379 port from outside to k8s cluster and we only allow port 443/80/8080 port. thats why I used 443 port. below is value.yaml
When I try to test using redis-cli on port 443 I got this error: Error: Protocol error, got "H" as reply type byte
Please find the attached value.yaml file.
Okay. That's odd.
I tried this out on my own cluster using the Helm chart and the following (minimal) values file:
auth:
password: "some-password"
master:
service:
type: "LoadBalancer"
ports:
redis: 6666
kubectl get svc shows the external IP address and I can connect from my local machine using redis-cli -h $IP -p 6666 and ping the server without any issues.
Oddly enough, I get the exact same error message (Error: Protocol error, got "H" as reply type byte) when I try to connect to port 443. And there's a Traefik Ingress Controller running on my cluster on port 443...
EDIT: Can you maybe provide the output of kubectl get svc (-A)?
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.