Create a docker image from a spring boot project

In order to create a docker image from a spring boot project, First, your pom.xml has to be configured. <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!-- Cofiguration for creating a docker image --> <image> <name>chamow01/${project.artifactId}</name> </image> </configuration> </plugin> </plugins> </build> Then, the next maven command needs to be applied, so spring boot uses paketo-buildpacks in order to create a docker image based on you Java code mvn spring-boot:build-image ... [INFO] > Running creator [INFO] [creator] ===> DETECTING [INFO] [creator] 6 of 24 buildpacks participating [INFO] [creator] paketo-buildpacks/ca-certificates 3.2.0 [INFO] [creator] paketo-buildpacks/bellsoft-liberica 9.3.2 [INFO]

Comandos Kubernetes


A continuación se detalla un listado de comandos para Kubernetes


Comando Descripción Ejemplo
Básicos
kubectl cluster-info Información del cluster de kubernetes, configurado en el proceso de instalación kubectl cluster-info
kubectl apply -f <filename> Permite cambiar la configuración del cluster de Kubernetes
kubectl apply -f client-pod.yaml
kubectl apply -f client-node-port.yaml
kubectl get <object type> Permite verificar el estado de los pods
kubectl get pods
kubectl get services
kubectl get all
kubectl describe <object type> <object name> Permite obtener la información de un objeto
kubectl describe pod client-pod --> Obtiene la información solo del pod client-pod
kubectl describe pods --> Obtiene toda la información de los tipo pod
kubectl delete -f <config file> Permite eliminar un objeto en base al tipo y nombre definidos en el archivo
kubectl delete -f client-pod.yaml

Comentarios

Entradas populares de este blog

Create a docker image from a spring boot project

Comandos docker

Kubernetes -Tipos de objetos