From f54d752657c68b6c3504f575969adc79ed2af6cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Tue, 24 Nov 2020 17:08:59 +0100 Subject: [PATCH] kubernecces --- k8s/videon-backend.yml | 64 ++++++++++++++++++++++++++++++++++++++++++ src/app.py | 2 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 k8s/videon-backend.yml diff --git a/k8s/videon-backend.yml b/k8s/videon-backend.yml new file mode 100644 index 0000000..60bebdf --- /dev/null +++ b/k8s/videon-backend.yml @@ -0,0 +1,64 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: input-service + labels: + app: input-service + namespace: birbnetes +data: + SENTRY_DSN: https://58bd309272c642d884ff2332c336b977@sentry.kmlabz.com/21 + RELEASE_ID: kmlabz-k8s + VIDEON_RELEASEMODE: release + VIDEON_POSTGRES_HOSTNAME: videon + VIDEON_POSTGRES_USERNAME: videon + VIDEON_POSTGRES_PASSWORD: videon-verszeklet + VIDEON_POSTGRES_DB: videon +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: backend + namespace: videon + labels: + app: backend +spec: + replicas: 1 + selector: + matchLabels: + app: backend + strategy: + type: Recreate + template: + metadata: + labels: + app: backend + spec: + containers: + - name: backend + image: registry.kmlabz.com/videon/backend + imagePullPolicy: Always + envFrom: + - configMapRef: + name: backend + ports: + - containerPort: 8080 + imagePullSecrets: + - name: regcred +--- +apiVersion: v1 +kind: Service +metadata: + name: backend + namespace: videon + labels: + app: backend +spec: + ports: + - name: backend + port: 80 + targetPort: 8080 + protocol: TCP + selector: + app: backend + type: ClusterIP \ No newline at end of file diff --git a/src/app.py b/src/app.py index 1dd35c0..7cd7bbc 100644 --- a/src/app.py +++ b/src/app.py @@ -43,7 +43,7 @@ ma.init_app(app) with app.app_context(): db.create_all() - +"" formatter = logging.Formatter( fmt="%(asctime)s - %(levelname)s - %(module)s - %(message)s" )