Skip to content

Preload all containers: no build required for faster starting #119

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

Merged
merged 1 commit into from
Nov 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions build-an-deploy-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

echo "This Script can be used to 'easily' build all WrongSecrets CTF party Components and install them to a local kubernetes cluster"
echo "For this to work the local kubernetes cluster must have access to the same local registry / image cache which 'docker build ...' writes its image to"
echo "For example docker-desktop with its included k8s cluster"

echo "Usage: ./build-an-deploy.sh"

source ./scripts/check-available-commands.sh
checkCommandsAvailable helm docker kubectl yq

version="$(uuidgen)"
docker login
WRONGSECRETS_IMAGE=$(cat helm/wrongsecrets-ctf-party/values.yaml| yq '.wrongsecrets.image')
WRONGSECRETS_TAG=$(cat helm/wrongsecrets-ctf-party/values.yaml| yq '.wrongsecrets.tag')
WEBTOP_IMAGE=$(cat helm/wrongsecrets-ctf-party/values.yaml| yq '.virtualdesktop.image')
WEBTOP_TAG=$(cat helm/wrongsecrets-ctf-party/values.yaml| yq '.virtualdesktop.tag')
WRONGSECRETS_BALANCER_IMAGE=$(cat helm/wrongsecrets-ctf-party/values.yaml| yq '.balancer.repository')
WRONGSECRETS_BALANCER_TAG=$(cat helm/wrongsecrets-ctf-party/values.yaml| yq '.balancer.tag')
WRONGSECRETS_CLEANER_IMAGE=$(cat helm/wrongsecrets-ctf-party/values.yaml| yq '.wrongsecretsCleanup.repository')
WRONGSECRETS_CLEANER_TAG=$(cat helm/wrongsecrets-ctf-party/values.yaml| yq '.wrongsecretsCleanup.tag')
echo "Pulling in required images to actually run $WRONGSECRETS_IMAGE:$WRONGSECRETS_TAG & $WEBTOP_IMAGE:$WEBTOP_TAG."
echo "If you see an authentication failure: pull them manually by the following 2 commands"
echo "'docker pull $WRONGSECRETS_IMAGE:$WRONGSECRETS_TAG'"
echo "'docker pull $WEBTOP_IMAGE:$WEBTOP_TAG'"
echo "'docker pull $WRONGSECRETS_BALANCER_IMAGE:$WRONGSECRETS_BALANCER_TAG'" &
echo "'docker pull $WRONGSECRETS_CLEANER_IMAGE:$WRONGSECRETS_CLEANER_TAG'" &
docker pull $WRONGSECRETS_IMAGE:$WRONGSECRETS_TAG &
docker pull $WEBTOP_IMAGE:$WEBTOP_TAG &
docker pull $WRONGSECRETS_BALANCER_IMAGE:$WRONGSECRETS_BALANCER_TAG &
docker pull $WRONGSECRETS_CLEANER_IMAGE:$WRONGSECRETS_CLEANER_TAG
wait

helm upgrade --install mj ./helm/wrongsecrets-ctf-party --set="imagePullPolicy=Never"
14 changes: 13 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ For minikube, run:

minikube start --cpus=6 --memory=10000MB --network-plugin=cni --cni=calico
eval $(minikube docker-env)
./build-an-deploy.sh
./build-an-deploy-container.sh
kubectl port-forward service/wrongsecrets-balancer 3000:3000

```
Expand All @@ -118,6 +118,18 @@ kubectl top nodes
kubectl top pods
```

### Develop with Minikube

```shell

minikube start --cpus=6 --memory=10000MB --network-plugin=cni --cni=calico
eval $(minikube docker-env)
./build-an-deploy.sh
kubectl port-forward service/wrongsecrets-balancer 3000:3000

```


### Play with AWS EKS:

** NOTE: SEE SECTIONS ABOVE ABOUT WHAT YOU NEED AND THE COST OF THINGS: This project is not responsible, and will not pay for any part of your AWS bill. **
Expand Down