Skip to content

Commit

Permalink
chore: let kube version of artifaces/deploy/karmada-apiserver version…
Browse files Browse the repository at this point in the history
… support configuration.

Signed-off-by: Lan Liang <gcslyp@gmail.com>
  • Loading branch information
liangyuanpeng committed Jun 18, 2024
1 parent 5e8152a commit 45e349a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 20 deletions.
21 changes: 4 additions & 17 deletions .github/workflows/ci-schedule-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
fail-fast: false
matrix:
kubeapiserver-version: [ v1.23.4, v1.24.2, v1.25.0, v1.26.0, v1.27.3, v1.28.0, v1.29.0, v1.30.0 ]
karmada-version: [ release-1.7, release-1.8, release-1.9 ]
karmada-version: [ master, release-1.7, release-1.8, release-1.9 ]
env:
KARMADA_APISERVER_VERSION: ${{ matrix.kubeapiserver-version }}
steps:
# Free up disk space on Ubuntu
- name: Free Disk Space (Ubuntu)
Expand All @@ -38,7 +40,7 @@ jobs:
# Number of commits to fetch. 0 indicates all history for all branches and tags.
# We need to guess version via git tags.
fetch-depth: 0
ref: ${{ matrix.karmada-version }}
# ref: ${{ matrix.karmada-version }}
- name: install Go
uses: actions/setup-go@v5
with:
Expand All @@ -50,21 +52,6 @@ jobs:
timeout_minutes: 20
command: |
hack/local-up-karmada.sh
- name: change kube-apiserver and kube-controller-manager version
run: |
# Update images
kubectl --kubeconfig=${HOME}/.kube/karmada.config --context=karmada-host \
set image deployment/karmada-apiserver -nkarmada-system \
karmada-apiserver=registry.k8s.io/kube-apiserver:${{ matrix.kubeapiserver-version }}
kubectl --kubeconfig=${HOME}/.kube/karmada.config --context=karmada-host \
set image deployment/karmada-kube-controller-manager -nkarmada-system \
kube-controller-manager=registry.k8s.io/kube-controller-manager:${{ matrix.kubeapiserver-version }}
# Wait ready
kubectl --kubeconfig=${HOME}/.kube/karmada.config --context=karmada-host \
rollout status deployment/karmada-kube-controller-manager -nkarmada-system --timeout=5m
kubectl --kubeconfig=${HOME}/.kube/karmada.config --context=karmada-host \
rollout status deployment/karmada-apiserver -nkarmada-system --timeout=5m
- name: run e2e
run: |
export ARTIFACTS_PATH=${{ github.workspace }}/karmada-e2e-logs/${{ matrix.kubeapiserver-version }}-${{ matrix.karmada-version }}/
Expand Down
2 changes: 1 addition & 1 deletion artifacts/deploy/karmada-apiserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion artifacts/deploy/kube-controller-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion hack/deploy-karmada.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit 45e349a

Please sign in to comment.