Skip to content

Commit

Permalink
Setup ngrok in turtles-dev.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Danil-Grigorev <[email protected]>
  • Loading branch information
Danil-Grigorev committed Oct 3, 2024
1 parent ce47546 commit 8cc74d4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
25 changes: 17 additions & 8 deletions exp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ This is a technical preview of the experimental features that are currently bein

## Setting up the environment

To set up the environment, first prepare your EC2 SSH Key Pair name, navigate to the root of the repository and run:
To set up the environment, navigate to the root of the repository and run:

```bash
make dev-env
export RANCHER_HOSTNAME="<hostname>"
export NGROK_API_KEY="<api-key>"
export NGROK_AUTHTOKEN="<api-authtoken>"

make dev-env
```

The `Makefile` target sets up the environment by executing the `scripts/etcd-backup-restore-dev.sh`
The `Makefile` target sets up the environment by executing the `scripts/etcd-backup-restore-dev.sh`
script with the `RANCHER_HOSTNAME` argument. Under the hood, it performs the following steps:

1. Creates a kind cluster.
Expand All @@ -35,15 +39,20 @@ export CLUSTER_NAME=rke2
export KUBERNETES_VERSION=v1.30.4
export RKE2_VERSION=v1.30.4+rke2r1

kubectl apply -f test/e2e/data/cluster-templates/docker-rke2.yaml
# Prevent replacing lb-config variables by envsubst
export address='$address'
export server='$server'

envsubst < test/e2e/data/cluster-templates/docker-rke2.yaml | kubectl apply -f -
```

## Performing the snapshot and restore

When all machine in the cluster are ready, automatic ETCDMachineSnapshot object should appear on the management cluster soon.
When all machines in the cluster are ready, automatic ETCDMachineSnapshot object should appear on the management cluster soon.

```bash
kubectl get etcdmachinesnapshot -A

kubectl get etcdmachinesnapshot -A
```

To perform a restore run the following command:
Expand All @@ -53,13 +62,13 @@ export CLUSTER_NAMESPACE=default
export CLUSTER_NAME=rke2
export ETCD_MACHINE_SNAPSHOT_NAME="<snapshot_name_from_the_output>"

kubectl apply -f etcdrestore/examples/etcd-restore.yaml
envsubst < etcdrestore/examples/etcd-restore.yaml | kubectl apply -f -
```

## Cleanup

To clean up the environment, run the following command from the root of the repo:

```bash
make clean-dev-env
make clean-dev-env
```
13 changes: 13 additions & 0 deletions scripts/turtles-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ kubectl rollout status deployment coredns -n kube-system --timeout=90s
helm repo add rancher-latest https://releases.rancher.com/server-charts/latest
helm repo add capi-operator https://kubernetes-sigs.github.io/cluster-api-operator
helm repo add jetstack https://charts.jetstack.io
helm repo add ngrok https://charts.ngrok.com
helm repo update

helm install cert-manager jetstack/cert-manager \
Expand All @@ -51,6 +52,15 @@ helm install capi-operator capi-operator/cluster-api-operator \

kubectl rollout status deployment capi-operator-cluster-api-operator -n capi-operator-system --timeout=180s

helm upgrade ngrok ngrok/kubernetes-ingress-controller \
--install \
--wait \
--timeout 5m \
--set credentials.apiKey=$NGROK_API_KEY \
--set credentials.authtoken=$NGROK_AUTHTOKEN

kubectl apply -f test/e2e/data/rancher/ingress-class-patch.yaml

helm install rancher rancher-latest/rancher \
--namespace cattle-system \
--create-namespace \
Expand All @@ -64,4 +74,7 @@ helm install rancher rancher-latest/rancher \

kubectl rollout status deployment rancher -n cattle-system --timeout=180s

kubectl apply -f test/e2e/data/rancher/rancher-service-patch.yaml
envsubst < test/e2e/data/rancher/rancher-setting-patch.yaml | kubectl apply -f -

tilt up

0 comments on commit 8cc74d4

Please sign in to comment.