Skip to content

Commit

Permalink
Add kubernetes configurations for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
matevskial committed Mar 21, 2021
1 parent 74eff98 commit 3d7f39d
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
12 changes: 12 additions & 0 deletions kubernetes/mongo_cluster_ip.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Exposes a set of pods to other objects in the cluster
apiVersion: v1
kind: Service
metadata:
name: test-mongo # hostname for the pods that are configured with this config
spec:
type: ClusterIP
selector:
component: db
ports:
- port: 27017
targetPort: 27017
19 changes: 19 additions & 0 deletions kubernetes/mongo_deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongo-deployment
spec:
replicas: 1 # number of different pods described with the template spec
selector:
matchLabels:
component: db
template: # configuration for every single pod that is configured by this Deployment
metadata:
labels:
component: db
spec:
containers:
- name: test-mongo
image: mongo
ports:
- containerPort: 27017
20 changes: 20 additions & 0 deletions kubernetes/webapp_deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp-deployment
spec:
replicas: 1 # number of different pods described with the template spec
selector:
matchLabels:
component: web
template: # configuration for every single pod that is configured by this Deployment
metadata:
labels:
component: web
spec:
containers:
- name: webapp
image: express-project-docker
imagePullPolicy: Never
ports:
- containerPort: 3000
13 changes: 13 additions & 0 deletions kubernetes/webapp_nodeport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1

kind: Service
metadata:
name: webapp-network
spec:
type: NodePort
ports:
- port: 3000
targetPort: 3000
nodePort: 31516
selector:
component: web

0 comments on commit 3d7f39d

Please sign in to comment.