apiVersion: apps/v1
kind: Deployment
metadata:
  name: projects
spec:
  replicas: 1
  selector:
    matchLabels:
      app: projects
  template:
    metadata:
      labels:
        app: projects
      annotations:
        prometheus.io/scrape: "true"
    spec:
      volumes:
        - { name: my, persistentVolumeClaim: { claimName: my } }
      containers:
        - name: projects
          image: bang5:5000/projects_image
          ports:
            - containerPort: 80
          command:
            - nodejs
            - server.js
          volumeMounts:
            - name: my
              mountPath: /data
              subPath: site/projects

      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: "kubernetes.io/hostname"
                    operator: In
                    values: ["bang", "dash", "slash"]
---
apiVersion: v1
kind: Service
metadata:
  name: projects
spec:
  ports:
    - { port: 80, targetPort: 80 }
  selector:
    app: projects
