From cbb0276b026e32583e1d25a5f1eae9ad512cb5bd Mon Sep 17 00:00:00 2001 From: xuzhonghu Date: Fri, 6 Dec 2019 15:48:36 +0800 Subject: [PATCH 1/3] Upgrade helm to v3.0.1 --- hack/lib/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/lib/install.sh b/hack/lib/install.sh index 13418acd84..dd95f0e008 100644 --- a/hack/lib/install.sh +++ b/hack/lib/install.sh @@ -60,7 +60,7 @@ function install-helm { HELM_TEMP_DIR=`mktemp -d` curl https://raw.githubusercontent.com/helm/helm/master/scripts/get > ${HELM_TEMP_DIR}/get_helm.sh #TODO: There are some issue with helm's latest version, remove '--version' when it get fixed. - chmod 700 ${HELM_TEMP_DIR}/get_helm.sh && ${HELM_TEMP_DIR}/get_helm.sh --version v2.13.0 + chmod 700 ${HELM_TEMP_DIR}/get_helm.sh && ${HELM_TEMP_DIR}/get_helm.sh --version v3.0.1 else echo -n "found helm, version: " && helm version fi From e3ab41666428421218b918aa61e60a0e36059bbf Mon Sep 17 00:00:00 2001 From: xuzhonghu Date: Fri, 6 Dec 2019 19:02:33 +0800 Subject: [PATCH 2/3] Fix helmv3 --- docs/design/queue/queue-state-management.md | 4 ---- hack/run-e2e-kind.sh | 2 +- .../helm/chart/volcano/templates/batch_v1alpha1_job.yaml | 2 -- .../chart/volcano/templates/bus_v1alpha1_command.yaml | 2 -- installer/helm/chart/volcano/templates/default-queue.yaml | 2 -- .../volcano/templates/scheduling_v1alpha1_podgroup.yaml | 2 -- .../volcano/templates/scheduling_v1alpha1_queue.yaml | 2 -- installer/volcano-development.yaml | 8 -------- 8 files changed, 1 insertion(+), 23 deletions(-) diff --git a/docs/design/queue/queue-state-management.md b/docs/design/queue/queue-state-management.md index 3a15e31bdb..8a708427e8 100644 --- a/docs/design/queue/queue-state-management.md +++ b/docs/design/queue/queue-state-management.md @@ -122,8 +122,6 @@ apiVersion: admissionregistration.k8s.io/v1beta1 kind: ValidatingWebhookConfiguration metadata: name: {{ .Release.Name }}-validate-queue - annotations: - "helm.sh/hook": pre-install,pre-upgrade,post-delete webhooks: - clientConfig: caBundle: "" @@ -171,8 +169,6 @@ apiVersion: admissionregistration.k8s.io/v1beta1 kind: MutatingWebhookConfiguration metadata: name: {{ .Release.Name }}-mutate-queue - annotations: - "helm.sh/hook": pre-install,pre-upgrade,post-delete webhooks: - clientConfig: caBundle: "" diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index e875451c69..6554130967 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -41,7 +41,7 @@ function install-volcano { kind load docker-image ${TF_EXAMPLE_IMAGE} ${CLUSTER_CONTEXT} echo "Install volcano chart" - helm install installer/helm/chart/volcano --namespace kube-system --name ${CLUSTER_NAME} --kubeconfig ${KUBECONFIG} --set basic.image_tag_version=${TAG} --set basic.scheduler_config_file=config/volcano-scheduler-ci.conf --wait + helm install volcano installer/helm/chart/volcano --namespace kube-system --name ${CLUSTER_NAME} --kubeconfig ${KUBECONFIG} --set basic.image_tag_version=${TAG} --set basic.scheduler_config_file=config/volcano-scheduler-ci.conf --wait } function uninstall-volcano { diff --git a/installer/helm/chart/volcano/templates/batch_v1alpha1_job.yaml b/installer/helm/chart/volcano/templates/batch_v1alpha1_job.yaml index 13a52405f2..b9ebfabdfe 100644 --- a/installer/helm/chart/volcano/templates/batch_v1alpha1_job.yaml +++ b/installer/helm/chart/volcano/templates/batch_v1alpha1_job.yaml @@ -2,8 +2,6 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: jobs.batch.volcano.sh - annotations: - "helm.sh/hook": crd-install spec: group: batch.volcano.sh names: diff --git a/installer/helm/chart/volcano/templates/bus_v1alpha1_command.yaml b/installer/helm/chart/volcano/templates/bus_v1alpha1_command.yaml index 111b55cb0a..1850904314 100644 --- a/installer/helm/chart/volcano/templates/bus_v1alpha1_command.yaml +++ b/installer/helm/chart/volcano/templates/bus_v1alpha1_command.yaml @@ -2,8 +2,6 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: commands.bus.volcano.sh - annotations: - "helm.sh/hook": crd-install spec: group: bus.volcano.sh names: diff --git a/installer/helm/chart/volcano/templates/default-queue.yaml b/installer/helm/chart/volcano/templates/default-queue.yaml index 00475756eb..3aa233f5db 100644 --- a/installer/helm/chart/volcano/templates/default-queue.yaml +++ b/installer/helm/chart/volcano/templates/default-queue.yaml @@ -2,7 +2,5 @@ apiVersion: scheduling.incubator.k8s.io/v1alpha1 kind: Queue metadata: name: default - annotations: - "helm.sh/hook": post-install spec: weight: 1 diff --git a/installer/helm/chart/volcano/templates/scheduling_v1alpha1_podgroup.yaml b/installer/helm/chart/volcano/templates/scheduling_v1alpha1_podgroup.yaml index 3b60f2bb55..244459a520 100644 --- a/installer/helm/chart/volcano/templates/scheduling_v1alpha1_podgroup.yaml +++ b/installer/helm/chart/volcano/templates/scheduling_v1alpha1_podgroup.yaml @@ -2,8 +2,6 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: podgroups.scheduling.incubator.k8s.io - annotations: - "helm.sh/hook": crd-install spec: group: scheduling.incubator.k8s.io names: diff --git a/installer/helm/chart/volcano/templates/scheduling_v1alpha1_queue.yaml b/installer/helm/chart/volcano/templates/scheduling_v1alpha1_queue.yaml index 46bc0ade69..1398b51b8e 100644 --- a/installer/helm/chart/volcano/templates/scheduling_v1alpha1_queue.yaml +++ b/installer/helm/chart/volcano/templates/scheduling_v1alpha1_queue.yaml @@ -2,8 +2,6 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: queues.scheduling.incubator.k8s.io - annotations: - "helm.sh/hook": crd-install spec: group: scheduling.incubator.k8s.io names: diff --git a/installer/volcano-development.yaml b/installer/volcano-development.yaml index c842ce3699..334a1e648d 100644 --- a/installer/volcano-development.yaml +++ b/installer/volcano-development.yaml @@ -371,8 +371,6 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: jobs.batch.volcano.sh - annotations: - "helm.sh/hook": crd-install spec: group: batch.volcano.sh names: @@ -573,8 +571,6 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: commands.bus.volcano.sh - annotations: - "helm.sh/hook": crd-install spec: group: bus.volcano.sh names: @@ -623,8 +619,6 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: podgroups.scheduling.incubator.k8s.io - annotations: - "helm.sh/hook": crd-install spec: group: scheduling.incubator.k8s.io names: @@ -667,8 +661,6 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: queues.scheduling.incubator.k8s.io - annotations: - "helm.sh/hook": crd-install spec: group: scheduling.incubator.k8s.io names: From f8e7ff4918fa615360a0e1e8c8617d5ad87d5228 Mon Sep 17 00:00:00 2001 From: xuzhonghu Date: Sat, 7 Dec 2019 16:01:36 +0800 Subject: [PATCH 3/3] Adapte to helm v3 --- hack/run-e2e-kind.sh | 15 ++------------- .../chart/volcano/templates/default-queue.yaml | 6 ------ 2 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 installer/helm/chart/volcano/templates/default-queue.yaml diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index 6554130967..80c38feac4 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -25,32 +25,21 @@ function kind-up-cluster { } function install-volcano { - echo "Preparing helm tiller service account" - kubectl create serviceaccount --namespace kube-system tiller - kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller - install-helm - helm init --service-account tiller --kubeconfig ${KUBECONFIG} --wait echo "Pulling required docker images" docker pull ${MPI_EXAMPLE_IMAGE} docker pull ${TF_EXAMPLE_IMAGE} - echo "Loading docker images into kind cluster" - kind load docker-image ${MPI_EXAMPLE_IMAGE} ${CLUSTER_CONTEXT} - kind load docker-image ${TF_EXAMPLE_IMAGE} ${CLUSTER_CONTEXT} - echo "Install volcano chart" - helm install volcano installer/helm/chart/volcano --namespace kube-system --name ${CLUSTER_NAME} --kubeconfig ${KUBECONFIG} --set basic.image_tag_version=${TAG} --set basic.scheduler_config_file=config/volcano-scheduler-ci.conf --wait + helm install ${CLUSTER_NAME} installer/helm/chart/volcano --namespace kube-system --kubeconfig ${KUBECONFIG} --set basic.image_tag_version=${TAG} --set basic.scheduler_config_file=config/volcano-scheduler-ci.conf --wait } function uninstall-volcano { - helm delete ${CLUSTER_NAME} --purge --kubeconfig ${KUBECONFIG} + helm uninstall ${CLUSTER_NAME} -n kube-system } function generate-log { - echo "Generating tiller log files" - kubectl logs deployment/tiller-deploy -n kube-system > helm-tiller.log echo "Generating volcano log files" kubectl logs deployment/${CLUSTER_NAME}-admission -n kube-system > volcano-admission.log kubectl logs deployment/${CLUSTER_NAME}-controllers -n kube-system > volcano-controller.log diff --git a/installer/helm/chart/volcano/templates/default-queue.yaml b/installer/helm/chart/volcano/templates/default-queue.yaml deleted file mode 100644 index 3aa233f5db..0000000000 --- a/installer/helm/chart/volcano/templates/default-queue.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: scheduling.incubator.k8s.io/v1alpha1 -kind: Queue -metadata: - name: default -spec: - weight: 1