From 8c55fdd1dc3f78e32d7214353f09dd67831de216 Mon Sep 17 00:00:00 2001 From: Andreas Geissler Date: Thu, 20 Jul 2023 11:15:42 +0200 Subject: [COMMON] Add missing labels for etcd, mongo, postgres Add labels for DB deployments to be compliant with Istio and kiali requirements Issue-ID: OOM-3230 Change-Id: I937d9f326dae8e2c2496eace2e919aa0b8eb0171 Signed-off-by: Andreas Geissler --- kubernetes/common/mongo/templates/service.yaml | 10 +++++----- kubernetes/common/mongo/templates/statefulset.yaml | 21 +++++---------------- 2 files changed, 10 insertions(+), 21 deletions(-) (limited to 'kubernetes/common/mongo/templates') diff --git a/kubernetes/common/mongo/templates/service.yaml b/kubernetes/common/mongo/templates/service.yaml index e8894c2b59..2be00a32e4 100644 --- a/kubernetes/common/mongo/templates/service.yaml +++ b/kubernetes/common/mongo/templates/service.yaml @@ -29,8 +29,8 @@ spec: - port: {{ .Values.service.internalPort }} name: {{ .Values.service.portName }} selector: - app: {{ include "common.name" . }} - release: {{ include "common.release" . }} + app.kubernetes.io/name: {{ include "common.name" . }} + app.kubernetes.io/instance: {{ include "common.release" . }} clusterIP: None --- # Client service for connecting to any Mongo instance for reads. @@ -46,8 +46,8 @@ spec: - port: {{ .Values.service.internalPort }} name: {{ .Values.service.portName }} selector: - app: {{ include "common.name" . }} - release: {{ include "common.release" . }} + app.kubernetes.io/name: {{ include "common.name" . }} + app.kubernetes.io/instance: {{ include "common.release" . }} --- {{ if .Values.geoEnabled }} apiVersion: v1 @@ -70,5 +70,5 @@ spec: type: NodePort selector: statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-0 - release: {{ include "common.release" . }} + app.kubernetes.io/instance: {{ include "common.release" . }} {{ end }} diff --git a/kubernetes/common/mongo/templates/statefulset.yaml b/kubernetes/common/mongo/templates/statefulset.yaml index e156db27db..fc06663029 100644 --- a/kubernetes/common/mongo/templates/statefulset.yaml +++ b/kubernetes/common/mongo/templates/statefulset.yaml @@ -16,25 +16,13 @@ apiVersion: apps/v1 kind: StatefulSet -metadata: - name: {{ include "common.fullname" . }} - namespace: {{ include "common.namespace" . }} - labels: - app: {{ include "common.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ include "common.release" . }} - heritage: {{ .Release.Service }} +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: - serviceName: {{ .Values.service.name }} + selector: {{- include "common.selectors" . | nindent 4 }} + serviceName: {{ include "common.servicename" . }} replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app: {{ include "common.name" . }} template: - metadata: - labels: - app: {{ include "common.name" . }} - release: {{ include "common.release" . }} + metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: {{ include "common.podSecurityContext" . | indent 6 }} imagePullSecrets: @@ -69,6 +57,7 @@ spec: value: "{{ .Values.config.dbName }}" ports: - containerPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.portName }} # disable liveness probe when breakpoints set in debugger # so K8s doesn't restart unresponsive container {{- if eq .Values.liveness.enabled true }} -- cgit 1.2.3-korg