feat: allow common.metadata
to be extended
This commit is contained in:
@ -3,7 +3,8 @@
|
||||
{{- define "common.configMap.tpl" -}}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
{{ include "common.metadata" . }}
|
||||
metadata:
|
||||
{{ include "common.metadata" . | nindent 2 }}
|
||||
data: {}
|
||||
{{- end -}}
|
||||
|
||||
|
@ -4,7 +4,8 @@
|
||||
{{- $autoscaling := .Values.autoscaling | default (dict) -}}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
{{ include "common.metadata" . }}
|
||||
metadata:
|
||||
{{ include "common.metadata" . | nindent 2 }}
|
||||
spec:
|
||||
{{- if not $autoscaling.enabled }}
|
||||
replicas: {{ .Values.replicaCount | default 1 }}
|
||||
|
@ -3,7 +3,8 @@
|
||||
{{- define "common.hpa.tpl" -}}
|
||||
apiVersion: autoscaling/v2beta2
|
||||
kind: HorizontalPodAutoscaler
|
||||
{{ include "common.metadata" . }}
|
||||
metadata:
|
||||
{{ include "common.metadata" . | nindent 2 }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
|
@ -1,5 +1,12 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
|
||||
{{- define "common.ingress.metadata" -}}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "common.ingress.tpl" -}}
|
||||
{{- $fullName := include "common.fullname" . -}}
|
||||
{{- $svcPort := .Values.service.port -}}
|
||||
@ -9,11 +16,8 @@ apiVersion: networking.k8s.io/v1beta1
|
||||
apiVersion: extensions/v1beta1
|
||||
{{- end }}
|
||||
kind: Ingress
|
||||
{{ include "common.metadata" . }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
metadata:
|
||||
{{ include "common.metadata" (list . "common.ingress.metadata") | nindent 2 }}
|
||||
spec:
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
|
@ -20,12 +20,15 @@ app.kubernetes.io/name: {{ include "common.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{ define "common.metadata.tpl" -}}
|
||||
name: {{ include "common.fullname" . }}
|
||||
labels:
|
||||
{{- include "common.labels" . | nindent 2 -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /*
|
||||
Create a standard metadata header
|
||||
*/ -}}
|
||||
{{ define "common.metadata" -}}
|
||||
metadata:
|
||||
name: {{ include "common.fullname" . }}
|
||||
labels:
|
||||
{{- include "common.labels" . | nindent 4 -}}
|
||||
{{- include "common.utils.flattenCall" (list "common.utils.merge" . "common.metadata.tpl") -}}
|
||||
{{- end -}}
|
||||
|
@ -3,7 +3,8 @@
|
||||
{{- define "common.pdb.tpl" -}}
|
||||
apiVersion: policy/v1beta1
|
||||
kind: PodDisruptionBudget
|
||||
{{ include "common.metadata" . }}
|
||||
metadata:
|
||||
{{ include "common.metadata" . | nindent 2 }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
|
@ -3,7 +3,8 @@
|
||||
{{- define "common.secret.tpl" -}}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
{{ include "common.metadata" . }}
|
||||
metadata:
|
||||
{{ include "common.metadata" . | nindent 2 }}
|
||||
type: Opaque
|
||||
data: {}
|
||||
{{- end -}}
|
||||
|
@ -3,7 +3,8 @@
|
||||
{{- define "common.service.tpl" -}}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
{{ include "common.metadata" . }}
|
||||
metadata:
|
||||
{{ include "common.metadata" . | nindent 2 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
|
@ -1,16 +1,18 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
|
||||
{{- define "common.serviceAccount.metadata" -}}
|
||||
name: {{ include "common.serviceAccountName" . }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "common.serviceAccount.tpl" -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "common.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "common.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{ include "common.metadata" (list . "common.serviceAccount.metadata") | nindent 2 }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "common.serviceAccount.if" -}}
|
||||
|
Reference in New Issue
Block a user