This repository contains an example deployment.yml for deploying 12factor-app-a and 12factor-app-b on Kubernetes
- Install and set up Minikube and kubectl
- Checkout this repository, 12factor-app-a and 12factor-app-b
- Run
minikube start
if minikube is not already started - Run
eval $(minikube docker-env)
to set up your docker environment to connect to minikube- This only affects the current terminal. You must run this command for each terminal where you're going to build a docker image.
- Change to the
12factor-app-a
directory and runmvn package -P docker-image
. This will build the app and the docker image. - Change to the
12factor-app-b
directory and runmvn package -P docker-image
. This will build the app and the docker image. - Change to the directory for this repository and run
kubectl apply -f deployment.yml
- This should deploy and start two instances of each app and expose service A on port 30080 on the minikube IP address
- You can run
kubectl get pods
to watch your containers starting
- Run
minikube ip
to get the minikube IP address - Visit
http://<minikube ip>:30080/demo/a
to see the response from service A