curso-basico-kubernetes/Clase 5/Ejercicio/node-show-text-app/deployment.yaml

55 lines
1.3 KiB
YAML
Raw Normal View History

2022-10-10 22:46:45 -06:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: node-app
namespace: node-app
spec:
replicas: 1
selector:
matchLabels:
2022-11-14 13:00:24 -06:00
com.docker.project: node-app
2022-10-10 22:46:45 -06:00
app: node-app
template:
metadata:
labels:
2022-11-14 13:00:24 -06:00
com.docker.project: node-app
2022-10-10 22:46:45 -06:00
app: node-app
spec:
containers:
- name: node-app
2022-11-14 13:00:24 -06:00
image: node
2022-10-10 22:46:45 -06:00
command:
- "/bin/sh"
- "-c"
2022-11-14 13:00:24 -06:00
- "cd /app && npm install && node app.js"
2022-10-10 22:46:45 -06:00
env:
- name: PORT
value: "3000"
- name: SECRET
valueFrom:
secretKeyRef:
name: node-app-secret
key: secret
- name: MESSAGE
valueFrom:
configMapKeyRef:
name: node-app-configmap
key: message
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 3000
2022-11-14 13:00:24 -06:00
protocol: TCP
2022-10-10 22:46:45 -06:00
volumeMounts:
- name: app-files
mountPath: /app/app.js
subPath: app.js
- name: app-files
mountPath: /app/package.json
subPath: package.json
volumes:
- name: app-files
configMap:
name: node-app-configmap