| #!/bin/bash |
| # |
| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You 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 |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| # |
| |
| set -x |
| |
| SCRIPTDIR=$(cd $(dirname "$0") && pwd) |
| |
| TRAVIS_KUBE_VERSION=${TRAVIS_KUBE_VERSION:="v1.20"} |
| |
| # Map from Kubernetes major versions to the kind node image tag |
| case $TRAVIS_KUBE_VERSION in |
| v1.14) KIND_NODE_TAG=v1.14.10@sha256:3fbed72bcac108055e46e7b4091eb6858ad628ec51bf693c21f5ec34578f6180 ;; |
| v1.15) KIND_NODE_TAG=v1.15.12@sha256:67181f94f0b3072fb56509107b380e38c55e23bf60e6f052fbd8052d26052fb5 ;; |
| v1.16) KIND_NODE_TAG=v1.16.15@sha256:c10a63a5bda231c0a379bf91aebf8ad3c79146daca59db816fb963f731852a99 ;; |
| v1.17) KIND_NODE_TAG=v1.17.17@sha256:7b6369d27eee99c7a85c48ffd60e11412dc3f373658bc59b7f4d530b7056823e ;; |
| v1.18) KIND_NODE_TAG=v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4 ;; |
| v1.19) KIND_NODE_TAG=v1.19.7@sha256:a70639454e97a4b733f9d9b67e12c01f6b0297449d5b9cbbef87473458e26dca ;; |
| v1.20) KIND_NODE_TAG=v1.20.2@sha256:8f7ea6e7642c0da54f04a7ee10431549c0257315b3a634f6ef2fecaaedb19bab ;; |
| *) echo "Unsupported Kubernetes version $TRAVIS_KUBE_VERSION"; exit 1 ;; |
| esac |
| |
| # Boot cluster |
| kind create cluster --config "$SCRIPTDIR/kind-cluster.yaml" --name kind --image kindest/node:${KIND_NODE_TAG} --wait 10m || exit 1 |
| |
| echo "Kubernetes cluster is deployed and reachable" |
| kubectl describe nodes |