From bf0a444a8a18ab208eb55297ab1fe795d8597dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Prud=27homme?= Date: Fri, 17 May 2019 01:16:29 +0200 Subject: [PATCH] [stable/chaoskube] Fix labels (#13848) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Prud'homme --- stable/chaoskube/Chart.yaml | 2 +- stable/chaoskube/templates/NOTES.txt | 2 +- stable/chaoskube/templates/_helpers.tpl | 14 ++++---------- stable/chaoskube/templates/deployment.yaml | 4 ++-- stable/chaoskube/values.yaml | 2 +- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/stable/chaoskube/Chart.yaml b/stable/chaoskube/Chart.yaml index 81d45a9f3b..c22b1761bc 100755 --- a/stable/chaoskube/Chart.yaml +++ b/stable/chaoskube/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: chaoskube -version: 1.1.0 +version: 2.0.0 appVersion: 0.13.0 description: Chaoskube periodically kills random pods in your Kubernetes cluster. icon: https://raw.githubusercontent.com/linki/chaoskube/master/chaoskube.png diff --git a/stable/chaoskube/templates/NOTES.txt b/stable/chaoskube/templates/NOTES.txt index 1e9fc3bed9..9ec1418f0a 100644 --- a/stable/chaoskube/templates/NOTES.txt +++ b/stable/chaoskube/templates/NOTES.txt @@ -2,7 +2,7 @@ chaoskube is running and will kill arbitrary pods every {{ .Values.interval }}. You can follow the logs to see what chaoskube does: - POD=$(kubectl -n {{ .Release.Namespace }} get pods -l='release={{ template "chaoskube.fullname" . }}' --output=jsonpath='{.items[0].metadata.name}') + POD=$(kubectl -n {{ .Release.Namespace }} get pods -l='app.kubernetes.io/instance={{ template "chaoskube.fullname" . }}' --output=jsonpath='{.items[0].metadata.name}') kubectl -n {{ .Release.Namespace }} logs -f $POD {{ if .Values.dryRun }} You are running in dry-run mode. No pod is actually terminated. diff --git a/stable/chaoskube/templates/_helpers.tpl b/stable/chaoskube/templates/_helpers.tpl index ced36d7cf7..15fc3d631c 100644 --- a/stable/chaoskube/templates/_helpers.tpl +++ b/stable/chaoskube/templates/_helpers.tpl @@ -31,15 +31,9 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{- /* -Credit: @technosophos -https://github.com/technosophos/common-chart/ -labels.standard prints the standard Helm labels. -The standard labels are frequently used in metadata. -*/ -}} {{- define "labels.standard" -}} -app: {{ include "chaoskube.name" . }} -heritage: {{ .Release.Service | quote }} -release: {{ .Release.Name | quote }} -chart: {{ include "chaoskube.chart" . }} +app.kubernetes.io/name: {{ include "chaoskube.name" . }} +app.kubernetes.io/managed-by: {{ .Release.Service | quote }} +app.kubernetes.io/instance: {{ .Release.Name | quote }} +helm.sh/chart: {{ include "chaoskube.chart" . }} {{- end -}} diff --git a/stable/chaoskube/templates/deployment.yaml b/stable/chaoskube/templates/deployment.yaml index e64e0ae46a..1ad219e5ad 100644 --- a/stable/chaoskube/templates/deployment.yaml +++ b/stable/chaoskube/templates/deployment.yaml @@ -12,8 +12,8 @@ spec: replicas: {{ .Values.replicas }} selector: matchLabels: - app: {{ include "chaoskube.name" . }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ include "chaoskube.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: labels: diff --git a/stable/chaoskube/values.yaml b/stable/chaoskube/values.yaml index 8d6e07bc02..6da7384ea3 100644 --- a/stable/chaoskube/values.yaml +++ b/stable/chaoskube/values.yaml @@ -84,7 +84,7 @@ affinity: {} # - topologyKey: "kubernetes.io/hostname" # labelSelector: # matchLabels: - # app: chaoskube + # app.kubernetes.io/name: chaoskube podAnnotations: {} ## Annotations for the chaoskube pod.