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
This commit is contained in:
Hemanth Nakkina 2019-10-01 03:06:25 +05:30
parent 027b4a0832
commit 1548d845ab
2 changed files with 10 additions and 6 deletions

View File

@ -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" }}

View File

@ -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: