changeset 1689:8f7f7ca65ed4

don't deploy config files; mount them in so i can edit
author drewp@bigasterisk.com
date Mon, 27 Sep 2021 23:19:53 -0700
parents 5871ef3a380e
children 0d7635335616
files service/mqtt_to_rdf/Dockerfile service/mqtt_to_rdf/deploy.yaml
diffstat 2 files changed, 38 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/service/mqtt_to_rdf/Dockerfile	Mon Sep 27 23:18:49 2021 -0700
+++ b/service/mqtt_to_rdf/Dockerfile	Mon Sep 27 23:19:53 2021 -0700
@@ -15,6 +15,5 @@
 RUN pnpm build
 
 COPY *.py *.html ./
-COPY conf/ ./conf
 
-CMD [ "python3", "./mqtt_to_rdf.py", "-v" ]
+CMD [ "python3", "./mqtt_to_rdf.py", "-v", "--cs=rules" ]
--- a/service/mqtt_to_rdf/deploy.yaml	Mon Sep 27 23:18:49 2021 -0700
+++ b/service/mqtt_to_rdf/deploy.yaml	Mon Sep 27 23:19:53 2021 -0700
@@ -1,3 +1,30 @@
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+  name: mqtt-to-rdf-data
+  labels:
+    type: local
+spec:
+  storageClassName: manual
+  hostPath:
+    path: "/my/proj/homeauto/service/mqtt_to_rdf/conf"
+  capacity: { storage: 1Mi }
+  accessModes: [ReadWriteOnce]
+  persistentVolumeReclaimPolicy: Retain
+  claimRef: { namespace: default, name: mqtt-to-rdf-data }
+---
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  name: mqtt-to-rdf-data
+spec:
+  storageClassName: ""
+  volumeName: "mqtt-to-rdf-data"
+  accessModes: [ReadWriteOnce]
+  resources:
+    requests:
+      storage: 1Mi
+---
 apiVersion: apps/v1
 kind: Deployment
 metadata:
@@ -17,7 +44,16 @@
           image: bang5:5000/mqtt_to_rdf_image
           imagePullPolicy: "Always"
           ports:
-          - containerPort: 10018
+            - containerPort: 10018 
+          volumeMounts:
+            - { name: data, mountPath: "/opt/conf" }
+          # resources:
+          #   limits:
+          #     cpu: "2"
+          #     memory: 100Mi
+      volumes:
+        - { name: data, persistentVolumeClaim: { claimName: mqtt-to-rdf-data } }
+
       affinity:
         nodeAffinity:
           requiredDuringSchedulingIgnoredDuringExecution: