Skip to content

Commit

Permalink
OCTOPUS-596: refactor the NodePort scripts and tests for power workloads
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Bastide <[email protected]>
  • Loading branch information
prb112 committed Mar 5, 2024
1 parent 6f07768 commit 65bdd5b
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: apps/v1
kind: Deployment
kind: DaemonSet
metadata:
name: ocp4-net-power-workload
namespace: openshift-net-workload
labels:
app: power-net-workload
spec:
replicas: 1
replicas: 2
selector:
matchLabels:
app: power-net-workload
Expand All @@ -22,19 +22,12 @@ spec:
- key: node-role.kubernetes.io/master
operator: Exists
effect: NoSchedule
nodeSelector:
kubernetes.io/arch: ppc64le
containers:
- name: agnhost
image: registry.k8s.io/e2e-test-images/agnhost:2.45
imagePullPolicy: Always
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- ppc64le
ports:
- containerPort: 8080
type: TCP
Expand Down
38 changes: 38 additions & 0 deletions manifests/network/pod-debug-run.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: v1
kind: Pod
metadata:
name: runner
labels:
app: power-net-workload
spec:
containers:
- name: runner
image: quay.io/centos/centos:stream9
imagePullPolicy: Always
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- ppc64le
command: ["/bin/sleep"]
args: ["infinity"]
resources:
limits:
memory: 100Mi
requests:
cpu: 100m
memory: 100Mi
securityContext:
privileged: false
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
runAsNonRoot: true
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
22 changes: 22 additions & 0 deletions scripts/run-svc-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

# The default port range is 30000-32767
# https://docs.openshift.com/container-platform/4.15/networking/configuring-node-port-service-range.html
for PORT in echo {30000..32767}
do
echo "\nTESTING PORT: ${PORT}"
cat pod-service.yaml | sed 's|30007|'${PORT}'|g' | oc apply -f -
echo "waiting 10 seconds"
sleep 10

for TRY in echo {0..5}
do
echo "TRY: ${TRY}"
echo "Putting a debug pod on the opposite - powerworker"
oc apply -f pod-debug-run.yaml
sleep 1

oc rsh pod/runner curl http://power-net-workload-svc.openshift-net-workload.svc.cluster.local:8080/status -k
[ $? -eq 1 ] && echo "Failed to curl"
done
done

0 comments on commit 65bdd5b

Please sign in to comment.