From 1548d845abe60ac8bf32e7520e1ffb296a00bd01 Mon Sep 17 00:00:00 2001 From: Hemanth Nakkina Date: Tue, 1 Oct 2019 03:06:25 +0530 Subject: [PATCH] Use apps/v1 k8s controllers and add labels Update apiversion for ClusterRole, ClusterRoleBinding to rbac.authorization.k8s.io/v1 Update apiversion for deployment to apps/v1 Add selector match labels to deployment This patch is similar to https://review.opendev.org/#/c/638276/ These changes are required to install armada, tiller helm charts against k8s 1.16.0 Change-Id: Ife08b4af4721c6c49c9c6faadd7fd31aa8700b39 --- charts/armada/templates/deployment-api.yaml | 12 ++++++++---- charts/tiller/templates/deployment-tiller.yaml | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/charts/armada/templates/deployment-api.yaml b/charts/armada/templates/deployment-api.yaml index b1fb57fc..a0ea31c7 100644 --- a/charts/armada/templates/deployment-api.yaml +++ b/charts/armada/templates/deployment-api.yaml @@ -16,13 +16,14 @@ limitations under the License. {{- if .Values.manifests.deployment_api }} {{- $envAll := . }} +{{- $labels := tuple $envAll "armada" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" -}} {{- $mounts_armada_api := .Values.pod.mounts.armada_api.armada_api }} {{- $mounts_armada_api_init := .Values.pod.mounts.armada_api.init_container }} {{- $prometheus_annotations := $envAll.Values.monitoring.prometheus.armada }} {{- $serviceAccountName := "armada-api" }} {{ tuple $envAll "api" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: armada-api-runner @@ -40,7 +41,7 @@ rules: - list - watch --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: run-armada-api @@ -66,7 +67,7 @@ subjects: name: {{ $serviceAccountName }} namespace: {{ .Release.Namespace }} --- -apiVersion: apps/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: armada-api @@ -74,11 +75,14 @@ metadata: {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.api }} + selector: + matchLabels: +{{ $labels | indent 6 }} {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: -{{ tuple $envAll "armada" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} +{{ $labels | indent 8 }} annotations: {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} diff --git a/charts/tiller/templates/deployment-tiller.yaml b/charts/tiller/templates/deployment-tiller.yaml index e32ab919..f5f8f27c 100644 --- a/charts/tiller/templates/deployment-tiller.yaml +++ b/charts/tiller/templates/deployment-tiller.yaml @@ -19,7 +19,7 @@ limitations under the License. {{- $serviceAccountName := "tiller-deploy" }} {{ tuple $envAll "tiller_deploy" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: run-tiller @@ -32,7 +32,7 @@ subjects: name: {{ $serviceAccountName }} namespace: {{ .Release.Namespace }} --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: labels: