Skip to content

Commit

Permalink
KubeDev#4 Deployment manifest added
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielMarques14 committed Apr 2, 2022
1 parent 63d354f commit 3b30b8f
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# MongoDB Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
name: mongodb
spec:
selector:
matchLabels:
app: mongodb
template:
metadata:
labels:
app: mongodb
spec:
containers:
- name: mongodb
image: mongo:5.0.5
ports:
- containerPort: 27017
env:
- name: MONGO_INITDB_ROOT_USERNAME
value: mongouser
- name: MONGO_INITDB_ROOT_PASSWORD
value: mongopwd
---
# Service for MongoDB

apiVersion: v1
kind: Service
metadata:
name: mongodb
spec:
selector:
app: mongodb
ports:
- port: 27017
type: ClusterIP
---
# Web App Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: gabrielxiv/rotten-potatoes:v2
ports:
- containerPort: 5000
env:
- name: MONGODB_DB
value: admin
- name: MONGODB_HOST
value: mongodb
- name: MONGODB_PORT
value: '27017'
- name: MONGODB_USERNAME
value: mongouser
- name: MONGODB_PASSWORD
value: mongopwd
---
# Service for Web App

apiVersion: v1
kind: Service
metadata:
name: web
spec:
selector:
app: web
ports:
- port: 80
targetPort: 5000
nodePort: 30000
type: NodePort

0 comments on commit 3b30b8f

Please sign in to comment.