Skip to content

Commit b17ee84

Browse files
committed
[Update] app.yaml
1 parent 9d880d8 commit b17ee84

File tree

1 file changed

+61
-61
lines changed

1 file changed

+61
-61
lines changed

kubernetes/app.yaml

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ spec:
1010
storage: 1Gi
1111

1212
---
13-
apiVersion: apps/v1
14-
kind: Deployment
15-
metadata:
16-
name: mysql
17-
spec:
18-
selector:
13+
apiVersion: apps/v1 # Version del Api
14+
kind: Deployment #Tipo de recurso
15+
metadata: #Los datos descriptivos o metadata
16+
name: mysql #eitquetas de metadata
17+
spec: #especificaciones del deployment
18+
selector: # etiquetas de seleccion
1919
matchLabels:
2020
app: mysql
21-
replicas: 1
22-
template:
23-
metadata:
21+
replicas: 1 # numero de replicas
22+
template: # template de los pods!!!
23+
metadata: #metadata de los pods!!
2424
labels:
2525
app: mysql
26-
spec:
27-
containers:
28-
- name: mysql
29-
image: arm64v8/mysql:8.0 # mysql:5.7replace if needed
30-
imagePullPolicy: Always
31-
env:
26+
spec: #Especificacion de los pods!!! -> Informacion de los contenedores
27+
containers: # listado de contenedores
28+
- name: mysql #contenedor 1 - nombre
29+
image: arm64v8/mysql:8.0 # mysql:5.7replace if needed #imagen
30+
imagePullPolicy: Always #Politica de Pulling
31+
env: #variables de entorno
3232
- name: MYSQL_ROOT_PASSWORD
3333
value: "your_password"
3434
- name: MYSQL_DATABASE
@@ -37,74 +37,74 @@ spec:
3737
value: "user"
3838
- name: MYSQL_PASSWORD
3939
value: "password"
40-
volumeMounts:
40+
volumeMounts: #volumenes
4141
- name: mysql-storage
4242
mountPath: /var/lib/mysql
43-
volumes:
43+
volumes: #volument PVC
4444
- name: mysql-storage
4545
persistentVolumeClaim:
4646
claimName: mysql-pvc
4747

4848
---
49-
apiVersion: v1
50-
kind: Service
51-
metadata:
49+
apiVersion: v1 #version de la api
50+
kind: Service #tipo de elemento
51+
metadata: #metadata
5252
name: mysql
53-
spec:
54-
ports:
53+
spec: #especificaciones del servicio
54+
ports: #puerto de interes
5555
- port: 3306
56-
selector:
56+
selector: #selector!
5757
app: mysql
5858

5959
---
60-
apiVersion: apps/v1
61-
kind: Deployment
62-
metadata:
60+
apiVersion: apps/v1 # version ip
61+
kind: Deployment #tipo de recurso
62+
metadata: #metadata
6363
name: fastapi-deployment
64-
spec:
65-
selector:
64+
spec: #especificaciones del pod
65+
selector: #selector
6666
matchLabels:
6767
app: fastapi
68-
replicas: 1
69-
template:
68+
replicas: 2 #replicas
69+
template: #template
7070
metadata:
7171
labels:
7272
app: fastapi
73-
spec:
74-
containers:
75-
- name: fastapi
76-
image: hfmartinez/fastapi-todo-app
77-
imagePullPolicy: Always
73+
spec: #especificaciones
74+
containers: #container
75+
- name: fastapi #nombre
76+
image: hfmartinez/fastapi-todo-app #imagen
77+
imagePullPolicy: Always #politica de pulling
7878
ports:
79-
- containerPort: 8000
80-
# envFrom:
81-
# - configMapRef:
82-
# name: fastapi-config
83-
# - secretRef:
84-
# name: fastapi-secrets
85-
env:
86-
- name: DATABASE_HOST
87-
value: "mysql"
88-
- name: MYSQL_ROOT_PASSWORD
89-
value: root_password
90-
- name: MYSQL_DATABASE
91-
value: todo_db
92-
- name: MYSQL_USER
93-
value: user
94-
- name: MYSQL_PASSWORD
95-
value: password
79+
- containerPort: 8000 #puerto!
80+
envFrom:
81+
- configMapRef:
82+
name: fastapi-config
83+
- secretRef:
84+
name: fastapi-secrets
85+
# env: #variables de entorno
86+
# - name: DATABASE_HOST
87+
# value: "mysql"
88+
# - name: MYSQL_ROOT_PASSWORD
89+
# value: root_password
90+
# - name: MYSQL_DATABASE
91+
# value: todo_db
92+
# - name: MYSQL_USER
93+
# value: user
94+
# - name: MYSQL_PASSWORD
95+
# value: password
9696

9797
---
98-
apiVersion: v1
99-
kind: Service
100-
metadata:
98+
apiVersion: v1 #version
99+
kind: Service #tipo servicio
100+
metadata: #metadad
101101
name: fastapi-service
102-
spec:
103-
type: NodePort
104-
ports:
105-
- port: 80
106-
targetPort: 8000
107-
selector:
102+
spec: #especificaciones
103+
type: NodePort #tipo de servicio
104+
ports: #puertos
105+
- port: 80 #puerto del servicio!!
106+
targetPort: 8000 #puerto del contenedor
107+
selector: #selector
108108
app: fastapi
109109

110110
---

0 commit comments

Comments
 (0)