-
Have an account for a Docker registry images. You can use Docker or Quay.io
-
Have a Kubernetes instances. You can run this using either Minikube, CodeReady Containers or Docker Desktop
-
You can generate a Docker image with the following command:
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=<your-id>/contacts-app-ui:v1
-
Push you image
docker push <your-id>/contacts-app-ui:v1
|
Warning
|
Use your docker id and replace it. |
-
You can generate the deployment with the following commands, make the necessary adjustments and deploy it to your Kubernetes instance.
kubectl create deployment contacts-app-ui --image=<your-id>/contacts-app-ui:v1 --dry-run=client -o=yaml > k8s-deployment.yaml echo --- >> k8s-deployment.yaml kubectl create service loadbalancer contacts-app-ui --tcp=8080:8080 --dry-run=client -o=yaml >> k8s-deployment.yaml