helm icon indicating copy to clipboard operation
helm copied to clipboard

Redis Service Name not matching Pod requierment

Open sonic-sw opened this issue 1 year ago • 4 comments

Describe the issue

Dear community,

I run the helm chart version via argoCD:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: translation
  namespace: argocd
  finalizers:
    - resources-finalizer.argocd.argoproj.io
  labels:
    type: translation

spec:
  project: default

  sources:
    - repoURL: "https://helm.weblate.org"
      chart: weblate
      targetRevision: 0.4.29
      helm:
        valueFiles:
          - $values/kubernetes/translation/weblate/values.yaml

    - repoURL: "https://github.com/XXXXX/XXXXXX.git"
      targetRevision: main
      ref: values

  # Destination cluster and namespace to deploy the application
  destination:
    name: in-cluster
    namespace: translation
  # Sync policy
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
      allowEmpty: false
    syncOptions:
      - Validate=true
      - CreateNamespace=true
      - PrunePropagationPolicy=foreground
      - PruneLast=true
    managedNamespaceMetadata:
      labels:
        enviroment: production
        type: translation

  revisionHistoryLimit: 5

and use it stock vaules in the DB and redis setup

image:
  repository: weblate/weblate
  tag: 4.18.2.1
  pullPolicy: IfNotPresent

imagePullSecrets: []
nameOverride: ''
fullnameOverride: ''
updateStrategy: Recreate
...
postgresql:
  auth:
  # PostgreSQL user should be a superuser to
  # be able to install pg_trgm extension. Alternatively you can install it
  # manually prior starting Weblate.
    userName: ''
    enablePostgresUser: true
    postgresPassword: weblate
    database: weblate
    existingSecret: ''
    secretKeys:
      userPasswordKey: postgresql-password
  service:
    ports:
      postgresql: 5432
  enabled: true
  # postgresql.postgresqlHost -- External postgres database endpoint, to be
  # used if `postgresql.enabled == false`
  # @default -- `None`
  postgresqlHost:

redis:
  architecture: standalone
  auth:
    enabled: true
    password: weblate
    existingSecret: ''
    existingSecretPasswordKey: redis-password
  db: 1
  enabled: true
  # redis.redisHost -- External redis database endpoint, to be
  # used if `redis.enabled == false`
  # @default -- `None`
  redisHost:

and noticed that the weblate pod fails to start as it tries to connect to redis service with the name translation-weblate-redis-master, however the created service of redis is named translation-redis-master.

image

File "/usr/local/lib/python3.11/site-packages/django_redis/client/default.py", line 670, in has_key raise ConnectionInterrupted(connection=client) from edjango_redis.exceptions.ConnectionInterrupted: Redis ConnectionError: Error -2 connecting to translation-weblate-redis-master:6379. Name or service not known.

sonic-sw avatar Jul 07 '23 12:07 sonic-sw

Hi. Do you have this issue also with the most recent helm chart version? (currently 0.4.31)

zisuu avatar Jul 31 '23 14:07 zisuu

as I have overwritten the name of the service, I cannot tell you if this is still present in this version.

sonic-sw avatar Aug 08 '23 12:08 sonic-sw

This does appear to still be happening in the current version of the helm template. The redis pod is created as {helmName}-redis-master-0 and the service as {helmName}-redis-master but weblate seems to be looking for {helmName}-weblate-redis-master by default.

Edit: Same seems to happen with Postgresql as well. Changing redis.redisHost and postgresql.postgresqlHost allows you to workaround the issue in the interim.

Crashdoom avatar Sep 15 '24 00:09 Crashdoom

This issue is still open, so nobody did fix that. Pull requests are welcome!

nijel avatar Sep 16 '24 10:09 nijel

Created PR with fixes.

Mart-Kuc avatar Sep 24 '24 15:09 Mart-Kuc

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

github-actions[bot] avatar Sep 25 '24 07:09 github-actions[bot]