Skip to content

Commit

Permalink
Update kind config
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLike committed Mar 20, 2019
1 parent 7a99532 commit 67a22db
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 40 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -41,6 +41,7 @@ unit-test:
go list ./... | grep -v e2e | xargs go test -v

e2e-test-kind:

./hack/run-e2e-kind.sh

clean:
Expand Down
16 changes: 0 additions & 16 deletions hack/e2e-kind-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 16 additions & 22 deletions hack/run-e2e-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 67a22db

Please sign in to comment.