mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Adding a readiness probe to kubectl e2e tests.
This commit is contained in:
parent
3bbf55d38b
commit
3f58a0b15b
19
examples/readiness-probe-pod
Normal file
19
examples/readiness-probe-pod
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Copy of pod.yaml without file extension for test
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: nginx
|
||||||
|
labels:
|
||||||
|
name: nginx
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: 80
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 5
|
@ -170,8 +170,8 @@ var _ = Describe("Kubectl client", func() {
|
|||||||
var podPath string
|
var podPath string
|
||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
podPath = filepath.Join(testContext.RepoRoot, "docs/user-guide/pod.yaml")
|
podPath = filepath.Join(testContext.RepoRoot, "examples/readiness-probe-pod")
|
||||||
By("creating the pod")
|
By(fmt.Sprintf("creating the pod from %v", podPath))
|
||||||
runKubectlOrDie("create", "-f", podPath, fmt.Sprintf("--namespace=%v", ns))
|
runKubectlOrDie("create", "-f", podPath, fmt.Sprintf("--namespace=%v", ns))
|
||||||
checkPodsRunningReady(c, ns, []string{simplePodName}, podStartTimeout)
|
checkPodsRunningReady(c, ns, []string{simplePodName}, podStartTimeout)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user