Skip to content

Exclude Redis exporter NetworkPolicy rules when exporter is disabled #3915

@cometship

Description

@cometship

Describe the bug

The default chart has:

redis:
  exporter:
    enabled: false

if we now set:

global:
  networkPolicy:
    create: true
    defaultDenyIngress: true

We get the following network policy warning for the redis pod:

... level=warn msg="Skipping named port" error="unknown named port" ...

This is because of this section in the generated network policy:

...
  - from:
    - namespaceSelector: {}
    ports:
    - port: metrics
      protocol: TCP
  podSelector:
    matchLabels:
      app.kubernetes.io/instance: argocd
      app.kubernetes.io/name: argocd-redis
...

But this port obviously does not exist. So would be good to exclude this section in the NetworkPolicy if redis.exporter.enabled equals false.

Related helm chart

argo-cd

Helm chart version

9.5.19

To Reproduce

Expected behavior

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions