Skip to content
Snippets Groups Projects
Commit 72338f15 authored by Steffen Vogel's avatar Steffen Vogel :santa_tone2:
Browse files

add kubernetes yaml files

parent 5c4fda87
No related branches found
No related tags found
No related merge requests found
Pipeline #188639 failed
Showing
with 445 additions and 4 deletions
backup/
\ No newline at end of file
backup/
etc/node/others/
version: "2.1"
version: "3.2"
volumes:
database:
......@@ -48,10 +48,8 @@ services:
# The MongoDB database for the VILLASweb backend
database:
image: mongo:latest
user: mongodb
volumes:
- database:/data/db
user: mongodb
restart: always
# VILLASnode, the gateway between UDP and WebSocket traffic
......
NAMESPACE=villas
KUBECTL=kubectl -n $(NAMESPACE)
APPLY=--dry-run -o yaml | $(KUBECTL) apply -f -
deploy: config-maps secrets
$(KUBECTL) apply -f .
namespace:
$(KUBECTL) create namespace villas $(APPLY)
config-maps:
$(KUBECTL) create configmap nginx-config --from-file=../etc/nginx/ $(APPLY)
$(KUBECTL) create configmap node-config --from-file=../etc/node/ $(APPLY)
$(KUBECTL) create configmap controller-config --from-file=../etc/controller/ $(APPLY)
secrets:
.PHONY: deploy config-maps secrets
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: backend
app.kubernetes.io/part-of: villas-web
name: backend
spec:
selector:
matchLabels:
app.kubernetes.io/component: backend
app.kubernetes.io/part-of: villas-web
template:
metadata:
labels:
app.kubernetes.io/component: backend
app.kubernetes.io/part-of: villas-web
spec:
containers:
- env:
- name: AMQP_ENDPOINT
value: amqp://villas:s3c0sim4!@broker/%2F
- name: DATABASE_URL
value: mongodb://database:27017/
- name: DEFAULT_ADMIN
value: "true"
- name: LOG_FILE
value: villasweb-backend_log.txt
- name: LOG_LEVEL
value: info
- name: NODE_ENV
value: dotenv
image: villas/web-backend
name: backend
volumeMounts:
- mountPath: /usr/src/app/public/
name: files
volumes:
- name: files
persistentVolumeClaim:
claimName: backend-files
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/component: files
name: backend-files
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: broker
app.kubernetes.io/part-of: villas-controller
name: broker
spec:
selector:
matchLabels:
app.kubernetes.io/component: broker
app.kubernetes.io/part-of: villas-controller
template:
metadata:
labels:
app.kubernetes.io/component: broker
app.kubernetes.io/part-of: villas-controller
spec:
containers:
- env:
- name: RABBITMQ_DEFAULT_PASS
value: s3c0sim4!
- name: RABBITMQ_DEFAULT_USER
value: villas
image: broker
name: broker
ports:
- containerPort: 15672
- containerPort: 5672
- containerPort: 1883
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: broker
app.kubernetes.io/part-of: villas-controller
name: broker
spec:
ports:
- name: "web"
port: 8083
targetPort: 15672
- name: "amqp"
port: 5672
targetPort: 5672
- name: "mqtt"
port: 1883
targetPort: 1883
selector:
app.kubernetes.io/component: broker
app.kubernetes.io/part-of: villas-controller
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: controller
name: controller
spec:
template:
metadata:
labels:
app.kubernetes.io/component: controller
spec:
containers:
- args:
- villas-ctl
- -b
- amqp://villas:s3c0sim4!@broker/%2F
- -c
- /etc/villas/controller/config.json
- daemon
image: villas/controller
name: controller
volumeMounts:
- mountPath: /etc/villas/controller/
name: config
volumes:
- name: config
configMap:
name: controller-config
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: database
name: database
spec:
template:
metadata:
labels:
app.kubernetes.io/component: database
spec:
containers:
- image: mongo:latest
name: database
volumeMounts:
- mountPath: /data/db
name: database
volumes:
- name: database
persistentVolumeClaim:
claimName: database
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/component: database
name: database
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: frontend
app.kubernetes.io/part-of: villas-web
name: frontend
spec:
selector:
matchLabels:
app.kubernetes.io/component: frontend
app.kubernetes.io/part-of: villas-web
template:
metadata:
labels:
app.kubernetes.io/component: frontend
app.kubernetes.io/part-of: villas-web
spec:
containers:
- image: villas/web-frontend
name: frontend
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: mongo-express
app.kubernetes.io/part-of: villas-web
name: mongo-express
spec:
selector:
matchLabels:
app.kubernetes.io/component: mongo-express
app.kubernetes.io/part-of: villas-web
template:
metadata:
labels:
app.kubernetes.io/component: mongo-express
app.kubernetes.io/part-of: villas-web
spec:
containers:
- env:
- name: ME_CONFIG_BASICAUTH_PASSWORD
value: mongo-admin
- name: ME_CONFIG_BASICAUTH_USERNAME
value: admin
- name: ME_CONFIG_MONGODB_SERVER
value: database
- name: ME_CONFIG_SITE_BASEURL
value: /mongo-express/
image: mongo-express
name: mongo-express
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/component: nginx-claim0
name: nginx-claim0
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: nginx
app.kubernetes.io/part-of: villas-web
name: nginx
spec:
selector:
matchLabels:
app.kubernetes.io/component: nginx
app.kubernetes.io/part-of: villas-web
template:
metadata:
labels:
app.kubernetes.io/component: nginx
app.kubernetes.io/part-of: villas-web
spec:
containers:
- image: nginx:stable-alpine
name: nginx
ports:
- containerPort: 8080
volumeMounts:
- mountPath: /etc/nginx/conf.d/default.conf
name: nginx-claim0
volumes:
- name: nginx-claim0
configMap:
name: nginx-config
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: nginx
name: nginx
spec:
ports:
- name: "http"
port: 8080
selector:
app.kubernetes.io/component: nginx
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/component: node-claim1
name: node-claim1
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: node
name: node
spec:
strategy:
type: Recreate
template:
metadata:
labels:
app.kubernetes.io/component: node
spec:
containers:
- args:
- node
- /etc/villas/node/demo.conf
image: villas/node:latest
name: node
ports:
- containerPort: 80
- containerPort: 12000
protocol: UDP
- containerPort: 12001
protocol: UDP
- containerPort: 12002
protocol: UDP
- containerPort: 12003
protocol: UDP
- containerPort: 12004
protocol: UDP
- containerPort: 12005
protocol: UDP
- containerPort: 12006
protocol: UDP
- containerPort: 12007
protocol: UDP
- containerPort: 12008
protocol: UDP
- containerPort: 12009
protocol: UDP
- containerPort: 12010
protocol: UDP
securityContext:
privileged: true
volumeMounts:
- mountPath: /etc/villas/node
name: config
- mountPath: /data
name: data
volumes:
- name: node-
configMap:
name: node-config
- name: node-claim1
persistentVolumeClaim:
claimName: node-data
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: node
name: node
spec:
ports:
- name: "8081"
port: 8081
targetPort: 80
- name: "12000"
port: 12000
protocol: UDP
targetPort: 12000
- name: "12001"
port: 12001
protocol: UDP
targetPort: 12001
- name: "12002"
port: 12002
protocol: UDP
targetPort: 12002
- name: "12003"
port: 12003
protocol: UDP
targetPort: 12003
- name: "12004"
port: 12004
protocol: UDP
targetPort: 12004
- name: "12005"
port: 12005
protocol: UDP
targetPort: 12005
- name: "12006"
port: 12006
protocol: UDP
targetPort: 12006
- name: "12007"
port: 12007
protocol: UDP
targetPort: 12007
- name: "12008"
port: 12008
protocol: UDP
targetPort: 12008
- name: "12009"
port: 12009
protocol: UDP
targetPort: 12009
- name: "12010"
port: 12010
protocol: UDP
targetPort: 12010
selector:
app.kubernetes.io/component: node
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: relay
app.kubernetes.io/part-of: villas-node
name: relay
spec:
selector:
matchLabels:
app.kubernetes.io/component: backend
app.kubernetes.io/part-of: villas-web
template:
metadata:
labels:
app.kubernetes.io/component: backend
app.kubernetes.io/part-of: villas-node
spec:
containers:
- args:
- relay
image: villas/node
name: relay
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment