mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
Add a negative test for HTTP health checks
This commit is contained in:
parent
d04fce045e
commit
5be9ff70af
@ -520,6 +520,39 @@ var _ = Describe("Pods", func() {
|
|||||||
}, true)
|
}, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("should *not* be restarted with a /healthz http liveness probe", func() {
|
||||||
|
runLivenessTest(framework.Client, framework.Namespace.Name, &api.Pod{
|
||||||
|
ObjectMeta: api.ObjectMeta{
|
||||||
|
Name: "liveness-http",
|
||||||
|
Labels: map[string]string{"test": "liveness"},
|
||||||
|
},
|
||||||
|
Spec: api.PodSpec{
|
||||||
|
Containers: []api.Container{
|
||||||
|
{
|
||||||
|
Name: "liveness",
|
||||||
|
Image: "gcr.io/google_containers/nettest:1.6",
|
||||||
|
// These args are garbage but the image will exit if they're not there
|
||||||
|
// we just care about /read serving a 200, which it always does.
|
||||||
|
Args: []string{
|
||||||
|
"-service=liveness-http",
|
||||||
|
"-peers=1",
|
||||||
|
"-namespace=" + framework.Namespace.Name},
|
||||||
|
Ports: []api.ContainerPort{{ContainerPort: 8080}},
|
||||||
|
LivenessProbe: &api.Probe{
|
||||||
|
Handler: api.Handler{
|
||||||
|
HTTPGet: &api.HTTPGetAction{
|
||||||
|
Path: "/read",
|
||||||
|
Port: util.NewIntOrStringFromInt(8080),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
InitialDelaySeconds: 15,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
|
||||||
// The following tests for remote command execution and port forwarding are
|
// The following tests for remote command execution and port forwarding are
|
||||||
// commented out because the GCE environment does not currently have nsenter
|
// commented out because the GCE environment does not currently have nsenter
|
||||||
// in the kubelet's PATH, nor does it have socat installed. Once we figure
|
// in the kubelet's PATH, nor does it have socat installed. Once we figure
|
||||||
|
Loading…
Reference in New Issue
Block a user