diff --git a/DOCKER.md b/DOCKER.md index eaf3b7733..57cb52ed5 100644 --- a/DOCKER.md +++ b/DOCKER.md @@ -1,3 +1,16 @@ +## k8s notes + +@nargetdev managed to configure a `kompose convert` adaptation to run Mycodo on kubernetes. + +`kompose` does not quite work out of the box because of a difference in how `docker compose` and `k8s` handle volume initialization.. +namely `k8s` does not handle volume initialization at all. For this reason an `initContainer:` is invoked in `mycododaemon-deployment.yaml` + +To apply the mycodo manifests to a cluster: + + kubectl apply -f kompose + +My workflow has been to modify docker-compose.yml, and then run `./kompose_output_directory.sh` to regenerate the `kompose` directory. + # Docker This effort is to get Mycodo running in Docker containers with all features working. Many parts of the system work, however there are also many that do not. diff --git a/docker-compose.yml b/docker-compose.yml index 2e140a018..78297b369 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,22 +2,43 @@ version: "3.7" services: - mycodo_influxdb: - container_name: mycodo_influxdb - build: - context: ./ - dockerfile: docker/influxdb/Dockerfile - env_file: - - 'docker/influxdb/env.influxdb' +## Deprecated untill I read the prev config. + +# mycodo_influxdb: +# container_name: mycodo_influxdb +# build: +# context: ./ +# dockerfile: docker/influxdb/Dockerfile +# env_file: +# - 'docker/influxdb/env.influxdb' +# volumes: +# - mycodo_influxdb:/var/lib/influxdb +# ports: +# - 8086:8086 + +## InfluxDBv2 setup + mycodoinfluxdb: + ports: + - 8086:8086 volumes: - - mycodo_influxdb:/var/lib/influxdb + - mycodo_influxdb:/var/lib/influxdb2 + image: influxdb:latest + environment: + - DOCKER_INFLUXDB_INIT_MODE=setup + - DOCKER_INFLUXDB_INIT_USERNAME=mycodo + - DOCKER_INFLUXDB_INIT_PASSWORD=mmdu77sj3nIoiajjs + - DOCKER_INFLUXDB_INIT_ORG=mycodo + - DOCKER_INFLUXDB_INIT_BUCKET=mycodo_db - mycodo_nginx: - container_name: mycodo_nginx + mycodonginx: +# labels: +# - kompose.service.group=sidecar + container_name: mycodonginx restart: always - build: - context: ./ - dockerfile: docker/nginx/Dockerfile + image: nargetdev/mycodonginx:c0.0.0-v8.15.1 +# build: +# context: ./ +# dockerfile: docker/nginx/Dockerfile volumes: - mycodo:/usr/local/mycodo - mycodo_log:/var/log/mycodo @@ -26,11 +47,16 @@ services: - 80:80 - 443:443 depends_on: - - mycodo_flask + - mycodoflask - mycodo_daemon: - container_name: mycodo_daemon - image: app + mycododaemon: + image: nargetdev/mycodoapp:c0.0.2-v8.15.1 + ports: + - "9080" +# labels: +# - kompose.service.group=sidecar + container_name: mycododaemon +# image: nargetdev/mycodoflask:c0.0.0-v8.15.1 restart: always environment: - TZ=America/New_York # See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for valid time zones @@ -47,22 +73,26 @@ services: - mycodo_custom_user_scripts:/home/mycodo/mycodo/user_scripts - mycodo_log:/var/log/mycodo - mycodo_ssl_certs:/home/mycodo/mycodo/mycodo_flask/ssl_certs - - /dev:/dev - - /sys:/sys - - /opt:/opt +# - /dev:/dev + - mycodo_sys:/sys + - mycodo_opt:/opt privileged: true - command: bash -c "wget --quiet --no-check-certificate -p http://mycodo_nginx/ -O /dev/null && + command: bash -c "wget --quiet --no-check-certificate -p http://mycodonginx/ -O /dev/null && PYTHONPATH=/home/mycodo /home/mycodo/env/bin/python mycodo_daemon.py" depends_on: - - mycodo_flask + - mycodoflask - mycodo_flask: - container_name: mycodo_flask - image: app - hostname: Mycodo # Change to your desired hostname - build: - context: ./ - dockerfile: docker/Dockerfile + mycodoflask: + image: nargetdev/mycodoapp:c0.0.2-v8.15.1 + ports: + - "9080" +# labels: +# - kompose.service.group=sidecar + container_name: mycodoflask + hostname: mycodohost # Change to your desired hostname +# build: +# context: ./ +# dockerfile: docker/Dockerfile restart: always environment: - TZ=America/New_York # See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for valid time zones @@ -82,12 +112,12 @@ services: - mycodo_log:/var/log/mycodo - mycodo_ssl_certs:/home/mycodo/mycodo/mycodo_flask/ssl_certs - mycodo_influxdb:/var/lib/influxdb - - /dev:/dev +# - /dev:/dev - /var/run/docker.sock:/var/run/docker.sock:ro # Permits container to restart itself privileged: true command: /home/mycodo/env/bin/python -m gunicorn --workers 1 --bind unix:/usr/local/mycodo/mycodoflask.sock start_flask_ui:app - depends_on: - - mycodo_influxdb +# depends_on: +# - mycodoinfluxdb # Uncomment the following blocks and rebuild to enable Grafana and/or Telegraf @@ -128,3 +158,5 @@ volumes: mycodo_log: mycodo_influxdb: mycodo_grafana: + mycodo_opt: + mycodo_sys: diff --git a/docker/Makefile b/docker/Makefile new file mode 100644 index 000000000..de87e2865 --- /dev/null +++ b/docker/Makefile @@ -0,0 +1,9 @@ +build: + docker compose build + +run: + docker compose up + +clean: + docker compose down + docker system prune -a diff --git a/echo b/echo new file mode 100644 index 000000000..e69de29bb diff --git a/kompose-multicontainer/mycodo-cameras-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-cameras-persistentvolumeclaim.yaml new file mode 100644 index 000000000..63824bcb1 --- /dev/null +++ b/kompose-multicontainer/mycodo-cameras-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-cameras + name: mycodo-cameras +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodo-custom-actions-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-custom-actions-persistentvolumeclaim.yaml new file mode 100644 index 000000000..d403696fe --- /dev/null +++ b/kompose-multicontainer/mycodo-custom-actions-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-actions + name: mycodo-custom-actions +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodo-custom-functions-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-custom-functions-persistentvolumeclaim.yaml new file mode 100644 index 000000000..1b367a874 --- /dev/null +++ b/kompose-multicontainer/mycodo-custom-functions-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-functions + name: mycodo-custom-functions +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodo-custom-inputs-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-custom-inputs-persistentvolumeclaim.yaml new file mode 100644 index 000000000..e970f3da1 --- /dev/null +++ b/kompose-multicontainer/mycodo-custom-inputs-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-inputs + name: mycodo-custom-inputs +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodo-custom-outputs-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-custom-outputs-persistentvolumeclaim.yaml new file mode 100644 index 000000000..5741b82fe --- /dev/null +++ b/kompose-multicontainer/mycodo-custom-outputs-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-outputs + name: mycodo-custom-outputs +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodo-custom-user-css-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-custom-user-css-persistentvolumeclaim.yaml new file mode 100644 index 000000000..a7bd74216 --- /dev/null +++ b/kompose-multicontainer/mycodo-custom-user-css-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-user-css + name: mycodo-custom-user-css +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodo-custom-user-js-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-custom-user-js-persistentvolumeclaim.yaml new file mode 100644 index 000000000..c223d5e01 --- /dev/null +++ b/kompose-multicontainer/mycodo-custom-user-js-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-user-js + name: mycodo-custom-user-js +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodo-custom-user-scripts-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-custom-user-scripts-persistentvolumeclaim.yaml new file mode 100644 index 000000000..e18e5073b --- /dev/null +++ b/kompose-multicontainer/mycodo-custom-user-scripts-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-user-scripts + name: mycodo-custom-user-scripts +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodo-custom-widgets-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-custom-widgets-persistentvolumeclaim.yaml new file mode 100644 index 000000000..777c4e44e --- /dev/null +++ b/kompose-multicontainer/mycodo-custom-widgets-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-widgets + name: mycodo-custom-widgets +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodo-databases-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-databases-persistentvolumeclaim.yaml new file mode 100644 index 000000000..8a5e7d4de --- /dev/null +++ b/kompose-multicontainer/mycodo-databases-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-databases + name: mycodo-databases +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodo-env-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-env-persistentvolumeclaim.yaml new file mode 100644 index 000000000..5e18adcb7 --- /dev/null +++ b/kompose-multicontainer/mycodo-env-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-env + name: mycodo-env +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodo-influxdb-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-influxdb-persistentvolumeclaim.yaml new file mode 100644 index 000000000..e769194f4 --- /dev/null +++ b/kompose-multicontainer/mycodo-influxdb-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-influxdb + name: mycodo-influxdb +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodo-log-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-log-persistentvolumeclaim.yaml new file mode 100644 index 000000000..e9cdfb8b0 --- /dev/null +++ b/kompose-multicontainer/mycodo-log-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-log + name: mycodo-log +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodo-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-persistentvolumeclaim.yaml new file mode 100644 index 000000000..29c5a7e11 --- /dev/null +++ b/kompose-multicontainer/mycodo-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo + name: mycodo +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodo-ssl-certs-persistentvolumeclaim.yaml b/kompose-multicontainer/mycodo-ssl-certs-persistentvolumeclaim.yaml new file mode 100644 index 000000000..29f3a01d3 --- /dev/null +++ b/kompose-multicontainer/mycodo-ssl-certs-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-ssl-certs + name: mycodo-ssl-certs +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/mycodoinfluxdb-deployment.yaml b/kompose-multicontainer/mycodoinfluxdb-deployment.yaml new file mode 100644 index 000000000..4cb581df7 --- /dev/null +++ b/kompose-multicontainer/mycodoinfluxdb-deployment.yaml @@ -0,0 +1,52 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert --service-group-mode=label -o kompose-multicontainer + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodoinfluxdb + name: mycodoinfluxdb +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: mycodoinfluxdb + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert --service-group-mode=label -o kompose-multicontainer + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodoinfluxdb + spec: + containers: + - env: + - name: DOCKER_INFLUXDB_INIT_BUCKET + value: mycodo_db + - name: DOCKER_INFLUXDB_INIT_MODE + value: setup + - name: DOCKER_INFLUXDB_INIT_ORG + value: mycodo + - name: DOCKER_INFLUXDB_INIT_PASSWORD + value: mmdu77sj3nIoiajjs + - name: DOCKER_INFLUXDB_INIT_USERNAME + value: mycodo + image: influxdb:latest + name: mycodoinfluxdb + ports: + - containerPort: 8086 + resources: {} + volumeMounts: + - mountPath: /var/lib/influxdb2 + name: mycodo-influxdb + restartPolicy: Always + volumes: + - name: mycodo-influxdb + persistentVolumeClaim: + claimName: mycodo-influxdb +status: {} diff --git a/kompose-multicontainer/mycodoinfluxdb-service.yaml b/kompose-multicontainer/mycodoinfluxdb-service.yaml new file mode 100644 index 000000000..815ee3ddd --- /dev/null +++ b/kompose-multicontainer/mycodoinfluxdb-service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert --service-group-mode=label -o kompose-multicontainer + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodoinfluxdb + name: mycodoinfluxdb +spec: + ports: + - name: "8086" + port: 8086 + targetPort: 8086 + selector: + io.kompose.service: mycodoinfluxdb +status: + loadBalancer: {} diff --git a/kompose-multicontainer/mycodonginx-service.yaml b/kompose-multicontainer/mycodonginx-service.yaml new file mode 100644 index 000000000..45048e4bc --- /dev/null +++ b/kompose-multicontainer/mycodonginx-service.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert --service-group-mode=label -o kompose-multicontainer + kompose.service.group: sidecar + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: sidecar + name: mycodonginx +spec: + ports: + - name: "80" + port: 80 + targetPort: 80 + - name: "443" + port: 443 + targetPort: 443 + selector: + io.kompose.service: sidecar +status: + loadBalancer: {} diff --git a/kompose-multicontainer/sidecar-claim12-persistentvolumeclaim.yaml b/kompose-multicontainer/sidecar-claim12-persistentvolumeclaim.yaml new file mode 100644 index 000000000..e749876d7 --- /dev/null +++ b/kompose-multicontainer/sidecar-claim12-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: sidecar-claim12 + name: sidecar-claim12 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/sidecar-claim13-persistentvolumeclaim.yaml b/kompose-multicontainer/sidecar-claim13-persistentvolumeclaim.yaml new file mode 100644 index 000000000..adb3f3097 --- /dev/null +++ b/kompose-multicontainer/sidecar-claim13-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: sidecar-claim13 + name: sidecar-claim13 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/sidecar-claim14-persistentvolumeclaim.yaml b/kompose-multicontainer/sidecar-claim14-persistentvolumeclaim.yaml new file mode 100644 index 000000000..09818485c --- /dev/null +++ b/kompose-multicontainer/sidecar-claim14-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: sidecar-claim14 + name: sidecar-claim14 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/sidecar-claim15-persistentvolumeclaim.yaml b/kompose-multicontainer/sidecar-claim15-persistentvolumeclaim.yaml new file mode 100644 index 000000000..17612d7c7 --- /dev/null +++ b/kompose-multicontainer/sidecar-claim15-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: sidecar-claim15 + name: sidecar-claim15 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/sidecar-claim16-persistentvolumeclaim.yaml b/kompose-multicontainer/sidecar-claim16-persistentvolumeclaim.yaml new file mode 100644 index 000000000..d98ce60cd --- /dev/null +++ b/kompose-multicontainer/sidecar-claim16-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: sidecar-claim16 + name: sidecar-claim16 +spec: + accessModes: + - ReadOnlyMany + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose-multicontainer/sidecar-deployment.yaml b/kompose-multicontainer/sidecar-deployment.yaml new file mode 100644 index 000000000..de39c4e84 --- /dev/null +++ b/kompose-multicontainer/sidecar-deployment.yaml @@ -0,0 +1,280 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert --service-group-mode=label -o kompose-multicontainer + kompose.service.group: sidecar + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: sidecar + name: sidecar +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: sidecar + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert --service-group-mode=label -o kompose-multicontainer + kompose.service.group: sidecar + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: sidecar + spec: +# initContainers: +# - name: initmycodoflaskssl +# image: nargetdev/mycodoapp:8.15.1 +# args: +# - /bin/bash +# - -c +# - > +# set -x; +# +# echo INITIALIZING CERTS VOLUME; +# CONTAINER_DIR=/home/mycodo/mycodo/mycodo_flask/ssl_certs; +# TARGET_DIR=/mnt/ssl_certs; +# cp -rT $CONTAINER_DIR $TARGET_DIR; +# ls -a $TARGET_DIR; +# +# echo INITIALIZING DATABASES VOLUME; +# CONTAINER_DIR=/home/mycodo/databases; +# TARGET_DIR=/mnt/databases; +# cp -rT $CONTAINER_DIR $TARGET_DIR; +# ls -a $TARGET_DIR; +# +# echo COPYING ENV; +# CONTAINER_DIR=/home/mycodo/env; +# TARGET_DIR=/mnt/env; +# cp -rT $CONTAINER_DIR $TARGET_DIR; +# ls -a $TARGET_DIR; +# +# echo COPYING LOCAL; +# CONTAINER_DIR=/usr/local/mycodo; +# TARGET_DIR=/mnt/mycodo; +# cp -rT $CONTAINER_DIR $TARGET_DIR; +# ls -a $TARGET_DIR; +# +# echo COPYING DEV; +# CONTAINER_DIR=/dev; +# TARGET_DIR=/mnt/dev; +# cp -rT $CONTAINER_DIR $TARGET_DIR; +# ls -a $TARGET_DIR; +# +# echo COPYING OPT; +# CONTAINER_DIR=/opt; +# TARGET_DIR=/mnt/opt; +# cp -rT $CONTAINER_DIR $TARGET_DIR; +# ls -a $TARGET_DIR; +# +# volumeMounts: +# - mountPath: /mnt/ssl_certs +# name: mycodo-ssl-certs +# - mountPath: /mnt/databases +# name: mycodo-databases +# - mountPath: /mnt/env +# name: mycodo-env +# - mountPath: /mnt/mycodo +# name: mycodo +# - mountPath: /mnt/dev +# name: sidecar-claim15 +# - mountPath: /mnt/opt +# name: sidecar-opt-claim + containers: + - name: mycodoflask + image: nargetdev/mycodoapp:c0.0.2-v8.15.1 + args: + - /home/mycodo/env/bin/python + - -m + - gunicorn + - --workers + - "1" + - --bind + - unix:/usr/local/mycodo/mycodoflask.sock + - start_flask_ui:app + env: + - name: TZ + value: America/New_York +# image: nargetdev/mycodoflask:c0.0.1-v8.15.1 + resources: {} + volumeMounts: + - mountPath: /home/mycodo/databases + name: mycodo-databases +# - mountPath: /var/run/docker.sock +# name: sidecar-claim16 +# readOnly: true + - mountPath: /home/mycodo/cameras + name: mycodo-cameras + - mountPath: /home/mycodo/mycodo/actions/custom_actions + name: mycodo-custom-actions + - mountPath: /home/mycodo/mycodo/user_scripts + name: mycodo-custom-user-scripts + - mountPath: /home/mycodo/mycodo/inputs/custom_inputs + name: mycodo-custom-inputs + - mountPath: /home/mycodo/env + name: mycodo-env + - mountPath: /home/mycodo/mycodo/mycodo_flask/ssl_certs + name: mycodo-ssl-certs + - mountPath: /home/mycodo/mycodo/functions/custom_functions + name: mycodo-custom-functions + - mountPath: /home/mycodo/mycodo/mycodo_flask/static/css/user_css + name: mycodo-custom-user-css + - mountPath: /var/log/mycodo + name: mycodo-log + - mountPath: /home/mycodo/mycodo/widgets/custom_widgets + name: mycodo-custom-widgets + - mountPath: /usr/local/mycodo + name: mycodo + - mountPath: /var/lib/influxdb + name: mycodo-influxdb +# - mountPath: /dev +# name: sidecar-claim15 + - mountPath: /home/mycodo/mycodo/outputs/custom_outputs + name: mycodo-custom-outputs + - mountPath: /home/mycodo/mycodo/mycodo_flask/static/js/user_js + name: mycodo-custom-user-js + - name: mycododaemon + image: nargetdev/mycodoapp:c0.0.2-v8.15.1 + args: + - bash + - -c + - wget --quiet --no-check-certificate -p http://mycodonginx/ -O /dev/null && PYTHONPATH=/home/mycodo /home/mycodo/env/bin/python mycodo_daemon.py +# - args: +# - /bin/sh +# - -c +# - > +# set -x; +# while :; do +# echo "."; +# sleep 15; +# done + env: + - name: TZ + value: America/New_York +# image: nargetdev/mycodoflask:c0.0.1-v8.15.1 + resources: {} + securityContext: + privileged: true + volumeMounts: + - mountPath: /usr/local/mycodo + name: mycodo + - mountPath: /var/log/mycodo + name: mycodo-log + - mountPath: /home/mycodo/mycodo/actions/custom_actions + name: mycodo-custom-actions + - mountPath: /home/mycodo/mycodo/widgets/custom_widgets + name: mycodo-custom-widgets + - mountPath: /home/mycodo/databases + name: mycodo-databases + - mountPath: /home/mycodo/cameras + name: mycodo-cameras + - mountPath: /home/mycodo/mycodo/user_scripts + name: mycodo-custom-user-scripts + - mountPath: /home/mycodo/env + name: mycodo-env + - mountPath: /sys + name: sidecar-claim13 + - mountPath: /home/mycodo/mycodo/mycodo_flask/ssl_certs + name: mycodo-ssl-certs + - mountPath: /opt + name: sidecar-opt-claim + - mountPath: /home/mycodo/mycodo/outputs/custom_outputs + name: mycodo-custom-outputs +# - mountPath: /dev +# name: sidecar-claim15 +# name: sidecar-claim12 + - mountPath: /home/mycodo/mycodo/functions/custom_functions + name: mycodo-custom-functions + - mountPath: /home/mycodo/mycodo/inputs/custom_inputs + name: mycodo-custom-inputs + - mountPath: /home/mycodo/mycodo/mycodo_flask/static/js/user_js + name: mycodo-custom-user-js + - mountPath: /var/run/docker.sock + name: sidecar-claim16 + readOnly: true + - mountPath: /var/lib/influxdb + name: mycodo-influxdb + - mountPath: /home/mycodo/mycodo/mycodo_flask/static/css/user_css + name: mycodo-custom-user-css + - name: mycodonginx + image: nargetdev/mycodonginx:c0.0.0-v8.15.1 + ports: + - containerPort: 80 + - containerPort: 443 + resources: {} + volumeMounts: + - mountPath: /usr/local/mycodo + name: mycodo + - mountPath: /var/log/mycodo + name: mycodo-log + - mountPath: /home/mycodo/mycodo/mycodo_flask/ssl_certs + name: mycodo-ssl-certs + hostname: mycodohost + restartPolicy: Always + volumes: + - name: mycodo-cameras + persistentVolumeClaim: + claimName: mycodo-cameras + - name: mycodo-log + persistentVolumeClaim: + claimName: mycodo-log + - name: sidecar-opt-claim + persistentVolumeClaim: + claimName: sidecar-claim14 + - name: mycodo-custom-user-scripts + persistentVolumeClaim: + claimName: mycodo-custom-user-scripts + - name: mycodo-custom-functions + persistentVolumeClaim: + claimName: mycodo-custom-functions + - name: mycodo-ssl-certs + persistentVolumeClaim: + claimName: mycodo-ssl-certs + - name: mycodo-env + persistentVolumeClaim: + claimName: mycodo-env + - name: mycodo-custom-outputs + persistentVolumeClaim: + claimName: mycodo-custom-outputs + - name: mycodo-custom-actions + persistentVolumeClaim: + claimName: mycodo-custom-actions + - name: mycodo-custom-widgets + persistentVolumeClaim: + claimName: mycodo-custom-widgets + - name: mycodo-custom-inputs + persistentVolumeClaim: + claimName: mycodo-custom-inputs + - name: sidecar-claim13 + persistentVolumeClaim: + claimName: sidecar-claim13 + - name: sidecar-claim12 + persistentVolumeClaim: + claimName: sidecar-claim12 + - name: mycodo + persistentVolumeClaim: + claimName: mycodo + - name: mycodo-databases + persistentVolumeClaim: + claimName: mycodo-databases + - name: mycodo-influxdb + persistentVolumeClaim: + claimName: mycodo-influxdb + - name: sidecar-claim16 + persistentVolumeClaim: + claimName: sidecar-claim16 + readOnly: true + - name: sidecar-claim15 + persistentVolumeClaim: + claimName: sidecar-claim15 + - name: mycodo-custom-user-css + persistentVolumeClaim: + claimName: mycodo-custom-user-css + - name: mycodo-custom-user-js + persistentVolumeClaim: + claimName: mycodo-custom-user-js +status: {} diff --git a/kompose.yml b/kompose.yml new file mode 100644 index 000000000..5a0d80963 --- /dev/null +++ b/kompose.yml @@ -0,0 +1,684 @@ +apiVersion: v1 +items: + - apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -o kompose.yml + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodoinfluxdb + name: mycodoinfluxdb + spec: + ports: + - name: "8086" + port: 8086 + targetPort: 8086 + selector: + io.kompose.service: mycodoinfluxdb + status: + loadBalancer: {} + - apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -o kompose.yml + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodonginx + name: mycodonginx + spec: + ports: + - name: "80" + port: 80 + targetPort: 80 + - name: "443" + port: 443 + targetPort: 443 + selector: + io.kompose.service: mycodonginx + status: + loadBalancer: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -o kompose.yml + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycododaemon + name: mycododaemon + spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: mycododaemon + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -o kompose.yml + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycododaemon + spec: + containers: + - args: + - bash + - -c + - wget --quiet --no-check-certificate -p http://mycodonginx/ -O /dev/null && PYTHONPATH=/home/mycodo /home/mycodo/env/bin/python mycodo_daemon.py + env: + - name: TZ + value: America/New_York + image: nargetdev/mycodoapp:c0.0.2-v8.15.1 + name: mycododaemon + resources: {} + securityContext: + privileged: true + volumeMounts: + - mountPath: /usr/local/mycodo + name: mycodo + - mountPath: /home/mycodo/env + name: mycodo-env + - mountPath: /home/mycodo/databases + name: mycodo-databases + - mountPath: /home/mycodo/cameras + name: mycodo-cameras + - mountPath: /home/mycodo/mycodo/functions/custom_functions + name: mycodo-custom-functions + - mountPath: /home/mycodo/mycodo/actions/custom_actions + name: mycodo-custom-actions + - mountPath: /home/mycodo/mycodo/inputs/custom_inputs + name: mycodo-custom-inputs + - mountPath: /home/mycodo/mycodo/outputs/custom_outputs + name: mycodo-custom-outputs + - mountPath: /home/mycodo/mycodo/widgets/custom_widgets + name: mycodo-custom-widgets + - mountPath: /home/mycodo/mycodo/user_scripts + name: mycodo-custom-user-scripts + - mountPath: /var/log/mycodo + name: mycodo-log + - mountPath: /home/mycodo/mycodo/mycodo_flask/ssl_certs + name: mycodo-ssl-certs + - mountPath: /dev + name: mycododaemon-claim12 + - mountPath: /sys + name: mycododaemon-claim13 + - mountPath: /opt + name: mycododaemon-claim14 + restartPolicy: Always + volumes: + - name: mycodo + persistentVolumeClaim: + claimName: mycodo + - name: mycodo-env + persistentVolumeClaim: + claimName: mycodo-env + - name: mycodo-databases + persistentVolumeClaim: + claimName: mycodo-databases + - name: mycodo-cameras + persistentVolumeClaim: + claimName: mycodo-cameras + - name: mycodo-custom-functions + persistentVolumeClaim: + claimName: mycodo-custom-functions + - name: mycodo-custom-actions + persistentVolumeClaim: + claimName: mycodo-custom-actions + - name: mycodo-custom-inputs + persistentVolumeClaim: + claimName: mycodo-custom-inputs + - name: mycodo-custom-outputs + persistentVolumeClaim: + claimName: mycodo-custom-outputs + - name: mycodo-custom-widgets + persistentVolumeClaim: + claimName: mycodo-custom-widgets + - name: mycodo-custom-user-scripts + persistentVolumeClaim: + claimName: mycodo-custom-user-scripts + - name: mycodo-log + persistentVolumeClaim: + claimName: mycodo-log + - name: mycodo-ssl-certs + persistentVolumeClaim: + claimName: mycodo-ssl-certs + - name: mycododaemon-claim12 + persistentVolumeClaim: + claimName: mycododaemon-claim12 + - name: mycododaemon-claim13 + persistentVolumeClaim: + claimName: mycododaemon-claim13 + - name: mycododaemon-claim14 + persistentVolumeClaim: + claimName: mycododaemon-claim14 + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo + name: mycodo + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-env + name: mycodo-env + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-databases + name: mycodo-databases + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-cameras + name: mycodo-cameras + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-functions + name: mycodo-custom-functions + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-actions + name: mycodo-custom-actions + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-inputs + name: mycodo-custom-inputs + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-outputs + name: mycodo-custom-outputs + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-widgets + name: mycodo-custom-widgets + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-user-scripts + name: mycodo-custom-user-scripts + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-log + name: mycodo-log + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-ssl-certs + name: mycodo-ssl-certs + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycododaemon-claim12 + name: mycododaemon-claim12 + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycododaemon-claim13 + name: mycododaemon-claim13 + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycododaemon-claim14 + name: mycododaemon-claim14 + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -o kompose.yml + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodoflask + name: mycodoflask + spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: mycodoflask + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -o kompose.yml + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodoflask + spec: + containers: + - args: + - /home/mycodo/env/bin/python + - -m + - gunicorn + - --workers + - "1" + - --bind + - unix:/usr/local/mycodo/mycodoflask.sock + - start_flask_ui:app + env: + - name: TZ + value: America/New_York + image: nargetdev/mycodoapp:c0.0.2-v8.15.1 + name: mycodoflask + resources: {} + securityContext: + privileged: true + volumeMounts: + - mountPath: /usr/local/mycodo + name: mycodo + - mountPath: /home/mycodo/env + name: mycodo-env + - mountPath: /home/mycodo/databases + name: mycodo-databases + - mountPath: /home/mycodo/cameras + name: mycodo-cameras + - mountPath: /home/mycodo/mycodo/functions/custom_functions + name: mycodo-custom-functions + - mountPath: /home/mycodo/mycodo/actions/custom_actions + name: mycodo-custom-actions + - mountPath: /home/mycodo/mycodo/inputs/custom_inputs + name: mycodo-custom-inputs + - mountPath: /home/mycodo/mycodo/outputs/custom_outputs + name: mycodo-custom-outputs + - mountPath: /home/mycodo/mycodo/widgets/custom_widgets + name: mycodo-custom-widgets + - mountPath: /home/mycodo/mycodo/user_scripts + name: mycodo-custom-user-scripts + - mountPath: /home/mycodo/mycodo/mycodo_flask/static/css/user_css + name: mycodo-custom-user-css + - mountPath: /home/mycodo/mycodo/mycodo_flask/static/js/user_js + name: mycodo-custom-user-js + - mountPath: /var/log/mycodo + name: mycodo-log + - mountPath: /home/mycodo/mycodo/mycodo_flask/ssl_certs + name: mycodo-ssl-certs + - mountPath: /var/lib/influxdb + name: mycodo-influxdb + - mountPath: /dev + name: mycodoflask-claim15 + - mountPath: /var/run/docker.sock + name: mycodoflask-claim16 + readOnly: true + hostname: mycodohost + restartPolicy: Always + volumes: + - name: mycodo + persistentVolumeClaim: + claimName: mycodo + - name: mycodo-env + persistentVolumeClaim: + claimName: mycodo-env + - name: mycodo-databases + persistentVolumeClaim: + claimName: mycodo-databases + - name: mycodo-cameras + persistentVolumeClaim: + claimName: mycodo-cameras + - name: mycodo-custom-functions + persistentVolumeClaim: + claimName: mycodo-custom-functions + - name: mycodo-custom-actions + persistentVolumeClaim: + claimName: mycodo-custom-actions + - name: mycodo-custom-inputs + persistentVolumeClaim: + claimName: mycodo-custom-inputs + - name: mycodo-custom-outputs + persistentVolumeClaim: + claimName: mycodo-custom-outputs + - name: mycodo-custom-widgets + persistentVolumeClaim: + claimName: mycodo-custom-widgets + - name: mycodo-custom-user-scripts + persistentVolumeClaim: + claimName: mycodo-custom-user-scripts + - name: mycodo-custom-user-css + persistentVolumeClaim: + claimName: mycodo-custom-user-css + - name: mycodo-custom-user-js + persistentVolumeClaim: + claimName: mycodo-custom-user-js + - name: mycodo-log + persistentVolumeClaim: + claimName: mycodo-log + - name: mycodo-ssl-certs + persistentVolumeClaim: + claimName: mycodo-ssl-certs + - name: mycodo-influxdb + persistentVolumeClaim: + claimName: mycodo-influxdb + - name: mycodoflask-claim15 + persistentVolumeClaim: + claimName: mycodoflask-claim15 + - name: mycodoflask-claim16 + persistentVolumeClaim: + claimName: mycodoflask-claim16 + readOnly: true + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-user-css + name: mycodo-custom-user-css + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-user-js + name: mycodo-custom-user-js + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-influxdb + name: mycodo-influxdb + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodoflask-claim15 + name: mycodoflask-claim15 + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodoflask-claim16 + name: mycodoflask-claim16 + spec: + accessModes: + - ReadOnlyMany + resources: + requests: + storage: 100Mi + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -o kompose.yml + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodoinfluxdb + name: mycodoinfluxdb + spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: mycodoinfluxdb + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -o kompose.yml + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodoinfluxdb + spec: + containers: + - env: + - name: DOCKER_INFLUXDB_INIT_BUCKET + value: mycodo_db + - name: DOCKER_INFLUXDB_INIT_MODE + value: setup + - name: DOCKER_INFLUXDB_INIT_ORG + value: mycodo + - name: DOCKER_INFLUXDB_INIT_PASSWORD + value: mmdu77sj3nIoiajjs + - name: DOCKER_INFLUXDB_INIT_USERNAME + value: mycodo + image: influxdb:latest + name: mycodoinfluxdb + ports: + - containerPort: 8086 + resources: {} + volumeMounts: + - mountPath: /var/lib/influxdb2 + name: mycodo-influxdb + restartPolicy: Always + volumes: + - name: mycodo-influxdb + persistentVolumeClaim: + claimName: mycodo-influxdb + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -o kompose.yml + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodonginx + name: mycodonginx + spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: mycodonginx + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -o kompose.yml + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodonginx + spec: + containers: + - image: nargetdev/mycodonginx:c0.0.0-v8.15.1 + name: mycodonginx + ports: + - containerPort: 80 + - containerPort: 443 + resources: {} + volumeMounts: + - mountPath: /usr/local/mycodo + name: mycodo + - mountPath: /var/log/mycodo + name: mycodo-log + - mountPath: /home/mycodo/mycodo/mycodo_flask/ssl_certs + name: mycodo-ssl-certs + restartPolicy: Always + volumes: + - name: mycodo + persistentVolumeClaim: + claimName: mycodo + - name: mycodo-log + persistentVolumeClaim: + claimName: mycodo-log + - name: mycodo-ssl-certs + persistentVolumeClaim: + claimName: mycodo-ssl-certs + status: {} +kind: List +metadata: {} + diff --git a/kompose.yml.sh b/kompose.yml.sh new file mode 100755 index 000000000..61884b475 --- /dev/null +++ b/kompose.yml.sh @@ -0,0 +1,2 @@ +#!/bin/bash +kompose convert -o kompose.yml diff --git a/kompose/mycodo-cameras-persistentvolumeclaim.yaml b/kompose/mycodo-cameras-persistentvolumeclaim.yaml new file mode 100644 index 000000000..63824bcb1 --- /dev/null +++ b/kompose/mycodo-cameras-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-cameras + name: mycodo-cameras +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-custom-actions-persistentvolumeclaim.yaml b/kompose/mycodo-custom-actions-persistentvolumeclaim.yaml new file mode 100644 index 000000000..d403696fe --- /dev/null +++ b/kompose/mycodo-custom-actions-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-actions + name: mycodo-custom-actions +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-custom-functions-persistentvolumeclaim.yaml b/kompose/mycodo-custom-functions-persistentvolumeclaim.yaml new file mode 100644 index 000000000..1b367a874 --- /dev/null +++ b/kompose/mycodo-custom-functions-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-functions + name: mycodo-custom-functions +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-custom-inputs-persistentvolumeclaim.yaml b/kompose/mycodo-custom-inputs-persistentvolumeclaim.yaml new file mode 100644 index 000000000..e970f3da1 --- /dev/null +++ b/kompose/mycodo-custom-inputs-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-inputs + name: mycodo-custom-inputs +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-custom-outputs-persistentvolumeclaim.yaml b/kompose/mycodo-custom-outputs-persistentvolumeclaim.yaml new file mode 100644 index 000000000..5741b82fe --- /dev/null +++ b/kompose/mycodo-custom-outputs-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-outputs + name: mycodo-custom-outputs +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-custom-user-css-persistentvolumeclaim.yaml b/kompose/mycodo-custom-user-css-persistentvolumeclaim.yaml new file mode 100644 index 000000000..a7bd74216 --- /dev/null +++ b/kompose/mycodo-custom-user-css-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-user-css + name: mycodo-custom-user-css +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-custom-user-js-persistentvolumeclaim.yaml b/kompose/mycodo-custom-user-js-persistentvolumeclaim.yaml new file mode 100644 index 000000000..c223d5e01 --- /dev/null +++ b/kompose/mycodo-custom-user-js-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-user-js + name: mycodo-custom-user-js +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-custom-user-scripts-persistentvolumeclaim.yaml b/kompose/mycodo-custom-user-scripts-persistentvolumeclaim.yaml new file mode 100644 index 000000000..e18e5073b --- /dev/null +++ b/kompose/mycodo-custom-user-scripts-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-user-scripts + name: mycodo-custom-user-scripts +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-custom-widgets-persistentvolumeclaim.yaml b/kompose/mycodo-custom-widgets-persistentvolumeclaim.yaml new file mode 100644 index 000000000..777c4e44e --- /dev/null +++ b/kompose/mycodo-custom-widgets-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-custom-widgets + name: mycodo-custom-widgets +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-databases-persistentvolumeclaim.yaml b/kompose/mycodo-databases-persistentvolumeclaim.yaml new file mode 100644 index 000000000..8a5e7d4de --- /dev/null +++ b/kompose/mycodo-databases-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-databases + name: mycodo-databases +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-env-persistentvolumeclaim.yaml b/kompose/mycodo-env-persistentvolumeclaim.yaml new file mode 100644 index 000000000..5e18adcb7 --- /dev/null +++ b/kompose/mycodo-env-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-env + name: mycodo-env +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-influxdb-persistentvolumeclaim.yaml b/kompose/mycodo-influxdb-persistentvolumeclaim.yaml new file mode 100644 index 000000000..e769194f4 --- /dev/null +++ b/kompose/mycodo-influxdb-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-influxdb + name: mycodo-influxdb +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-log-persistentvolumeclaim.yaml b/kompose/mycodo-log-persistentvolumeclaim.yaml new file mode 100644 index 000000000..e9cdfb8b0 --- /dev/null +++ b/kompose/mycodo-log-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-log + name: mycodo-log +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-opt-persistentvolumeclaim.yaml b/kompose/mycodo-opt-persistentvolumeclaim.yaml new file mode 100644 index 000000000..9be87b51d --- /dev/null +++ b/kompose/mycodo-opt-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-opt + name: mycodo-opt +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-persistentvolumeclaim.yaml b/kompose/mycodo-persistentvolumeclaim.yaml new file mode 100644 index 000000000..29c5a7e11 --- /dev/null +++ b/kompose/mycodo-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo + name: mycodo +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-ssl-certs-persistentvolumeclaim.yaml b/kompose/mycodo-ssl-certs-persistentvolumeclaim.yaml new file mode 100644 index 000000000..29f3a01d3 --- /dev/null +++ b/kompose/mycodo-ssl-certs-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-ssl-certs + name: mycodo-ssl-certs +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodo-sys-persistentvolumeclaim.yaml b/kompose/mycodo-sys-persistentvolumeclaim.yaml new file mode 100644 index 000000000..db12843b4 --- /dev/null +++ b/kompose/mycodo-sys-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodo-sys + name: mycodo-sys +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycododaemon-deployment.yaml b/kompose/mycododaemon-deployment.yaml new file mode 100644 index 000000000..d3eade47b --- /dev/null +++ b/kompose/mycododaemon-deployment.yaml @@ -0,0 +1,209 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -o kompose + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycododaemon + name: mycododaemon +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: mycododaemon + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -o kompose + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycododaemon + spec: + nodeName: lilgreen + initContainers: + - name: initmycodoapp + image: nargetdev/mycodoapp:c0.0.2-v8.15.1 +# image: nargetdev/mycodoapp:8.15.1 + args: + - /bin/bash + - -c + - > + set -x; + + echo INITIALIZING CERTS VOLUME; + CONTAINER_DIR=/home/mycodo/mycodo/mycodo_flask/ssl_certs; + TARGET_DIR=/mnt/ssl_certs; + cp -rT $CONTAINER_DIR $TARGET_DIR; + ls -a $TARGET_DIR; + + echo INITIALIZING DATABASES VOLUME; + CONTAINER_DIR=/home/mycodo/databases; + TARGET_DIR=/mnt/databases; + cp -rT $CONTAINER_DIR $TARGET_DIR; + ls -a $TARGET_DIR; + + echo COPYING ENV; + CONTAINER_DIR=/home/mycodo/env; + TARGET_DIR=/mnt/env; + cp -rT $CONTAINER_DIR $TARGET_DIR; + ls -a $TARGET_DIR; + + echo COPYING LOCAL; + CONTAINER_DIR=/usr/local/mycodo; + TARGET_DIR=/mnt/mycodo; + cp -rT $CONTAINER_DIR $TARGET_DIR; + ls -a $TARGET_DIR; + + echo COPYING OPT; + CONTAINER_DIR=/opt; + TARGET_DIR=/mnt/opt; + cp -rT $CONTAINER_DIR $TARGET_DIR; + ls -a $TARGET_DIR; + + volumeMounts: + - mountPath: /mnt/ssl_certs + name: mycodo-ssl-certs + - mountPath: /mnt/databases + name: mycodo-databases + - mountPath: /mnt/env + name: mycodo-env + - mountPath: /mnt/mycodo + name: mycodo + - mountPath: /mnt/opt + name: mycodo-opt + containers: + - args: + - bash + - -c + - wget --quiet --no-check-certificate -p http://mycodonginx/ -O /dev/null && PYTHONPATH=/home/mycodo /home/mycodo/env/bin/python mycodo_daemon.py + env: + - name: TZ + value: America/New_York + image: nargetdev/mycodoapp:c0.0.2-v8.15.1 + name: mycododaemon + ports: + - containerPort: 9080 + resources: {} + securityContext: + privileged: true + volumeMounts: + - mountPath: /usr/local/mycodo + name: mycodo + - mountPath: /home/mycodo/env + name: mycodo-env + - mountPath: /home/mycodo/databases + name: mycodo-databases + - mountPath: /home/mycodo/cameras + name: mycodo-cameras + - mountPath: /home/mycodo/mycodo/functions/custom_functions + name: mycodo-custom-functions + - mountPath: /home/mycodo/mycodo/actions/custom_actions + name: mycodo-custom-actions + - mountPath: /home/mycodo/mycodo/inputs/custom_inputs + name: mycodo-custom-inputs + - mountPath: /home/mycodo/mycodo/outputs/custom_outputs + name: mycodo-custom-outputs + - mountPath: /home/mycodo/mycodo/widgets/custom_widgets + name: mycodo-custom-widgets + - mountPath: /home/mycodo/mycodo/user_scripts + name: mycodo-custom-user-scripts + - mountPath: /var/log/mycodo + name: mycodo-log + - mountPath: /home/mycodo/mycodo/mycodo_flask/ssl_certs + name: mycodo-ssl-certs + - mountPath: /sys + name: mycodo-sys + - mountPath: /opt + name: mycodo-opt + restartPolicy: Always + volumes: + - name: mycodo +# persistentVolumeClaim: +# claimName: mycodo + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo + - name: mycodo-env +# persistentVolumeClaim: +# claimName: mycodo-env + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-env + - name: mycodo-databases +# persistentVolumeClaim: +# claimName: mycodo-databases + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-databases + - name: mycodo-cameras + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-cameras +# persistentVolumeClaim: +# claimName: mycodo-cameras + - name: mycodo-custom-functions + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-custom-functions +# persistentVolumeClaim: +# claimName: mycodo-custom-functions + - name: mycodo-custom-actions + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-custom-actions +# persistentVolumeClaim: +# claimName: mycodo-custom-actions + - name: mycodo-custom-inputs + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-custom-inputs +# persistentVolumeClaim: +# claimName: mycodo-custom-inputs + - name: mycodo-custom-outputs + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-custom-outputs +# persistentVolumeClaim: +# claimName: mycodo-custom-outputs + - name: mycodo-custom-widgets + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-custom-widgets +# persistentVolumeClaim: +# claimName: mycodo-custom-widgets + - name: mycodo-custom-user-scripts + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-custom-user-scripts +# persistentVolumeClaim: +# claimName: mycodo-custom-user-scripts + - name: mycodo-log + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-custom-user-scripts +# persistentVolumeClaim: +# claimName: mycodo-log + - name: mycodo-ssl-certs + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-ssl-certs +# persistentVolumeClaim: +# claimName: mycodo-ssl-certs + - name: mycodo-sys + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-sys +# persistentVolumeClaim: +# claimName: mycodo-sys + - name: mycodo-opt + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-opt +# persistentVolumeClaim: +# claimName: mycodo-opt +status: {} diff --git a/kompose/mycododaemon-service.yaml b/kompose/mycododaemon-service.yaml new file mode 100644 index 000000000..1016edc62 --- /dev/null +++ b/kompose/mycododaemon-service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert -o kompose + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycododaemon + name: mycododaemon +spec: + ports: + - name: "9080" + port: 9080 + targetPort: 9080 + selector: + io.kompose.service: mycododaemon +status: + loadBalancer: {} diff --git a/kompose/mycodoflask-claim15-persistentvolumeclaim.yaml b/kompose/mycodoflask-claim15-persistentvolumeclaim.yaml new file mode 100644 index 000000000..915882d96 --- /dev/null +++ b/kompose/mycodoflask-claim15-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: mycodoflask-claim15 + name: mycodoflask-claim15 +spec: + accessModes: + - ReadOnlyMany + resources: + requests: + storage: 100Mi +status: {} diff --git a/kompose/mycodoflask-deployment.yaml b/kompose/mycodoflask-deployment.yaml new file mode 100644 index 000000000..6e8d6c376 --- /dev/null +++ b/kompose/mycodoflask-deployment.yaml @@ -0,0 +1,182 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -o kompose + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodoflask + name: mycodoflask +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: mycodoflask + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -o kompose + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodoflask + spec: + nodeName: lilgreen + containers: + - args: + - /home/mycodo/env/bin/python + - -m + - gunicorn + - --workers + - "1" + - --bind + - unix:/usr/local/mycodo/mycodoflask.sock + - start_flask_ui:app + env: + - name: TZ + value: America/New_York + image: nargetdev/mycodoapp:c0.0.2-v8.15.1 + name: mycodoflask + ports: + - containerPort: 9080 + resources: {} + securityContext: + privileged: true + volumeMounts: + - mountPath: /usr/local/mycodo + name: mycodo + - mountPath: /home/mycodo/env + name: mycodo-env + - mountPath: /home/mycodo/databases + name: mycodo-databases + - mountPath: /home/mycodo/cameras + name: mycodo-cameras + - mountPath: /home/mycodo/mycodo/functions/custom_functions + name: mycodo-custom-functions + - mountPath: /home/mycodo/mycodo/actions/custom_actions + name: mycodo-custom-actions + - mountPath: /home/mycodo/mycodo/inputs/custom_inputs + name: mycodo-custom-inputs + - mountPath: /home/mycodo/mycodo/outputs/custom_outputs + name: mycodo-custom-outputs + - mountPath: /home/mycodo/mycodo/widgets/custom_widgets + name: mycodo-custom-widgets + - mountPath: /home/mycodo/mycodo/user_scripts + name: mycodo-custom-user-scripts + - mountPath: /home/mycodo/mycodo/mycodo_flask/static/css/user_css + name: mycodo-custom-user-css + - mountPath: /home/mycodo/mycodo/mycodo_flask/static/js/user_js + name: mycodo-custom-user-js + - mountPath: /var/log/mycodo + name: mycodo-log + - mountPath: /home/mycodo/mycodo/mycodo_flask/ssl_certs + name: mycodo-ssl-certs + - mountPath: /var/lib/influxdb + name: mycodo-influxdb + - mountPath: /var/run/docker.sock + name: mycodoflask-claim15 + readOnly: true + hostname: mycodohost + restartPolicy: Always + volumes: + - name: mycodo + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo +# persistentVolumeClaim: +# claimName: mycodo + - name: mycodo-env + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-env +# persistentVolumeClaim: +# claimName: mycodo-env + - name: mycodo-databases + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-databases +# persistentVolumeClaim: +# claimName: mycodo-databases + - name: mycodo-cameras + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-cameras +# persistentVolumeClaim: +# claimName: mycodo-cameras + - name: mycodo-custom-functions + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-custom-functions +# persistentVolumeClaim: +# claimName: mycodo-custom-functions + - name: mycodo-custom-actions + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-custom-actions +# persistentVolumeClaim: +# claimName: mycodo-custom-actions + - name: mycodo-custom-inputs + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-custom-inputs +# persistentVolumeClaim: +# claimName: mycodo-custom-inputs + - name: mycodo-custom-outputs + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-custom-outputs +# persistentVolumeClaim: +# claimName: mycodo-custom-outputs + - name: mycodo-custom-widgets + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-custom-widgets +# persistentVolumeClaim: +# claimName: mycodo-custom-widgets + - name: mycodo-custom-user-scripts + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-user-scripts +# persistentVolumeClaim: +# claimName: mycodo-custom-user-scripts + - name: mycodo-custom-user-css + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-user-css +# persistentVolumeClaim: +# claimName: mycodo-custom-user-css + - name: mycodo-custom-user-js + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-custom-user-js +# persistentVolumeClaim: +# claimName: mycodo-custom-user-js + - name: mycodo-log + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-log +# persistentVolumeClaim: +# claimName: mycodo-log + - name: mycodo-ssl-certs + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-ssl-certs +# persistentVolumeClaim: +# claimName: mycodo-ssl-certs + - name: mycodo-influxdb + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-influxdb +# persistentVolumeClaim: +# claimName: mycodo-influxdb + - name: mycodoflask-claim15 + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-claim15 +# persistentVolumeClaim: +# claimName: mycodoflask-claim15 +# readOnly: true +status: {} diff --git a/kompose/mycodoflask-service.yaml b/kompose/mycodoflask-service.yaml new file mode 100644 index 000000000..821c1cefd --- /dev/null +++ b/kompose/mycodoflask-service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert -o kompose + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodoflask + name: mycodoflask +spec: + ports: + - name: "9080" + port: 9080 + targetPort: 9080 + selector: + io.kompose.service: mycodoflask +status: + loadBalancer: {} diff --git a/kompose/mycodoinfluxdb-deployment.yaml b/kompose/mycodoinfluxdb-deployment.yaml new file mode 100644 index 000000000..34ff77424 --- /dev/null +++ b/kompose/mycodoinfluxdb-deployment.yaml @@ -0,0 +1,56 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -o kompose + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodoinfluxdb + name: mycodoinfluxdb +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: mycodoinfluxdb + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -o kompose + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodoinfluxdb + spec: + nodeName: lilgreen + containers: + - env: + - name: DOCKER_INFLUXDB_INIT_BUCKET + value: mycodo_db + - name: DOCKER_INFLUXDB_INIT_MODE + value: setup + - name: DOCKER_INFLUXDB_INIT_ORG + value: mycodo + - name: DOCKER_INFLUXDB_INIT_PASSWORD + value: mmdu77sj3nIoiajjs + - name: DOCKER_INFLUXDB_INIT_USERNAME + value: mycodo + image: influxdb:latest + name: mycodoinfluxdb + ports: + - containerPort: 8086 + resources: {} + volumeMounts: + - mountPath: /var/lib/influxdb2 + name: mycodo-influxdb + restartPolicy: Always + volumes: + - name: mycodo-influxdb + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-influxdb +# persistentVolumeClaim: +# claimName: mycodo-influxdb +status: {} diff --git a/kompose/mycodoinfluxdb-service.yaml b/kompose/mycodoinfluxdb-service.yaml new file mode 100644 index 000000000..882144403 --- /dev/null +++ b/kompose/mycodoinfluxdb-service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert -o kompose + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodoinfluxdb + name: mycodoinfluxdb +spec: + ports: + - name: "8086" + port: 8086 + targetPort: 8086 + selector: + io.kompose.service: mycodoinfluxdb +status: + loadBalancer: {} diff --git a/kompose/mycodonginx-deployment.yaml b/kompose/mycodonginx-deployment.yaml new file mode 100644 index 000000000..8eb062d68 --- /dev/null +++ b/kompose/mycodonginx-deployment.yaml @@ -0,0 +1,62 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -o kompose + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodonginx + name: mycodonginx +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: mycodonginx + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -o kompose + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodonginx + spec: + nodeName: lilgreen + containers: + - image: nargetdev/mycodonginx:c0.0.0-v8.15.1 + name: mycodonginx + ports: + - containerPort: 80 + - containerPort: 443 + resources: {} + volumeMounts: + - mountPath: /usr/local/mycodo + name: mycodo + - mountPath: /var/log/mycodo + name: mycodo-log + - mountPath: /home/mycodo/mycodo/mycodo_flask/ssl_certs + name: mycodo-ssl-certs + restartPolicy: Always + volumes: + - name: mycodo + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo +# persistentVolumeClaim: +# claimName: mycodo + - name: mycodo-log + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-log +# persistentVolumeClaim: +# claimName: mycodo-log + - name: mycodo-ssl-certs + nfs: + server: 192.168.1.247 + path: /volume2/SSD_500GB/mycodoPVs/mycodo-ssl-certs +# persistentVolumeClaim: +# claimName: mycodo-ssl-certs +status: {} diff --git a/kompose/mycodonginx-service.yaml b/kompose/mycodonginx-service.yaml new file mode 100644 index 000000000..65bfa9453 --- /dev/null +++ b/kompose/mycodonginx-service.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert -o kompose + kompose.version: 1.26.0 (40646f47) + creationTimestamp: null + labels: + io.kompose.service: mycodonginx + name: mycodonginx +spec: + ports: + - name: "80" + port: 80 + targetPort: 80 + - name: "443" + port: 443 + targetPort: 443 + selector: + io.kompose.service: mycodonginx +status: + loadBalancer: {} diff --git a/kompose_output_directory.sh b/kompose_output_directory.sh new file mode 100755 index 000000000..fbddee810 --- /dev/null +++ b/kompose_output_directory.sh @@ -0,0 +1,2 @@ +#!/bin/bash +kompose convert -o kompose diff --git a/mycodo/config.py b/mycodo/config.py index bdc8ca278..19801f508 100644 --- a/mycodo/config.py +++ b/mycodo/config.py @@ -103,7 +103,7 @@ # Pyro5 URI/host, used by mycodo_client.py if DOCKER_CONTAINER: - PYRO_URI = 'PYRO:mycodo.pyro_server@mycodo_daemon:9080' + PYRO_URI = 'PYRO:mycodo.pyro_server@mycododaemon:9080' else: PYRO_URI = 'PYRO:mycodo.pyro_server@127.0.0.1:9080' diff --git a/mycodo/mycodo_flask/utils/utils_export.py b/mycodo/mycodo_flask/utils/utils_export.py index b35ad3e02..97082ab24 100644 --- a/mycodo/mycodo_flask/utils/utils_export.py +++ b/mycodo/mycodo_flask/utils/utils_export.py @@ -171,7 +171,7 @@ def thread_import_settings(tmp_folder): # Start Mycodo daemon (backend) append_to_log(IMPORT_LOG_FILE, f"\n[{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] Restarting backend") if DOCKER_CONTAINER: - subprocess.Popen('docker start mycodo_daemon 2>&1', shell=True) + subprocess.Popen('docker start mycododaemon 2>&1', shell=True) else: cmd = f"{INSTALL_DIRECTORY}/mycodo/scripts/mycodo_wrapper daemon_restart | ts '[%Y-%m-%d %H:%M:%S]' >> {IMPORT_LOG_FILE} 2>&1" a, b, c = cmd_output(cmd) @@ -284,7 +284,7 @@ def import_settings(form): append_to_log(IMPORT_LOG_FILE, f"\n[{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] Stopping daemon and copying files") try: if DOCKER_CONTAINER: - subprocess.Popen('docker stop mycodo_daemon 2>&1', shell=True) + subprocess.Popen('docker stop mycododaemon 2>&1', shell=True) else: # Stop Mycodo daemon (backend) cmd = f"{INSTALL_DIRECTORY}/mycodo/scripts/mycodo_wrapper daemon_stop"