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:
            - python3
            - repo_github_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 }
  selector:
    app: reposync
