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

schedule ip-masq-agent on masters #4049

Merged
merged 3 commits into from
Oct 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some questions, what is this CriticalAddonsOnly tolerance used for? Is it needed here or just follow some conventions?

The PR looks good to me.

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 @@ -781,6 +781,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