Add labels to test pod to match network policy selectors: - app=api-gateway (matches network policy pod selector) - managed-by=argocd (matches network policy pod selector) - role=test (identify as test pod) - test-run=<sha> (track which test run spawned it) Network policy 'api-gateway' in api namespace already allows egress to: ✅ kube-system (DNS resolution) ✅ poimen (port 8080 - Memory service) ✅ temporal (port 7233 - Workflow service) ✅ storage (ports 80, 9000 - S3/MinIO) ✅ sqs (port 9090 - SQS service) ✅ iam (ports 9000, 9443 - Authentik/IAM) Test pod inherits same network access as production pods via labels. No additional network policies needed.
This commit is contained in:
@@ -84,6 +84,7 @@ jobs:
|
|||||||
--namespace=api \
|
--namespace=api \
|
||||||
--restart=Never \
|
--restart=Never \
|
||||||
--port=8080 \
|
--port=8080 \
|
||||||
|
--labels="app=api-gateway,managed-by=argocd,role=test,test-run=${{ steps.sha.outputs.short_sha }}" \
|
||||||
--overrides='{"spec":{"containers":[{"name":"gateway","securityContext":{"runAsNonRoot":true,"runAsUser":65532,"allowPrivilegeEscalation":false}}]}}'
|
--overrides='{"spec":{"containers":[{"name":"gateway","securityContext":{"runAsNonRoot":true,"runAsUser":65532,"allowPrivilegeEscalation":false}}]}}'
|
||||||
|
|
||||||
echo "Waiting for test pod to be ready..."
|
echo "Waiting for test pod to be ready..."
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ metadata:
|
|||||||
namespace: api
|
namespace: api
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: api-gateway
|
||||||
|
managed-by: test
|
||||||
|
role: integration-test
|
||||||
spec:
|
spec:
|
||||||
serviceAccountName: api-gateway
|
serviceAccountName: api-gateway
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
|
|||||||
Reference in New Issue
Block a user