зеркало из https://github.com/Azure/acs-engine.git
Adding tests to ensure plugins for container monitoring are running fine. (#3298)
This commit is contained in:
Родитель
bbc665a3d3
Коммит
647dae5671
|
@ -222,6 +222,8 @@ metadata:
|
|||
value: my_aks_cluster
|
||||
- name: DISABLE_KUBE_SYSTEM_LOG_COLLECTION
|
||||
value: "true"
|
||||
- name: ISTEST
|
||||
value: true
|
||||
securityContext:
|
||||
privileged: true
|
||||
ports:
|
||||
|
|
|
@ -351,6 +351,85 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
|
|||
}
|
||||
})
|
||||
|
||||
It("should have cluster-omsagent daemonset running", func() {
|
||||
if hasContainerMonitoring, clusterContainerMonitoringAddon := eng.HasAddon("container-monitoring"); hasContainerMonitoring {
|
||||
running, err := pod.WaitOnReady("omsagent-", "kube-system", 3, 30*time.Second, cfg.Timeout)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(running).To(Equal(true))
|
||||
By("Ensuring that the correct resources have been applied")
|
||||
pods, err := pod.GetAllByPrefix("omsagent-", "kube-system")
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
for i, c := range clusterContainerMonitoringAddon.Containers {
|
||||
err := pods[0].Spec.Containers[i].ValidateResources(c)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
}
|
||||
} else {
|
||||
Skip("container monitoring disabled for this cluster, will not test")
|
||||
}
|
||||
})
|
||||
|
||||
It("should have cluster-omsagent replicaset running", func() {
|
||||
if hasContainerMonitoring, clusterContainerMonitoringAddon := eng.HasAddon("container-monitoring"); hasContainerMonitoring {
|
||||
running, err := pod.WaitOnReady("omsagent-rs", "kube-system", 3, 30*time.Second, cfg.Timeout)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(running).To(Equal(true))
|
||||
By("Ensuring that the correct resources have been applied")
|
||||
pods, err := pod.GetAllByPrefix("omsagent-rs", "kube-system")
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
for i, c := range clusterContainerMonitoringAddon.Containers {
|
||||
err := pods[0].Spec.Containers[i].ValidateResources(c)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
}
|
||||
} else {
|
||||
Skip("container monitoring disabled for this cluster, will not test")
|
||||
}
|
||||
})
|
||||
|
||||
It("should be successfully running kubepodinventory plugin - ContainerMonitoring", func() {
|
||||
if hasContainerMonitoring, _ := eng.HasAddon("container-monitoring"); hasContainerMonitoring {
|
||||
running, err := pod.WaitOnReady("omsagent-rs", "kube-system", 3, 30*time.Second, cfg.Timeout)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(running).To(Equal(true))
|
||||
By("Ensuring that the kubepodinventory plugin is writing data successfully")
|
||||
pods, err := pod.GetAllByPrefix("omsagent-rs", "kube-system")
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
_, err = pods[0].Exec("grep", "\"in_kube_podinventory::emit-stream : Success\"", "/var/opt/microsoft/omsagent/log/omsagent.log")
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
} else {
|
||||
Skip("container monitoring disabled for this cluster, will not test")
|
||||
}
|
||||
})
|
||||
|
||||
It("should be successfully running kubenodeinventory plugin - ContainerMonitoring", func() {
|
||||
if hasContainerMonitoring, _ := eng.HasAddon("container-monitoring"); hasContainerMonitoring {
|
||||
running, err := pod.WaitOnReady("omsagent-rs", "kube-system", 3, 30*time.Second, cfg.Timeout)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(running).To(Equal(true))
|
||||
By("Ensuring that the kubenodeinventory plugin is writing data successfully")
|
||||
pods, err := pod.GetAllByPrefix("omsagent-rs", "kube-system")
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
_, err = pods[0].Exec("grep", "\"in_kube_nodeinventory::emit-stream : Success\"", "/var/opt/microsoft/omsagent/log/omsagent.log")
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
} else {
|
||||
Skip("container monitoring disabled for this cluster, will not test")
|
||||
}
|
||||
})
|
||||
|
||||
It("should be successfully running cadvisor_perf plugin - ContainerMonitoring", func() {
|
||||
if hasContainerMonitoring, _ := eng.HasAddon("container-monitoring"); hasContainerMonitoring {
|
||||
running, err := pod.WaitOnReady("omsagent-", "kube-system", 3, 30*time.Second, cfg.Timeout)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(running).To(Equal(true))
|
||||
By("Ensuring that the cadvisor_perf plugin is writing data successfully")
|
||||
pods, err := pod.GetAllByPrefix("omsagent-", "kube-system")
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
_, err = pods[0].Exec("grep", "\"in_cadvisor_perf::emit-stream : Success\"", "/var/opt/microsoft/omsagent/log/omsagent.log")
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
} else {
|
||||
Skip("container monitoring disabled for this cluster, will not test")
|
||||
}
|
||||
})
|
||||
|
||||
It("should have rescheduler running", func() {
|
||||
if hasRescheduler, reschedulerAddon := eng.HasAddon("rescheduler"); hasRescheduler {
|
||||
running, err := pod.WaitOnReady("rescheduler", "kube-system", 3, 30*time.Second, cfg.Timeout)
|
||||
|
|
Загрузка…
Ссылка в новой задаче