From fa629cdbbd787918599977651153f8200062877a Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Mon, 11 Jun 2018 21:58:39 -0500 Subject: [PATCH] Daemonsets: Use current kubernetes daemonset api version This PS moves to use the current ga version for kubernetes daemonsets, additionally any remaining deployments that were using the `extensions/v1beta1` have been updated to `apps/v1`. Story: 2002205 Task: 21735 Change-Id: If9703162dc472af1e6096bf2b9062802fd5ce8ab Signed-off-by: Pete Birley --- calico/templates/daemonset-calico-etcd.yaml | 6 +++++- calico/templates/daemonset-calico-node.yaml | 2 +- calico/templates/deployment-calico-kube-controllers.yaml | 6 +++++- elasticsearch/templates/deployment-client.yaml | 7 ++++++- elasticsearch/templates/deployment-master.yaml | 7 ++++++- .../monitoring/prometheus/exporter-deployment.yaml | 7 ++++++- flannel/templates/daemonset-kube-flannel-ds.yaml | 7 ++++++- fluent-logging/templates/daemonset-fluent-bit.yaml | 7 ++++++- fluent-logging/templates/deployment-fluentd.yaml | 7 ++++++- .../monitoring/prometheus/exporter-deployment.yaml | 7 ++++++- grafana/templates/deployment.yaml | 7 ++++++- kibana/templates/deployment.yaml | 7 ++++++- kube-dns/templates/deployment-kube-dns.yaml | 2 +- kubernetes-keystone-webhook/templates/deployment.yaml | 7 ++++++- nagios/templates/deployment.yaml | 7 ++++++- prometheus-kube-state-metrics/templates/deployment.yaml | 7 ++++++- prometheus-node-exporter/templates/daemonset.yaml | 7 ++++++- prometheus-openstack-exporter/templates/deployment.yaml | 7 ++++++- registry/templates/daemonset-registry-proxy.yaml | 7 ++++++- tiller/templates/deployment-tiller.yaml | 2 +- 20 files changed, 103 insertions(+), 20 deletions(-) diff --git a/calico/templates/daemonset-calico-etcd.yaml b/calico/templates/daemonset-calico-etcd.yaml index 8071f9d89..cdd8f88ab 100644 --- a/calico/templates/daemonset-calico-etcd.yaml +++ b/calico/templates/daemonset-calico-etcd.yaml @@ -23,7 +23,7 @@ limitations under the License. # This manifest installs the Calico etcd on the kubeadm master. This uses a DaemonSet # to force it to run on the master even when the master isn't schedulable, and uses # nodeSelector to ensure it only runs on the master. -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: name: calico-etcd @@ -31,6 +31,10 @@ metadata: k8s-app: calico-etcd {{ tuple $envAll "calico" "etcd" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: + selector: + matchLabels: + k8s-app: calico-etcd +{{ tuple $envAll "calico" "etcd" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} template: metadata: labels: diff --git a/calico/templates/daemonset-calico-node.yaml b/calico/templates/daemonset-calico-node.yaml index b5a23de7a..b4caf1ea8 100644 --- a/calico/templates/daemonset-calico-node.yaml +++ b/calico/templates/daemonset-calico-node.yaml @@ -67,7 +67,7 @@ rules: # as the Calico CNI plugins and network config on # each master and worker node in a Kubernetes cluster. kind: DaemonSet -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 metadata: name: calico-node namespace: kube-system diff --git a/calico/templates/deployment-calico-kube-controllers.yaml b/calico/templates/deployment-calico-kube-controllers.yaml index 7b8cb41cc..f1bb575df 100644 --- a/calico/templates/deployment-calico-kube-controllers.yaml +++ b/calico/templates/deployment-calico-kube-controllers.yaml @@ -52,7 +52,7 @@ rules: --- # This manifest deploys the Calico Kubernetes controllers. # See https://github.com/projectcalico/kube-controllers -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: calico-kube-policy-controllers @@ -63,6 +63,10 @@ metadata: spec: # The controllers can only have a single active instance. replicas: 1 + selector: + matchLabels: + k8s-app: calico-kube-policy-controllers +{{ tuple $envAll "calico" "kube-controller" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} strategy: type: Recreate {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} diff --git a/elasticsearch/templates/deployment-client.yaml b/elasticsearch/templates/deployment-client.yaml index 3ec074708..1706dc867 100644 --- a/elasticsearch/templates/deployment-client.yaml +++ b/elasticsearch/templates/deployment-client.yaml @@ -59,12 +59,17 @@ rules: verbs: - get --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: elasticsearch-client + labels: +{{ tuple $envAll "elasticsearch" "client" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.client }} + selector: + matchLabels: +{{ tuple $envAll "elasticsearch" "client" | 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/elasticsearch/templates/deployment-master.yaml b/elasticsearch/templates/deployment-master.yaml index 5c13ecf06..5af6ef2c8 100644 --- a/elasticsearch/templates/deployment-master.yaml +++ b/elasticsearch/templates/deployment-master.yaml @@ -57,12 +57,17 @@ rules: verbs: - get --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: elasticsearch-master + labels: +{{ tuple $envAll "elasticsearch" "master" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.master }} + selector: + matchLabels: +{{ tuple $envAll "elasticsearch" "master" | 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/elasticsearch/templates/monitoring/prometheus/exporter-deployment.yaml b/elasticsearch/templates/monitoring/prometheus/exporter-deployment.yaml index c0468b40f..cfe666c91 100644 --- a/elasticsearch/templates/monitoring/prometheus/exporter-deployment.yaml +++ b/elasticsearch/templates/monitoring/prometheus/exporter-deployment.yaml @@ -22,12 +22,17 @@ limitations under the License. {{- $serviceAccountName := "prometheus-elasticsearch-exporter" }} {{ tuple $envAll "prometheus_elasticsearch_exporter" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: prometheus-elasticsearch-exporter + labels: +{{ tuple $envAll "elasticsearch" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.prometheus_elasticsearch_exporter }} + selector: + matchLabels: +{{ tuple $envAll "elasticsearch" "exporter" | 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/flannel/templates/daemonset-kube-flannel-ds.yaml b/flannel/templates/daemonset-kube-flannel-ds.yaml index 2fb51bfc2..0c6e274aa 100644 --- a/flannel/templates/daemonset-kube-flannel-ds.yaml +++ b/flannel/templates/daemonset-kube-flannel-ds.yaml @@ -58,7 +58,7 @@ subjects: name: {{ $serviceAccountName }} namespace: {{ .Release.Namespace }} --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: name: kube-flannel-ds @@ -67,6 +67,11 @@ metadata: app: flannel {{ tuple $envAll "flannel" "node" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: + selector: + matchLabels: + tier: node + app: flannel +{{ tuple $envAll "flannel" "node" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} template: metadata: labels: diff --git a/fluent-logging/templates/daemonset-fluent-bit.yaml b/fluent-logging/templates/daemonset-fluent-bit.yaml index c090be92a..a66545e7b 100644 --- a/fluent-logging/templates/daemonset-fluent-bit.yaml +++ b/fluent-logging/templates/daemonset-fluent-bit.yaml @@ -72,11 +72,16 @@ rules: - list - watch --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: name: fluentbit + labels: +{{ tuple $envAll "fluentbit" "daemon" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: + selector: + matchLabels: +{{ tuple $envAll "fluentbit" "daemon" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} {{ tuple $envAll "fluentbit" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }} template: metadata: diff --git a/fluent-logging/templates/deployment-fluentd.yaml b/fluent-logging/templates/deployment-fluentd.yaml index 1ebd13bde..fa1d31023 100644 --- a/fluent-logging/templates/deployment-fluentd.yaml +++ b/fluent-logging/templates/deployment-fluentd.yaml @@ -72,12 +72,17 @@ rules: - list - watch --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: fluentd + labels: +{{ tuple $envAll "fluentd" "internal" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.fluentd }} + selector: + matchLabels: +{{ tuple $envAll "fluentd" "internal" | 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/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml b/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml index f77367d34..031057563 100644 --- a/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml +++ b/fluent-logging/templates/monitoring/prometheus/exporter-deployment.yaml @@ -24,12 +24,17 @@ limitations under the License. {{- $serviceAccountName := "prometheus-fluentd-exporter"}} {{ tuple $envAll "prometheus_fluentd_exporter" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: prometheus-fluentd-exporter + labels: +{{ tuple $envAll "prometheus_fluentd_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.prometheus_fluentd_exporter }} + selector: + matchLabels: +{{ tuple $envAll "prometheus_fluentd_exporter" "exporter" | 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/grafana/templates/deployment.yaml b/grafana/templates/deployment.yaml index 8d0594061..94d2902a3 100644 --- a/grafana/templates/deployment.yaml +++ b/grafana/templates/deployment.yaml @@ -22,12 +22,17 @@ limitations under the License. {{- $serviceAccountName := "grafana" }} {{ tuple $envAll "grafana" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: grafana + labels: +{{ tuple $envAll "grafana" "dashboard" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.grafana }} + selector: + matchLabels: +{{ tuple $envAll "grafana" "dashboard" | 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/kibana/templates/deployment.yaml b/kibana/templates/deployment.yaml index d46d3abb7..24285fc50 100644 --- a/kibana/templates/deployment.yaml +++ b/kibana/templates/deployment.yaml @@ -22,12 +22,17 @@ limitations under the License. {{- $serviceAccountName := "kibana" }} {{ tuple $envAll "kibana" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: kibana + labels: +{{ tuple $envAll "kibana" "dashboard" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.kibana }} + selector: + matchLabels: +{{ tuple $envAll "kibana" "dashboard" | 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/kube-dns/templates/deployment-kube-dns.yaml b/kube-dns/templates/deployment-kube-dns.yaml index d702a64c5..27ff06b81 100644 --- a/kube-dns/templates/deployment-kube-dns.yaml +++ b/kube-dns/templates/deployment-kube-dns.yaml @@ -17,7 +17,7 @@ limitations under the License. {{- if .Values.manifests.deployment_kube_dns }} {{- $envAll := . }} --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: labels: diff --git a/kubernetes-keystone-webhook/templates/deployment.yaml b/kubernetes-keystone-webhook/templates/deployment.yaml index 906574a15..6053e9d18 100644 --- a/kubernetes-keystone-webhook/templates/deployment.yaml +++ b/kubernetes-keystone-webhook/templates/deployment.yaml @@ -17,12 +17,17 @@ limitations under the License. {{- if .Values.manifests.deployment }} {{- $envAll := . }} --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: kubernetes-keystone-webhook + labels: +{{ tuple $envAll "kubernetes-keystone-webhook" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ $envAll.Values.pod.replicas.api }} + selector: + matchLabels: +{{ tuple $envAll "kubernetes-keystone-webhook" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} template: metadata: labels: diff --git a/nagios/templates/deployment.yaml b/nagios/templates/deployment.yaml index 433a3b6b9..c09605607 100644 --- a/nagios/templates/deployment.yaml +++ b/nagios/templates/deployment.yaml @@ -59,12 +59,17 @@ roleRef: name: {{ $serviceAccountName }} apiGroup: rbac.authorization.k8s.io --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: nagios + labels: +{{ tuple $envAll "nagios" "monitoring" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.nagios }} + selector: + matchLabels: +{{ tuple $envAll "nagios" "monitoring" | 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/prometheus-kube-state-metrics/templates/deployment.yaml b/prometheus-kube-state-metrics/templates/deployment.yaml index 98d710b56..ac827cb42 100644 --- a/prometheus-kube-state-metrics/templates/deployment.yaml +++ b/prometheus-kube-state-metrics/templates/deployment.yaml @@ -78,12 +78,17 @@ roleRef: name: {{ $serviceAccountName }} apiGroup: rbac.authorization.k8s.io --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: kube-state-metrics + labels: +{{ tuple $envAll "kube-state-metrics" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.kube_state_metrics }} + selector: + matchLabels: +{{ tuple $envAll "kube-state-metrics" "exporter" | 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/prometheus-node-exporter/templates/daemonset.yaml b/prometheus-node-exporter/templates/daemonset.yaml index 7c518a48d..3397e898c 100644 --- a/prometheus-node-exporter/templates/daemonset.yaml +++ b/prometheus-node-exporter/templates/daemonset.yaml @@ -33,12 +33,17 @@ roleRef: name: cluster-admin apiGroup: rbac.authorization.k8s.io --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: name: node-exporter namespace: {{ .Values.endpoints.node_metrics.namespace }} + labels: +{{ tuple $envAll "node_exporter" "metrics" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: + selector: + matchLabels: +{{ tuple $envAll "node_exporter" "metrics" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} {{ tuple $envAll "node_exporter" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }} template: metadata: diff --git a/prometheus-openstack-exporter/templates/deployment.yaml b/prometheus-openstack-exporter/templates/deployment.yaml index 9f7576cd0..126ce50c9 100644 --- a/prometheus-openstack-exporter/templates/deployment.yaml +++ b/prometheus-openstack-exporter/templates/deployment.yaml @@ -21,12 +21,17 @@ limitations under the License. {{- $serviceAccountName := "prometheus-openstack-exporter" }} {{ tuple $envAll "prometheus_openstack_exporter" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: prometheus-openstack-exporter + labels: +{{ tuple $envAll "prometheus-openstack-exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: replicas: {{ .Values.pod.replicas.prometheus_openstack_exporter }} + selector: + matchLabels: +{{ tuple $envAll "prometheus-openstack-exporter" "exporter" | 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/daemonset-registry-proxy.yaml b/registry/templates/daemonset-registry-proxy.yaml index 3a37fc3ae..80f2fb014 100644 --- a/registry/templates/daemonset-registry-proxy.yaml +++ b/registry/templates/daemonset-registry-proxy.yaml @@ -20,11 +20,16 @@ limitations under the License. {{- $serviceAccountName := "docker-registry-proxy"}} {{ tuple $envAll "registry_proxy" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: name: docker-registry-proxy + labels: +{{ tuple $envAll "docker" "registry-proxy" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: + selector: + matchLabels: +{{ tuple $envAll "docker" "registry-proxy" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }} template: metadata: labels: diff --git a/tiller/templates/deployment-tiller.yaml b/tiller/templates/deployment-tiller.yaml index dc9b863f9..3d865f274 100644 --- a/tiller/templates/deployment-tiller.yaml +++ b/tiller/templates/deployment-tiller.yaml @@ -33,7 +33,7 @@ subjects: name: {{ $serviceAccountName }} namespace: {{ .Release.Namespace }} --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: labels: