Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e: test case for health probe annotations (#1117)
* e2e test case for health probe annotations * add the e2e prefix * correct yaml, test health-probe-hostname in ssl-e2e-redirect * use the right https endpoint * correct typo * set namespace when apply manifest * add helper to update k8s resource object * add missing namespace
- Loading branch information
Showing
11 changed files
with
415 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...ts/e2e/cmd/runner/testdata/one-namespace-one-ingress/health-probe-configurations/app.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: test-deployment | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: test-app | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: test-app | ||
spec: | ||
containers: | ||
- name: test-app | ||
imagePullPolicy: Always | ||
image: docker.io/kennethreitz/httpbin | ||
ports: | ||
- containerPort: 80 | ||
livenessProbe: | ||
httpGet: | ||
path: /status/200 | ||
port: 80 | ||
initialDelaySeconds: 3 | ||
periodSeconds: 3 | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: test-service | ||
spec: | ||
selector: | ||
app: test-app | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 | ||
|
||
--- | ||
|
||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: test-ingress | ||
annotations: | ||
kubernetes.io/ingress.class: azure/application-gateway | ||
appgw.ingress.kubernetes.io/health-probe-interval: "1" | ||
appgw.ingress.kubernetes.io/health-probe-unhealthy-threshold: "3" | ||
appgw.ingress.kubernetes.io/health-probe-timeout: "1" | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: /status/* | ||
backend: | ||
serviceName: test-service | ||
servicePort: 80 |
18 changes: 18 additions & 0 deletions
18
...runner/testdata/one-namespace-one-ingress/health-probe-configurations/probe-path-bad.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: test-ingress | ||
annotations: | ||
kubernetes.io/ingress.class: azure/application-gateway | ||
appgw.ingress.kubernetes.io/health-probe-path: "/statuss/200" | ||
appgw.ingress.kubernetes.io/health-probe-interval: "1" | ||
appgw.ingress.kubernetes.io/health-probe-unhealthy-threshold: "3" | ||
appgw.ingress.kubernetes.io/health-probe-timeout: "1" | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: /status/* | ||
backend: | ||
serviceName: test-service | ||
servicePort: 80 |
18 changes: 18 additions & 0 deletions
18
...unner/testdata/one-namespace-one-ingress/health-probe-configurations/probe-path-good.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: test-ingress | ||
annotations: | ||
kubernetes.io/ingress.class: azure/application-gateway | ||
appgw.ingress.kubernetes.io/health-probe-path: "/status/200" | ||
appgw.ingress.kubernetes.io/health-probe-interval: "1" | ||
appgw.ingress.kubernetes.io/health-probe-unhealthy-threshold: "3" | ||
appgw.ingress.kubernetes.io/health-probe-timeout: "1" | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: /status/* | ||
backend: | ||
serviceName: test-service | ||
servicePort: 80 |
18 changes: 18 additions & 0 deletions
18
...runner/testdata/one-namespace-one-ingress/health-probe-configurations/probe-port-bad.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: test-ingress | ||
annotations: | ||
kubernetes.io/ingress.class: azure/application-gateway | ||
appgw.ingress.kubernetes.io/health-probe-port: "81" | ||
appgw.ingress.kubernetes.io/health-probe-interval: "1" | ||
appgw.ingress.kubernetes.io/health-probe-unhealthy-threshold: "3" | ||
appgw.ingress.kubernetes.io/health-probe-timeout: "1" | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: /status/* | ||
backend: | ||
serviceName: test-service | ||
servicePort: 80 |
Oops, something went wrong.