From 8e437531559fc66cc38a0653aae682f40d8a5246 Mon Sep 17 00:00:00 2001 From: Lan Liang Date: Tue, 18 Jun 2024 09:05:55 +0000 Subject: [PATCH] chore: let kube version of artifaces/deploy/karmada-apiserver version support configuration. Signed-off-by: Lan Liang --- artifacts/deploy/karmada-apiserver.yaml | 2 +- artifacts/deploy/kube-controller-manager.yaml | 2 +- hack/deploy-karmada.sh | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/artifacts/deploy/karmada-apiserver.yaml b/artifacts/deploy/karmada-apiserver.yaml index 4cdf040afeb8..296f7b8f0a9a 100644 --- a/artifacts/deploy/karmada-apiserver.yaml +++ b/artifacts/deploy/karmada-apiserver.yaml @@ -64,7 +64,7 @@ spec: - --tls-private-key-file=/etc/karmada/pki/apiserver.key - --tls-min-version=VersionTLS13 name: karmada-apiserver - image: registry.k8s.io/kube-apiserver:v1.27.11 + image: registry.k8s.io/kube-apiserver:{{karmada_apiserver_version}} imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 8 diff --git a/artifacts/deploy/kube-controller-manager.yaml b/artifacts/deploy/kube-controller-manager.yaml index b74f2a90c687..205759193f3c 100644 --- a/artifacts/deploy/kube-controller-manager.yaml +++ b/artifacts/deploy/kube-controller-manager.yaml @@ -52,7 +52,7 @@ spec: - --service-cluster-ip-range=10.96.0.0/12 - --use-service-account-credentials=true - --v=4 - image: registry.k8s.io/kube-controller-manager:v1.27.11 + image: registry.k8s.io/kube-controller-manager:{{karmada_apiserver_version}} imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 8 diff --git a/hack/deploy-karmada.sh b/hack/deploy-karmada.sh index 97989c6a738e..9a48440281b7 100755 --- a/hack/deploy-karmada.sh +++ b/hack/deploy-karmada.sh @@ -200,8 +200,10 @@ fi # deploy karmada apiserver TEMP_PATH_APISERVER=$(mktemp -d) trap '{ rm -rf ${TEMP_PATH_APISERVER}; }' EXIT +KARMADA_APISERVER_VERSION=${KARMADA_APISERVER_VERSION:-"v1.27.11"} cp "${REPO_ROOT}"/artifacts/deploy/karmada-apiserver.yaml "${TEMP_PATH_APISERVER}"/karmada-apiserver.yaml sed -i'' -e "s/{{service_type}}/${KARMADA_APISERVER_SERVICE_TYPE}/g" "${TEMP_PATH_APISERVER}"/karmada-apiserver.yaml +sed -i'' -e "s/{{karmada_apiserver_version}}/${KARMADA_APISERVER_VERSION}/g" "${TEMP_PATH_APISERVER}"/karmada-apiserver.yaml echo -e "\nApply dynamic rendered apiserver service in ${TEMP_PATH_APISERVER}/karmada-apiserver.yaml." kubectl --context="${HOST_CLUSTER_NAME}" apply -f "${TEMP_PATH_APISERVER}"/karmada-apiserver.yaml @@ -238,7 +240,9 @@ fi util::append_client_kubeconfig "${HOST_CLUSTER_KUBECONFIG}" "${CERT_DIR}/karmada.crt" "${CERT_DIR}/karmada.key" "${KARMADA_APISERVER_IP}" "${KARMADA_APISERVER_SECURE_PORT}" karmada-apiserver # deploy kube controller manager -kubectl --context="${HOST_CLUSTER_NAME}" apply -f "${REPO_ROOT}/artifacts/deploy/kube-controller-manager.yaml" +cp "${REPO_ROOT}"/artifacts/deploy/kube-controller-manager.yaml "${TEMP_PATH_APISERVER}"/kube-controller-manager.yaml +sed -i'' -e "s/{{karmada_apiserver_version}}/${KARMADA_APISERVER_VERSION}/g" "${TEMP_PATH_APISERVER}"/kube-controller-manager.yaml +kubectl --context="${HOST_CLUSTER_NAME}" apply -f "${TEMP_PATH_APISERVER}"/kube-controller-manager.yaml # deploy aggregated-apiserver on host cluster kubectl --context="${HOST_CLUSTER_NAME}" apply -f "${REPO_ROOT}/artifacts/deploy/karmada-aggregated-apiserver.yaml" util::wait_pod_ready "${HOST_CLUSTER_NAME}" "${KARMADA_AGGREGATION_APISERVER_LABEL}" "${KARMADA_SYSTEM_NAMESPACE}"