- A running kubernetes cluster (you can use Minikube or Kind)
- Kustomize
- Go 1.17 or newer https://go.dev/dl/
- Make https://www.gnu.org/software/make/
git clone https://github.com/Alevsk/dvka && cd dvka/challenge-1
There are several ways to run this lab
# compile the binary
make && cd cmd/app
# run the binary
DVKA_LAB1_SIGNING_KEY="" DVKA_LAB1_FLAG="" ./lab1
# build docker image
TAG=alevsk/dvka:lab-1 make docker
# run container using docker
docker run --rm -p 8080:8080 -e DVKA_LAB1_SIGNING_KEY="" -e DVKA_LAB1_FLAG="" --name=dvka-labl-1 alevsk/dvka:lab-1
# or using docker-compose
docker-compose up -d
Optional: configure various parameters of the challenge using
k8s/base/secret.yaml
andk8s/base/deployment.yaml
files
# deploy the Lab using
kustomize build k8s/base | kubectl apply -f -
# Expose lab-1 application service
kubectl port-forward svc/nft-store 8080:8080 -n lab-1
Open your browser and go to http://localhost:8080/
- Stop the program with
ctrl-c
- Stop the
docker run
command withctrl-c
- If using
docker-compose
thendocker-compose down
- Stop the
port-forward
command withctrl-c
# delete the lab from the cluster
kustomize build k8s/base | kubectl delete -f -