-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some resources required for testing specific test cases (#422)
* Add some resources required for testing specific test cases The ones included in this change allow testing "lifecycle-affinity-required-pods".
- Loading branch information
Showing
5 changed files
with
120 additions
and
0 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
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,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Initialization | ||
SCRIPT_DIR=$(dirname "$0") | ||
|
||
# shellcheck disable=SC1091 # Not following. | ||
source "$SCRIPT_DIR"/init-env.sh | ||
|
||
mkdir -p ./temp | ||
|
||
"$SCRIPT_DIR"/mo ./test-target/special-resources.yaml >./temp/rendered-test-special-resources.yaml | ||
oc delete --filename ./temp/rendered-test-special-resources.yaml -n "$TNF_EXAMPLE_CNF_NAMESPACE" --ignore-not-found=true | ||
rm ./temp/rendered-test-special-resources.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,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Initialization | ||
SCRIPT_DIR=$(dirname "$0") | ||
|
||
# shellcheck disable=SC1091 # Not following. | ||
source "$SCRIPT_DIR"/init-env.sh | ||
|
||
mkdir -p ./temp | ||
|
||
"$SCRIPT_DIR"/mo ./test-target/special-resources.yaml >./temp/rendered-test-special-resources.yaml | ||
oc apply --filename ./temp/rendered-test-special-resources.yaml --namespace "$TNF_EXAMPLE_CNF_NAMESPACE" | ||
rm ./temp/rendered-test-special-resources.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,92 @@ | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: special-dp | ||
namespace: {{ TNF_EXAMPLE_CNF_NAMESPACE }} | ||
labels: | ||
test-network-function.com/generic: target | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
app: special-dp | ||
template: | ||
metadata: | ||
labels: | ||
test-network-function.com/generic: target | ||
test-network-function.com/container: target | ||
app: special-dp | ||
AffinityRequired: "true" | ||
name: special-dp | ||
spec: | ||
terminationGracePeriodSeconds: 30 | ||
automountServiceAccountToken: false | ||
serviceAccountName: test-pod-sa | ||
containers: | ||
- image: quay.io/testnetworkfunction/cnf-test-partner:latest | ||
imagePullPolicy: IfNotPresent | ||
name: test | ||
ports: | ||
- name: "http-probe" | ||
containerPort: 8080 | ||
resources: | ||
limits: | ||
memory: 512Mi | ||
cpu: 0.25 | ||
lifecycle: | ||
postStart: | ||
exec: | ||
command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /tmp/message"] | ||
preStop: | ||
exec: | ||
command: ["/bin/sh", "-c", "killall -0 tail"] | ||
livenessProbe: | ||
httpGet: | ||
path: /health | ||
port: 8080 | ||
httpHeaders: | ||
- name: health-check | ||
value: liveness | ||
initialDelaySeconds: 10 | ||
periodSeconds: 5 | ||
readinessProbe: | ||
httpGet: | ||
path: /ready | ||
port: 8080 | ||
httpHeaders: | ||
- name: health-check | ||
value: readiness | ||
initialDelaySeconds: 10 | ||
periodSeconds: 5 | ||
startupProbe: | ||
httpGet: | ||
path: /health | ||
port: 8080 | ||
httpHeaders: | ||
- name: health-check | ||
value: startup | ||
failureThreshold: 10 | ||
periodSeconds: 5 | ||
command: ["./bin/app"] | ||
terminationMessagePolicy: FallbackToLogsOnError | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: node-role.kubernetes.io/worker | ||
operator: In | ||
values: | ||
- worker | ||
--- | ||
apiVersion: policy/v1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: special-pdb | ||
namespace: {{ TNF_EXAMPLE_CNF_NAMESPACE }} | ||
spec: | ||
minAvailable: 1 | ||
selector: | ||
matchLabels: | ||
app: special-dp |