Skip to content

Commit

Permalink
Add first k8s config
Browse files Browse the repository at this point in the history
  • Loading branch information
René Meier committed Nov 29, 2023
1 parent 8009c14 commit 8683e10
Show file tree
Hide file tree
Showing 11 changed files with 226 additions and 0 deletions.
25 changes: 25 additions & 0 deletions k8s/cdkdepict/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: massbank3-cdkdepict
namespace: massbank3
labels:
app: massbank3-cdkdepict
spec:
replicas: 1
selector:
matchLabels:
app: massbank3-cdkdepict
template:
metadata:
name: massbank3-cdkdepict
labels:
app: massbank3-cdkdepict
spec:
containers:
- name: massbank3-cdkdepict
image: docker.io/simolecule/cdkdepict:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
restartPolicy: Always
14 changes: 14 additions & 0 deletions k8s/cdkdepict/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: massbank3-cdkdepict
namespace: massbank3
spec:
selector:
app: massbank3-cdkdepict
ports:
- protocol: TCP
port: 8080
targetPort: 8080
nodePort: 30001
type: NodePort
28 changes: 28 additions & 0 deletions k8s/mb3frontent/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: massbank3-frontent
namespace: massbank3
labels:
app: massbank3-frontent
spec:
replicas: 1
selector:
matchLabels:
app: massbank3-frontent
template:
metadata:
name: massbank3-frontent
labels:
app: massbank3-frontent
spec:
containers:
- name: massbank3-frontent
image: rmeier/massbank3-frontent:latest
env:
- name: MB3_API_URL
value: "http://massbank3-server:8081"
ports:
- containerPort: 8080
imagePullPolicy: IfNotPresent
restartPolicy: Always
13 changes: 13 additions & 0 deletions k8s/mb3frontent/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: massbank3-frontent
namespace: massbank3
spec:
selector:
app: massbank3-frontent
ports:
- protocol: TCP
port: 8080
targetPort: 3000
type: NodePort
42 changes: 42 additions & 0 deletions k8s/mb3server/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: massbank3-server
namespace: massbank3
labels:
app: massbank3-server
spec:
replicas: 1
selector:
matchLabels:
app: massbank3-server
template:
metadata:
name: massbank3-server
labels:
app: massbank3-server
spec:
containers:
- name: massbank3-server
image: rmeier/massbank3-server:latest
imagePullPolicy: IfNotPresent
env:
- name: DB_TYPE
value: postgres
- name: DB_PORT
value: "5432"
- name: DB_PASSWORD
value: massbank3password
- name: DB_HOST
value: massbank3-postgress
- name: DB_NAME
value: massbank3
- name: DB_CONN_STRING
value: ""
- name: MB3_SERVER_PORT
value: "8080"
- name: CDKDEPICT_URL
value: "http://massbank3-cdkdepict:8080"
ports:
- containerPort: 8080
restartPolicy: Always
14 changes: 14 additions & 0 deletions k8s/mb3server/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: massbank3-service
namespace: massbank3
spec:
selector:
app: massbank3-server
ports:
- protocol: TCP
port: 8081
targetPort: 8080
nodePort: 30002
type: NodePort
4 changes: 4 additions & 0 deletions k8s/ns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: massbank3
9 changes: 9 additions & 0 deletions k8s/postgress/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: postgres-config
namespace: massbank3
data:
POSTGRES_PASSWORD: massbank3password
POSTGRES_USER: massbank3
POSTGRES_DB: massbank3
35 changes: 35 additions & 0 deletions k8s/postgress/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: massbank3-postgres
namespace: massbank3
labels:
app: massbank3-postgres
spec:
replicas: 1
selector:
matchLabels:
app: massbank3-postgres
template:
metadata:
name: massbank3-postgres
labels:
app: massbank3-postgres
spec:
containers:
- name: massbank3-postgres
image: docker.io/postgres:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5432
envFrom:
- configMapRef:
name: postgres-config
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgredb
volumes:
- name: postgredb
persistentVolumeClaim:
claimName: postgres-pv-claim
restartPolicy: Always
30 changes: 30 additions & 0 deletions k8s/postgress/pv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
kind: PersistentVolume
apiVersion: v1
metadata:
name: postgres-pv-volume
namespace: massbank3
labels:
type: local
app: postgres
spec:
storageClassName: manual
capacity:
storage: 5Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/mnt/data"
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: postgres-pv-claim
labels:
app: postgres
spec:
storageClassName: manual
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
12 changes: 12 additions & 0 deletions k8s/postgress/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: massbank3-postgres
namespace: massbank3
spec:
selector:
app: massbank3-postgres
ports:
- protocol: TCP
port: 5432
type: NodePort

0 comments on commit 8683e10

Please sign in to comment.