diff --git a/charts/litmus-core/Chart.yaml b/charts/litmus-core/Chart.yaml index 81e102aa..6f0ce5c1 100644 --- a/charts/litmus-core/Chart.yaml +++ b/charts/litmus-core/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "3.11.0" description: A Helm chart to install litmus infra components on Kubernetes name: litmus-core -version: 3.11.0 +version: 3.11.1 home: https://litmuschaos.io sources: - https://github.com/litmuschaos/litmus diff --git a/charts/litmus-core/README.md b/charts/litmus-core/README.md index e5970ef6..1f4b086e 100644 --- a/charts/litmus-core/README.md +++ b/charts/litmus-core/README.md @@ -1,6 +1,6 @@ # litmus-core -![Version: 3.11.0](https://img.shields.io/badge/Version-3.11.0-informational?style=flat-square) ![AppVersion: 3.11.0](https://img.shields.io/badge/AppVersion-3.11.0-informational?style=flat-square) +![Version: 3.11.1](https://img.shields.io/badge/Version-3.11.1-informational?style=flat-square) ![AppVersion: 3.11.0](https://img.shields.io/badge/AppVersion-3.11.0-informational?style=flat-square) A Helm chart to install litmus infra components on Kubernetes diff --git a/charts/litmus-core/templates/_helpers.tpl b/charts/litmus-core/templates/_helpers.tpl index a2d2703b..37e23a3a 100644 --- a/charts/litmus-core/templates/_helpers.tpl +++ b/charts/litmus-core/templates/_helpers.tpl @@ -31,12 +31,10 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{/* Generate basic labels */}} -{{- define "litmus.labels" }} +{{/* Generate common labels */}} +{{- define "litmus.commonLabels" }} app.kubernetes.io/component: litmus-infra -app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} -app.kubernetes.io/name: {{ template "litmus.name" . }} app.kubernetes.io/part-of: {{ template "litmus.name" . }} app.kubernetes.io/version: "{{ .Chart.Version }}" helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} @@ -46,10 +44,28 @@ litmuschaos.io/version: {{ .Chart.AppVersion }} {{- end }} {{- end }} -{{/* -Specify default selectors -*/}} -{{- define "litmus.selectors" }} +{{/* Generate chaos-operator labels*/}} +{{- define "litmus.operatorLabels" }} +{{ include "litmus.commonLabels" . }} +{{ include "litmus.operatorSelectors" . }} +{{- end }} + +{{/* Chaos operator selectors labels */}} +{{- define "litmus.operatorSelectors" }} +app: {{ template "litmus.name" . }} app.kubernetes.io/name: {{ template "litmus.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* Generate chaos-exporter labels*/}} +{{- define "litmus.exporterLabels" }} +{{ include "litmus.commonLabels" . }} +{{ include "litmus.exporterSelectors" . }} +{{- end }} + +{{/* Chaos exporter selectors labels */}} +{{- define "litmus.exporterSelectors" }} +app: {{ template "litmus.name" . }} +app.kubernetes.io/name: {{ template "litmus.name" . }}-monitor +app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} \ No newline at end of file diff --git a/charts/litmus-core/templates/clusterrole.yaml b/charts/litmus-core/templates/clusterrole.yaml index 6d495d3d..99e7864f 100644 --- a/charts/litmus-core/templates/clusterrole.yaml +++ b/charts/litmus-core/templates/clusterrole.yaml @@ -5,8 +5,7 @@ kind: ClusterRole metadata: name: {{ include "litmus.fullname" . }} labels: - app: {{ template "litmus.name" . }} - {{- include "litmus.labels" . | indent 4 }} + {{- include "litmus.operatorLabels" . | indent 4 }} rules: - apiGroups: [""] resources: ["replicationcontrollers","secrets"] @@ -46,8 +45,7 @@ kind: ClusterRole metadata: name: {{ include "litmus.fullname" . }}-admin labels: - app: {{ template "litmus.name" . }} - {{- include "litmus.labels" . | indent 4 }} + {{- include "litmus.operatorLabels" . | indent 4 }} rules: - apiGroups: [""] resources: ["pods","pods/exec","pods/eviction","events"] diff --git a/charts/litmus-core/templates/clusterrolebinding.yaml b/charts/litmus-core/templates/clusterrolebinding.yaml index 01dad305..e696b2a2 100644 --- a/charts/litmus-core/templates/clusterrolebinding.yaml +++ b/charts/litmus-core/templates/clusterrolebinding.yaml @@ -5,8 +5,7 @@ kind: ClusterRoleBinding metadata: name: {{ include "litmus.fullname" . }} labels: - app: {{ template "litmus.name" . }} - {{- include "litmus.labels" . | indent 4 }} + {{- include "litmus.operatorLabels" . | indent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -23,8 +22,7 @@ kind: ClusterRoleBinding metadata: name: {{ include "litmus.fullname" . }}-admin labels: - app: {{ template "litmus.name" . }} - {{- include "litmus.labels" . | indent 4 }} + {{- include "litmus.operatorLabels" . | indent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/charts/litmus-core/templates/deployment.yaml b/charts/litmus-core/templates/deployment.yaml index 1e749f15..29be746d 100644 --- a/charts/litmus-core/templates/deployment.yaml +++ b/charts/litmus-core/templates/deployment.yaml @@ -4,19 +4,16 @@ metadata: name: {{ include "litmus.fullname" . }} namespace: {{ .Release.Namespace }} labels: - app: {{ template "litmus.name" . }} - {{- include "litmus.labels" . | indent 4 }} + {{- include "litmus.operatorLabels" . | indent 4 }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: - app: {{ template "litmus.name" . }} - {{- include "litmus.selectors" . | indent 6 }} + {{- include "litmus.operatorSelectors" . | indent 6 }} template: metadata: labels: - app: {{ template "litmus.name" . }} - {{- include "litmus.labels" . | indent 8 }} + {{- include "litmus.operatorLabels" . | indent 8 }} spec: serviceAccountName: {{ include "litmus.fullname" . }} {{- if .Values.priorityClassName }} diff --git a/charts/litmus-core/templates/exporter-deployment.yaml b/charts/litmus-core/templates/exporter-deployment.yaml index 60081830..f2359170 100644 --- a/charts/litmus-core/templates/exporter-deployment.yaml +++ b/charts/litmus-core/templates/exporter-deployment.yaml @@ -5,8 +5,7 @@ metadata: name: {{ include "litmus.fullname" . }}-monitor namespace: {{ .Release.Namespace }} labels: - app: {{ template "litmus.name" . }} - {{- include "litmus.labels" . | indent 4 }} + {{- include "litmus.exporterLabels" . | indent 4 }} {{- if .Values.exporter.annotations }} annotations: {{- toYaml .Values.exporter.annotations | nindent 4 }} @@ -15,13 +14,11 @@ spec: replicas: 1 selector: matchLabels: - app: {{ template "litmus.name" . }} - {{- include "litmus.selectors" . | indent 6 }} + {{- include "litmus.exporterSelectors" . | indent 6 }} template: metadata: labels: - app: {{ template "litmus.name" . }} - {{- include "litmus.labels" . | indent 8 }} + {{- include "litmus.exporterLabels" . | indent 8 }} {{- if .Values.exporter.annotations }} annotations: {{- toYaml .Values.exporter.annotations | nindent 10 }} diff --git a/charts/litmus-core/templates/exporter-servicemonitor.yaml b/charts/litmus-core/templates/exporter-servicemonitor.yaml index b756aa4f..ae1d723d 100644 --- a/charts/litmus-core/templates/exporter-servicemonitor.yaml +++ b/charts/litmus-core/templates/exporter-servicemonitor.yaml @@ -7,8 +7,7 @@ metadata: namespace: {{ .Values.exporter.serviceMonitor.namespace }} {{- end }} labels: - app: {{ template "litmus.name" . }} - {{- include "litmus.labels" . | indent 4 }} + {{- include "litmus.exporterLabels" . | indent 4 }} {{- if .Values.exporter.serviceMonitor.additionalLabels }} {{- toYaml .Values.exporter.serviceMonitor.additionalLabels | nindent 4 }} {{- end }} @@ -31,6 +30,5 @@ spec: - {{ .Release.Namespace }} selector: matchLabels: - app: {{ template "litmus.name" . }} - {{- include "litmus.selectors" . | indent 6 }} + {{- include "litmus.exporterSelectors" . | indent 6 }} {{- end }} diff --git a/charts/litmus-core/templates/exporter-svc.yaml b/charts/litmus-core/templates/exporter-svc.yaml index 9a933895..2747a29c 100644 --- a/charts/litmus-core/templates/exporter-svc.yaml +++ b/charts/litmus-core/templates/exporter-svc.yaml @@ -4,8 +4,7 @@ kind: Service metadata: name: {{ include "litmus.name" . }}-monitor labels: - app: {{ template "litmus.name" . }} - {{- include "litmus.labels" . | nindent 4 }} + {{- include "litmus.exporterLabels" . | nindent 4 }} {{- if .Values.exporter.service.annotations }} annotations: {{- toYaml .Values.exporter.service.annotations | nindent 4 }} @@ -18,6 +17,5 @@ spec: targetPort: http type: {{ .Values.exporter.service.type }} selector: - app: {{ template "litmus.name" . }} - {{- include "litmus.selectors" . | nindent 4 }} + {{- include "litmus.exporterSelectors" . | nindent 4 }} {{- end -}} diff --git a/charts/litmus-core/templates/namespaced-role.yaml b/charts/litmus-core/templates/namespaced-role.yaml index 05348a00..5736a9c1 100644 --- a/charts/litmus-core/templates/namespaced-role.yaml +++ b/charts/litmus-core/templates/namespaced-role.yaml @@ -5,8 +5,7 @@ kind: Role metadata: name: {{ include "litmus.fullname" . }} labels: - app: {{ template "litmus.name" . }} - {{- include "litmus.labels" . | indent 4 }} + {{- include "litmus.operatorLabels" . | indent 4 }} rules: - apiGroups: ["","apps","batch","extensions","litmuschaos.io", "argoproj.io"] resources: ["pods","pods/exec","pods/log","pods/eviction","jobs","deployments","daemonsets","statefulsets","events","configmaps","services","rollouts","chaosengines","chaosexperiments","chaosresults"] diff --git a/charts/litmus-core/templates/namespaced-rolebinding.yaml b/charts/litmus-core/templates/namespaced-rolebinding.yaml index 1453f9a3..e0cc88df 100644 --- a/charts/litmus-core/templates/namespaced-rolebinding.yaml +++ b/charts/litmus-core/templates/namespaced-rolebinding.yaml @@ -5,8 +5,7 @@ kind: RoleBinding metadata: name: {{ include "litmus.fullname" . }} labels: - app: {{ template "litmus.name" . }} - {{- include "litmus.labels" . | indent 4 }} + {{- include "litmus.operatorLabels" . | indent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role diff --git a/charts/litmus-core/templates/serviceaccount.yaml b/charts/litmus-core/templates/serviceaccount.yaml index a3b5f836..3af817c4 100644 --- a/charts/litmus-core/templates/serviceaccount.yaml +++ b/charts/litmus-core/templates/serviceaccount.yaml @@ -3,8 +3,7 @@ kind: ServiceAccount metadata: name: {{ include "litmus.fullname" . }} labels: - app: {{ template "litmus.name" . }} - {{- include "litmus.labels" . | indent 4 }} + {{- include "litmus.operatorLabels" . | indent 4 }} {{ if eq .Values.operatorMode "admin" }} --- apiVersion: v1 @@ -12,6 +11,5 @@ kind: ServiceAccount metadata: name: {{ include "litmus.fullname" . }}-admin labels: - app: {{ template "litmus.name" . }} - {{- include "litmus.labels" . | indent 4 }} + {{- include "litmus.operatorLabels" . | indent 4 }} {{ end }}