-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: add chaos setup * chore add files to ignore * chore: diferentiate linux from macos * negate linux aarch64 * fix: chaos env
- Loading branch information
1 parent
7e28bc7
commit 95f1fe4
Showing
4 changed files
with
50 additions
and
32 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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
!docker/ | ||
!docker/Dockerfile.run_with_importer | ||
!src/ | ||
!.cargo/ | ||
!Cargo.toml | ||
!Cargo.lock | ||
!static/ | ||
|
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 |
---|---|---|
@@ -1,27 +1,36 @@ | ||
#!/bin/sh | ||
|
||
echo "Checking OS and installing dependencies..." | ||
|
||
if [ "$(uname)" = "Darwin" ]; then | ||
echo "Installing dependencies for macOS..." | ||
if ! [ -x "$(command -v kind)" ]; then | ||
brew install kind | ||
fi | ||
if ! [ -x "$(command -v kubectl)" ]; then | ||
brew install kubectl | ||
fi | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo "Checking if Kind cluster exists..." | ||
if ! kind get clusters | grep -q local-testing; then | ||
echo "Setting up Kind cluster..." | ||
kind create cluster --name local-testing | ||
kind get kubeconfig --name local-testing > kubeconfig.yaml | ||
else | ||
echo "Installing dependencies for Linux..." | ||
if ! [ -x "$(command -v kind)" ]; then | ||
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64 | ||
chmod +x ./kind | ||
sudo mv ./kind /usr/local/bin/kind | ||
fi | ||
if ! [ -x "$(command -v kubectl)" ]; then | ||
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" | ||
chmod +x ./kubectl | ||
sudo mv ./kubectl /usr/local/bin/kubectl | ||
fi | ||
echo "Kind cluster already exists." | ||
fi | ||
|
||
echo "Dependencies installed" | ||
echo "Configuring kubectl to use Kind cluster..." | ||
export KUBECONFIG=$(pwd)/kubeconfig.yaml | ||
|
||
echo "Checking if Docker image is already built..." | ||
if ! docker images | grep -q local/run_with_importer; then | ||
echo "Building Docker image..." | ||
docker build -t local/run_with_importer -f ./docker/Dockerfile.run_with_importer . | ||
else | ||
echo "Docker image already built." | ||
fi | ||
|
||
echo "Loading Docker image into Kind..." | ||
kind load docker-image local/run_with_importer --name local-testing | ||
|
||
echo "Deploying application..." | ||
kubectl apply -f chaos/local-deployment.yaml | ||
kubectl apply -f chaos/local-service.yaml | ||
|
||
echo "Waiting for pods to be ready..." | ||
kubectl wait --for=condition=ready pod -l app=stratus-api --timeout=180s | ||
|
||
echo "Deployment complete. Checking pod status..." | ||
kubectl get pods -o wide |
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