Skip to content

Singlebinary mode is not handled in -ingress networkpolicy #19199

@david-caro

Description

@david-caro

Describe the bug
When deploying loki in single-binary mode, the -ingress networkpolicy does not match the loki pods as it only matches app.kubernetes.io write and read, but not single-binary.

This prevents traffic from alloy to the loki pods as though the networkingpolicy matches the alloy namespace and pods, it does not match the target loki pods correctly.

Tested using chart versioin helm-loki 6.30.1.

To Reproduce
Steps to reproduce the behavior:

  1. Deploy loki in single-binary mode without gateway enabled (using loki.name=testloki for example)
  2. kubectl get -n loki networkpolicy -o yaml testloki-ingress
  3. You get a matchExpression with the only member in the array being:
key: app.kubernetes.io/component
operator: In
values:
- read
- write

Expected behavior
You'll get instead (or also) the value single-binary.

Environment:

  • Infrastructure: kubernetes
  • Deployment tool: helm

Screenshots, Promtail config, or terminal output
We are using this helmfile to deploy it:
https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/blob/main/components/logging/helmfile.yaml?ref_type=heads

The one having the issues is the local environment, https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/blob/main/components/logging/values/loki/local.yaml?ref_type=heads

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/helmtype/bugSomehing is not working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions