From b6a51fb57fc4ea0ac3c00b93a30e7a34cb37cc01 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Mon, 11 Jun 2018 21:47:29 -0500 Subject: [PATCH] Use current kubernetes API version This PS moves to use the current API version for kubernetes rcs' that were previously using `apps/v1beta1`. Story: 2002205 Task: 21735 Change-Id: Icb4e7aa2392da6867427a58926be2da6f424bd56 Signed-off-by: Pete Birley --- elasticsearch/templates/statefulset-data.yaml | 7 ++++++- ldap/templates/statefulset.yaml | 7 ++++++- nfs-provisioner/templates/deployment.yaml | 7 ++++++- prometheus-alertmanager/templates/statefulset.yaml | 7 ++++++- prometheus/templates/statefulset.yaml | 7 ++++++- redis/templates/deployment.yaml | 7 ++++++- registry/templates/deployment-registry.yaml | 7 ++++++- 7 files changed, 42 insertions(+), 7 deletions(-) diff --git a/elasticsearch/templates/statefulset-data.yaml b/elasticsearch/templates/statefulset-data.yaml index 0030ca7a0..240732ae3 100644 --- a/elasticsearch/templates/statefulset-data.yaml +++ b/elasticsearch/templates/statefulset-data.yaml @@ -57,13 +57,18 @@ rules: verbs: - get --- -apiVersion: apps/v1beta1 +apiVersion: apps/v1 kind: StatefulSet metadata: name: elasticsearch-data + labels: +{{ tuple $envAll "elasticsearch" "data" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: serviceName: {{ tuple "elasticsearch" "data" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }} replicas: {{ .Values.pod.replicas.data }} + selector: + matchLabels: +{{ tuple $envAll "elasticsearch" "data" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} template: metadata: labels: diff --git a/ldap/templates/statefulset.yaml b/ldap/templates/statefulset.yaml index e96c489b7..95bcbca11 100644 --- a/ldap/templates/statefulset.yaml +++ b/ldap/templates/statefulset.yaml @@ -20,13 +20,18 @@ limitations under the License. {{- $serviceAccountName := "ldap" }} {{ tuple $envAll "ldap" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- -apiVersion: apps/v1beta1 +apiVersion: apps/v1 kind: StatefulSet metadata: name: ldap + labels: +{{ tuple $envAll "ldap" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: serviceName: {{ tuple "ldap" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }} replicas: {{ .Values.pod.replicas.server }} + selector: + matchLabels: +{{ tuple $envAll "ldap" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} template: metadata: labels: diff --git a/nfs-provisioner/templates/deployment.yaml b/nfs-provisioner/templates/deployment.yaml index a642d589d..a53aa25b4 100644 --- a/nfs-provisioner/templates/deployment.yaml +++ b/nfs-provisioner/templates/deployment.yaml @@ -92,13 +92,18 @@ roleRef: apiGroup: rbac.authorization.k8s.io --- kind: Deployment -apiVersion: apps/v1beta1 +apiVersion: apps/v1 metadata: name: nfs-provisioner + labels: +{{ tuple $envAll "nfs" "provisioner" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.server }} strategy: type: Recreate + selector: + matchLabels: +{{ tuple $envAll "nfs" "provisioner" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} template: metadata: labels: diff --git a/prometheus-alertmanager/templates/statefulset.yaml b/prometheus-alertmanager/templates/statefulset.yaml index dfbf33f17..7d009be68 100644 --- a/prometheus-alertmanager/templates/statefulset.yaml +++ b/prometheus-alertmanager/templates/statefulset.yaml @@ -23,13 +23,18 @@ limitations under the License. {{- $serviceAccountName := "alertmanager"}} {{ tuple $envAll "alertmanager" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- -apiVersion: apps/v1beta1 +apiVersion: apps/v1 kind: StatefulSet metadata: name: alertmanager + labels: +{{ tuple $envAll "alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: serviceName: {{ tuple "alerts" "discovery" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }} replicas: {{ .Values.pod.replicas.alertmanager }} + selector: + matchLabels: +{{ tuple $envAll "alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} template: metadata: labels: diff --git a/prometheus/templates/statefulset.yaml b/prometheus/templates/statefulset.yaml index 407a01fc8..cc381dc44 100644 --- a/prometheus/templates/statefulset.yaml +++ b/prometheus/templates/statefulset.yaml @@ -64,13 +64,18 @@ roleRef: name: {{ $serviceAccountName }} apiGroup: rbac.authorization.k8s.io --- -apiVersion: apps/v1beta1 +apiVersion: apps/v1 kind: StatefulSet metadata: name: prometheus + labels: +{{ tuple $envAll "prometheus" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: serviceName: {{ tuple "monitoring" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }} replicas: {{ .Values.pod.replicas.prometheus }} + selector: + matchLabels: +{{ tuple $envAll "prometheus" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} template: metadata: labels: diff --git a/redis/templates/deployment.yaml b/redis/templates/deployment.yaml index 349912ce5..2ecb6d567 100644 --- a/redis/templates/deployment.yaml +++ b/redis/templates/deployment.yaml @@ -20,12 +20,17 @@ limitations under the License. {{- $serviceAccountName := "redis"}} {{ tuple $envAll "redis" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- -apiVersion: apps/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: redis + labels: +{{ tuple $envAll "redis" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.server }} + selector: + matchLabels: +{{ tuple $envAll "redis" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: diff --git a/registry/templates/deployment-registry.yaml b/registry/templates/deployment-registry.yaml index f8d6dac3e..fd0c078b2 100644 --- a/registry/templates/deployment-registry.yaml +++ b/registry/templates/deployment-registry.yaml @@ -20,12 +20,17 @@ limitations under the License. {{- $serviceAccountName := "docker-registry"}} {{ tuple $envAll "registry" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- -apiVersion: apps/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: docker-registry + labels: +{{ tuple $envAll "docker" "registry" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.registry }} + selector: + matchLabels: +{{ tuple $envAll "docker" "registry" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: