From 3056ca2d48659d1231638d8569ba14748e6e019d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Reegn?= Date: Fri, 9 Aug 2019 14:43:00 +0200 Subject: [PATCH] Upgrade addons to use apps/v1 instead of extensions/v1beta1 extensions/v1beta1 are deprecated and will not be served with kubernetes 1.16 anymore. For Deployment,DaemonSet and StatefulSet the apps/v1 api has been present since kubernetes 1.9. See following blog post for details: https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/ --- deploy/addons/ingress/ingress-dp.yaml.tmpl | 2 +- .../metrics-server/metrics-server-deployment.yaml.tmpl | 2 +- deploy/addons/registry/registry-proxy.yaml.tmpl | 7 ++++++- .../glusterfs-daemonset.yaml.tmpl | 2 ++ .../heketi-deployment.yaml.tmpl | 7 ++++++- .../storage-provisioner-glusterfile.yaml.tmpl | 6 +++++- test/integration/fn_addons.go | 5 +---- 7 files changed, 22 insertions(+), 9 deletions(-) diff --git a/deploy/addons/ingress/ingress-dp.yaml.tmpl b/deploy/addons/ingress/ingress-dp.yaml.tmpl index 46806633ac23..67f8ff04de38 100644 --- a/deploy/addons/ingress/ingress-dp.yaml.tmpl +++ b/deploy/addons/ingress/ingress-dp.yaml.tmpl @@ -13,7 +13,7 @@ # limitations under the License. --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: nginx-ingress-controller diff --git a/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl b/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl index 96875e23924e..60293af7ba92 100644 --- a/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl +++ b/deploy/addons/metrics-server/metrics-server-deployment.yaml.tmpl @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: metrics-server diff --git a/deploy/addons/registry/registry-proxy.yaml.tmpl b/deploy/addons/registry/registry-proxy.yaml.tmpl index 0a818fd9cb0a..3b6a378466e9 100644 --- a/deploy/addons/registry/registry-proxy.yaml.tmpl +++ b/deploy/addons/registry/registry-proxy.yaml.tmpl @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: labels: @@ -7,9 +7,14 @@ metadata: name: registry-proxy namespace: kube-system spec: + selector: + matchLabels: + registry-proxy: "true" + kubernetes.io/minikube-addons: registry template: metadata: labels: + registry-proxy: "true" kubernetes.io/minikube-addons: registry addonmanager.kubernetes.io/mode: Reconcile spec: diff --git a/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl index 1fac8513e4a3..e5b6156002ce 100644 --- a/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/glusterfs-daemonset.yaml.tmpl @@ -15,6 +15,8 @@ metadata: spec: selector: matchLabels: + glusterfs: pod + glusterfs-node: pod k8s-app: storage-provisioner-gluster template: metadata: diff --git a/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl index 2d72ace39c75..c35188ce032b 100644 --- a/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/heketi-deployment.yaml.tmpl @@ -86,7 +86,7 @@ data: --- kind: Deployment -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 metadata: namespace: storage-gluster name: heketi @@ -100,6 +100,11 @@ metadata: description: Defines how to deploy Heketi spec: replicas: 1 + selector: + matchLabels: + glusterfs: heketi-pod + heketi: pod + k8s-app: storage-provisioner-gluster template: metadata: namespace: storage-gluster diff --git a/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl b/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl index 88c7a5ab89cf..df579da77733 100644 --- a/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl +++ b/deploy/addons/storage-provisioner-gluster/storage-provisioner-glusterfile.yaml.tmpl @@ -77,7 +77,7 @@ subjects: name: glusterfile-provisioner --- kind: Deployment -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 metadata: namespace: storage-gluster name: glusterfile-provisioner @@ -89,6 +89,10 @@ metadata: description: Defines how to deploy the glusterfile provisioner pod. spec: replicas: 1 + selector: + matchLabels: + glusterfs: file-provisioner-pod + glusterfile: provisioner-pod strategy: type: Recreate template: diff --git a/test/integration/fn_addons.go b/test/integration/fn_addons.go index c6f3a1cea764..7820e9696298 100644 --- a/test/integration/fn_addons.go +++ b/test/integration/fn_addons.go @@ -206,10 +206,7 @@ func testRegistry(t *testing.T) { if err := kapi.WaitForPodsWithLabelRunning(client, "kube-system", rs); err != nil { t.Fatalf("waiting for registry pods: %v", err) } - ps, err := labels.Parse("kubernetes.io/minikube-addons=registry,actual-registry!=true") - if err != nil { - t.Fatalf("Unable to parse selector: %v", err) - } + ps := labels.SelectorFromSet(labels.Set(map[string]string{"registry-proxy": "true"})) if err := kapi.WaitForPodsWithLabelRunning(client, "kube-system", ps); err != nil { t.Fatalf("waiting for registry-proxy pods: %v", err) }