stakater / IngressMonitorController

A Kubernetes controller to watch ingresses and create liveness alerts for your apps/microservices in UptimeRobot, StatusCake, Pingdom, etc. – [✩Star] if you're using it!
https://stakater.com
Apache License 2.0
587 stars 102 forks source link

missing global.labels in pods #519

Open Boeller666 opened 12 months ago

Boeller666 commented 12 months ago

We need to set some labels by default to our deployments/pods.

global.labels does not attach these labels to the pods.

Please add

{{- if .Values.global.labels }}
{{ toYaml .Values.global.labels }}
{{- end }}

to the deployment.yaml or create another podLabels helper method that includes the global labels.

MuneebAijaz commented 11 months ago

@Boeller666 hi, we welcome Pull Requests if you are willing to resolve this issue

nohant commented 11 months ago

The chart at version 2.1.38, with this values.yml

global:
  labels:
    app: ingressmonitorcontroller

generates this kind of configuration inside the deployment:

monitoring, ingressmonitorcontroller, Deployment (apps) has changed:
  # Source: ingressmonitorcontroller/templates/deployment.yaml
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: ingressmonitorcontroller
    namespace: monitoring
    labels:
      helm.sh/chart: ingressmonitorcontroller-2.1.38
      app.kubernetes.io/name: ingressmonitorcontroller
      app.kubernetes.io/instance: ingress-monitor-controller
      app.kubernetes.io/version: "2.1.38"
      app.kubernetes.io/managed-by: helm
+     app: ingressmonitorcontroller
      control-plane: controller-manager

due to the configuration in the file helpers. @Boeller666 you instead need the spec.template.labels?

    template:
      metadata:
        labels:
          app.kubernetes.io/name: ingressmonitorcontroller
          app.kubernetes.io/instance: ingress-monitor-controller
+         app: ingressmonitorcontroller
      spec:
github-actions[bot] commented 9 months ago

This issue is stale because it has been open for 60 days with no activity.