diff --git a/charts/agent-stack-k8s/templates/_helper.tpl b/charts/agent-stack-k8s/templates/_helper.tpl new file mode 100644 index 00000000..598b74f0 --- /dev/null +++ b/charts/agent-stack-k8s/templates/_helper.tpl @@ -0,0 +1,5 @@ +{{/* Generate basic labels */}} +{{- define "agent-stack-k8s.labels" }} +{{- toYaml $.Values.labels }} +app: {{ .Release.Name }} +{{- end }} diff --git a/charts/agent-stack-k8s/templates/deployment.yaml.tpl b/charts/agent-stack-k8s/templates/deployment.yaml.tpl index 39eece02..569a159b 100644 --- a/charts/agent-stack-k8s/templates/deployment.yaml.tpl +++ b/charts/agent-stack-k8s/templates/deployment.yaml.tpl @@ -10,7 +10,7 @@ spec: template: metadata: labels: - app: {{ .Release.Name }} +{{- include "agent-stack-k8s.labels" . | nindent 8 }} annotations: checksum/config: {{ include (print $.Template.BasePath "/config.yaml.tpl") . | sha256sum }} checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml.tpl") . | sha256sum }} diff --git a/charts/agent-stack-k8s/values.schema.json b/charts/agent-stack-k8s/values.schema.json index 9b15dd30..a702439d 100644 --- a/charts/agent-stack-k8s/values.schema.json +++ b/charts/agent-stack-k8s/values.schema.json @@ -36,6 +36,23 @@ } ] }, + "labels": { + "type": "object", + "default": {}, + "title": "The labels Schema", + "description": "label app is reserved, user input label app is not allowed", + "not": { "required": [ "app" ] }, + "additionalProperties": { + "type": "string", + "default": "" + }, + "example": [ + { + "user": "name", + "project": "project" + } + ] + }, "resources": { "type": "object", "default": {}, diff --git a/charts/agent-stack-k8s/values.yaml b/charts/agent-stack-k8s/values.yaml index 9b202fc2..81783fb5 100644 --- a/charts/agent-stack-k8s/values.yaml +++ b/charts/agent-stack-k8s/values.yaml @@ -10,3 +10,6 @@ resources: requests: cpu: 100m memory: 100Mi + +labels: {} +