Skip to content
Permalink
Browse files

Switch ApiVersion for kubeadm config

  • Loading branch information...
masa213f committed Sep 9, 2019
1 parent 3a9750a commit 733adacfbb96bdac483d8bbab20612251acb8f61
Showing with 17 additions and 8 deletions.
  1. +4 −4 .circleci/config.yml
  2. +1 −1 deploy/README.md
  3. +11 −2 e2e/Makefile
  4. +1 −1 e2e/topolvm-cluster.yaml
@@ -25,7 +25,7 @@ commands:
make setup
cd e2e
if [ -n "<<parameters.kubernetes-version>>" ]; then
OPT="KUBERNETES_VERSION=<<parameters.kubernetes-version>>"
OPT="TEST_KUBERNETES_VERSION=<<parameters.kubernetes-version>>"
fi
make ${OPT} setup
- run:
@@ -34,7 +34,7 @@ commands:
cd e2e
make start-lvmd
if [ -n "<<parameters.kubernetes-version>>" ]; then
OPT="KUBERNETES_VERSION=<<parameters.kubernetes-version>>"
OPT="TEST_KUBERNETES_VERSION=<<parameters.kubernetes-version>>"
fi
make ${OPT} test
@@ -126,15 +126,15 @@ jobs:
steps:
- checkout
- e2e-command:
kubernetes-version: 1.15.3
kubernetes-version: "1.15"
e2e-k8s-v1_14:
machine:
image: ubuntu-1604:201903-01
working_directory: /home/circleci/work
steps:
- checkout
- e2e-command:
kubernetes-version: 1.14.6
kubernetes-version: "1.14"

workflows:
version: 2
@@ -191,7 +191,7 @@ Configure kube-scheduler
If your Kubernetes cluster was installed with `kubeadm`, then reconfigure it as follows:

```yaml
apiVersion: kubeadm.k8s.io/v1beta1
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
metadata:
name: config
@@ -3,9 +3,17 @@ GOFLAGS=-mod=vendor
export GOFLAGS
GINKGO=$(GOPATH)/bin/ginkgo
KUBECTL=/usr/local/bin/kubectl
KUBERNETES_VERSION=1.15.3
KIND_VERSION=0.5.1

TEST_KUBERNETES_VERSION=1.15
ifeq ($(TEST_KUBERNETES_VERSION),1.15)
KUBERNETES_VERSION=1.15.3
KUBEADM_APIVERSION=kubeadm.k8s.io/v1beta2
else ifeq ($(TEST_KUBERNETES_VERSION),1.14)
KUBERNETES_VERSION=1.14.6
KUBEADM_APIVERSION=kubeadm.k8s.io/v1beta1
endif

GO_FILES := $(shell find .. -path ../vendor -prune -o -path ../e2e -prune -o -name '*.go' -print)
CA_FILES=./certs/ca.csr ./certs/ca.pem ./certs/ca-key.pem
SERVER_CERT_FILES=./certs/server.csr ./certs/server.pem ./certs/server-key.pem
@@ -38,7 +46,8 @@ topolvm.img: $(GO_FILES)

launch-kind: /tmp/topolvm/scheduler/scheduler-config.yaml /tmp/topolvm/scheduler/scheduler-policy.cfg
$(SUDO) rm -rf /tmp/topolvm/controller /tmp/topolvm/worker*
sed s/@KUBERNETES_VERSION@/$(KUBERNETES_VERSION)/ topolvm-cluster.yaml > /tmp/topolvm-cluster.yaml
sed -e "s/@KUBERNETES_VERSION@/$(KUBERNETES_VERSION)/" \
-e "s|@KUBEADM_APIVERSION@|$(KUBEADM_APIVERSION)|" topolvm-cluster.yaml > /tmp/topolvm-cluster.yaml
env KUBECONFIG= kind create cluster --config /tmp/topolvm-cluster.yaml --image kindest/node:v$(KUBERNETES_VERSION)

shutdown-kind:
@@ -6,7 +6,7 @@ kubeadmConfigPatches:
# When update to Kubernetes 1.15, make sure to change the
# apiVersion to "kubeadm.k8s.io/v1beta2". Also make sure
# to change the node image in Makefile (--image kindest/node)
apiVersion: kubeadm.k8s.io/v1beta1
apiVersion: "@KUBEADM_APIVERSION@"
kind: ClusterConfiguration
metadata:
name: config

0 comments on commit 733adac

Please sign in to comment.
You can’t perform that action at this time.