From 147d84ad8237b04c0d29c9010bfdaf4bf9f20569 Mon Sep 17 00:00:00 2001 From: Francisco Martinez <18524627+fmartinez255@users.noreply.github.com> Date: Wed, 17 Apr 2024 16:50:20 -0700 Subject: [PATCH] Support user labels and annotations (#5) * add userLabels and userAnnotations --- charts/lightlytics/templates/_helpers.tpl | 20 ++++++++++++++++++- .../templates/cost_deployment.yaml | 9 ++++++++- charts/lightlytics/templates/deployment.yaml | 9 ++++++++- .../templates/process_discovery_ds.yaml | 9 ++++++++- charts/lightlytics/values.yaml | 4 ++++ charts/lightlytics/values.yaml.jinja2 | 4 ++++ 6 files changed, 51 insertions(+), 4 deletions(-) diff --git a/charts/lightlytics/templates/_helpers.tpl b/charts/lightlytics/templates/_helpers.tpl index 5d9a09a..b417620 100644 --- a/charts/lightlytics/templates/_helpers.tpl +++ b/charts/lightlytics/templates/_helpers.tpl @@ -63,6 +63,15 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} +{{/* +User labels +*/}} +{{- define "user.labels" -}} +{{- with .Values.userLabels }} +{{ toYaml .}} +{{- end }} +{{- end }} + {{/* Selector labels */}} @@ -71,6 +80,15 @@ app.kubernetes.io/name: {{ include "lightlytics.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +{{/* +User annotations +*/}} +{{- define "user.annotations" -}} +{{- with .Values.userAnnotations }} +{{ toYaml .}} +{{- end }} +{{- end }} + {{/* Create the name of the service account to use */}} @@ -88,4 +106,4 @@ Create the name of the service account to use {{- else }} {{- default "default" .Values.lightlytics.clusterRole.name }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/lightlytics/templates/cost_deployment.yaml b/charts/lightlytics/templates/cost_deployment.yaml index ee7b3ba..e67c421 100644 --- a/charts/lightlytics/templates/cost_deployment.yaml +++ b/charts/lightlytics/templates/cost_deployment.yaml @@ -6,6 +6,13 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "lightlytics.labels" . | nindent 4 }} + {{- if .Values.userLabels }} + {{- include "user.labels" . | indent 4 }} + {{- end }} + {{- if .Values.userAnnotations }} + annotations: + {{- include "user.annotations" . | indent 4 }} + {{- end }} spec: replicas: {{ .Values.lightlytics.replicas }} selector: @@ -72,4 +79,4 @@ spec: value: {{ $envVarValue | quote }} {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/lightlytics/templates/deployment.yaml b/charts/lightlytics/templates/deployment.yaml index c8fc98c..51f3ec1 100644 --- a/charts/lightlytics/templates/deployment.yaml +++ b/charts/lightlytics/templates/deployment.yaml @@ -6,6 +6,13 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "lightlytics.labels" . | nindent 4 }} + {{- if .Values.userLabels }} + {{- include "user.labels" . | indent 4 }} + {{- end }} + {{- if .Values.userAnnotations }} + annotations: + {{- include "user.annotations" . | indent 4 }} + {{- end }} spec: replicas: {{ .Values.lightlytics.replicas }} selector: @@ -107,4 +114,4 @@ spec: {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/lightlytics/templates/process_discovery_ds.yaml b/charts/lightlytics/templates/process_discovery_ds.yaml index f9afaee..3927fd8 100644 --- a/charts/lightlytics/templates/process_discovery_ds.yaml +++ b/charts/lightlytics/templates/process_discovery_ds.yaml @@ -6,6 +6,13 @@ metadata: labels: {{- include "lightlytics.labels" . | nindent 4 }} app: {{ template "lightlytics.fullname" . }}-process-discovery + {{- if .Values.userLabels }} + {{- include "user.labels" . | indent 4 }} + {{- end }} + {{- if .Values.userAnnotations }} + annotations: + {{- include "user.annotations" . | indent 4 }} + {{- end }} spec: selector: matchLabels: @@ -100,4 +107,4 @@ spec: - protocol: TCP port: 8080 targetPort: 8080 -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/lightlytics/values.yaml b/charts/lightlytics/values.yaml index 93efbbc..2d45500 100644 --- a/charts/lightlytics/values.yaml +++ b/charts/lightlytics/values.yaml @@ -8,6 +8,10 @@ nameOverride: # "" fullnameOverride: # "" +userLabels: {} + +userAnnotations: {} + registry: public.ecr.aws/f1v0s3d7 lightlytics: diff --git a/charts/lightlytics/values.yaml.jinja2 b/charts/lightlytics/values.yaml.jinja2 index f11fdda..a9dafda 100644 --- a/charts/lightlytics/values.yaml.jinja2 +++ b/charts/lightlytics/values.yaml.jinja2 @@ -6,6 +6,10 @@ nameOverride: # "" fullnameOverride: # "" +userLabels: # "" + +userAnnotations: # "" + registry: {{ecr_repo}} lightlytics: