Skip to content
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

Update prepare-kind-cluster script to pin Kubernetes 1.24 #2473

Merged
merged 1 commit into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions scripts/installer
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,24 @@ fi
}

ingress() {
INGRESS_DEFAULT_CLASS_NAME_CONFIG=""
if [ "$INGRESS_DEFAULT_CLASS" == "true" ]; then
INGRESS_DEFAULT_CLASS_NAME_CONFIG="ingressClassName: nginx"
cat <<EOF >> $TMP_FILE
---
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
labels:
app.kubernetes.io/component: controller
name: nginx
annotations:
ingressclass.kubernetes.io/is-default-class: "true"
spec:
controller: k8s.io/ingress-nginx
EOF
fi

if [ ! -z "$INGRESS_URL" ] && [ ! -z "$INGRESS_SECRET" ]; then
cat <<EOF >> $TMP_FILE
---
Expand All @@ -297,6 +315,7 @@ metadata:
name: tekton-dashboard
namespace: $INSTALL_NAMESPACE
spec:
$INGRESS_DEFAULT_CLASS_NAME_CONFIG
tls:
- hosts:
- $INGRESS_URL
Expand All @@ -321,6 +340,7 @@ metadata:
name: tekton-dashboard
namespace: $INSTALL_NAMESPACE
spec:
$INGRESS_DEFAULT_CLASS_NAME_CONFIG
rules:
- host: $INGRESS_URL
http:
Expand Down Expand Up @@ -515,6 +535,9 @@ while [[ $# -gt 0 ]]; do
shift
TENANT_NAMESPACE="${1}"
;;
'--ingress-default-class')
INGRESS_DEFAULT_CLASS="true"
;;
'--ingress-url')
shift
INGRESS_URL="${1}"
Expand Down
16 changes: 12 additions & 4 deletions scripts/prepare-kind-cluster
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Copyright 2020-2021 The Tekton Authors
# Copyright 2020-2022 The Tekton Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -16,16 +16,24 @@ set -e
CLUSTERNAME=tekton-dashboard
DEFAULT_OPTIONS="--log-format console"
ENABLE_INGRESS="false"
KUBERNETES_NODE_IMAGE="kindest/node:v1.24.4@sha256:adfaebada924a26c2c9308edd53c6e33b3d4e453782c0063dc0028bdebaddf98"

create_cluster() {
if [ "$ENABLE_INGRESS" == "false" ]; then
kind create cluster --name $CLUSTERNAME
kind create cluster --name $CLUSTERNAME --config - <<EOF
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: $KUBERNETES_NODE_IMAGE
EOF
else
kind create cluster --name $CLUSTERNAME --config - <<EOF
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: $KUBERNETES_NODE_IMAGE
kubeadmConfigPatches:
- |
kind: InitConfiguration
Expand Down Expand Up @@ -58,7 +66,7 @@ header() {

install_ingress_nginx() {
header 'Installing ingress controller'
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-0.32.0/deploy/static/provider/kind/deploy.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.3.1/deploy/static/provider/kind/deploy.yaml
sleep 20
kubectl wait -n ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=90s
}
Expand Down Expand Up @@ -102,7 +110,7 @@ case $1 in
install_ingress_nginx
install_pipelines
install_triggers
install_dashboard --ingress-url tekton-dashboard.127.0.0.1.nip.io $@
install_dashboard --ingress-url tekton-dashboard.127.0.0.1.nip.io --ingress-default-class $@
;;
'update'|u)
shift
Expand Down