Skip to content

Commit

Permalink
add step to create ingressclass and params
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviassss committed Sep 28, 2023
1 parent cc860d0 commit 5bc41ab
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
20 changes: 7 additions & 13 deletions scripts/run-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set -e

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
GINKGO_TEST_BUILD="$SCRIPT_DIR/../test/build"
OSTYPE=${OSTYPE:-"linux-gnu"}
source "$SCRIPT_DIR"/lib/common.sh

# TEST_IMAGE_REGISTRY is the registry in test-infra-* accounts where e2e test images are stored
Expand Down Expand Up @@ -135,29 +134,24 @@ function install_controller_for_adc_regions() {
# Iterate through the mapping and perform the replacements
for default_url in "${!url_mapping[@]}"; do
adc_url="${url_mapping[$default_url]}"
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i "" "s#$default_url#$adc_url#g" "$cert_manager_yaml"
else
sed -i "s#$default_url#$adc_url#g" "$cert_manager_yaml"
fi
sed -i "s#$default_url#$adc_url#g" "$cert_manager_yaml"
done
echo "Image URLs in $cert_manager_yaml have been updated to use the ADC registry"
kubectl apply -f $cert_manager_yaml || true
sleep 60s
echo "install the controller via yaml"
controller_yaml="$SCRIPT_DIR"/../test/prow/v2_6_0_adc.yaml
default_controller_image="public.ecr.aws/eks/aws-load-balancer-controller"
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i "" "s#$default_controller_image#$IMAGE#g" "$controller_yaml"
sed -i "" "s#your-cluster-name#$CLUSTER_NAME#g" "$controller_yaml"
else
sed -i "s#$default_controller_image#$IMAGE#g" "$controller_yaml"
sed -i "s#your-cluster-name#$CLUSTER_NAME#g" "$controller_yaml"
fi
sed -i "s#$default_controller_image#$IMAGE#g" "$controller_yaml"
echo "Image URL in $controller_yaml has been updated to $IMAGE"
sed -i "s#your-cluster-name#$CLUSTER_NAME#g" "$controller_yaml"
echo "cluster name in $controller_yaml has been update to $CLUSTER_NAME"
kubectl apply -f $controller_yaml || true
kubectl rollout status -n kube-system deployment aws-load-balancer-controller || true

echo "apply the manifest for ingressclass and ingressclassparam"
ingclass_yaml="$SCRIPT_DIR"/../test/prow/v2_6_0_ingclass.yaml
kubectl apply -f $ingclass_yaml || true
}

echo "installing AWS load balancer controller"
Expand Down
19 changes: 19 additions & 0 deletions test/prow/v2_6_0_ingclass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: elbv2.k8s.aws/v1beta1
kind: IngressClassParams
metadata:
labels:
app.kubernetes.io/name: aws-load-balancer-controller
name: alb
---
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
labels:
app.kubernetes.io/name: aws-load-balancer-controller
name: alb
spec:
controller: ingress.k8s.aws/alb
parameters:
apiGroup: elbv2.k8s.aws
kind: IngressClassParams
name: alb

0 comments on commit 5bc41ab

Please sign in to comment.