From 09351bbedf1cd8385217ebe8fe5a241e316d30c3 Mon Sep 17 00:00:00 2001 From: Patrick Lang Date: Tue, 3 Jul 2018 17:04:40 -0700 Subject: [PATCH] Adding test for and fixing daemonsets that should not run on Windows (#3407) --- parts/k8s/addons/azure-cni-networkmonitor.yaml | 2 ++ ...kubernetesmasteraddons-azure-npm-daemonset.yaml | 4 +++- .../kubernetesmasteraddons-calico-daemonset.yaml | 2 ++ .../kubernetesmasteraddons-flannel-daemonset.yaml | 1 + ...esmasteraddons-kube-rescheduler-deployment.yaml | 2 ++ test/e2e/kubernetes/kubernetes_test.go | 14 ++++++++++++++ 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/parts/k8s/addons/azure-cni-networkmonitor.yaml b/parts/k8s/addons/azure-cni-networkmonitor.yaml index 7bc3127e61..390044fcc7 100644 --- a/parts/k8s/addons/azure-cni-networkmonitor.yaml +++ b/parts/k8s/addons/azure-cni-networkmonitor.yaml @@ -20,6 +20,8 @@ spec: tolerations: - key: CriticalAddonsOnly operator: Exists + nodeSelector: + beta.kubernetes.io/os: linux containers: - name: azure-cnms image: diff --git a/parts/k8s/addons/kubernetesmasteraddons-azure-npm-daemonset.yaml b/parts/k8s/addons/kubernetesmasteraddons-azure-npm-daemonset.yaml index 21e30e993f..06ba15756d 100644 --- a/parts/k8s/addons/kubernetesmasteraddons-azure-npm-daemonset.yaml +++ b/parts/k8s/addons/kubernetesmasteraddons-azure-npm-daemonset.yaml @@ -71,6 +71,8 @@ spec: tolerations: - key: CriticalAddonsOnly operator: Exists + nodeSelector: + beta.kubernetes.io/os: linux containers: - name: azure-npm image: containernetworking/azure-npm:v0.0.3 @@ -98,4 +100,4 @@ spec: hostPath: path: /run/xtables.lock type: File - serviceAccountName: azure-npm + serviceAccountName: azure-npm \ No newline at end of file diff --git a/parts/k8s/addons/kubernetesmasteraddons-calico-daemonset.yaml b/parts/k8s/addons/kubernetesmasteraddons-calico-daemonset.yaml index 85d3bd4d5a..c53052ec8d 100644 --- a/parts/k8s/addons/kubernetesmasteraddons-calico-daemonset.yaml +++ b/parts/k8s/addons/kubernetesmasteraddons-calico-daemonset.yaml @@ -210,6 +210,8 @@ spec: scheduler.alpha.kubernetes.io/critical-pod: '' spec: hostNetwork: true + nodeSelector: + beta.kubernetes.io/os: linux tolerations: - key: CriticalAddonsOnly operator: Exists diff --git a/parts/k8s/addons/kubernetesmasteraddons-flannel-daemonset.yaml b/parts/k8s/addons/kubernetesmasteraddons-flannel-daemonset.yaml index 3180d73e51..b9c2f956e8 100644 --- a/parts/k8s/addons/kubernetesmasteraddons-flannel-daemonset.yaml +++ b/parts/k8s/addons/kubernetesmasteraddons-flannel-daemonset.yaml @@ -56,6 +56,7 @@ spec: hostNetwork: true nodeSelector: beta.kubernetes.io/arch: amd64 + beta.kubernetes.io/os: linux tolerations: - key: node-role.kubernetes.io/master operator: Equal diff --git a/parts/k8s/addons/kubernetesmasteraddons-kube-rescheduler-deployment.yaml b/parts/k8s/addons/kubernetesmasteraddons-kube-rescheduler-deployment.yaml index fc62947df0..64d5c688a4 100644 --- a/parts/k8s/addons/kubernetesmasteraddons-kube-rescheduler-deployment.yaml +++ b/parts/k8s/addons/kubernetesmasteraddons-kube-rescheduler-deployment.yaml @@ -19,6 +19,8 @@ spec: annotations: scheduler.alpha.kubernetes.io/critical-pod: '' spec: + nodeSelector: + beta.kubernetes.io/os: linux containers: - image: name: rescheduler diff --git a/test/e2e/kubernetes/kubernetes_test.go b/test/e2e/kubernetes/kubernetes_test.go index 1dbb7152ef..5007be4418 100644 --- a/test/e2e/kubernetes/kubernetes_test.go +++ b/test/e2e/kubernetes/kubernetes_test.go @@ -777,6 +777,20 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu } }) + It("Should not have any unready or crashing pods right after deployment", func() { + if eng.HasWindowsAgents() { + By("Checking ready status of each pod in kube-system") + pods, err := pod.GetAll("kube-system") + Expect(err).NotTo(HaveOccurred()) + Expect(len(pods.Pods)).ToNot(BeZero()) + for _, currentPod := range pods.Pods { + log.Printf("Checking %s", currentPod.Metadata.Name) + Expect(currentPod.Status.ContainerStatuses[0].Ready).To(BeTrue()) + Expect(currentPod.Status.ContainerStatuses[0].RestartCount).To(BeNumerically("<", 3)) + } + } + }) + // Windows Bug 16598869 /* It("should be able to reach hostport in an iis webserver", func() {