Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
schedule ip-masq-agent on masters (#4049)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis committed Oct 17, 2018
1 parent 46b5d25 commit e5c7bba
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
7 changes: 7 additions & 0 deletions parts/k8s/addons/ip-masq-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ spec:
hostNetwork: true
nodeSelector:
beta.kubernetes.io/os: linux
tolerations:
- key: CriticalAddonsOnly
operator: Exists
- key: node-role.kubernetes.io/master
operator: Equal
value: "true"
effect: NoSchedule
containers:
- name: azure-ip-masq-agent
image: gcr.io/google-containers/ip-masq-agent-amd64:v2.0.0
Expand Down
21 changes: 21 additions & 0 deletions test/e2e/kubernetes/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,27 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
Skip("No linux agent was provisioned for this Cluster Definition")
}
})

It("should be able to schedule a pod to a master node", func() {
By("Creating a pod with master nodeSelector")
p, err := pod.CreatePodFromFile(filepath.Join(WorkloadDir, "nginx-master.yaml"), "nginx-master", "default")
if err != nil {
p, err = pod.Get("nginx-master", "default")
Expect(err).NotTo(HaveOccurred())
}
running, err := p.WaitOnReady(5*time.Second, cfg.Timeout)
Expect(err).NotTo(HaveOccurred())
Expect(running).To(Equal(true))

By("validating that master-scheduled pod has outbound internet connectivity")
pass, err := p.CheckLinuxOutboundConnection(5*time.Second, cfg.Timeout)
Expect(err).NotTo(HaveOccurred())
Expect(pass).To(BeTrue())

By("Cleaning up after ourselves")
err = p.Delete(deleteResourceRetries)
Expect(err).NotTo(HaveOccurred())
})
})

Describe("with a GPU-enabled agent pool", func() {
Expand Down
19 changes: 19 additions & 0 deletions test/e2e/kubernetes/workloads/nginx-master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Pod
metadata:
name: nginx-master
labels:
app: nginx-master
spec:
containers:
- image: library/nginx:latest
name: nginx-master
command:
- sleep
- "1000000"
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: "Exists"
nodeSelector:
kubernetes.io/role: master

0 comments on commit e5c7bba

Please sign in to comment.