sigstore / helm-charts

Helm charts for sigstore project
Apache License 2.0
64 stars 93 forks source link

Support adding custom labels to the deployment policy controller #658

Open CodeGlitcher opened 10 months ago

CodeGlitcher commented 10 months ago

Description

Support added custom labels to the webhook deployment for hte policy controller

In our project we use NetworkPolicies to limit what applications are allowed to access. For the network policies we have created custom labels to select where they apply: like: egress-kube-system-api-server

Could the helm chart support a variable like extraLabels to add additional labels to the deployment?

hectorj2f commented 10 months ago

@CodeGlitcher That is already possible, look here https://github.com/sigstore/helm-charts/blob/main/charts/policy-controller/templates/webhook/deployment_webhook.yaml#L5.

CodeGlitcher commented 10 months ago

I dont think so. policy-controller.labels are defined in the helm __helpers As far as I know you cannot override these from the values.yaml

{{/*
Common labels
*/}}
{{- define "policy-controller.labels" -}}
helm.sh/chart: {{ include "policy-controller.chart" . }}
{{ include "policy-controller.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

also these labels are added to the deployment and not the actual pod.

hectorj2f commented 10 months ago

Yes, you're right. Let me fix that in a PR.