-
Notifications
You must be signed in to change notification settings - Fork 91
Run zenko tests out of cluster #2336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1b3fbc6
cbbcb61
ed605fc
fac0083
b87ae37
1348694
64c1ca3
fd8ba68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,9 +87,5 @@ runs: | |
| if: ${{ inputs.deploy_metadata == 'true' }} | ||
| - name: End-to-end configuration | ||
| shell: bash | ||
| run: bash configure-e2e.sh "end2end" ${E2E_IMAGE_NAME}:${E2E_IMAGE_TAG} "default" | ||
| working-directory: ./.github/scripts/end2end | ||
| - name: Linting | ||
| shell: bash | ||
| run: bash run-e2e-test.sh "end2end" ${E2E_IMAGE_NAME}:${E2E_IMAGE_TAG} "lint" "default" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to do the linting in the deploy action..
|
||
| run: bash configure-e2e.sh "end2end" "default" | ||
| working-directory: ./.github/scripts/end2end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,9 @@ set -exu | |
|
|
||
| DIR=$(dirname "$0") | ||
|
|
||
| # Set up ingress endpoints and /etc/hosts for out-of-cluster access | ||
| source "$DIR/configure-e2e-endpoints.sh" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This setup will be common to ctst and end2end tests. |
||
|
|
||
| # Get kafka image name and tag | ||
| kafka_image() { | ||
| source <( "$DIR"/../../../solution/kafka_build_vars.sh ) | ||
|
|
@@ -76,9 +79,6 @@ UUID=$(kubectl get secret -l app.kubernetes.io/name=backbeat-config,app.kubernet | |
| UUID=${UUID%.*} | ||
| UUID=${UUID:1} | ||
|
|
||
| echo "127.0.0.1 iam.zenko.local s3-local-file.zenko.local keycloak.zenko.local \ | ||
| sts.zenko.local management.zenko.local s3.zenko.local website.mywebsite.com utilization.zenko.local" | sudo tee -a /etc/hosts | ||
|
|
||
| # Add bucket notification target | ||
| envsubst < ./configs/notification_destinations.yaml | kubectl apply -f - | ||
| # Wait for service stabilization | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| #!/bin/bash | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be idempotent. I used it multiple times in Codespace without issues |
||
|
|
||
| # Only set strict mode when executed directly, not when sourced | ||
| if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then | ||
| set -eu | ||
| fi | ||
|
|
||
| ZENKO_NAME="${ZENKO_NAME:-end2end}" | ||
| NAMESPACE="${NAMESPACE:-default}" | ||
|
|
||
| # --- Create missing Ingress resources --- | ||
|
|
||
| apply_ingress() { | ||
| local name="$1" | ||
| local host="$2" | ||
| local service="$3" | ||
|
|
||
| # Skip if an ingress already serves this host (e.g., from a prior Zenko instance in PRA) | ||
| if kubectl get ingress -A -o jsonpath='{.items[*].spec.rules[*].host}' | grep -qw "${host}"; then | ||
| echo "Ingress for ${host} already exists, skipping" | ||
| return | ||
| fi | ||
|
|
||
| kubectl apply -f - <<EOF | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: Ingress | ||
| metadata: | ||
| name: ${name} | ||
| namespace: ${NAMESPACE} | ||
| annotations: | ||
| nginx.ingress.kubernetes.io/proxy-body-size: "0" | ||
| spec: | ||
| ingressClassName: nginx | ||
| rules: | ||
| - host: ${host} | ||
| http: | ||
| paths: | ||
| - backend: | ||
| service: | ||
| name: ${service} | ||
| port: | ||
| name: http | ||
| path: / | ||
| pathType: Prefix | ||
| EOF | ||
| } | ||
|
|
||
| # Backbeat API — used by node tests (CRR) and CTST | ||
| apply_ingress \ | ||
| "${ZENKO_NAME}-backbeat-api-ingress" \ | ||
| "backbeat-api.zenko.local" \ | ||
| "${ZENKO_NAME}-management-backbeat-api" | ||
|
|
||
| # Vault auth API — used by CTST | ||
| apply_ingress \ | ||
| "${ZENKO_NAME}-vault-auth-api-ingress" \ | ||
| "vault-auth.zenko.local" \ | ||
| "${ZENKO_NAME}-connector-vault-auth-api" | ||
|
|
||
| # S3C (Ring) — only when metadata namespace exists (ENABLE_RING_TESTS=true) | ||
| if kubectl get namespace metadata &>/dev/null; then | ||
| kubectl apply -f - <<EOF | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: Ingress | ||
| metadata: | ||
| name: s3c-ingress | ||
| namespace: metadata | ||
| annotations: | ||
| nginx.ingress.kubernetes.io/proxy-body-size: "0" | ||
| spec: | ||
| ingressClassName: nginx | ||
| rules: | ||
| - host: s3c.local | ||
| http: | ||
| paths: | ||
| - backend: | ||
| service: | ||
| name: s3c-cloudserver | ||
| port: | ||
| number: 8000 | ||
| path: / | ||
| pathType: Prefix | ||
| EOF | ||
| fi | ||
|
|
||
| # --- Wait for ingress controller to pick them up --- | ||
|
|
||
| if kubectl get ingress "${ZENKO_NAME}-backbeat-api-ingress" &>/dev/null; then | ||
| kubectl wait --for=jsonpath='{.status.loadBalancer.ingress}' \ | ||
| ingress/${ZENKO_NAME}-backbeat-api-ingress \ | ||
| ingress/${ZENKO_NAME}-vault-auth-api-ingress \ | ||
| --timeout=60s 2>/dev/null || true | ||
| fi | ||
|
|
||
| if kubectl get ingress s3c-ingress -n metadata &>/dev/null; then | ||
| kubectl wait --for=jsonpath='{.status.loadBalancer.ingress}' \ | ||
| ingress/s3c-ingress -n metadata \ | ||
| --timeout=60s 2>/dev/null || true | ||
| fi | ||
|
|
||
| # --- /etc/hosts setup --- | ||
|
|
||
| ZENKO_HOSTS="\ | ||
| s3.zenko.local \ | ||
| iam.zenko.local \ | ||
| sts.zenko.local \ | ||
| management.zenko.local \ | ||
| keycloak.zenko.local \ | ||
| utilization.zenko.local \ | ||
| backbeat-api.zenko.local \ | ||
| vault-auth.zenko.local \ | ||
| aws-mock.zenko.local \ | ||
| azure-mock.zenko.local \ | ||
| devstoreaccount1.blob.azure-mock.zenko.local \ | ||
| devstoreaccount1.queue.azure-mock.zenko.local \ | ||
| s3c.local \ | ||
| s3-local-file.zenko.local \ | ||
| website.mywebsite.com" | ||
|
|
||
| if ! grep -q "backbeat-api.zenko.local" /etc/hosts 2>/dev/null; then | ||
| echo "127.0.0.1 ${ZENKO_HOSTS}" | sudo tee -a /etc/hosts | ||
| fi | ||
|
|
||
| # --- Export endpoint variables --- | ||
| # These use the ingress hostnames, reachable from outside the cluster. | ||
|
|
||
| export CLOUDSERVER_HOST="s3.zenko.local" | ||
| export CLOUDSERVER_ENDPOINT="http://s3.zenko.local" | ||
| export BACKBEAT_API_ENDPOINT="http://backbeat-api.zenko.local" | ||
| export VAULT_ENDPOINT="http://iam.zenko.local" | ||
| export VAULT_STS_ENDPOINT="http://sts.zenko.local" | ||
| export VAULT_AUTH_HOST="vault-auth.zenko.local" | ||
|
|
||
| echo "=== Endpoints configured for out-of-cluster access ===" | ||
| echo " S3: ${CLOUDSERVER_ENDPOINT}" | ||
| echo " Backbeat API: ${BACKBEAT_API_ENDPOINT}" | ||
| echo " Vault IAM: ${VAULT_ENDPOINT}" | ||
| echo " Vault STS: ${VAULT_STS_ENDPOINT}" | ||
| echo " Vault Auth: http://${VAULT_AUTH_HOST}" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this anymore as we don't need the container, and config is handled differently