@@ -84,13 +84,18 @@ applyChart() {
8484 local version=$5
8585 local opts=$6
8686 local installed=$7
87+ local crd_cmd=$8
8788 local chart_repo=" $chart_name $chart_name --repo $repo "
8889 local msg=" $pretty not found. Installing..."
8990
9091 if [[ " $repo " =~ ^oci:// ]] ; then
9192 chart_repo=" $chart_name $repo "
9293 fi
9394
95+ if [ -n " $crd_cmd " ] ; then
96+ runOrPrint $crd_cmd
97+ fi
98+
9499 if [ -n " $installed " ] && [ " $UPGRADE " = false ] ; then
95100 echo " $pretty has already been installed."
96101 else
@@ -151,13 +156,16 @@ CM_OPTS="--set crds.enabled=true \
151156--set webhook.tolerations[0].'effect'='NoSchedule' \
152157--set webhook.tolerations[0].'operator'='Exists'"
153158
159+ ING_CRD_CMD=" "
154160if [ " $INGRESS " = " traefik" ]; then
155161 ING_PRETTY=" Traefik Proxy (Ingress/Gateway API)"
156162 ING_REPO=https://traefik.github.io/charts
157163 ING_CHART_NAME=traefik
158164 ING_NAMESPACE=${TRAEFIK_NAMESPACE:- traefik}
159165 ING_VERSION=${TRAEFIK_VERSION:- }
160166 ING_INSTALLED=$( kubectl get clusterroles -l app.kubernetes.io/name=traefik 2> /dev/null)
167+ ING_CRD_CMD=" helm show crds traefik --repo $ING_REPO | kubectl apply --server-side --force-conflicts -f - && \
168+ kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.5.1/standard-install.yaml"
161169 NGINX_COMPAT_VALUES=" \
162170--set providers.kubernetesIngressNGINX.enabled=true \
163171--set providers.kubernetesIngressNGINX.ingressClassByName=true \
@@ -264,10 +272,10 @@ for c in ${COMPONENTS[@]} ; do
264272 message " c=${c} " " debug"
265273 case " $c " in
266274 cert-manager)
267- applyChart " $CM_PRETTY " " $CM_REPO " " $CM_CHART_NAME " " $CM_NAMESPACE " " $CM_VERSION " " $CM_OPTS " " $CM_INSTALLED "
275+ applyChart " $CM_PRETTY " " $CM_REPO " " $CM_CHART_NAME " " $CM_NAMESPACE " " $CM_VERSION " " $CM_OPTS " " $CM_INSTALLED " " "
268276 ;;
269277 ingress)
270- applyChart " $ING_PRETTY " " $ING_REPO " " $ING_CHART_NAME " " $ING_NAMESPACE " " $ING_VERSION " " $ING_OPTS " " $ING_INSTALLED "
278+ applyChart " $ING_PRETTY " " $ING_REPO " " $ING_CHART_NAME " " $ING_NAMESPACE " " $ING_VERSION " " $ING_OPTS " " $ING_INSTALLED " " $ING_CRD_CMD "
271279 if [ " $INGRESS " = " traefik" ]; then
272280 NGINX_CURRENT_CONTROLLER=$( kubectl get ingressclass nginx -o=" jsonpath={.spec.controller}" 2> /dev/null || true)
273281 if [ -z " $NGINX_CURRENT_CONTROLLER " ]; then
@@ -278,7 +286,7 @@ for c in ${COMPONENTS[@]} ; do
278286 fi
279287 ;;
280288 secrets)
281- applyChart " $SEC_PRETTY " " $SEC_REPO " " $SEC_CHART_NAME " " $SEC_NAMESPACE " " $SEC_VERSION " " $SEC_OPTS " " $SEC_INSTALLED "
289+ applyChart " $SEC_PRETTY " " $SEC_REPO " " $SEC_CHART_NAME " " $SEC_NAMESPACE " " $SEC_VERSION " " $SEC_OPTS " " $SEC_INSTALLED " " "
282290 ;;
283291 esac
284292done
0 commit comments