Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[binami/redis] Issue with Write Operations in Redis Bitnami Chart When Accessing via Ingress #31067

Open
er-sami777 opened this issue Dec 17, 2024 · 2 comments
Assignees
Labels
redis tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@er-sami777
Copy link

er-sami777 commented Dec 17, 2024

Name and Version

bitnami/redis 20.2.1

What architecture are you using?

arm64

What steps will reproduce the bug?

I have deployed Redis using the Bitnami Redis Helm chart with the following configuration (see below). The chart successfully creates a StatefulSet and two services: redis and redis-headless, both of type ClusterIP. I have configured an ingress to access Redis from outside the cluster, but I am encountering an issue with performing write operations using the domain attached to the ingress.

Step 1:

helm repo add bitnami https://charts.bitnami.com/bitnami
helm install redis bitnami/redis -f redis-values.yaml --namespace redis --create-namespace

========= redis-values.yaml =========

architecture: replication
sentinel:
  enabled: true
    
auth:
  enabled: true
  password: "password123"

master:
  persistence:
    enabled: true
    size: 10Gi
    storageClass: "gp3"
  topologySpreadConstraints:
    - maxSkew: 1
      topologyKey: kubernetes.io/hostname
      whenUnsatisfiable: DoNotSchedule
      labelSelector:
        matchLabels:
          app.kubernetes.io/component: master

replica:
  replicaCount: 3
  persistence:
    enabled: true
    size: 10Gi
    storageClass: "gp3"
  topologySpreadConstraints:
    - maxSkew: 1
      topologyKey: kubernetes.io/hostname
      whenUnsatisfiable: DoNotSchedule
      labelSelector:
        matchLabels:
          app.kubernetes.io/component: replica
  autoscaling:
    enabled: true
    minReplicas: 3
    maxReplicas: 10
    targetCPUUtilizationPercentage: 50
    targetMemoryUtilizationPercentage: 50

sentinel:
  enabled: true

volumePermissions:
  enabled: true

global:
  storageClass: "gp3"

##### Monitoring Configuration #####
metrics:
  enabled: true
  serviceMonitor:
    enabled: true
    namespace: "monitoring"
    interval: 30s

================== ingress.yaml ============

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: redis-ingress
  namespace: redis
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    terraform.io/destroy-order: "0"
    nginx.ingress.kubernetes.io/backend-protocol: HTTP
    nginx.ingress.kubernetes.io/service-upstream: "true"
    nginx.ingress.kubernetes.io/service-port: "6379"
spec:
  ingressClassName: nginx
  rules:
    - host: redis.smcdevops.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: redis
                port:
                  number: 6379

I already added 6379 as listener in the created NLB

Are you using any custom parameters or values?

  • uthentication: Enabled with the password password123.
  • Persistence: Enabled with a storage class of gp3 and size of 10Gi for both the master and replica.
  • Topology Spread Constraints: Defined for both master and replica components.
  • Sentinel: Enabled for high availability.
  • Ingress Configuration: Added listener port 6397 for Redis connection.

What is the expected behavior?

Write operations should work consistently when accessing Redis through the ingress domain, similar to how read operations are functioning correctly.

What do you see instead?: Write operations fail intermittently when accessing Redis via the ingress domain. Sometimes, I am able to perform write operations, but it is inconsistent.

What do you see instead?

Write operations fail intermittently when accessing Redis via the ingress domain. Sometimes, I am able to perform write operations, but it is inconsistent.

Additional information

  • The Redis deployment is running with the Bitnami Redis Helm chart.
  • The Redis setup is configured with replication and persistence enabled for the master and replica nodes.
  • The ingress is configured to route traffic to redis and redis-headless services of type ClusterIP.
  • The issue occurs when using the domain configured in the ingress for accessing Redis from outside the Kubernetes cluster.
  • The write failure behavior is unpredictable and occurs most of the time; say 9/10.
@er-sami777 er-sami777 added the tech-issues The user has a technical issue about an application label Dec 17, 2024
@github-actions github-actions bot added the triage Triage is needed label Dec 17, 2024
@carrodher
Copy link
Member

Hi, the issue may not be directly related to the Bitnami container image/Helm chart, but rather to how the application is being utilized, configured in your specific environment, or tied to a particular scenario that is not easy to reproduce on our side.

If you think that's not the case and want to contribute a solution, we'd like to invite you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Please feel free to contact us if you have any questions or need assistance.

Suppose you have any questions about the application, customizing its content, or technology and infrastructure usage. In that case, we highly recommend that you refer to the forums and user guides provided by the project responsible for the application or technology.

With that said, we'll keep this ticket open until the stale bot automatically closes it, in case someone from the community contributes valuable insights.

@er-sami777
Copy link
Author

hey @carrodher Thank you for the response. I understand that the issue might be related to the environment and configuration, so I would like some guidance on how to use Bitnami Redis in a scenario where I have an application deployed on an EC2 instance (outside Kubernetes) that needs to write data to Redis, which is running inside a Kubernetes cluster (EKS).

Here’s the scenario in more detail:

My application is deployed on an EC2 instance inside the same VPC as my Kubernetes cluster (EKS).
The application on EC2 needs to communicate with Redis running inside the Kubernetes cluster to store and retrieve data.
Given that both the EC2 instance and the EKS cluster are within the same VPC, I assume I need to expose the Redis service running inside Kubernetes so that it can be accessed from the EC2 instance.

Could you please guide me on the best practices for achieving this setup? Specifically:

  • How should I expose the Redis service from within the Kubernetes cluster (EKS) so that it's accessible by the EC2 instance (while Write operation)?
  • What type of service (e.g., ClusterIP, LoadBalancer, etc.) should I use in Kubernetes to allow communication between the EC2 instance and Redis?
  • Are there any other configuration details or security considerations I should be aware of for this setup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
redis tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

3 participants