Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support extra labels for bindplane and prometheus pods #102

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

jsirianni
Copy link
Member

@jsirianni jsirianni commented Mar 21, 2024

Description of Changes

Added two new options

  • extraPodLabels
  • prometheus.extraPodLabels

These will add abitrary labels to the StatefulSet / Deployment's pod template (spec.template.metadata.labels, AKA pod labels).

Testing

minikube start
helm template charts/bindplane --values test/cases/labels/values.yaml | kubectl apply -f -

Once deployed, you can do a get pod <name on the bindplane and Prometheus pods, parse with jq.

➜  bindplane-op-helm git:(feat/extra-pod-labels) ✗ kubectl get pod release-name-bindplane-0 -o json | jq '.metadata.labels'
{
  "app.kubernetes.io/component": "server",
  "app.kubernetes.io/instance": "release-name",
  "app.kubernetes.io/name": "bindplane",
  "app.kubernetes.io/stack": "bindplane",
  "controller-revision-hash": "release-name-bindplane-69d7695dff",
  "extraKey": "extraValue",
  "extraKey2": "extraValue2",
  "statefulset.kubernetes.io/pod-name": "release-name-bindplane-0"
}

➜  bindplane-op-helm git:(feat/extra-pod-labels) ✗ kubectl get pod release-name-bindplane-prometheus-0 -o json | jq '.metadata.labels'
{
  "app.kubernetes.io/component": "prometheus",
  "app.kubernetes.io/instance": "release-name",
  "app.kubernetes.io/name": "bindplane",
  "app.kubernetes.io/stack": "bindplane",
  "controller-revision-hash": "release-name-bindplane-prometheus-564456c78b",
  "extraKeyProm": "extraValueProm",
  "extraKeyProm2": "extraValueProm2",
  "statefulset.kubernetes.io/pod-name": "release-name-bindplane-prometheus-0"
}

The labels defined in the values file appear on the pod as expected.

Please check that the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • CI passes

@jsirianni jsirianni marked this pull request as ready for review March 21, 2024 21:26
@jsirianni jsirianni requested a review from a team as a code owner March 21, 2024 21:26
@jsirianni jsirianni requested review from cpheps and Mrod1598 March 21, 2024 21:26
@jsirianni jsirianni merged commit 57e85c6 into main Mar 21, 2024
13 checks passed
@jsirianni jsirianni deleted the feat/extra-pod-labels branch March 21, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants