Skip to content

Commit

Permalink
fix up labels
Browse files Browse the repository at this point in the history
  • Loading branch information
kalinon committed Mar 29, 2023
1 parent 89a1c93 commit 598040a
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 41 deletions.
4 changes: 2 additions & 2 deletions charts/app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ maintainers:
- name: Holden Omans
email: [email protected]
# Please make sure that version and appVersion are always the same.
version: 0.1.12
appVersion: 0.1.12
version: 0.1.13
appVersion: 0.1.13
10 changes: 9 additions & 1 deletion charts/app/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,19 @@ Common labels
app.kubernetes.io/name: {{ include "app.name" . }}
helm.sh/chart: {{ include "app.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
kalinon.com/app: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
kalinon.com/group: {{ include "app.name" . }}
kalinon.com/app: {{ .Release.Name }}
{{- if .Values.labels }}
{{- toYaml .Values.labels | nindent 0 }}
{{- end }}
{{- if .Values.istio.enabled }}
app: {{ .Release.Name }}
version: {{ .Chart.Version }}
{{- end }}
{{- end -}}

{{/*
Expand Down
15 changes: 1 addition & 14 deletions charts/app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ metadata:
name: {{ include "app.fullname" . }}
labels:
{{ include "app.labels" . | indent 4 }}
{{- if .Values.labels }}
{{- toYaml .Values.labels | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
{{- if .Values.strategy }}
Expand All @@ -19,17 +16,7 @@ spec:
template:
metadata:
labels:
{{- if .Values.istio.enabled }}
app: {{ .Release.Name }}
version: {{ .Chart.Version }}
{{- end }}
app.kubernetes.io/name: {{ include "app.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
kalinon.com/group: {{ include "app.name" . }}
kalinon.com/app: {{ .Release.Name }}
{{- if .Values.labels }}
{{- toYaml .Values.labels | nindent 8 }}
{{- end }}
{{ include "app.labels" . | indent 8 }}
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 8 }}
Expand Down
3 changes: 0 additions & 3 deletions charts/app/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- if .Values.labels }}
{{- toYaml .Values.labels | nindent 4 }}
{{- end }}
{{ include "app.labels" . | indent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
Expand Down
10 changes: 1 addition & 9 deletions charts/app/templates/istio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ metadata:
name: {{ $fullName }}-cert
namespace: {{ .Values.istio.gateway.namespace }}
labels:
{{- if .Values.labels }}
{{- toYaml .Values.labels | nindent 4 }}
{{- end }}
{{ include "app.labels" . | indent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
Expand All @@ -33,9 +30,6 @@ kind: Gateway
metadata:
name: {{ $fullName }}-gateway
labels:
{{- if .Values.labels }}
{{- toYaml .Values.labels | nindent 4 }}
{{- end }}
{{ include "app.labels" . | indent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
Expand Down Expand Up @@ -63,9 +57,7 @@ kind: VirtualService
metadata:
name: {{ $fullName }}
labels:
{{- if .Values.labels }}
{{- toYaml .Values.labels | nindent 4 }}
{{- end }}
{{ include "app.labels" . | indent 4 }}
spec:
hosts:
{{- range .Values.istio.hosts }}
Expand Down
3 changes: 0 additions & 3 deletions charts/app/templates/pv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ apiVersion: v1
kind: PersistentVolume
metadata:
labels:
{{- if .Values.labels }}
{{- toYaml .Values.labels | nindent 4 }}
{{- end }}
{{ include "app.labels" $root | indent 4 }}
{{- if hasKey . "volumeName" }}
name: {{ .volumeName }}
Expand Down
3 changes: 0 additions & 3 deletions charts/app/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
{{- if .Values.labels }}
{{- toYaml .Values.labels | nindent 4 }}
{{- end }}
{{ include "app.labels" $root | indent 4 }}
name: {{ $root.Release.Name }}-{{ .name | default $index }}-pvc
spec:
Expand Down
3 changes: 0 additions & 3 deletions charts/app/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ metadata:
name: {{ include "app.fullname" . }}
labels:
{{ include "app.labels" . | indent 4 }}
{{- if .Values.labels }}
{{- toYaml .Values.labels | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
Expand Down
3 changes: 0 additions & 3 deletions charts/app/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@ metadata:
name: {{ template "app.serviceAccountName" . }}
labels:
{{ include "app.labels" . | indent 4 }}
{{- if .Values.labels }}
{{- toYaml .Values.labels | nindent 4 }}
{{- end }}
{{- end -}}
1 change: 1 addition & 0 deletions charts/app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,4 @@ istio:
namespace: istio-system
selector:
istio: ingressgateway
# labels: {}

0 comments on commit 598040a

Please sign in to comment.