-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add kubernetes configurations for deployment
- Loading branch information
1 parent
74eff98
commit 3d7f39d
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |