Skip to content

Commit

Permalink
Update labels to follow best practices
Browse files Browse the repository at this point in the history
  • Loading branch information
isZumpo committed Aug 14, 2024
1 parent 4fc9f38 commit 5eebfa8
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 56 deletions.
9 changes: 5 additions & 4 deletions charts/birdnet-go/templates/configmaps/birdnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ kind: ConfigMap
metadata:
name: {{ template "birdnet-go.fullname" . }}-birdnet
labels:
app: {{ template "birdnet-go.name" . }}
chart: {{ template "birdnet-go.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
app.kubernetes.io/name: {{ template "birdnet-go.name" . }}
helm.sh/chart: {{ template "birdnet-go.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: birdnet-go
data:
config.yaml: |
{{- range .Values.birdnet.config }}
Expand Down
9 changes: 5 additions & 4 deletions charts/birdnet-go/templates/configurations/microphones.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ kind: Configuration
metadata:
name: {{ template "birdnet-go.fullname" $ }}-mic-{{ $microphone.name }}
labels:
app: {{ template "birdnet-go.name" $ }}
chart: {{ template "birdnet-go.chart" $ }}
release: {{ $.Release.Name }}
heritage: {{ $.Release.Service }}
app.kubernetes.io/name: {{ template "birdnet-go.name" $ }}
helm.sh/chart: {{ template "birdnet-go.chart" $ }}
app.kubernetes.io/instance: {{ $.Release.Name }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
app.kubernetes.io/component: rtsp-client
spec:
capacity: 1
discoveryHandler:
Expand Down
25 changes: 15 additions & 10 deletions charts/birdnet-go/templates/deployments/birdnet.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "birdnet-go.fullname" . }}-birdnet
name: {{ template "birdnet-go.fullname" . }}-birdnet-go
labels:
app: {{ template "birdnet-go.name" . }}
chart: {{ template "birdnet-go.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
app.kubernetes.io/name: {{ template "birdnet-go.name" . }}
helm.sh/chart: {{ template "birdnet-go.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: birdnet-go
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "birdnet-go.name" . }}
release: {{ .Release.Name }}
app.kubernetes.io/name: {{ template "birdnet-go.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: birdnet-go
template:
metadata:
labels:
app: {{ template "birdnet-go.name" . }}
release: {{ .Release.Name }}
app.kubernetes.io/name: {{ template "birdnet-go.name" . }}
helm.sh/chart: {{ template "birdnet-go.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: birdnet-go
spec:
containers:
- image: {{ .Values.birdnet.image }}
Expand Down Expand Up @@ -61,4 +66,4 @@ spec:
{{- end }}
- name: config
configMap:
name: {{ template "birdnet-go.fullname" . }}-birdnet
name: {{ template "birdnet-go.fullname" . }}-birdnet-go
21 changes: 13 additions & 8 deletions charts/birdnet-go/templates/deployments/rtsp-clients.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,29 @@ kind: Deployment
metadata:
name: {{ template "birdnet-go.fullname" $ }}-rtsp-client-{{ $microphone.name }}
labels:
app: {{ template "birdnet-go.name" $ }}
chart: {{ template "birdnet-go.chart" $ }}
release: {{ $.Release.Name }}
heritage: {{ $.Release.Service }}
app.kubernetes.io/name: {{ template "birdnet-go.name" $ }}
helm.sh/chart: {{ template "birdnet-go.chart" $ }}
app.kubernetes.io/instance: {{ $.Release.Name }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
app.kubernetes.io/component: rtsp-client
spec:
replicas: {{ $.Values.replicaCount }}
strategy:
type: Recreate # Needed for akri since bound to single USB device
selector:
matchLabels:
app: {{ template "birdnet-go.name" $ }}
release: {{ $.Release.Name }}
app.kubernetes.io/name: {{ template "birdnet-go.name" $ }}
app.kubernetes.io/instance: {{ $.Release.Name }}
app.kubernetes.io/component: rtsp-client
microphone: {{ $microphone.name }}
template:
metadata:
labels:
app: {{ template "birdnet-go.name" $ }}
release: {{ $.Release.Name }}
app.kubernetes.io/name: {{ template "birdnet-go.name" $ }}
helm.sh/chart: {{ template "birdnet-go.chart" $ }}
app.kubernetes.io/instance: {{ $.Release.Name }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
app.kubernetes.io/component: rtsp-client
microphone: {{ $microphone.name }}
spec:
containers:
Expand Down
21 changes: 13 additions & 8 deletions charts/birdnet-go/templates/deployments/rtsp-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@ kind: Deployment
metadata:
name: {{ template "birdnet-go.fullname" . }}-rtsp-server
labels:
app: {{ template "birdnet-go.name" . }}-rtsp-server
chart: {{ template "birdnet-go.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
app.kubernetes.io/name: {{ template "birdnet-go.name" . }}
helm.sh/chart: {{ template "birdnet-go.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: rtsp-server
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "birdnet-go.name" . }}-rtsp-server
release: {{ .Release.Name }}
app.kubernetes.io/name: {{ template "birdnet-go.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: rtsp-server
template:
metadata:
labels:
app: {{ template "birdnet-go.name" . }}-rtsp-server
release: {{ .Release.Name }}
app.kubernetes.io/name: {{ template "birdnet-go.name" . }}
helm.sh/chart: {{ template "birdnet-go.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: rtsp-server
spec:
containers:
- image: {{ .Values.rtsp.server.image }}
Expand Down
11 changes: 6 additions & 5 deletions charts/birdnet-go/templates/ingresses/birdnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ kind: Ingress
metadata:
name: {{ template "birdnet-go.fullname" . }}-birdnet
labels:
app: {{ template "birdnet-go.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
app.kubernetes.io/name: {{ template "birdnet-go.name" . }}
helm.sh/chart: {{ template "birdnet-go.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: birdnet-go
{{- with .Values.birdnet.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -30,7 +31,7 @@ spec:
pathType: ImplementationSpecific
backend:
service:
name: {{ template "birdnet-go.name" . }}
name: {{ template "birdnet-go.name" . }}-birdnet-go
port:
name: http
{{- end }}
Expand Down
11 changes: 5 additions & 6 deletions charts/birdnet-go/templates/pvcs/birdnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ metadata:
{{ toYaml .Values.birdnet.persistentVolumeClaim.annotations | indent 4 }}
{{- end }}
labels:
app: {{ template "birdnet-go.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: "{{ .Values.birdnet.persistentVolumeClaim.name }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "birdnet-go.fullname" . }}
app.kubernetes.io/name: {{ template "birdnet-go.name" . }}
helm.sh/chart: {{ template "birdnet-go.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
name: {{ template "birdnet-go.fullname" . }}-birdnet-go
spec:
accessModes:
{{ toYaml .Values.birdnet.persistentVolumeClaim.accessModes | indent 4 }}
Expand Down
15 changes: 9 additions & 6 deletions charts/birdnet-go/templates/services/birdnet.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "birdnet-go.fullname" . }}-birdnet
name: {{ template "birdnet-go.fullname" . }}-birdnet-go
labels:
app: {{ template "birdnet-go.name" . }}
chart: {{ template "birdnet-go.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
app.kubernetes.io/name: {{ template "birdnet-go.name" . }}
helm.sh/chart: {{ template "birdnet-go.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: birdnet-go
spec:
type: ClusterIP
selector:
app: {{ template "birdnet-go.name" . }}-birdnet
app.kubernetes.io/name: {{ template "birdnet-go.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: birdnet-go
ports:
- name: http
protocol: TCP
Expand Down
13 changes: 8 additions & 5 deletions charts/birdnet-go/templates/services/rtsp-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ kind: Service
metadata:
name: {{ template "birdnet-go.fullname" . }}-rtsp-server
labels:
app: {{ template "birdnet-go.name" . }}-rtsp-server
chart: {{ template "birdnet-go.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
app.kubernetes.io/name: {{ template "birdnet-go.name" . }}
helm.sh/chart: {{ template "birdnet-go.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: rtsp-server
spec:
type: ClusterIP
selector:
app: {{ template "birdnet-go.name" . }}-rtsp-server
app.kubernetes.io/name: {{ template "birdnet-go.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: rtsp-server
ports:
- name: rtsp
protocol: TCP
Expand Down

0 comments on commit 5eebfa8

Please sign in to comment.