Commit 5a50ca77 authored by Alexander Lercher's avatar Alexander Lercher

Trace Retrieval: Added MongoDB; only one k8s file

parent 25716ce5
......@@ -3,12 +3,10 @@ import os
docker_reg = '172.16.1.20:5000'
paths = []
for r, _, f in os.walk('./'):
for p, _, f in os.walk('./'):
for file in f:
if 'deployment.yml' == file:
paths.append(os.path.join(r, ''))
paths.append(os.path.join(p, ''))
for path in paths:
os.system(f"kubectl apply -f {path}deployment.yml")
os.system(f"kubectl apply -f {path}service.yml")
os.system(f"kubectl apply -f {path}")
apiVersion: v1
kind: Service
metadata:
name: trace-retrieval
spec:
type: LoadBalancer
externalIPs:
- 143.205.173.36
selector:
app: trace-retrieval
ports:
- name: http
port: 80
targetPort: 5000
nodePort: 30001
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: trace-retrieval
spec:
replicas: 2
selector:
......@@ -18,4 +33,46 @@ spec:
- name: trace-retrieval
image: 172.16.1.20:5000/trace-retrieval-microservice
ports:
- containerPort: 5000
\ No newline at end of file
- containerPort: 5000
---
apiVersion: v1
kind: Service
metadata:
name: trace-retrieval-db
spec:
type: LoadBalancer
externalIPs:
- 143.205.173.36
selector:
app: trace-retrieval-db
ports:
- name: http
port: 27017
targetPort: 27017
nodePort: 30003
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: trace-retrieval-db
spec:
replicas: 1
selector:
matchLabels:
app: trace-retrieval-db
template:
metadata:
labels:
app: trace-retrieval-db
spec:
containers:
- name: trace-retrieval-db
image: mongo
env:
- name: MONGO_INITDB_ROOT_USERNAME
value: root
- name: MONGO_INITDB_ROOT_PASSWORD
value: root
ports:
- containerPort: 27017
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: trace-retrieval
spec:
type: LoadBalancer
externalIPs:
- 143.205.173.36
selector:
app: trace-retrieval
ports:
- name: http
port: 80
targetPort: 5000
nodePort: 30001
protocol: TCP
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment