loki icon indicating copy to clipboard operation
loki copied to clipboard

fix: Specify "loki" in podAntiAffinity matchLabels

Open graknol opened this issue 1 year ago • 2 comments

When deploying tempo, then loki (in that order) on the same cluster, the loki ingester pod will be stuck in pending state. By adding the extra labels to the affinity rule, both tempo and loki can live in harmony, without enforcing a hard anti-affinity on each-other (by default).

What this PR does / why we need it:

Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

Checklist

  • [X] Reviewed the CONTRIBUTING.md guide (required)
  • [X] Documentation added
  • [X] Tests updated
  • [X] Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • [X] Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • [X] If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

graknol avatar Oct 08 '24 12:10 graknol

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 08 '24 12:10 CLAassistant

Kubernetes Manifest Diff Summary

Scenario: default-single-binary-values (Added: 0, Modified: 8, Removed: 0)

Summary:

  • Added: 0

  • Modified: 8

  • Removed: 0

Added Files

No added files

Modified Files

loki/templates/querier/deployment-querier.yaml
*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/querier/deployment-querier.yaml	2024-10-08 12:17:58.731993130 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/querier/deployment-querier.yaml	2024-10-08 12:18:00.755988260 +0000
***************
*** 97,102 ****
--- 97,104 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: querier
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: config
loki/templates/query-frontend/deployment-query-frontend.yaml
*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/query-frontend/deployment-query-frontend.yaml	2024-10-08 12:17:58.731993130 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/query-frontend/deployment-query-frontend.yaml	2024-10-08 12:18:00.755988260 +0000
***************
*** 84,89 ****
--- 84,91 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: query-frontend
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: config
loki/templates/compactor/statefulset-compactor.yaml
*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/compactor/statefulset-compactor.yaml	2024-10-08 12:17:58.731993130 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/compactor/statefulset-compactor.yaml	2024-10-08 12:18:00.755988260 +0000
***************
*** 90,95 ****
--- 90,97 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: compactor
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: temp
loki/templates/gateway/deployment-gateway-nginx.yaml
*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/gateway/deployment-gateway-nginx.yaml	2024-10-08 12:17:58.731993130 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/gateway/deployment-gateway-nginx.yaml	2024-10-08 12:18:00.755988260 +0000
***************
*** 75,80 ****
--- 75,82 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: gateway
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: config
loki/templates/query-scheduler/deployment-query-scheduler.yaml
*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/query-scheduler/deployment-query-scheduler.yaml	2024-10-08 12:17:58.731993130 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/query-scheduler/deployment-query-scheduler.yaml	2024-10-08 12:18:00.755988260 +0000
***************
*** 84,89 ****
--- 84,91 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: query-scheduler
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: config
loki/templates/ruler/statefulset-ruler.yaml
*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/ruler/statefulset-ruler.yaml	2024-10-08 12:17:58.731993130 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/ruler/statefulset-ruler.yaml	2024-10-08 12:18:00.755988260 +0000
***************
*** 85,90 ****
--- 85,92 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: ruler
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: config
loki/templates/index-gateway/statefulset-index-gateway.yaml
*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/index-gateway/statefulset-index-gateway.yaml	2024-10-08 12:17:58.731993130 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/index-gateway/statefulset-index-gateway.yaml	2024-10-08 12:18:00.755988260 +0000
***************
*** 87,92 ****
--- 87,94 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: index-gateway
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: config
loki/templates/distributor/deployment-distributor.yaml
*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/distributor/deployment-distributor.yaml	2024-10-08 12:17:58.731993130 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/distributor/deployment-distributor.yaml	2024-10-08 12:18:00.755988260 +0000
***************
*** 88,93 ****
--- 88,95 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: distributor
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: config

Removed Files

No removed files

Scenario: default-values (Added: 0, Modified: 4, Removed: 0)

Summary:

  • Added: 0

  • Modified: 4

  • Removed: 0

Added Files

No added files

Modified Files

