From 27ec548b884bd22f76d8393f6b9f1242ec93c511 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Tue, 10 Sep 2019 22:06:55 +0300 Subject: [PATCH] Add support for k8s v1.16.0-beta.2 (#5148) Cleaned up deprecated APIs: apps/v1beta1 apps/v1beta2 extensions/v1beta1 for ds,deploy,rs Add workaround for deploying helm using incompatible deployment manifest. Change-Id: I78b36741348f47a999df3841ee63cf4e6f377830 --- .../roles/provision/templates/metallb.yml.j2 | 4 ++-- .../templates/glusterfs-daemonset.json.j2 | 2 +- .../templates/heketi-bootstrap.json.j2 | 2 +- .../templates/heketi-deployment.json.j2 | 2 +- roles/download/defaults/main.yml | 6 ++++++ .../ansible/tasks/netchecker.yml | 21 ------------------- .../templates/coredns-deployment.yml.j2 | 2 +- .../templates/netchecker-agent-ds.yml.j2 | 5 ++++- .../netchecker-agent-hostnet-ds.yml.j2 | 5 ++++- .../netchecker-server-deployment.yml.j2 | 9 ++++++-- .../nvidia-driver-install-daemonset.yml.j2 | 5 ++++- .../local-path-storage-deployment.yml.j2 | 2 +- roles/kubernetes-apps/helm/tasks/main.yml | 9 +++++++- .../templates/deploy-cert-manager.yml.j2 | 2 +- .../metrics-server-deployment.yaml.j2 | 2 +- roles/kubernetes-apps/registry/README.md | 2 +- roles/kubernetes/node/defaults/main.yml | 6 ++++++ .../calico/templates/calico-node.yml.j2 | 2 +- .../calico/templates/calico-typha.yml.j2 | 2 +- .../canal/templates/canal-node.yaml.j2 | 2 +- .../contiv/templates/contiv-api-proxy.yml.j2 | 5 ++++- .../contiv/templates/contiv-cleanup.yml.j2 | 2 +- .../contiv/templates/contiv-etcd-proxy.yml.j2 | 2 +- .../contiv/templates/contiv-etcd.yml.j2 | 2 +- .../contiv/templates/contiv-netmaster.yml.j2 | 5 ++++- .../contiv/templates/contiv-netplugin.yml.j2 | 2 +- .../contiv/templates/contiv-ovs.yml.j2 | 2 +- .../flannel/templates/cni-flannel.yml.j2 | 6 +++++- .../kube-router/templates/kube-router.yml.j2 | 6 +++++- .../multus/templates/multus-daemonset.yml.j2 | 6 +++++- .../weave/templates/weave-net.yml.j2 | 5 ++++- 31 files changed, 84 insertions(+), 51 deletions(-) diff --git a/contrib/metallb/roles/provision/templates/metallb.yml.j2 b/contrib/metallb/roles/provision/templates/metallb.yml.j2 index ea8da29e9..b830c5f52 100644 --- a/contrib/metallb/roles/provision/templates/metallb.yml.j2 +++ b/contrib/metallb/roles/provision/templates/metallb.yml.j2 @@ -115,7 +115,7 @@ roleRef: kind: Role name: config-watcher --- -apiVersion: apps/v1beta2 +apiVersion: apps/v1 kind: DaemonSet metadata: namespace: metallb-system @@ -169,7 +169,7 @@ spec: - net_raw --- -apiVersion: apps/v1beta2 +apiVersion: apps/v1 kind: Deployment metadata: namespace: metallb-system diff --git a/contrib/network-storage/heketi/roles/provision/templates/glusterfs-daemonset.json.j2 b/contrib/network-storage/heketi/roles/provision/templates/glusterfs-daemonset.json.j2 index 74c031ffe..15efb3d6a 100644 --- a/contrib/network-storage/heketi/roles/provision/templates/glusterfs-daemonset.json.j2 +++ b/contrib/network-storage/heketi/roles/provision/templates/glusterfs-daemonset.json.j2 @@ -1,6 +1,6 @@ { "kind": "DaemonSet", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "glusterfs", "labels": { diff --git a/contrib/network-storage/heketi/roles/provision/templates/heketi-bootstrap.json.j2 b/contrib/network-storage/heketi/roles/provision/templates/heketi-bootstrap.json.j2 index 764de5efa..6f82bb409 100644 --- a/contrib/network-storage/heketi/roles/provision/templates/heketi-bootstrap.json.j2 +++ b/contrib/network-storage/heketi/roles/provision/templates/heketi-bootstrap.json.j2 @@ -30,7 +30,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "deploy-heketi", "labels": { diff --git a/contrib/network-storage/heketi/roles/provision/templates/heketi-deployment.json.j2 b/contrib/network-storage/heketi/roles/provision/templates/heketi-deployment.json.j2 index cd7466ae5..0cd24e167 100644 --- a/contrib/network-storage/heketi/roles/provision/templates/heketi-deployment.json.j2 +++ b/contrib/network-storage/heketi/roles/provision/templates/heketi-deployment.json.j2 @@ -44,7 +44,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "heketi", "labels": { diff --git a/roles/download/defaults/main.yml b/roles/download/defaults/main.yml index 2e3912d53..0cdb87b16 100644 --- a/roles/download/defaults/main.yml +++ b/roles/download/defaults/main.yml @@ -105,6 +105,7 @@ crictl_checksums: # Checksums hyperkube_checksums: arm: + v1.16.0-beta.2: 2b64ef9e8e2f92b72352cc7ab95b416407f4fca9ed1a5020aeeb6a3777bd16ed v1.15.3: 100d8bddb29e77397b90e6dfbcf0af2d901a90ea4bde90b83b5a39f394c3900b v1.15.2: eeaa8e071541c7bcaa186ff1d2919d076b27ef70c9e9df70f910756eba55dc99 v1.15.1: fc5af96fd9341776d84c38675be7b8045dee20af327af9331972c422a4109918 @@ -116,6 +117,7 @@ hyperkube_checksums: v1.14.1: 839a4abfeafbd5f5ab057ad0e8a0b0b488b3cde14a646eba040a7f579875f565 v1.14.0: d090b1da23564a7e9bb8f1f4264f2116536c52611ae203fe2ca13eaad0a8003e arm64: + v1.16.0-beta.2: 0f1e694db5c75cff526c6c066e618c43e83384c36d4e38cf1ac6e9baf71b38d4 v1.15.3: 1e3e70b8d1e8ebc642f2801d9c7938a27764dfb2f5aea432ab4326d43c04a1f5 v1.15.2: c4cf69f52c7013faee9d54e0f376e0732a4a7b0f7ffc7241e9b7e28bad0ac77f v1.15.1: 80ed372c5f6c5178df88616175310057c06bdc9d0905953814a1927eb3aaa657 @@ -127,6 +129,7 @@ hyperkube_checksums: v1.14.1: d5236efc2547fd07c7cc2ed9345dfbcd1204385847ca686cf1c62d15056de399 v1.14.0: 708e00a41f6516d525dee00c91ebe3c3bf2feaf9b7f0af7689487e3e17e356c2 amd64: + v1.16.0-beta.2: 2f05aba15c163883a610681a563d89fd7adf10cb70b90cdb6760f00f8d023a4b v1.15.3: 3685c65b4fb85d552f77346900affc2e9a1bc997b4cd3dde0e705fd8c1d9be7a v1.15.2: ab885606438748eb89a7738e219f5353d94c40c63a4935a539ce89760280f065 v1.15.1: 22b7b1e7f5f2a452d62e0ca4c2cba67119c51e04219aaeaf8452825f9177069e @@ -139,6 +142,7 @@ hyperkube_checksums: v1.14.0: af8b04504365dbe4ce6a1772f42eb390d4221a21149b522fc8a0c4b1cd3d97aa kubeadm_checksums: arm: + v1.16.0-beta.2: 6cf8b364b40aba09e1aaa4ed873d90df2b17725dafa78252470777df9404a736 v1.15.3: 6c6fa56810908b5be83882094ea199844edc94b7e969160623c86512d9251c06 v1.15.2: 4b35ad0031c08a83de7c8d9f9bbed6a30d93a5c74e16ea9e6211ad2e0e12bdd1 v1.15.1: 855abd520291dcef0577a1a2ef87a70f522fd2b22603a12abcd86c2f7ec9c022 @@ -150,6 +154,7 @@ kubeadm_checksums: v1.14.1: 4bd111411208f1270ed3af8780b87d24a3c17c9fdbe4b0f8c7a9a21cd765543e v1.14.0: 11f2cfa8bf7ee177dbac8073ab0f039dc265536baaa8dc0c4dea699f981f6fd1 arm64: + v1.16.0-beta.2: 0e3ae66f2f57a18eb363af1d49a22b35a24e32bf36af5ef630aa5ceeedc9feed v1.15.3: 6f472bc8ab1ba3d76448bd45b200edef96741e5affde8dc1429300af3a4904d8 v1.15.2: d3b6ee2048b366726ca366d2db4c46b2cacc38e8ec09cc35781d16593753d930 v1.15.1: 44fbfad0f1026d249fc4f365f1e9562cd52d75360d4d1032731122ba5a4d57dc @@ -161,6 +166,7 @@ kubeadm_checksums: v1.14.1: 5cf05464168e45ee4719264a267c65f9319fae1ceb9923fedab97a9d6a629e0b v1.14.0: 7ed9d706e50cd6d3fc618a7af3d19b691b8a5343ddedaeccb4ea09af3ecfae2c amd64: + v1.16.0-beta.2: bba224360cfb4e6471f84523fcc954951c05c0fef0a4311a07e76f306cadebf1 v1.15.3: ec56a00bc8d9ec4ac2b081a3b2127d8593daf3b2c86560cf9e6cba5ada2d5a80 v1.15.2: fe2a13a1dea73249560ea44ab54c0359a9722e9c66832f6bcad86798438cba2f v1.15.1: 3d42441ae177826f1181e559cd2a729464ca8efadef196cfa0e8053a615333b5 diff --git a/roles/kubernetes-apps/ansible/tasks/netchecker.yml b/roles/kubernetes-apps/ansible/tasks/netchecker.yml index d99700dbb..81121c53b 100644 --- a/roles/kubernetes-apps/ansible/tasks/netchecker.yml +++ b/roles/kubernetes-apps/ansible/tasks/netchecker.yml @@ -1,25 +1,4 @@ --- - -- name: Kubernetes Apps | Check if netchecker-server manifest already exists - stat: - path: "{{ kube_config_dir }}/netchecker-server-deployment.yml" - register: netchecker_server_manifest - tags: - - facts - - upgrade - -- name: Kubernetes Apps | Apply netchecker-server manifest to update annotations - kube: - name: "netchecker-server" - namespace: "{{ netcheck_namespace }}" - filename: "{{ netchecker_server_manifest.stat.path }}" - kubectl: "{{ bin_dir }}/kubectl" - resource: "deploy" - state: latest - when: inventory_hostname == groups['kube-master'][0] and netchecker_server_manifest.stat.exists - tags: - - upgrade - - name: Kubernetes Apps | Netchecker Templates list set_fact: netchecker_templates: diff --git a/roles/kubernetes-apps/ansible/templates/coredns-deployment.yml.j2 b/roles/kubernetes-apps/ansible/templates/coredns-deployment.yml.j2 index e6406efb5..dcb976de7 100644 --- a/roles/kubernetes-apps/ansible/templates/coredns-deployment.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/coredns-deployment.yml.j2 @@ -1,5 +1,5 @@ --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: "coredns{{ coredns_ordinal_suffix }}" diff --git a/roles/kubernetes-apps/ansible/templates/netchecker-agent-ds.yml.j2 b/roles/kubernetes-apps/ansible/templates/netchecker-agent-ds.yml.j2 index c91733cb3..eafb1029f 100644 --- a/roles/kubernetes-apps/ansible/templates/netchecker-agent-ds.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/netchecker-agent-ds.yml.j2 @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: labels: @@ -6,6 +6,9 @@ metadata: name: netchecker-agent namespace: {{ netcheck_namespace }} spec: + selector: + matchLabels: + app: netchecker-agent template: metadata: name: netchecker-agent diff --git a/roles/kubernetes-apps/ansible/templates/netchecker-agent-hostnet-ds.yml.j2 b/roles/kubernetes-apps/ansible/templates/netchecker-agent-hostnet-ds.yml.j2 index 22eb2db68..af57ceb6f 100644 --- a/roles/kubernetes-apps/ansible/templates/netchecker-agent-hostnet-ds.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/netchecker-agent-hostnet-ds.yml.j2 @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: labels: @@ -6,6 +6,9 @@ metadata: name: netchecker-agent-hostnet namespace: {{ netcheck_namespace }} spec: + selector: + matchLabels: + app: netchecker-agent-hostnet template: metadata: name: netchecker-agent-hostnet diff --git a/roles/kubernetes-apps/ansible/templates/netchecker-server-deployment.yml.j2 b/roles/kubernetes-apps/ansible/templates/netchecker-server-deployment.yml.j2 index 76d50e4a4..53f6c4807 100644 --- a/roles/kubernetes-apps/ansible/templates/netchecker-server-deployment.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/netchecker-server-deployment.yml.j2 @@ -1,15 +1,20 @@ -apiVersion: apps/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: netchecker-server + namespace: {{ netcheck_namespace }} + labels: + app: netchecker-server spec: replicas: 1 + selector: + matchLabels: + app: netchecker-server template: metadata: name: netchecker-server labels: app: netchecker-server - namespace: {{ netcheck_namespace }} spec: priorityClassName: {% if netcheck_namespace == 'kube-system' %}system-cluster-critical{% else %}k8s-cluster-critical{% endif %}{{''}} containers: diff --git a/roles/kubernetes-apps/container_engine_accelerator/nvidia_gpu/templates/nvidia-driver-install-daemonset.yml.j2 b/roles/kubernetes-apps/container_engine_accelerator/nvidia_gpu/templates/nvidia-driver-install-daemonset.yml.j2 index 97aff97ac..ea097ede4 100644 --- a/roles/kubernetes-apps/container_engine_accelerator/nvidia_gpu/templates/nvidia-driver-install-daemonset.yml.j2 +++ b/roles/kubernetes-apps/container_engine_accelerator/nvidia_gpu/templates/nvidia-driver-install-daemonset.yml.j2 @@ -12,12 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: name: nvidia-driver-installer namespace: kube-system spec: + selector: + matchLabels: + name: nvidia-driver-installer template: metadata: labels: diff --git a/roles/kubernetes-apps/external_provisioner/local_path_provisioner/templates/local-path-storage-deployment.yml.j2 b/roles/kubernetes-apps/external_provisioner/local_path_provisioner/templates/local-path-storage-deployment.yml.j2 index 384d13b58..231d4c4ac 100644 --- a/roles/kubernetes-apps/external_provisioner/local_path_provisioner/templates/local-path-storage-deployment.yml.j2 +++ b/roles/kubernetes-apps/external_provisioner/local_path_provisioner/templates/local-path-storage-deployment.yml.j2 @@ -1,5 +1,5 @@ --- -apiVersion: apps/v1beta2 +apiVersion: apps/v1 kind: Deployment metadata: name: local-path-provisioner diff --git a/roles/kubernetes-apps/helm/tasks/main.yml b/roles/kubernetes-apps/helm/tasks/main.yml index ecb3688a7..721cd59dd 100644 --- a/roles/kubernetes-apps/helm/tasks/main.yml +++ b/roles/kubernetes-apps/helm/tasks/main.yml @@ -36,8 +36,9 @@ include_tasks: "gen_helm_tiller_certs.yml" when: tiller_enable_tls +# FIXME: https://github.com/helm/helm/issues/6374 - name: Helm | Install/upgrade helm - command: > + shell: > {{ bin_dir }}/helm init --tiller-namespace={{ tiller_namespace }} {% if helm_skip_refresh %} --skip-refresh{% endif %} {% if helm_stable_repo_url is defined %} --stable-repo-url {{ helm_stable_repo_url }}{% endif %} @@ -51,6 +52,10 @@ {% if tiller_enable_tls %} --tiller-tls --tiller-tls-verify --tiller-tls-cert={{ tiller_tls_cert }} --tiller-tls-key={{ tiller_tls_key }} --tls-ca-cert={{ tiller_tls_ca_cert }} {% endif %} {% if tiller_secure_release_info %} --override 'spec.template.spec.containers[0].command'='{/tiller,--storage=secret}' {% endif %} {% if tiller_wait %} --wait{% endif %} + --output yaml + | sed 's@apiVersion: extensions/v1beta1@apiVersion: apps/v1@' + | {{ bin_dir }}/kubectl patch --local -oyaml -f - -p '{"spec":{"selector": {"app":"helm","name":"tiller"} } }' + | {{ bin_dir }}/kubectl apply -f - {% else %} --client-only {% endif %} @@ -73,6 +78,8 @@ {% if tiller_secure_release_info %} --override 'spec.template.spec.containers[0].command'='{/tiller,--storage=secret}' {% endif %} {% if tiller_wait %} --wait{% endif %} --output yaml + | sed 's@apiVersion: extensions/v1beta1@apiVersion: apps/v1@' + | {{ bin_dir }}/kubectl patch --local -oyaml -f - -p '{"spec":{"selector": {"app":"helm","name":"tiller"} } }' | {{ bin_dir }}/kubectl apply -f - changed_when: false when: diff --git a/roles/kubernetes-apps/ingress_controller/cert_manager/templates/deploy-cert-manager.yml.j2 b/roles/kubernetes-apps/ingress_controller/cert_manager/templates/deploy-cert-manager.yml.j2 index daf82ebe0..383dab5d3 100644 --- a/roles/kubernetes-apps/ingress_controller/cert_manager/templates/deploy-cert-manager.yml.j2 +++ b/roles/kubernetes-apps/ingress_controller/cert_manager/templates/deploy-cert-manager.yml.j2 @@ -1,5 +1,5 @@ --- -apiVersion: apps/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: cert-manager diff --git a/roles/kubernetes-apps/metrics_server/templates/metrics-server-deployment.yaml.j2 b/roles/kubernetes-apps/metrics_server/templates/metrics-server-deployment.yaml.j2 index a536cfd35..9e27626e7 100644 --- a/roles/kubernetes-apps/metrics_server/templates/metrics-server-deployment.yaml.j2 +++ b/roles/kubernetes-apps/metrics_server/templates/metrics-server-deployment.yaml.j2 @@ -1,5 +1,5 @@ --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: metrics-server diff --git a/roles/kubernetes-apps/registry/README.md b/roles/kubernetes-apps/registry/README.md index 06bc99a2b..eccf384a9 100644 --- a/roles/kubernetes-apps/registry/README.md +++ b/roles/kubernetes-apps/registry/README.md @@ -186,7 +186,7 @@ node by creating following daemonset. ``` yaml -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: name: kube-registry-proxy diff --git a/roles/kubernetes/node/defaults/main.yml b/roles/kubernetes/node/defaults/main.yml index af441ffa9..c5180028c 100644 --- a/roles/kubernetes/node/defaults/main.yml +++ b/roles/kubernetes/node/defaults/main.yml @@ -48,9 +48,15 @@ loadbalancer_apiserver_cpu_requests: 25m loadbalancer_apiserver_keepalive_timeout: 5m +# Uncomment if you need to enable deprecated runtimes # kube_api_runtime_config: +# - apps/v1beta1=true +# - apps/ve1beta2=true # - extensions/v1beta1/daemonsets=true # - extensions/v1beta1/deployments=true +# - extensions/v1beta1/replicasets=true +# - extensions/v1beta1/networkpolicies=true +# - extensions/v1beta1/podsecuritypolicies=true # A port range to reserve for services with NodePort visibility. # Inclusive at both ends of the range. diff --git a/roles/network_plugin/calico/templates/calico-node.yml.j2 b/roles/network_plugin/calico/templates/calico-node.yml.j2 index 75c5bbe73..ab64450c2 100644 --- a/roles/network_plugin/calico/templates/calico-node.yml.j2 +++ b/roles/network_plugin/calico/templates/calico-node.yml.j2 @@ -3,7 +3,7 @@ # 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/roles/network_plugin/calico/templates/calico-typha.yml.j2 b/roles/network_plugin/calico/templates/calico-typha.yml.j2 index c7402dace..87bdd8162 100644 --- a/roles/network_plugin/calico/templates/calico-typha.yml.j2 +++ b/roles/network_plugin/calico/templates/calico-typha.yml.j2 @@ -21,7 +21,7 @@ spec: # This manifest creates a Deployment of Typha to back the above service. -apiVersion: apps/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: calico-typha diff --git a/roles/network_plugin/canal/templates/canal-node.yaml.j2 b/roles/network_plugin/canal/templates/canal-node.yaml.j2 index 354cd0b94..127d52330 100644 --- a/roles/network_plugin/canal/templates/canal-node.yaml.j2 +++ b/roles/network_plugin/canal/templates/canal-node.yaml.j2 @@ -1,6 +1,6 @@ --- kind: DaemonSet -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 metadata: name: canal-node namespace: kube-system diff --git a/roles/network_plugin/contiv/templates/contiv-api-proxy.yml.j2 b/roles/network_plugin/contiv/templates/contiv-api-proxy.yml.j2 index 156c3d9a0..74c60896f 100644 --- a/roles/network_plugin/contiv/templates/contiv-api-proxy.yml.j2 +++ b/roles/network_plugin/contiv/templates/contiv-api-proxy.yml.j2 @@ -1,5 +1,5 @@ # This manifest deploys the Contiv API Proxy Server on Kubernetes. -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: name: contiv-api-proxy @@ -9,6 +9,9 @@ metadata: spec: updateStrategy: type: RollingUpdate + selector: + matchLabels: + k8s-app: contiv-api-proxy template: metadata: name: contiv-api-proxy diff --git a/roles/network_plugin/contiv/templates/contiv-cleanup.yml.j2 b/roles/network_plugin/contiv/templates/contiv-cleanup.yml.j2 index a1354f425..6d6938823 100644 --- a/roles/network_plugin/contiv/templates/contiv-cleanup.yml.j2 +++ b/roles/network_plugin/contiv/templates/contiv-cleanup.yml.j2 @@ -1,6 +1,6 @@ --- kind: DaemonSet -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 metadata: name: contiv-cleanup namespace: kube-system diff --git a/roles/network_plugin/contiv/templates/contiv-etcd-proxy.yml.j2 b/roles/network_plugin/contiv/templates/contiv-etcd-proxy.yml.j2 index 6651ad9a5..9725a0f2a 100644 --- a/roles/network_plugin/contiv/templates/contiv-etcd-proxy.yml.j2 +++ b/roles/network_plugin/contiv/templates/contiv-etcd-proxy.yml.j2 @@ -1,6 +1,6 @@ --- kind: DaemonSet -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 metadata: name: contiv-etcd-proxy namespace: kube-system diff --git a/roles/network_plugin/contiv/templates/contiv-etcd.yml.j2 b/roles/network_plugin/contiv/templates/contiv-etcd.yml.j2 index 0b49bbfa4..6341be719 100644 --- a/roles/network_plugin/contiv/templates/contiv-etcd.yml.j2 +++ b/roles/network_plugin/contiv/templates/contiv-etcd.yml.j2 @@ -1,6 +1,6 @@ --- kind: DaemonSet -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 metadata: name: contiv-etcd namespace: kube-system diff --git a/roles/network_plugin/contiv/templates/contiv-netmaster.yml.j2 b/roles/network_plugin/contiv/templates/contiv-netmaster.yml.j2 index e3d390789..2ffa8962b 100644 --- a/roles/network_plugin/contiv/templates/contiv-netmaster.yml.j2 +++ b/roles/network_plugin/contiv/templates/contiv-netmaster.yml.j2 @@ -1,6 +1,6 @@ --- kind: DaemonSet -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 metadata: name: contiv-netmaster namespace: kube-system @@ -9,6 +9,9 @@ metadata: spec: updateStrategy: type: RollingUpdate + selector: + matchLabels: + k8s-app: contiv-netmaster template: metadata: name: contiv-netmaster diff --git a/roles/network_plugin/contiv/templates/contiv-netplugin.yml.j2 b/roles/network_plugin/contiv/templates/contiv-netplugin.yml.j2 index a3cf6bc9e..80c4e32fc 100644 --- a/roles/network_plugin/contiv/templates/contiv-netplugin.yml.j2 +++ b/roles/network_plugin/contiv/templates/contiv-netplugin.yml.j2 @@ -3,7 +3,7 @@ # as the Contiv 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: contiv-netplugin namespace: kube-system diff --git a/roles/network_plugin/contiv/templates/contiv-ovs.yml.j2 b/roles/network_plugin/contiv/templates/contiv-ovs.yml.j2 index 4bb4be096..56680b0bd 100644 --- a/roles/network_plugin/contiv/templates/contiv-ovs.yml.j2 +++ b/roles/network_plugin/contiv/templates/contiv-ovs.yml.j2 @@ -2,7 +2,7 @@ apiVersion: apps/v1 # This manifest deploys the contiv-ovs pod. kind: DaemonSet -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 metadata: name: contiv-ovs namespace: kube-system diff --git a/roles/network_plugin/flannel/templates/cni-flannel.yml.j2 b/roles/network_plugin/flannel/templates/cni-flannel.yml.j2 index c549e0804..9afabd151 100644 --- a/roles/network_plugin/flannel/templates/cni-flannel.yml.j2 +++ b/roles/network_plugin/flannel/templates/cni-flannel.yml.j2 @@ -37,7 +37,7 @@ data: } } --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: name: kube-flannel @@ -46,6 +46,10 @@ metadata: tier: node k8s-app: flannel spec: + selector: + matchLabels: + tier: node + k8s-app: flannel template: metadata: labels: diff --git a/roles/network_plugin/kube-router/templates/kube-router.yml.j2 b/roles/network_plugin/kube-router/templates/kube-router.yml.j2 index cc8208824..5bf07ea58 100644 --- a/roles/network_plugin/kube-router/templates/kube-router.yml.j2 +++ b/roles/network_plugin/kube-router/templates/kube-router.yml.j2 @@ -41,7 +41,7 @@ data: current-context: kube-router-context --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: labels: @@ -55,6 +55,10 @@ spec: rollingUpdate: maxUnavailable: 1 type: RollingUpdate + selector: + matchLabels: + k8s-app: kube-router + tier: node template: metadata: labels: diff --git a/roles/network_plugin/multus/templates/multus-daemonset.yml.j2 b/roles/network_plugin/multus/templates/multus-daemonset.yml.j2 index 96847aa14..3e2fbd9cd 100644 --- a/roles/network_plugin/multus/templates/multus-daemonset.yml.j2 +++ b/roles/network_plugin/multus/templates/multus-daemonset.yml.j2 @@ -1,6 +1,6 @@ --- kind: DaemonSet -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 metadata: name: kube-multus-ds-amd64 namespace: kube-system @@ -8,6 +8,10 @@ metadata: tier: node app: multus spec: + selector: + matchLabels: + tier: node + app: multus template: metadata: labels: diff --git a/roles/network_plugin/weave/templates/weave-net.yml.j2 b/roles/network_plugin/weave/templates/weave-net.yml.j2 index 33931fd48..222b2f97a 100644 --- a/roles/network_plugin/weave/templates/weave-net.yml.j2 +++ b/roles/network_plugin/weave/templates/weave-net.yml.j2 @@ -101,7 +101,7 @@ items: - kind: ServiceAccount name: weave-net namespace: kube-system - - apiVersion: extensions/v1beta1 + - apiVersion: apps/v1 kind: DaemonSet metadata: name: weave-net @@ -110,6 +110,9 @@ items: namespace: kube-system spec: minReadySeconds: 5 + selector: + matchLabels: + name: weave-net template: metadata: labels: