Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 kustomize for e2e tests #555

Closed
wants to merge 14 commits into from
2 changes: 1 addition & 1 deletion kustomize/apiserver/clusterpedia_apiserver_apiservice.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
name: v1beta1.clusterpedia.io-208003
name: v1beta1.clusterpedia.io
spec:
insecureSkipTLSVerify: true
group: clusterpedia.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Secret
metadata:
name: internalstorage-password
namespace: clusterpedia-system-0110
namespace: clusterpedia-system
labels:
app: clusterpedia-internalstorage
internalstorage.clusterpedia.io/type: postgres
Expand Down
16 changes: 2 additions & 14 deletions test/helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function create_cluster() {
kind create cluster --name "${name}" --image "docker.io/kindest/node:${version}"
load_image "${name}" localtest/clustersynchro-manager-amd64:test
load_image "${name}" localtest/apiserver-amd64:test
load_image "${name}" localtest/controller-manager-amd64:test
load_image "${name}" docker.io/bitnami/postgresql:11.15.0-debian-10-r14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

load_image "${name}" postgres:12

}

Expand All @@ -66,20 +67,7 @@ function delete_cluster() {
# install the Clusterpedia into the kind cluster
function install_clusterpedia() {
kubectl apply -f "${ROOT}/deploy/crds"
Iceber marked this conversation as resolved.
Show resolved Hide resolved
# local charts will be removed, waiting for the kustomize way to be ready
helm repo add bitnami https://charts.bitnami.com/bitnami
helm dependency build "${ROOT}/charts/clusterpedia"
helm install clusterpedia "${ROOT}/charts/clusterpedia" \
--namespace clusterpedia-system \
--create-namespace \
--wait \
--set persistenceMatchNode=None \
--set clustersynchroManager.image.registry=localtest \
--set clustersynchroManager.image.repository=clustersynchro-manager-amd64 \
--set clustersynchroManager.image.tag=test \
--set apiserver.image.registry=localtest \
--set apiserver.image.repository=apiserver-amd64 \
--set apiserver.image.tag=test
kubectl kustomize "${ROOT}/test/kustomize" | kubectl apply -f -
echo kubectl get all -n clusterpedia-system
kubectl get all -n clusterpedia-system
}
Expand Down
19 changes: 19 additions & 0 deletions test/kustomize/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../kustomize

images:
- name: ghcr.io/clusterpedia-io/clusterpedia/apiserver
newName: localtest/apiserver-amd64
newTag: test
- name: ghcr.io/clusterpedia-io/clusterpedia/clustersynchro-manager
newName: localtest/clustersynchro-manager-amd64
newTag: test
- name: ghcr.io/clusterpedia-io/clusterpedia/controller-manager
newName: localtest/controller-manager-amd64
newTag: test

patches:
- path: pvc.patch.yaml
7 changes: 7 additions & 0 deletions test/kustomize/pvc.patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: internalstorage-postgres
namespace: clusterpedia-system
spec:
select: null
Iceber marked this conversation as resolved.
Show resolved Hide resolved