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] ...
Kubernetes -Tipos de objetos
- Obtener enlace
- X
- Correo electrónico
- Otras aplicaciones
A continuación se detalla los tipos de objetos se se pueden configurar en Kubernetes de acuerdo a version del api
apiVersion: v1
| Objeto | Descripción |
|---|---|
| componentStatus | |
| Endpoint | |
| Namespace | |
| configMap | |
| Event | |
Pod
Es una agrupación de contenedores con un mismo propósito en común.
Un pod es la unidad más pequeña que se puede deployar en Kubernetes
Ejemplo archivo client-pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: client-pod
labels:
#name: myapp
component: web
spec:
containers:
- name: client
image: stephengrider/multi-client
ports:
- containerPort: 3000
resources:
limits:
memory: "128Mi"
cpu: "500m"
Service
Permite configurar los temas de red en un cluster de Kubernetes
Subtipos- Cluster IP
- NodePort
El subtipo NodePort permite exponer el contenedor (solo para propósitos de desarrollo)
- LoadBalancer
- Ingress
Ejemplo archivo client-node-port.yaml
apiVersion: v1
kind: Service
metadata:
name: client-node-port
spec:
type: NodePort
ports:
- port: 3050
targetPort: 3000
nodePort: 31515
selector:
component: web
Deployment
Mantiene un conjunto de pods identicos, asegurando que estos tienen una correcta configuración y que existen en número correcto. Se use usar pods o deployments para correr contenedores, pero estos tienen diferencias
Se utiliza una plantilla para crear un deployment
Ejemplo archivo client-node-port.yaml
apiVersion: v1
kind: Service
metadata:
name: client-node-port
spec:
type: NodePort
ports:
- port: 3050
targetPort: 3000
nodePort: 31515
selector:
component: web
apiVersion: apps/v1
| Objeto | Descripción |
|---|---|
| ControllerRevision | |
| StatefulSet | |
- Obtener enlace
- X
- Correo electrónico
- Otras aplicaciones
Entradas populares de este blog
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] ...
Kubernetes - Relación entre un POD y un SERVICE
A continuación se detalla como se comunica un Pod con un Service en el cluster de Kubernetes Diagrama de configuración Archivo client-pod.yaml apiVersion: v1 kind: Pod metadata: name: client-pod labels: component: web spec: containers: - name: client image: stephengrider/multi-client ports: - containerPort: 3000 resources: limits: memory: "128Mi" cpu: "500m" labels: Permite asignar un nombre al pod. Es una relación clave-valor; en este caso componente:web ports: Permite asignar el valor del puerto por donde el pod va a escuchar Archivo client-node-port.yaml apiVersion: v1 kind: Service metadata: name: client-node-port spec: type: NodePort ports: - port: 3050 targetPort: 3000 nodePort: 31515 selector: component: web selector: Permite asociar el servicio al pod, mediante la relación clave-valor; en este caso componente:web ...
Revert changes to a specifi commit
Steps for reverting code to a specific commit: Resets index to former commit; replace '56e05fced' with your commit code git reset 56e05fced Moves pointer back to previous HEAD git reset --soft HEAD@{1} Commit de revert git commit -m "Revert to 56e05fced" Updates working copy to reflect the new commit git reset --hard Origin: https://stackoverflow.com/questions/4114095/how-to-revert-a-git-repository-to-a-previous-commit
Comentarios
Publicar un comentario