|
@@ -0,0 +1,57 @@
|
|
|
|
|
+apiVersion: apps/v1
|
|
|
|
|
+kind: Deployment
|
|
|
|
|
+metadata:
|
|
|
|
|
+ name: mongo-express
|
|
|
|
|
+ namespace: mongo-express
|
|
|
|
|
+ labels:
|
|
|
|
|
+ app: mongo-express
|
|
|
|
|
+spec:
|
|
|
|
|
+ replicas: 1
|
|
|
|
|
+ selector:
|
|
|
|
|
+ matchLabels:
|
|
|
|
|
+ app: mongo-express
|
|
|
|
|
+ template:
|
|
|
|
|
+ metadata:
|
|
|
|
|
+ labels:
|
|
|
|
|
+ app: mongo-express
|
|
|
|
|
+ spec:
|
|
|
|
|
+ containers:
|
|
|
|
|
+ - name: mongo-express
|
|
|
|
|
+ image: mongo-express
|
|
|
|
|
+ ports:
|
|
|
|
|
+ - containerPort: 8081
|
|
|
|
|
+ env:
|
|
|
|
|
+ # 1. Fuerza a Mongo Express a ignorar su lógica interna de construcción
|
|
|
|
|
+ - name: ME_CONFIG_MONGODB_URL
|
|
|
|
|
+ value: "mongodb://mongo-mongodb-headless.overleaf.svc.cluster.local:27017/sharelatex?authSource=admin"
|
|
|
|
|
+
|
|
|
|
|
+ # 2. Obligatorio: Pon el "SERVER" apuntando exactamente a la misma dirección
|
|
|
|
|
+ # para resolver un bug de herencia de variables en Kubernetes.
|
|
|
|
|
+ - name: ME_CONFIG_MONGODB_SERVER
|
|
|
|
|
+ value: "mongo-mongodb-headless.overleaf.svc.cluster.local"
|
|
|
|
|
+
|
|
|
|
|
+ - name: ME_CONFIG_MONGODB_ADMINUSERNAME
|
|
|
|
|
+ valueFrom:
|
|
|
|
|
+ secretKeyRef:
|
|
|
|
|
+ name: mongodb-secret
|
|
|
|
|
+ key: mongo-root-username
|
|
|
|
|
+ - name: ME_CONFIG_MONGODB_ADMINPASSWORD
|
|
|
|
|
+ valueFrom:
|
|
|
|
|
+ secretKeyRef:
|
|
|
|
|
+ name: mongodb-secret
|
|
|
|
|
+ key: mongo-root-password
|
|
|
|
|
+---
|
|
|
|
|
+apiVersion: v1
|
|
|
|
|
+kind: Service
|
|
|
|
|
+metadata:
|
|
|
|
|
+ name: mongo-express-service
|
|
|
|
|
+ namespace: mongo-express
|
|
|
|
|
+spec:
|
|
|
|
|
+ selector:
|
|
|
|
|
+ app: mongo-express
|
|
|
|
|
+ type: NodePort
|
|
|
|
|
+ ports:
|
|
|
|
|
+ - protocol: TCP
|
|
|
|
|
+ port: 8081
|
|
|
|
|
+ targetPort: 8081
|
|
|
|
|
+ nodePort: 30000
|