-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1fdda6b
commit 9e1ab79
Showing
2 changed files
with
43 additions
and
8 deletions.
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Python test in k8s cluster | |
on: pull_request | ||
|
||
jobs: | ||
create-cluster: | ||
no-ha-cluster: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
@@ -24,10 +24,14 @@ jobs: | |
run: | | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
helm repo update | ||
helm install my-postgresql bitnami/postgresql --version 13.2.9 | ||
helm install my-rabbitmq bitnami/rabbitmq --version 12.5.0 | ||
helm install my-redis bitnami/redis --version 18.3.3 --set architecture=standalone | ||
helm install my-postgresql bitnami/postgresql | ||
helm install my-rabbitmq bitnami/rabbitmq | ||
helm install my-redis bitnami/redis --set architecture=standalone | ||
# wait all service is raidy | ||
kubectl --namespace default wait pod/my-postgresql-0 --for=condition=Ready --timeout=2m | ||
kubectl --namespace default wait pod/my-rabbitmq-0 --for=condition=Ready --timeout=2m | ||
kubectl --namespace default wait pod/my-redis-master-0 --for=condition=Ready --timeout=2m | ||
# postgresql | ||
# my-postgresql.default.svc.cluster.local | ||
|
@@ -44,7 +48,38 @@ jobs: | |
# my-redis-master.default.svc.cluster.local | ||
export REDIS_PASSWORD=$(kubectl get secret --namespace default my-redis -o jsonpath="{.data.redis-password}" | base64 -d) | ||
kubectl port-forward --namespace default svc/my-redis-master 6379:6379 & | ||
REDISCLI_AUTH="$REDIS_PASSWORD" redis-cli -h my-redis-master | ||
# test | ||
# Install Charts (in ha mode) | ||
# REDISCLI_AUTH="$REDIS_PASSWORD" redis-cli -h my-redis-master | ||
# test | ||
ha-cluster: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Helm | ||
uses: azure/[email protected] | ||
with: | ||
version: v3.12.3 | ||
- name: Set up Python '3.11' | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.11' | ||
- name: Create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
- name: Install Charts (in ha mode) | ||
run: | | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
helm repo update | ||
helm install my-postgresql bitnami/postgresql | ||
helm install my-rabbitmq bitnami/rabbitmq | ||
helm install my-redis bitnami/redis --set sentinel.enabled=true | ||
# wait all service is raidy | ||
kubectl --namespace default wait pod/my-redis-node-0 --for=condition=Ready --timeout=2m | ||
kubectl --namespace default wait pod/my-redis-node-1 --for=condition=Ready --timeout=2m | ||
kubectl --namespace default wait pod/my-redis-node-2 --for=condition=Ready --timeout=2m | ||
# bidule | ||
export REDIS_PASSWORD=$(kubectl get secret --namespace default my-redis -o jsonpath="{.data.redis-password}" | base64 -d) | ||
kubectl port-forward --namespace default svc/my-redis 6379:6379 26379:26379 & |
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