loki/templates/read/deployment-read.yaml
*** /home/runner/work/loki/loki/output/base/default-values/loki/templates/read/deployment-read.yaml	2024-10-08 12:17:58.827992865 +0000
--- /home/runner/work/loki/loki/output/pr/default-values/loki/templates/read/deployment-read.yaml	2024-10-08 12:18:00.851988090 +0000
***************
*** 92,97 ****
--- 92,99 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: read
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: tmp
loki/templates/write/statefulset-write.yaml
*** /home/runner/work/loki/loki/output/base/default-values/loki/templates/write/statefulset-write.yaml	2024-10-08 12:17:58.827992865 +0000
--- /home/runner/work/loki/loki/output/pr/default-values/loki/templates/write/statefulset-write.yaml	2024-10-08 12:18:00.851988090 +0000
***************
*** 90,95 ****
--- 90,97 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: write
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: config
loki/templates/gateway/deployment-gateway-nginx.yaml
*** /home/runner/work/loki/loki/output/base/default-values/loki/templates/gateway/deployment-gateway-nginx.yaml	2024-10-08 12:17:58.827992865 +0000
--- /home/runner/work/loki/loki/output/pr/default-values/loki/templates/gateway/deployment-gateway-nginx.yaml	2024-10-08 12:18:00.851988090 +0000
***************
*** 75,80 ****
--- 75,82 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: gateway
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: config
loki/templates/backend/statefulset-backend.yaml
*** /home/runner/work/loki/loki/output/base/default-values/loki/templates/backend/statefulset-backend.yaml	2024-10-08 12:17:58.827992865 +0000
--- /home/runner/work/loki/loki/output/pr/default-values/loki/templates/backend/statefulset-backend.yaml	2024-10-08 12:18:00.851988090 +0000
***************
*** 119,124 ****
--- 119,126 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: backend
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: tmp

Removed Files

No removed files

Scenario: ingress-values (Added: 0, Modified: 4, Removed: 0)

Summary:

  • Added: 0

  • Modified: 4

  • Removed: 0

Added Files

No added files

Modified Files

loki/templates/read/deployment-read.yaml
*** /home/runner/work/loki/loki/output/base/ingress-values/loki/templates/read/deployment-read.yaml	2024-10-08 12:17:58.923992598 +0000
--- /home/runner/work/loki/loki/output/pr/ingress-values/loki/templates/read/deployment-read.yaml	2024-10-08 12:18:00.947987920 +0000
***************
*** 92,97 ****
--- 92,99 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: read
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: tmp
loki/templates/write/statefulset-write.yaml
*** /home/runner/work/loki/loki/output/base/ingress-values/loki/templates/write/statefulset-write.yaml	2024-10-08 12:17:58.923992598 +0000
--- /home/runner/work/loki/loki/output/pr/ingress-values/loki/templates/write/statefulset-write.yaml	2024-10-08 12:18:00.947987920 +0000
***************
*** 90,95 ****
--- 90,97 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: write
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: config
loki/templates/gateway/deployment-gateway-nginx.yaml
*** /home/runner/work/loki/loki/output/base/ingress-values/loki/templates/gateway/deployment-gateway-nginx.yaml	2024-10-08 12:17:58.923992598 +0000
--- /home/runner/work/loki/loki/output/pr/ingress-values/loki/templates/gateway/deployment-gateway-nginx.yaml	2024-10-08 12:18:00.947987920 +0000
***************
*** 75,80 ****
--- 75,82 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: gateway
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: config
loki/templates/backend/statefulset-backend.yaml
*** /home/runner/work/loki/loki/output/base/ingress-values/loki/templates/backend/statefulset-backend.yaml	2024-10-08 12:17:58.923992598 +0000
--- /home/runner/work/loki/loki/output/pr/ingress-values/loki/templates/backend/statefulset-backend.yaml	2024-10-08 12:18:00.947987920 +0000
***************
*** 119,124 ****
--- 119,126 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: backend
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: tmp

Removed Files

No removed files

Scenario: legacy-monitoring-values (Added: 0, Modified: 4, Removed: 0)

Summary:

  • Added: 0

  • Modified: 4

  • Removed: 0

Added Files

No added files

Modified Files

