forked from kurator-dev/kurator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
- Loading branch information
1 parent
4d616a0
commit eccc1d6
Showing
5 changed files
with
141 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: e2e | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
e2e-test: | ||
runs-on: ubuntu-22.04 | ||
name: E2E Test | ||
timeout-minutes: 40 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Build Clusters | ||
uses: helm/kind-action@v1.8.0 | ||
with: | ||
version: v0.18.0 | ||
install_only: true | ||
run: | | ||
hack/local-dev-setup.sh | ||
- name: Install Helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: v3.10.1 | ||
- name: Init kurator cluster | ||
run: | | ||
test/install.sh | ||
- name: fleet-clusters e2e test | ||
run: | | ||
test/fleet-clusters/e2e-run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
KUBECONFIG_PATH=${KUBECONFIG_PATH:-"${HOME}/.kube"} | ||
MAIN_KUBECONFIG=${MAIN_KUBECONFIG:-"${KUBECONFIG_PATH}/kurator-host.config"} | ||
export KUBECONFIG=${MAIN_KUBECONFIG} | ||
|
||
kubectl create secret generic kurator-member1 --from-file=kurator-member1.config=${KUBECONFIG_PATH}/kurator-member1.config | ||
kubectl create secret generic kurator-member2 --from-file=kurator-member2.config=${KUBECONFIG_PATH}/kurator-member2.config | ||
|
||
cat <<EOF | kubectl apply -f - | ||
apiVersion: cluster.kurator.dev/v1alpha1 | ||
kind: AttachedCluster | ||
metadata: | ||
name: kurator-member1 | ||
namespace: default | ||
spec: | ||
kubeconfig: | ||
name: kurator-member1 | ||
key: kurator-member1.config | ||
EOF | ||
|
||
ok=false | ||
sleep 10 | ||
kubectl get attachedclusters.cluster.kurator.dev kurator-member1 -o yaml | grep 'ready: true' && ok=true || ok=false | ||
if [ ${ok} = false ]; then | ||
echo "create attachedCluster resources failed" | ||
exit 1 | ||
fi | ||
|
||
cat <<EOF | kubectl apply -f - | ||
apiVersion: cluster.kurator.dev/v1alpha1 | ||
kind: AttachedCluster | ||
metadata: | ||
name: kurator-member2 | ||
namespace: default | ||
spec: | ||
kubeconfig: | ||
name: kurator-member2 | ||
key: kurator-member2.config | ||
EOF | ||
|
||
ok=false | ||
sleep 10 | ||
kubectl get attachedclusters.cluster.kurator.dev kurator-member1 -o yaml | grep 'ready: true' && ok=true || ok=false | ||
if [ ${ok} = false ]; then | ||
echo "create attachedCluster resources failed" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
|
||
REPO_ROOT=$(git rev-parse --show-toplevel) | ||
DIR="$(cd "$(dirname "$0")" && pwd)" | ||
|
||
"$DIR"/attachedcluster.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
# This script installs Kurator cluster-operater and fleet-manager. | ||
|
||
KUBECONFIG_PATH=${KUBECONFIG_PATH:-"${HOME}/.kube"} | ||
MAIN_KUBECONFIG=${MAIN_KUBECONFIG:-"${KUBECONFIG_PATH}/kurator-host.config"} | ||
export KUBECONFIG=${MAIN_KUBECONFIG} | ||
VERSION=${VERSION:-"0.6.0"} | ||
|
||
helm repo add jetstack https://charts.jetstack.io | ||
helm repo update | ||
kubectl create namespace cert-manager | ||
sleep 5s | ||
helm install -n cert-manager cert-manager jetstack/cert-manager --set installCRDs=true | ||
|
||
sleep 5s | ||
|
||
helm repo add fluxcd-community https://fluxcd-community.github.io/helm-charts | ||
cat <<EOF | helm install fluxcd fluxcd-community/flux2 --version 2.7.0 -n fluxcd-system --create-namespace -f - | ||
imageAutomationController: | ||
create: false | ||
imageReflectionController: | ||
create: false | ||
notificationController: | ||
create: false | ||
EOF | ||
|
||
sleep 5s | ||
|
||
helm repo add kurator https://kurator-dev.github.io/helm-charts | ||
helm repo update | ||
sleep 5s | ||
|
||
helm install --create-namespace kurator-cluster-operator kurator/cluster-operator --version=${VERSION} -n kurator-system | ||
helm install --create-namespace kurator-fleet-manager kurator/fleet-manager --version=${VERSION} -n kurator-system | ||
|
||
echo "install kurator successful" |