schedule ip-masq-agent on masters (#4049)

This commit is contained in:
Jack Francis 2018-10-16 17:02:00 -07:00 коммит произвёл GitHub
Родитель 17aa20ed64
Коммит 20ff962bd7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 47 добавлений и 0 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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() {

Просмотреть файл

@ -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