This guide will walk you through the steps to build and deploy MyApp using Maven, Docker, and Kubernetes.
Before you begin, make sure to have the following tools and utilities installed on your system:
Clone the project from the repository:
git clone https://github.com/dorbanianas/devops-presentation
Navigate to the project directory:
cd devops-presentationClean the project to remove any previous build artifacts:
mvn clean
Build the application package:
mvn package
Log in to your Docker Hub account or your preferred container registry:
docker login
Build a Docker image for MyApp, giving it a name and version tag (e.g.,
devopspresentation/myapp:latest):docker build -t devopspresentation/myapp:latest .Push the Docker image to Docker Hub:
docker push devopspresentation/myapp:latest
Verify that the Docker image has been successfully built:
docker images
Apply the Kubernetes deployment configuration to deploy MyApp using minikube:
minikube start
Apply the Kubernetes deployment configuration to deploy MyApp:
kubectl apply -f deployment.yaml
Check the nodes in your Kubernetes cluster:
kubectl get nodes -o wide
View the deployments in your cluster:
kubectl get deployments
Check the pods created by the deployment:
kubectl get pods
Access the logs of all the pods if needed using the following script:
./get_pods_logs.sh
Apply the Kubernetes service configuration to expose the application:
kubectl apply -f service.yaml
Check the services available in your cluster:
kubectl get service
Verify the nodes and their details:
kubectl get nodes -o wide
Access your application by obtaining the external IP of the service using the following script:
./get_app_url.sh