Skip to content

ArgoCD chart issue when using netpols with redis-ha and haproxy #3569

@pmcgrath-mck

Description

@pmcgrath-mck

Describe the bug

When trying to upgrade to the latest version (9.1.0) which depends on redis-ha 4.34.11, seeing an issue with enabling netpol for redis-ha haproxy

Can see with this

helm template argocd -n argocd argo/argo-cd --version 9.1.0 \
  --set redis-ha.enabled=true \
  --set redis-ha.haproxy.enabled=true \
  --set redis-ha.haproxy.networkPolicy.enabled=true \
  --set redis-ha.haproxy.networkPolicy.ingressRules[0].selectors[0].podSelector.matchLabels.app\.kubernetes\.io/instance=argo-cd

Error: template: argo-cd/charts/redis-ha/templates/redis-haproxy-network-policy.yaml:64:12: executing "argo-cd/charts/redis-ha/templates/redis-haproxy-network-policy.yaml" at <include "redis-ports" .>: error calling include: template: argo-cd/charts/redis-ha/templates/_helpers.tpl:138:22: executing "redis-ports" at <.Values.redis.port>: nil pointer evaluating interface {}.redis

This has been fixed in this redis-ha release https://github.com/DandyDeveloper/charts/releases/tag/redis-ha-4.34.13

Related helm chart

argo-cd

Helm chart version

9.1.0

To Reproduce

Can see it works with the new redis-ha version with

helm template redis-ha dandydev/redis-ha --version 4.35.0 \
  --set haproxy.enabled=true \
  --set haproxy.networkPolicy.enabled=true \
  --set haproxy.networkPolicy.ingressRules[0].selectors[0].podSelector.matchLabels.app\.kubernetes\.io/instance=argo-cd | \
  yq 'select(.kind == "NetworkPolicy")' | \
  head -n 10
---
# Source: redis-ha/templates/redis-haproxy-network-policy.yaml
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  name: redis-ha-haproxy-network-policy
  namespace: "default"
  labels:
    app: redis-ha
    heritage: "Helm"

Can see same issue we were seeing with the version the 9.1.0 argo-cd chart uses with

helm template redis-ha dandydev/redis-ha --version 4.34.11 \
  --set haproxy.enabled=true \
  --set haproxy.networkPolicy.enabled=true \
  --set haproxy.networkPolicy.ingressRules[0].selectors[0].podSelector.matchLabels.app\.kubernetes\.io/instance=argo-cd
Error: template: redis-ha/templates/redis-haproxy-network-policy.yaml:64:12: executing "redis-ha/templates/redis-haproxy-network-policy.yaml" at <include "redis-ports" .>: error calling include: template: redis-ha/templates/_helpers.tpl:138:22: executing "redis-ports" at <.Values.redis.port>: nil pointer evaluating interface {}.redis

Expected behavior

If the redis-ha is bumped to 4.35.0+ i think this will no longer be an issue and we can continue using netpols

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    argo-cdawaiting-upstreamIs waiting for a change upstream to be completed before it can be merged.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions