diff --git a/clusters/cl01tl/helm/argocd/templates/_helpers.tpl b/clusters/cl01tl/helm/argocd/templates/_helpers.tpl new file mode 100644 index 000000000..251852577 --- /dev/null +++ b/clusters/cl01tl/helm/argocd/templates/_helpers.tpl @@ -0,0 +1,14 @@ +{{/* +Common labels +*/}} +{{- define "argocd.labels" -}} +{{ include "argocd.selectorLabels" $ }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "argocd.selectorLabels" -}} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/part-of: {{ .Release.Name }} +{{- end }} diff --git a/clusters/cl01tl/helm/argocd/templates/external-secret.yaml b/clusters/cl01tl/helm/argocd/templates/external-secret.yaml index c44d04109..8626fb963 100644 --- a/clusters/cl01tl/helm/argocd/templates/external-secret.yaml +++ b/clusters/cl01tl/helm/argocd/templates/external-secret.yaml @@ -4,9 +4,8 @@ metadata: name: argocd-oidc-authentik namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: argocd-oidc-authentik + {{- include "argocd.labels" . | nindent 4 }} spec: secretStoreRef: kind: ClusterSecretStore @@ -28,9 +27,8 @@ metadata: name: argocd-notifications-ntfy namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: argocd-notifications-ntfy + {{- include "argocd.labels" . | nindent 4 }} spec: secretStoreRef: kind: ClusterSecretStore diff --git a/clusters/cl01tl/helm/audiobookshelf/templates/_helpers.tpl b/clusters/cl01tl/helm/audiobookshelf/templates/_helpers.tpl new file mode 100644 index 000000000..fafc16ec0 --- /dev/null +++ b/clusters/cl01tl/helm/audiobookshelf/templates/_helpers.tpl @@ -0,0 +1,27 @@ +{{/* +Common labels +*/}} +{{- define "audiobookshelf.labels" -}} +{{ include "audiobookshelf.selectorLabels" $ }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "audiobookshelf.selectorLabels" -}} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/part-of: {{ .Release.Name }} +{{- end }} + +{{/* +NFS names +*/}} +{{- define "audiobookshelf.booksNfsName" -}} +audiobookshelf-books-nfs-storage +{{- end -}} +{{- define "audiobookshelf.audiobooksNfsName" -}} +audiobookshelf-audiobooks-nfs-storage +{{- end -}} +{{- define "audiobookshelf.podcastsNfsName" -}} +audiobookshelf-podcasts-nfs-storage +{{- end -}} diff --git a/clusters/cl01tl/helm/audiobookshelf/templates/external-secret.yaml b/clusters/cl01tl/helm/audiobookshelf/templates/external-secret.yaml index a7a93d4fa..d82c2ad62 100644 --- a/clusters/cl01tl/helm/audiobookshelf/templates/external-secret.yaml +++ b/clusters/cl01tl/helm/audiobookshelf/templates/external-secret.yaml @@ -4,9 +4,8 @@ metadata: name: audiobookshelf-config-apprise namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: audiobookshelf-config-apprise + {{- include "audiobookshelf.labels" . | nindent 4 }} spec: secretStoreRef: kind: ClusterSecretStore diff --git a/clusters/cl01tl/helm/audiobookshelf/templates/persistent-volume-claim.yaml b/clusters/cl01tl/helm/audiobookshelf/templates/persistent-volume-claim.yaml index 46fc79075..1aeef0cb8 100644 --- a/clusters/cl01tl/helm/audiobookshelf/templates/persistent-volume-claim.yaml +++ b/clusters/cl01tl/helm/audiobookshelf/templates/persistent-volume-claim.yaml @@ -1,14 +1,13 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: audiobookshelf-books-nfs-storage + name: {{- include "audiobookshelf.booksNfsName" . }} namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: {{- include "audiobookshelf.booksNfsName" . }} + {{- include "audiobookshelf.labels" . | nindent 4 }} spec: - volumeName: {{ .Template.Name }} + volumeName: {{- include "audiobookshelf.booksNfsName" . }} storageClassName: nfs-client accessModes: - ReadWriteMany @@ -20,14 +19,13 @@ spec: apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: audiobookshelf-audiobooks-nfs-storage + name: {{- include "audiobookshelf.audiobooksNfsName" . }} namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: {{- include "audiobookshelf.audiobooksNfsName" . }} + {{- include "audiobookshelf.labels" . | nindent 4 }} spec: - volumeName: {{ .Template.Name }} + volumeName: {{- include "audiobookshelf.audiobooksNfsName" . }} storageClassName: nfs-client accessModes: - ReadWriteMany @@ -39,14 +37,13 @@ spec: apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: audiobookshelf-podcasts-nfs-storage + name: {{- include "audiobookshelf.podcastsNfsName" . }} namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: {{- include "audiobookshelf.podcastsNfsName" . }} + {{- include "audiobookshelf.labels" . | nindent 4 }} spec: - volumeName: {{ .Template.Name }} + volumeName: {{- include "audiobookshelf.podcastsNfsName" . }} storageClassName: nfs-client accessModes: - ReadWriteMany diff --git a/clusters/cl01tl/helm/audiobookshelf/templates/persistent-volume.yaml b/clusters/cl01tl/helm/audiobookshelf/templates/persistent-volume.yaml index c26aa31d0..e6a4e3467 100644 --- a/clusters/cl01tl/helm/audiobookshelf/templates/persistent-volume.yaml +++ b/clusters/cl01tl/helm/audiobookshelf/templates/persistent-volume.yaml @@ -1,12 +1,11 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: audiobookshelf-books-nfs-storage + name: {{- include "audiobookshelf.booksNfsName" . }} namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: {{- include "audiobookshelf.booksNfsName" . }} + {{- include "audiobookshelf.labels" . | nindent 4 }} spec: persistentVolumeReclaimPolicy: Retain storageClassName: nfs-client @@ -26,12 +25,11 @@ spec: apiVersion: v1 kind: PersistentVolume metadata: - name: audiobookshelf-audiobooks-nfs-storage + name: {{- include "audiobookshelf.audiobooksNfsName" . }} namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: {{- include "audiobookshelf.audiobooksNfsName" . }} + {{- include "audiobookshelf.labels" . | nindent 4 }} spec: persistentVolumeReclaimPolicy: Retain storageClassName: nfs-client @@ -51,12 +49,11 @@ spec: apiVersion: v1 kind: PersistentVolume metadata: - name: audiobookshelf-podcasts-nfs-storage + name: {{- include "audiobookshelf.podcastsNfsName" . }} namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: {{- include "audiobookshelf.podcastsNfsName" . }} + {{- include "audiobookshelf.labels" . | nindent 4 }} spec: persistentVolumeReclaimPolicy: Retain storageClassName: nfs-client diff --git a/clusters/cl01tl/helm/authentik/templates/_helpers.tpl b/clusters/cl01tl/helm/authentik/templates/_helpers.tpl new file mode 100644 index 000000000..523f2ccb7 --- /dev/null +++ b/clusters/cl01tl/helm/authentik/templates/_helpers.tpl @@ -0,0 +1,14 @@ +{{/* +Common labels +*/}} +{{- define "authentik.labels" -}} +{{ include "authentik.selectorLabels" $ }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "authentik.selectorLabels" -}} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/part-of: {{ .Release.Name }} +{{- end }} diff --git a/clusters/cl01tl/helm/authentik/templates/external-secret.yaml b/clusters/cl01tl/helm/authentik/templates/external-secret.yaml index 4249d3536..7d2fa7041 100644 --- a/clusters/cl01tl/helm/authentik/templates/external-secret.yaml +++ b/clusters/cl01tl/helm/authentik/templates/external-secret.yaml @@ -4,9 +4,8 @@ metadata: name: authentik-key namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: authentik-key + {{- include "authentik.labels" . | nindent 4 }} spec: secretStoreRef: kind: ClusterSecretStore diff --git a/clusters/cl01tl/helm/authentik/templates/ingress.yaml b/clusters/cl01tl/helm/authentik/templates/ingress.yaml index 2e8da1298..b16db26c5 100644 --- a/clusters/cl01tl/helm/authentik/templates/ingress.yaml +++ b/clusters/cl01tl/helm/authentik/templates/ingress.yaml @@ -1,13 +1,12 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: authentik-tailscale + name: {{ .Release.Name }}-tailscale namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: {{ .Release.Name }}-tailscale tailscale.com/proxy-class: no-metrics + {{- include "authentik.labels" . | nindent 4 }} annotations: tailscale.com/experimental-forward-cluster-traffic-via-ingress: "true" spec: diff --git a/clusters/cl01tl/helm/authentik/templates/reference-grant.yaml b/clusters/cl01tl/helm/authentik/templates/reference-grant.yaml index b182dd3f0..b03d840fb 100644 --- a/clusters/cl01tl/helm/authentik/templates/reference-grant.yaml +++ b/clusters/cl01tl/helm/authentik/templates/reference-grant.yaml @@ -4,9 +4,8 @@ metadata: name: allow-outpost-cross-namespace-access namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: allow-outpost-cross-namespace-access + {{- include "authentik.labels" . | nindent 4 }} spec: from: - group: gateway.networking.k8s.io diff --git a/clusters/cl01tl/helm/backrest/templates/_helpers.tpl b/clusters/cl01tl/helm/backrest/templates/_helpers.tpl new file mode 100644 index 000000000..13cb540f8 --- /dev/null +++ b/clusters/cl01tl/helm/backrest/templates/_helpers.tpl @@ -0,0 +1,24 @@ +{{/* +Common labels +*/}} +{{- define "backrest.labels" -}} +{{ include "backrest.selectorLabels" $ }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "backrest.selectorLabels" -}} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/part-of: {{ .Release.Name }} +{{- end }} + +{{/* +NFS names +*/}} +{{- define "backrest.storageNfsName" -}} +backrest-nfs-storage +{{- end -}} +{{- define "backrest.shareNfsName" -}} +backrest-nfs-share +{{- end -}} diff --git a/clusters/cl01tl/helm/backrest/templates/persistent-volume-claim.yaml b/clusters/cl01tl/helm/backrest/templates/persistent-volume-claim.yaml index 81dbaea9a..30ec73aa5 100644 --- a/clusters/cl01tl/helm/backrest/templates/persistent-volume-claim.yaml +++ b/clusters/cl01tl/helm/backrest/templates/persistent-volume-claim.yaml @@ -1,14 +1,13 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: backrest-nfs-storage + name: {{- include "backrest.storageNfsName" . }} namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: {{- include "backrest.storageNfsName" . }} + {{- include "backrest.labels" . | nindent 4 }} spec: - volumeName: {{ .Template.Name }} + volumeName: {{- include "backrest.storageNfsName" . }} storageClassName: nfs-client accessModes: - ReadWriteMany @@ -20,14 +19,13 @@ spec: apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: backrest-nfs-share + name: {{- include "backrest.shareNfsName" . }} namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: {{- include "backrest.shareNfsName" . }} + {{- include "backrest.labels" . | nindent 4 }} spec: - volumeName: {{ .Template.Name }} + volumeName: {{- include "backrest.shareNfsName" . }} storageClassName: nfs-client accessModes: - ReadWriteMany diff --git a/clusters/cl01tl/helm/backrest/templates/persistent-volume.yaml b/clusters/cl01tl/helm/backrest/templates/persistent-volume.yaml index 7d7fc09ad..d1f889f7a 100644 --- a/clusters/cl01tl/helm/backrest/templates/persistent-volume.yaml +++ b/clusters/cl01tl/helm/backrest/templates/persistent-volume.yaml @@ -1,12 +1,11 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: backrest-nfs-storage + name: {{- include "backrest.storageNfsName" . }} namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: {{- include "backrest.storageNfsName" . }} + {{- include "backrest.labels" . | nindent 4 }} spec: persistentVolumeReclaimPolicy: Retain storageClassName: nfs-client @@ -26,12 +25,11 @@ spec: apiVersion: v1 kind: PersistentVolume metadata: - name: backrest-nfs-share + name: {{- include "backrest.shareNfsName" . }} namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: {{- include "backrest.shareNfsName" . }} + {{- include "backrest.labels" . | nindent 4 }} spec: persistentVolumeReclaimPolicy: Retain storageClassName: nfs-client diff --git a/clusters/cl01tl/helm/bazarr/templates/_helpers.tpl b/clusters/cl01tl/helm/bazarr/templates/_helpers.tpl new file mode 100644 index 000000000..b86c452c0 --- /dev/null +++ b/clusters/cl01tl/helm/bazarr/templates/_helpers.tpl @@ -0,0 +1,21 @@ +{{/* +Common labels +*/}} +{{- define "bazarr.labels" -}} +{{ include "bazarr.selectorLabels" $ }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "bazarr.selectorLabels" -}} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/part-of: {{ .Release.Name }} +{{- end }} + +{{/* +NFS names +*/}} +{{- define "bazarr.storageNfsName" -}} +bazarr-nfs-storage +{{- end -}} diff --git a/clusters/cl01tl/helm/bazarr/templates/external-secret.yaml b/clusters/cl01tl/helm/bazarr/templates/external-secret.yaml index 70b4100e8..b2421d884 100644 --- a/clusters/cl01tl/helm/bazarr/templates/external-secret.yaml +++ b/clusters/cl01tl/helm/bazarr/templates/external-secret.yaml @@ -4,9 +4,8 @@ metadata: name: bazarr-key namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: bazarr-key + {{- include "bazarr.labels" . | nindent 4 }} spec: secretStoreRef: kind: ClusterSecretStore diff --git a/clusters/cl01tl/helm/bazarr/templates/persistent-volume-claim.yaml b/clusters/cl01tl/helm/bazarr/templates/persistent-volume-claim.yaml index 017540c01..a71736ef3 100644 --- a/clusters/cl01tl/helm/bazarr/templates/persistent-volume-claim.yaml +++ b/clusters/cl01tl/helm/bazarr/templates/persistent-volume-claim.yaml @@ -1,12 +1,11 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: bazarr-nfs-storage + name: {{- include "bazarr.storageNfsName" . }} namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: {{- include "bazarr.storageNfsName" . }} + {{- include "bazarr.labels" . | nindent 4 }} spec: volumeName: {{ .Template.Name }} storageClassName: nfs-client diff --git a/clusters/cl01tl/helm/bazarr/templates/persistent-volume.yaml b/clusters/cl01tl/helm/bazarr/templates/persistent-volume.yaml index c608b11da..2021b4a6d 100644 --- a/clusters/cl01tl/helm/bazarr/templates/persistent-volume.yaml +++ b/clusters/cl01tl/helm/bazarr/templates/persistent-volume.yaml @@ -1,12 +1,11 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: bazarr-nfs-storage + name: {{- include "bazarr.storageNfsName" . }} namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: {{- include "bazarr.storageNfsName" . }} + {{- include "bazarr.labels" . | nindent 4 }} spec: persistentVolumeReclaimPolicy: Retain storageClassName: nfs-client diff --git a/clusters/cl01tl/helm/cert-manager/templates/_helpers.tpl b/clusters/cl01tl/helm/cert-manager/templates/_helpers.tpl new file mode 100644 index 000000000..fd08bb911 --- /dev/null +++ b/clusters/cl01tl/helm/cert-manager/templates/_helpers.tpl @@ -0,0 +1,24 @@ +{{/* +Common labels +*/}} +{{- define "cert-manager.labels" -}} +{{ include "cert-manager.selectorLabels" $ }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "cert-manager.selectorLabels" -}} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/part-of: {{ .Release.Name }} +{{- end }} + +{{/* +NFS names +*/}} +{{- define "cert-manager.cloudflareSecretName" -}} +cert-manager-cloudflare-api-token +{{- end -}} +{{- define "cert-manager.cloudflareSecretKey" -}} +api-token +{{- end -}} diff --git a/clusters/cl01tl/helm/cert-manager/templates/cluster-issuer.yaml b/clusters/cl01tl/helm/cert-manager/templates/cluster-issuer.yaml index d1baf3b38..73587a621 100644 --- a/clusters/cl01tl/helm/cert-manager/templates/cluster-issuer.yaml +++ b/clusters/cl01tl/helm/cert-manager/templates/cluster-issuer.yaml @@ -4,9 +4,8 @@ metadata: name: letsencrypt-issuer namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: letsencrypt-issuer + {{- include "cert-manager.labels" . | nindent 4 }} spec: acme: email: alexanderlebens@gmail.com @@ -22,5 +21,5 @@ spec: cloudflare: email: alexanderlebens@gmail.com apiTokenSecretRef: - name: cloudflare-api-token - key: api-token + name: {{- include "cert-manager.cloudflareSecretName" . }} + key: {{- include "cert-manager.cloudflareSecretKey" . }} diff --git a/clusters/cl01tl/helm/cert-manager/templates/external-secret.yaml b/clusters/cl01tl/helm/cert-manager/templates/external-secret.yaml index 821e314a0..ab52d7d52 100644 --- a/clusters/cl01tl/helm/cert-manager/templates/external-secret.yaml +++ b/clusters/cl01tl/helm/cert-manager/templates/external-secret.yaml @@ -1,18 +1,17 @@ apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: - name: cloudflare-api-token + name: {{- include "cert-manager.cloudflareSecretName" . }} namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: {{- include "cert-manager.cloudflareSecretName" . }} + {{- include "cert-manager.labels" . | nindent 4 }} spec: secretStoreRef: kind: ClusterSecretStore name: openbao data: - - secretKey: api-token + - secretKey: {{- include "cert-manager.cloudflareSecretKey" . }} remoteRef: key: /cloudflare/alexlebens.net/cl01tl-issuer-certificate property: token diff --git a/clusters/cl01tl/helm/cilium/templates/_helpers.tpl b/clusters/cl01tl/helm/cilium/templates/_helpers.tpl new file mode 100644 index 000000000..4a67642f9 --- /dev/null +++ b/clusters/cl01tl/helm/cilium/templates/_helpers.tpl @@ -0,0 +1,14 @@ +{{/* +Common labels +*/}} +{{- define "cilium.labels" -}} +{{ include "cilium.selectorLabels" $ }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "cilium.selectorLabels" -}} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/part-of: {{ .Release.Name }} +{{- end }} diff --git a/clusters/cl01tl/helm/cilium/templates/cilium-bgp-advertisement.yaml b/clusters/cl01tl/helm/cilium/templates/cilium-bgp-advertisement.yaml index 79e4a752c..5d3c07756 100644 --- a/clusters/cl01tl/helm/cilium/templates/cilium-bgp-advertisement.yaml +++ b/clusters/cl01tl/helm/cilium/templates/cilium-bgp-advertisement.yaml @@ -4,9 +4,8 @@ # name: cilium-bgp-advertisements # namespace: {{ .Release.Namespace }} # labels: -# app.kubernetes.io/name: {{ .Template.Name }} -# app.kubernetes.io/instance: {{ .Release.Name }} -# app.kubernetes.io/part-of: {{ .Release.Name }} +# app.kubernetes.io/name: cilium-bgp-advertisements +# {{- include "cilium.labels" . | nindent 4 }} # spec: # advertisements: # - advertisementType: "Service" diff --git a/clusters/cl01tl/helm/cilium/templates/cilium-bgp-cluster-config.yaml b/clusters/cl01tl/helm/cilium/templates/cilium-bgp-cluster-config.yaml index 2324072d1..2d51255f9 100644 --- a/clusters/cl01tl/helm/cilium/templates/cilium-bgp-cluster-config.yaml +++ b/clusters/cl01tl/helm/cilium/templates/cilium-bgp-cluster-config.yaml @@ -4,9 +4,8 @@ # name: cilium-bgp # namespace: {{ .Release.Namespace }} # labels: -# app.kubernetes.io/name: {{ .Template.Name }} -# app.kubernetes.io/instance: {{ .Release.Name }} -# app.kubernetes.io/part-of: {{ .Release.Name }} +# app.kubernetes.io/name: cilium-bgp +# {{- include "cilium.labels" . | nindent 4 }} # spec: # nodeSelector: # matchLabels: diff --git a/clusters/cl01tl/helm/cilium/templates/cilium-bgp-peer-config.yaml b/clusters/cl01tl/helm/cilium/templates/cilium-bgp-peer-config.yaml index bc2200e01..a9fbb4d0d 100644 --- a/clusters/cl01tl/helm/cilium/templates/cilium-bgp-peer-config.yaml +++ b/clusters/cl01tl/helm/cilium/templates/cilium-bgp-peer-config.yaml @@ -4,9 +4,8 @@ # name: cilium-peer # namespace: {{ .Release.Namespace }} # labels: -# app.kubernetes.io/name: {{ .Template.Name }} -# app.kubernetes.io/instance: {{ .Release.Name }} -# app.kubernetes.io/part-of: {{ .Release.Name }} +# app.kubernetes.io/name: cilium-peer +# {{- include "cilium.labels" . | nindent 4 }} # spec: # timers: # holdTimeSeconds: 9 diff --git a/clusters/cl01tl/helm/cilium/templates/cilium-load-balancer-ip-pool.yaml b/clusters/cl01tl/helm/cilium/templates/cilium-load-balancer-ip-pool.yaml index e4b522773..a3b8a2917 100644 --- a/clusters/cl01tl/helm/cilium/templates/cilium-load-balancer-ip-pool.yaml +++ b/clusters/cl01tl/helm/cilium/templates/cilium-load-balancer-ip-pool.yaml @@ -4,9 +4,8 @@ metadata: name: default-ip-pool namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: default-ip-pool + {{- include "cilium.labels" . | nindent 4 }} spec: blocks: - start: "10.232.1.21" @@ -19,9 +18,8 @@ metadata: name: bgp-ip-pool namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: bgp-ip-pool + {{- include "cilium.labels" . | nindent 4 }} spec: blocks: - start: "10.232.2.100" diff --git a/clusters/cl01tl/helm/cilium/templates/gateway.yaml b/clusters/cl01tl/helm/cilium/templates/gateway.yaml index 149a03974..75954e77f 100644 --- a/clusters/cl01tl/helm/cilium/templates/gateway.yaml +++ b/clusters/cl01tl/helm/cilium/templates/gateway.yaml @@ -4,9 +4,8 @@ # name: cilium-tls-gateway # namespace: {{ .Release.Namespace }} # labels: -# app.kubernetes.io/name: {{ .Template.Name }} -# app.kubernetes.io/instance: {{ .Release.Name }} -# app.kubernetes.io/part-of: {{ .Release.Name }} +# app.kubernetes.io/name: cilium-tls-gateway +# {{- include "cilium.labels" . | nindent 4 }} # annotations: # cert-manager.io/cluster-issuer: letsencrypt-issuer # spec: diff --git a/clusters/cl01tl/helm/cilium/templates/http-route.yaml b/clusters/cl01tl/helm/cilium/templates/http-route.yaml index 8c7d8a845..f2e951592 100644 --- a/clusters/cl01tl/helm/cilium/templates/http-route.yaml +++ b/clusters/cl01tl/helm/cilium/templates/http-route.yaml @@ -4,9 +4,8 @@ metadata: name: hubble namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: hubble + {{- include "cilium.labels" . | nindent 4 }} spec: parentRefs: - group: gateway.networking.k8s.io diff --git a/clusters/cl01tl/helm/dawarich/templates/_helpers.tpl b/clusters/cl01tl/helm/dawarich/templates/_helpers.tpl new file mode 100644 index 000000000..fd1b5cc89 --- /dev/null +++ b/clusters/cl01tl/helm/dawarich/templates/_helpers.tpl @@ -0,0 +1,14 @@ +{{/* +Common labels +*/}} +{{- define "dawarich.labels" -}} +{{ include "dawarich.selectorLabels" $ }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "dawarich.selectorLabels" -}} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/part-of: {{ .Release.Name }} +{{- end }} diff --git a/clusters/cl01tl/helm/dawarich/templates/external-secret.yaml b/clusters/cl01tl/helm/dawarich/templates/external-secret.yaml index c5be43732..924a8baa5 100644 --- a/clusters/cl01tl/helm/dawarich/templates/external-secret.yaml +++ b/clusters/cl01tl/helm/dawarich/templates/external-secret.yaml @@ -4,9 +4,8 @@ metadata: name: dawarich-key namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: dawarich-key + {{- include "dawarich.labels" . | nindent 4 }} spec: secretStoreRef: kind: ClusterSecretStore @@ -24,9 +23,8 @@ metadata: name: dawarich-oidc-authentik namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Template.Name }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/part-of: {{ .Release.Name }} + app.kubernetes.io/name: dawarich-oidc-authentik + {{- include "dawarich.labels" . | nindent 4 }} spec: secretStoreRef: kind: ClusterSecretStore