Skip to content

Commit

Permalink
Create myapp.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
legah2045 authored Oct 27, 2020
1 parent 2728298 commit 2fe8cc9
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions myapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: springbootdeployment
spec:
replicas: 2
selector:
matchLabels:
app: springboot
template:
metadata:
name: springapppod
labels:
app: springboot
spec:
containers:
- image: mylandmarktech/spring-boot-mongo
name: springboot
ports:
- containerPort: 8080
env:
- name: MONGO_DB_HOSTNAME
value: mongo
- name: MONGO_INITDB_ROOT_USERNAME
value: springapp
- name: MONGO_INITDB_ROOT_PASSWORD
value: mongodb@123
---
# Node Port Service For SpringApp
apiVersion: v1
kind: Service
metadata:
name: springboot
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
selector:
app: springboot
---
# Mongo RC with host path Volume
apiVersion: v1
kind: ReplicationController
metadata:
name: mongo-controller
spec:
replicas: 1
selector:
app: mongo
template:
metadata:
labels:
app: mongo
spec:
containers:
- image: mongo
name: mongo
env:
- name: MONGO_INITDB_ROOT_USERNAME
value: springapp
- name: MONGO_INITDB_ROOT_PASSWORD
value: mongodb@123
ports:
- containerPort: 27017
volumeMounts:
- name: mongo-persistent-storage
mountPath: /data/db
volumes:
- name: mongo-persistent-storage
hostPath:
path: /tmp/dbbackup
---
# Mongo Node Port RC
apiVersion: v1
kind: Service
metadata:
name: mongo
spec:
type: ClusterIP
ports:
- port: 27017
targetPort: 27017
selector:
app: mongo

0 comments on commit 2fe8cc9

Please sign in to comment.