loki/templates/read/deployment-read.yaml
*** /home/runner/work/loki/loki/output/base/legacy-monitoring-values/loki/templates/read/deployment-read.yaml	2024-10-08 12:17:59.031992299 +0000
--- /home/runner/work/loki/loki/output/pr/legacy-monitoring-values/loki/templates/read/deployment-read.yaml	2024-10-08 12:18:01.051987735 +0000
***************
*** 92,97 ****
--- 92,99 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: read
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: tmp
loki/templates/write/statefulset-write.yaml
*** /home/runner/work/loki/loki/output/base/legacy-monitoring-values/loki/templates/write/statefulset-write.yaml	2024-10-08 12:17:59.031992299 +0000
--- /home/runner/work/loki/loki/output/pr/legacy-monitoring-values/loki/templates/write/statefulset-write.yaml	2024-10-08 12:18:01.051987735 +0000
***************
*** 90,95 ****
--- 90,97 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: write
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: config
loki/templates/gateway/deployment-gateway-nginx.yaml
*** /home/runner/work/loki/loki/output/base/legacy-monitoring-values/loki/templates/gateway/deployment-gateway-nginx.yaml	2024-10-08 12:17:59.031992299 +0000
--- /home/runner/work/loki/loki/output/pr/legacy-monitoring-values/loki/templates/gateway/deployment-gateway-nginx.yaml	2024-10-08 12:18:01.051987735 +0000
***************
*** 75,80 ****
--- 75,82 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: gateway
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: config
loki/templates/backend/statefulset-backend.yaml
*** /home/runner/work/loki/loki/output/base/legacy-monitoring-values/loki/templates/backend/statefulset-backend.yaml	2024-10-08 12:17:59.031992299 +0000
--- /home/runner/work/loki/loki/output/pr/legacy-monitoring-values/loki/templates/backend/statefulset-backend.yaml	2024-10-08 12:18:01.051987735 +0000
***************
*** 119,124 ****
--- 119,126 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: backend
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: tmp

Removed Files

No removed files

Scenario: simple-scalable-aws-kube-irsa-values (Added: 0, Modified: 3, Removed: 0)

Summary:

  • Added: 0

  • Modified: 3

  • Removed: 0

Added Files

No added files

Modified Files

loki/templates/read/deployment-read.yaml
*** /home/runner/work/loki/loki/output/base/simple-scalable-aws-kube-irsa-values/loki/templates/read/deployment-read.yaml	2024-10-08 12:17:59.139991999 +0000
--- /home/runner/work/loki/loki/output/pr/simple-scalable-aws-kube-irsa-values/loki/templates/read/deployment-read.yaml	2024-10-08 12:18:01.163987538 +0000
***************
*** 94,99 ****
--- 94,101 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: read
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: tmp
loki/templates/write/statefulset-write.yaml
*** /home/runner/work/loki/loki/output/base/simple-scalable-aws-kube-irsa-values/loki/templates/write/statefulset-write.yaml	2024-10-08 12:17:59.139991999 +0000
--- /home/runner/work/loki/loki/output/pr/simple-scalable-aws-kube-irsa-values/loki/templates/write/statefulset-write.yaml	2024-10-08 12:18:01.163987538 +0000
***************
*** 92,97 ****
--- 92,99 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: write
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: config
loki/templates/backend/statefulset-backend.yaml
*** /home/runner/work/loki/loki/output/base/simple-scalable-aws-kube-irsa-values/loki/templates/backend/statefulset-backend.yaml	2024-10-08 12:17:59.139991999 +0000
--- /home/runner/work/loki/loki/output/pr/simple-scalable-aws-kube-irsa-values/loki/templates/backend/statefulset-backend.yaml	2024-10-08 12:18:01.163987538 +0000
***************
*** 121,126 ****
--- 121,128 ----
 - labelSelector:
 matchLabels:
 app.kubernetes.io/component: backend
+ app.kubernetes.io/instance: loki
+ app.kubernetes.io/name: loki
 topologyKey: kubernetes.io/hostname
 volumes:
 - name: tmp

Removed Files

No removed files

github-actions[bot] avatar Oct 08 '24 12:10 github-actions[bot]