Skip to content

Commit

Permalink
Add e2e for karmadactl init
Browse files Browse the repository at this point in the history
Signed-off-by: jwcesign <[email protected]>
  • Loading branch information
jwcesign committed Feb 17, 2023
1 parent e523977 commit a079364
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,63 @@ jobs:
with:
name: karmada_e2e_log_${{ matrix.k8s }}
path: ${{ github.workspace }}/karmada-e2e-logs/${{ matrix.k8s }}/
karmadactlinit:
name: karmadactl init installation test
needs: build
runs-on: ubuntu-20.04
strategy:
matrix:
k8s: [ v1.21.10, v1.22.7, v1.23.4, v1.24.2, v1.25.0, v1.26.0 ]

steps:
- name: checkout code
uses: actions/checkout@v3
with:
# 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
- name: install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.5
- name: run karmadactl init test
run: |
set -x
# tar the newest crds
cd charts/karmada/
cp -r _crds crds
tar -zcvf ../../crds.tar.gz crds
cd -
# prepare karmdactl and images
make karmadactl
cp _output/bin/linux/amd64/karmadactl /usr/local/bin/
export VERSION=ci-e2e
make images
# create host cluster and load images
export CLUSTER_VERSION=kindest/node:${{ matrix.k8s }}
export KUBECONFIG=${HOME}/.kube/karmada.config
hack/create-cluster.sh host
docker images | grep ci-e2e | awk '{printf "%s:%s\n",$1,$2}' | xargs kind load docker-image --name host
# init Karmada control plane
karmadactl init --crds='./crds.tar.gz' \
--karmada-aggregated-apiserver-image='karmada/karmada-aggregated-apiserver:ci-e2e' \
--karmada-controller-manager-image='karmada/karmada-controller-manager:ci-e2e' \
--karmada-scheduler-image='karmada/karmada-scheduler:ci-e2e' \
--karmada-webhook-image='karmada/karmada-webhook:ci-e2e'
# create member cluster
export KUBECONFIG=${HOME}/.kube/member.config
hack/create-cluster.sh member-1
# join cluster
karmadactl --kubeconfig /etc/karmada/karmada-apiserver.config join member-1 --cluster-kubeconfig=${HOME}/.kube/member.config
# check
ready_clusters=`kubectl --kubeconfig /etc/karmada/karmada-apiserver.config get clusters | grep True | wc -l`
if [[ ${ready_clusters} != 1 ]]; then
exit 1
fi

0 comments on commit a079364

Please sign in to comment.