Added template annotations

This commit is contained in:
Jim Martens 2023-11-08 09:38:09 +01:00
parent fb87d34c96
commit dc6b288dc9
10 changed files with 24 additions and 7 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: template
description: A Helm library chart containing common templates, keeping application templates short
type: library
version: 0.2.3
version: 0.2.4
maintainers:
- name: Jim Martens
url: https://2martens.de
@ -10,10 +10,8 @@ sources:
- https://git.2martens.de/2martens/cloud-configuration
annotations:
artifacthub.io/changes: |
- kind: fixed
description: Reverted path to secret for vault
- kind: fixed
description: Changed namespace for vault secrets app to release namespace
- kind: added
description: Added "template.annotations"
artifacthub.io/signKey: |
fingerprint: F0F153B65BAD467201D7544E47393ABD1F96B7C8
url: https://mafiasi.de/pks/key/47393ABD1F96B7C8.asc

View File

@ -5,6 +5,8 @@ metadata:
name: {{ include "template.fullname" . }}
labels:
{{- include "template.labels" . | nindent 4 }}
annotations:
{{- include "template.annotations" . | nindent 4 }}
spec:
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
{{- if not .Values.autoscaling.enabled }}
@ -24,6 +26,7 @@ spec:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "template.annotations" . | nindent 8 }}
labels:
{{- include "template.selectorLabels" . | nindent 8 }}
spec:

View File

@ -41,6 +41,10 @@ app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | qu
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{- define "template.annotations" -}}
meta.helm.sh/release-name: {{ .Release.Name }}
meta.helm.sh/release-namespace: {{ .Release.Namespace }}
{{- end }}
{{/*
Selector labels

View File

@ -6,6 +6,8 @@ metadata:
name: {{ include "template.fullname" . }}
labels:
{{- include "template.labels" . | nindent 4 }}
annotations:
{{- include "template.annotations" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1

View File

@ -8,10 +8,11 @@ metadata:
name: {{ $fullName }}
labels:
{{- include "template.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- include "template.annotations" . | nindent 4 }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}

View File

@ -8,6 +8,8 @@ metadata:
labels:
{{- include "template.labels" . | nindent 4 }}
release: {{ .Values.prometheus.releaseName | quote | default "prometheus" }}
annotations:
{{- include "template.annotations" . | nindent 4 }}
spec:
podMetricsEndpoints:
- port: "{{ .Values.application.actuatorPort }}"

View File

@ -6,6 +6,8 @@ metadata:
name: {{ include "template.fullname" . }}
labels:
{{- include "template.labels" . | nindent 4 }}
annotations:
{{- include "template.annotations" . | nindent 4 }}
data:
{{- range $key, $value := .Values.secrets }}
{{ $key }}: {{ $value | b64enc }}

View File

@ -5,6 +5,8 @@ metadata:
name: {{ include "template.fullname" . }}
labels:
{{- include "template.labels" . | nindent 4 }}
annotations:
{{- include "template.annotations" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:

View File

@ -6,9 +6,10 @@ metadata:
name: {{ include "template.serviceAccountName" . }}
labels:
{{- include "template.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- with .Values.serviceAccount.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- include "template.annotations" . | nindent 4 }}
{{- end }}
{{- end }}

View File

@ -7,6 +7,8 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
{{- include "template.labels" . | nindent 4 }}
annotations:
{{- include "template.annotations" . | nindent 4 }}
spec:
appName: {{ .Values.vault.applicationName }}
hcpAuthRef: {{ .Values.vault.operatorNamespace | default "vault-secrets-operator-system" }}/hcp-auth