From 67a22db5ca5674b9072502dddaa2837f67b2b1d6 Mon Sep 17 00:00:00 2001 From: TommyLike Date: Wed, 20 Mar 2019 13:57:05 +0800 Subject: [PATCH] Update kind config --- Makefile | 5 +++-- hack/e2e-kind-config.yaml | 16 ---------------- hack/run-e2e-kind.sh | 38 ++++++++++++++++---------------------- 3 files changed, 19 insertions(+), 40 deletions(-) diff --git a/Makefile b/Makefile index c64b75f745d..7c539820bea 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ BIN_DIR=_output/bin -IMAGE=volcano -TAG = 1.0 +export IMAGE=volcano +export TAG = 1.0 all: controllers scheduler cli admission @@ -41,6 +41,7 @@ unit-test: go list ./... | grep -v e2e | xargs go test -v e2e-test-kind: + ./hack/run-e2e-kind.sh clean: diff --git a/hack/e2e-kind-config.yaml b/hack/e2e-kind-config.yaml index 68184def83d..317d7160a65 100644 --- a/hack/e2e-kind-config.yaml +++ b/hack/e2e-kind-config.yaml @@ -5,22 +5,6 @@ apiVersion: kind.sigs.k8s.io/v1alpha2 nodes: # the control plane node config - role: control-plane - # patch the generated kubeadm config with some extra settings - kubeadmConfigPatches: - - | - apiVersion: kubeadm.k8s.io/v1beta1 - kind: ClusterConfiguration - networking: - serviceSubnet: 10.0.0.0/16 - # patch it further using a JSON 6902 patch - kubeadmConfigPatchesJson6902: - - group: kubeadm.k8s.io - version: v1beta1 - kind: ClusterConfiguration - patch: | - - op: add - path: /apiServer/certSANs/- - value: my-hostname # the three workers - role: worker # replicas specifies the number of nodes to create with this configuration diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index bf3154858d4..f8d467c4af3 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -34,36 +34,30 @@ function check-prerequisites { # spin up cluster with kind command function kind-up-cluster { check-prerequisites - check-kind-image echo "Running kind: [kind create cluster ${CLUSTER_CONTEXT} ${KIND_OPT}]" kind create cluster ${CLUSTER_CONTEXT} ${KIND_OPT} } function install-volcano { - kubectl --kubeconfig ${KUBECONFIG} create -f ${VK_ROOT}/installer/chart/volcano-init/templates/scheduling_v1alpha1_podgroup.yaml - kubectl --kubeconfig ${KUBECONFIG} create -f ${VK_ROOT}/installer/chart/volcano-init/templates/scheduling_v1alpha1_queue.yaml - kubectl --kubeconfig ${KUBECONFIG} create -f ${VK_ROOT}/installer/chart/volcano-init/templates/batch_v1alpha1_job.yaml - kubectl --kubeconfig ${KUBECONFIG} create -f ${VK_ROOT}/installer/chart/volcano-init/templates/bus_v1alpha1_command.yaml - - # TODO: make vk-controllers and vk-scheduler run in container / in k8s - # start controller - nohup ${VK_BIN}/vk-controllers --kubeconfig ${KUBECONFIG} --logtostderr --v ${LOG_LEVEL} > controller.log 2>&1 & - echo $! > vk-controllers.pid - - # start scheduler - nohup ${VK_BIN}/vk-scheduler --kubeconfig ${KUBECONFIG} --scheduler-conf=example/kube-batch-conf.yaml --logtostderr --v ${LOG_LEVEL} > scheduler.log 2>&1 & - echo $! > vk-scheduler.pid + echo "Install helm via script" + curl https://raw.githubusercontent.com/helm/helm/master/scripts/get > get_helm.sh + chmod 700 get_helm.sh + #TODO: There are some issue with helm's latest version, remove '--version' when it get fixed. + ./get_helm.sh --version v2.12.0 + helm init + echo "Loading docker images into kind cluster" + kind load docker-image ${IMAGE}-controllers:${TAG} + kind load docker-image ${IMAGE}-scheduler:${TAG} + kind load docker-image ${IMAGE}-admission:${TAG} + echo "Install volcano plugin...." + helm plugin install installer/chart/volcano/plugins/gen-admission-secret + helm gen-admission-secret --service integration-admission-service --namespace kube-system + echo "Install volcano chart" + helm install installer/chart/volcano --namespace kube-system --name integration } function uninstall-volcano { - kubectl --kubeconfig ${KUBECONFIG} delete -f ${VK_ROOT}/installer/chart/volcano-init/templates/scheduling_v1alpha1_podgroup.yaml - kubectl --kubeconfig ${KUBECONFIG} delete -f ${VK_ROOT}/installer/chart/volcano-init/templates/scheduling_v1alpha1_queue.yaml - kubectl --kubeconfig ${KUBECONFIG} delete -f ${VK_ROOT}/installer/chart/volcano-init/templates/batch_v1alpha1_job.yaml - kubectl --kubeconfig ${KUBECONFIG} delete -f ${VK_ROOT}/installer/chart/volcano-init/templates/bus_v1alpha1_command.yaml - - kill -9 $(cat vk-controllers.pid) - kill -9 $(cat vk-scheduler.pid) - rm vk-controllers.pid vk-scheduler.pid + helm delete integration } # clean up