view deploy.yaml @ 4:759f0ba7d345

crash (and get restarted) better
author drewp@bigasterisk.com
date Sat, 23 Mar 2024 16:15:34 -0700
parents 0cc41259fddd
children f0d549ec5e59
line wrap: on
line source

apiVersion: apps/v1
kind: Deployment
metadata:
  name: pi-mqtt
spec:
  replicas: 1
  selector:
    matchLabels:
      app: pi-mqtt
  template:
    metadata:
      labels:
        app: pi-mqtt
    spec:

      volumes:
        - name: nginx-conf
          configMap:
            name: pi-mqtt-nginx-conf
      containers:
        - name: proxy
          image: docker.io/nginx:1.21.6
          ports:
            - containerPort: 80
          volumeMounts:
            - { name: nginx-conf, mountPath: "/etc/nginx/" }
          livenessProbe:
            httpGet:
              path: /health
              port: 80
        - name: pi-mqtt-vite
          image: reg:5000/pi_mqtt_image
          ports:
            - containerPort: 8002
          command:
            - pnpm
            - exec
            - vite
            - --port=8002
        - name: pi-mqtt-py
          image: reg:5000/pi_mqtt_image
          ports:
            - containerPort: 8001
          command:
          - pdm
          - run
          - python
          - 'pi_mqtt.py'
---
apiVersion: v1
kind: Service
metadata:
  name: pi-mqtt
spec:
  ports:
  - {port: 80, targetPort: 80}
  selector:
    app: pi-mqtt