view deploy.yaml @ 21:cb71722bb75c

use pipenv
author drewp@bigasterisk.com
date Tue, 29 Mar 2022 21:13:48 -0700
parents b59912649fc4
children b9fe6d26b3fa
line wrap: on
line source

apiVersion: apps/v1
kind: Deployment
metadata:
  name: reposync
spec:
  replicas: 1
  selector:
    matchLabels:
      app: reposync
  template:
    metadata:
      labels:
        app: reposync
    spec:
      containers:
        - name: view
          image: bang5:5000/reposync_image
          command:
            - pnpx
            - vite
            - --mode=dev
          ports:
            - containerPort: 3000
        - name: github-status
          image: bang5:5000/reposync_image
          ports:
            - containerPort: 8000
          command:
            - pipenv
            - run
            - python
            - repo_github_status.py
            - "-v"
        - name: hg-status
          image: bang5:5000/reposync_image
          ports:
            - containerPort: 8001
          command:
            - pipenv
            - run
            - python
            - repo_local_status.py
            - "-v"
          volumeMounts:
            - { name: my, mountPath: /my }

      volumes:
        - { name: my, persistentVolumeClaim: { claimName: my } }
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: "kubernetes.io/hostname"
                    operator: In
                    values: ["bang"]
---
apiVersion: v1
kind: Service
metadata:
  name: reposync
spec:
  ports:
    - { port: 80, targetPort: 3000, name: http }
    - { port: 8000, targetPort: 8000, name: localrepos }
    - { port: 8001, targetPort: 8001, name: githubrepos }
  selector:
    app: reposync