Skip to content

Commit 1e4b89d

Browse files
Use rendered contour Gateway API yamls
By doing that we avoid restarting contour. This a) speeds deployment up b) avoids Contour occasionally not noticing Gateway API enablement change in its config map Co-authored-by: Danail Branekov <danailster@gmail.com>
1 parent 8051ad3 commit 1e4b89d

15 files changed

+19714
-8829
lines changed

scripts/install-dependencies.sh

+8-14
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ TEST_DIR="$SCRIPT_DIR/../tests"
77
DEP_DIR="$TEST_DIR/dependencies"
88
VENDOR_DIR="$TEST_DIR/vendor"
99

10+
TEMP_FILES=()
11+
trap 'for file in ${TEMP_FILES[@]}; do rm -rf $file; done' EXIT
12+
1013
function usage_text() {
1114
cat <<EOF
1215
Usage:
@@ -66,27 +69,18 @@ echo "********************"
6669
echo " Installing Contour"
6770
echo "********************"
6871

69-
kubectl apply -f "$VENDOR_DIR/gateway-api"
70-
kubectl apply -f "$VENDOR_DIR/contour"
72+
TEMP_FILES+=("$DEP_DIR/contour/contour-gateway.yaml")
73+
cp "$VENDOR_DIR/contour/contour-gateway.yaml" "$DEP_DIR/contour/contour-gateway.yaml"
74+
kubectl apply -k "$DEP_DIR/contour"
75+
7176
kubectl apply -f - <<EOF
72-
kind: ConfigMap
73-
apiVersion: v1
74-
metadata:
75-
name: contour
76-
namespace: projectcontour
77-
data:
78-
contour.yaml: |
79-
gateway:
80-
controllerName: projectcontour.io/gateway-controller
81-
---
8277
kind: GatewayClass
8378
apiVersion: gateway.networking.k8s.io/v1beta1
8479
metadata:
8580
name: contour
8681
spec:
8782
controllerName: projectcontour.io/gateway-controller
8883
EOF
89-
kubectl -n projectcontour rollout restart deployment/contour
9084

9185
echo "************************************"
9286
echo " Installing Service Binding Runtime"
@@ -102,7 +96,7 @@ if ! kubectl get apiservice v1beta1.metrics.k8s.io >/dev/null 2>&1; then
10296
echo " Installing Metrics Server Insecure TLS options"
10397
echo "************************************************"
10498

105-
trap "rm $DEP_DIR/insecure-metrics-server/components.yaml" EXIT
99+
TEMP_FILES+=("$DEP_DIR/insecure-metrics-server/components.yaml")
106100
cp "$VENDOR_DIR/metrics-server-local/components.yaml" "$DEP_DIR/insecure-metrics-server/components.yaml"
107101
kubectl apply -k "$DEP_DIR/insecure-metrics-server"
108102
else

scripts/installer/install-korifi-kind.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ spec:
7373
- bash
7474
- -c
7575
- |
76+
set -euo pipefail
77+
7678
scripts/install-dependencies.sh --insecure-tls-metrics-server
7779
7880
helm repo add twuni https://helm.twun.io
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
resources:
2+
- contour-gateway.yaml
3+
4+
patches:
5+
- patch: |
6+
$patch: delete
7+
apiVersion: gateway.networking.k8s.io/v1beta1
8+
kind: GatewayClass
9+
metadata:
10+
name: example
11+
target:
12+
kind: GatewayClass
13+
- patch: |
14+
$patch: delete
15+
apiVersion: gateway.networking.k8s.io/v1beta1
16+
kind: Gateway
17+
metadata:
18+
name: example
19+
target:
20+
kind: Gateway

tests/vendir.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,13 @@ directories:
3232
depth: 1
3333
refSelection:
3434
semver:
35-
constraints: ">=1.19.1"
35+
constraints: ">=1.27.0"
3636
includePaths:
37-
- examples/contour/*.yaml
38-
newRootPath: examples/contour
37+
- examples/render/contour-gateway.yaml
38+
newRootPath: examples/render
3939
- path: gateway-api
4040
githubRelease:
4141
slug: kubernetes-sigs/gateway-api
4242
latest: true
4343
disableAutoChecksumValidation: true
4444
assetNames: ["experimental-install.yaml"]
45-

tests/vendor/contour/00-common.yaml

-17
This file was deleted.

tests/vendor/contour/01-contour-config.yaml

-185
This file was deleted.

0 commit comments

Comments
 (0)