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

Add legacy varient to kind config patch #16176

Merged
merged 2 commits into from Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions prow/config/trustworthy-jwt-12.yaml
@@ -0,0 +1,14 @@
# This configs KinD to spin up a k8s cluster with trustworthy jwt (Service Account Token Volume Projection) feature.
# This must be used for 1.14 and 1.13 k8s versions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean for k8s 1.12?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
kubeadmConfigPatches:
- |
apiVersion: kubeadm.k8s.io/v1alpha3
kind: ClusterConfiguration
metadata:
name: config
apiServer:
extraArgs:
"service-account-issuer": "kubernetes.default.svc"
"service-account-signing-key-file": "/etc/kubernetes/pki/sa.key"
14 changes: 14 additions & 0 deletions prow/config/trustworthy-jwt-13-14.yaml
@@ -0,0 +1,14 @@
# This configs KinD to spin up a k8s cluster with trustworthy jwt (Service Account Token Volume Projection) feature.
# This must be used for 1.14 and 1.13 k8s versions
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
kubeadmConfigPatches:
- |
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
metadata:
name: config
apiServer:
extraArgs:
"service-account-issuer": "kubernetes.default.svc"
"service-account-signing-key-file": "/etc/kubernetes/pki/sa.key"
15 changes: 14 additions & 1 deletion prow/lib.sh
Expand Up @@ -124,8 +124,21 @@ function setup_kind_cluster() {

trap cleanup_kind_cluster EXIT

# Different Kubernetes versions need different patches
K8S_VERSION=$(cut -d ":" -f 2 <<< "${IMAGE}")
if [[ -n "${IMAGE}" && "${K8S_VERSION}" < "v1.13" ]]; then
# Kubernetes 1.12
CONFIG=./prow/config/trustworthy-jwt-12.yaml
elif [[ -n "${IMAGE}" && "${K8S_VERSION}" < "v1.15" ]]; then
# Kubernetes 1.13, 1.14
CONFIG=./prow/config/trustworthy-jwt-13-14.yaml
else
# Kubernetes 1.15
CONFIG=./prow/config/trustworthy-jwt.yaml
fi

# Create KinD cluster
if ! (kind create cluster --name=istio-testing --config ./prow/config/trustworthy-jwt.yaml --loglevel debug --retain --image "${IMAGE}"); then
if ! (kind create cluster --name=istio-testing --config "${CONFIG}" --loglevel debug --retain --image "${IMAGE}"); then
echo "Could not setup KinD environment. Something wrong with KinD setup. Exporting logs."
exit 1
fi
Expand Down