2022-12-21 04:49:21 -05:00
|
|
|
name: E2E load balancer test
|
|
|
|
description: "Test load balancer functionality."
|
|
|
|
|
|
|
|
inputs:
|
|
|
|
kubeconfig:
|
|
|
|
description: "The kubeconfig of the cluster to test."
|
|
|
|
required: true
|
2024-05-10 02:51:32 -04:00
|
|
|
cloudProvider:
|
|
|
|
description: "The CSP this test runs on. Some tests exercise functionality not supported everywhere."
|
|
|
|
required: false
|
2022-12-21 04:49:21 -05:00
|
|
|
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
# This action assumes that the cluster is in an ready state, with all nodes joined and ready.
|
|
|
|
- name: Create deployments
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
KUBECONFIG: ${{ inputs.kubeconfig }}
|
|
|
|
working-directory: ./.github/actions/e2e_lb
|
|
|
|
run: |
|
|
|
|
kubectl apply -f ns.yml
|
|
|
|
kubectl apply -f lb.yml
|
2024-05-14 05:46:52 -04:00
|
|
|
bazel run --test_timeout=14400 //e2e/internal/lb:lb_test
|
2022-12-21 04:49:21 -05:00
|
|
|
|
2024-05-10 02:51:32 -04:00
|
|
|
- name: Test AWS Ingress
|
|
|
|
if: inputs.cloudProvider == 'aws'
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
KUBECONFIG: ${{ inputs.kubeconfig }}
|
|
|
|
working-directory: ./.github/actions/e2e_lb
|
|
|
|
run: |
|
|
|
|
kubectl apply -f aws-ingress.yml
|
|
|
|
kubectl wait -n lb-test ing/whoami --for=jsonpath='{.status.loadBalancer.ingress}' --timeout=5m
|
|
|
|
host=$(kubectl get -n lb-test ingress whoami -o=jsonpath='{.status.loadBalancer.ingress[0].hostname}')
|
|
|
|
for i in $(seq 30); do
|
|
|
|
curl --silent --fail --connect-timeout 5 --output /dev/null http://$host && exit 0
|
|
|
|
sleep 10
|
|
|
|
done
|
|
|
|
echo "::error::Ingress did not become ready in the alloted time."
|
|
|
|
kubectl describe ing -n lb-test
|
|
|
|
exit 1
|
|
|
|
|
2022-12-21 04:49:21 -05:00
|
|
|
- name: Delete deployment
|
|
|
|
if: always()
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
KUBECONFIG: ${{ inputs.kubeconfig }}
|
|
|
|
working-directory: ./.github/actions/e2e_lb
|
|
|
|
run: |
|
|
|
|
kubectl delete -f lb.yml
|
2024-05-10 02:51:32 -04:00
|
|
|
kubectl delete --ignore-not-found -f aws-ingress.yml
|
2023-01-03 06:41:46 -05:00
|
|
|
kubectl delete -f ns.yml --timeout=5m
|