Verified Commit 07e58abc authored by Hugo's avatar Hugo
Browse files

add standards labels

parent a02048ca
{{- define "hedgedoc.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- define "hedgedoc.labels" -}}
helm.sh/chart: {{ include "hedgedoc.chart" . }}
{{ include "hedgedoc.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{- define "hedgedoc.selectorLabels" -}}
app.kubernetes.io/name: {{ .Chart.Name | trunc 63 | trimSuffix "-" }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- define "configName" -}}
{{ tpl .Values.fqdn . }}-config
{{- end -}}
......
......@@ -2,6 +2,8 @@ kind: ConfigMap
apiVersion: v1
metadata:
name: {{ tpl .Values.fqdn . }}-file
labels:
{{- include "hedgedoc.labels" . | nindent 4 }}
data:
config.json: |-
{
......
kind: ConfigMap
metadata:
name: {{ template "configName" . }}
labels:
{{- include "hedgedoc.labels" . | nindent 4 }}
apiVersion: v1
data:
{{- if .Values.oauth.enabled }}
......
......@@ -2,19 +2,13 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: app
app.kubernetes.io/instance: {{ tpl .Values.fqdn . }}
app.kubernetes.io/name: hedgedoc
app.kubernetes.io/part-of: hedgedoc
{{- include "hedgedoc.selectorLabels" . | nindent 4 }}
name: {{ tpl .Values.fqdn . }}-app
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/instance: {{ tpl .Values.fqdn . }}
app.kubernetes.io/name: hedgedoc
app.kubernetes.io/part-of: hedgedoc
{{- include "hedgedoc.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
......@@ -22,10 +16,7 @@ spec:
checksum/configfile: {{ include (print $.Template.BasePath "/configfile.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
labels:
app.kubernetes.io/component: app
app.kubernetes.io/instance: {{ tpl .Values.fqdn . }}
app.kubernetes.io/name: hedgedoc
app.kubernetes.io/part-of: hedgedoc
{{- include "hedgedoc.selectorLabels" . | nindent 8 }}
spec:
volumes:
- name: config
......
......@@ -5,10 +5,7 @@ metadata:
annotations:
kubernetes.io/tls-acme: "true"
labels:
app.kubernetes.io/component: app
app.kubernetes.io/instance: {{ tpl .Values.fqdn . }}
app.kubernetes.io/name: hedgedoc
app.kubernetes.io/part-of: hedgedoc
{{- include "hedgedoc.labels" . | nindent 4 }}
name: {{ tpl .Values.fqdn . }}-app
spec:
rules:
......
......@@ -5,10 +5,7 @@ metadata:
annotations:
kubernetes.io/tls-acme: "true"
labels:
app.kubernetes.io/component: app
app.kubernetes.io/instance: {{ tpl .Values.fqdn . }}
app.kubernetes.io/name: hedgedoc
app.kubernetes.io/part-of: hedgedoc
{{- include "hedgedoc.labels" . | nindent 4 }}
name: {{ tpl .Values.fqdn . }}-app
spec:
rules:
......
......@@ -7,6 +7,8 @@ apiVersion: batch/v1
kind: Job
metadata:
name: {{ tpl .Values.fqdn . }}-migrate-domain
labels:
{{- include "hedgedoc.labels" . | nindent 4 }}
spec:
template:
spec:
......
......@@ -5,6 +5,8 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ template "secretName" . }}
labels:
{{- include "hedgedoc.labels" . | nindent 4 }}
type: Opaque
stringData:
{{- if $pgSecret.data }}
......
......@@ -2,10 +2,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: app
app.kubernetes.io/instance: {{ tpl .Values.fqdn . }}
app.kubernetes.io/name: hedgedoc
app.kubernetes.io/part-of: hedgedoc
{{- include "hedgedoc.labels" . | nindent 4 }}
name: {{ tpl .Values.fqdn . }}-app
spec:
ports:
......@@ -14,8 +11,5 @@ spec:
protocol: TCP
targetPort: http
selector:
app.kubernetes.io/component: app
app.kubernetes.io/instance: {{ tpl .Values.fqdn . }}
app.kubernetes.io/name: hedgedoc
app.kubernetes.io/part-of: hedgedoc
{{- include "hedgedoc.selectorLabels" . | nindent 4 }}
type: ClusterIP
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment