apiVersion: apps/v1
kind: Deployment
metadata:
  name: qa-backend
  namespace: kra-qa
spec:
  replicas: 1
  selector:
    matchLabels:
      app: qa-backend
  template:
    metadata:
      labels:
        app: qa-backend
    spec:
      containers:
        - name: backend
          #image: centos:7.9.2009 # Replace with your Docker image name and tag
          image: private-repo:5000/build-tool-node:v1.2
          command: ["/bin/bash","-c","--"]
          args: ["while true; do sleep 180; done; mkdir -p /var/starmf"]
          ports:
          - containerPort: 8080
          volumeMounts:
          - mountPath: "/var/kra"
            name: qa-backend-data-pv-volume
      volumes:
        - name: qa-backend-data-pv-volume
          persistentVolumeClaim:
            claimName: qa-backend-data-pv-claim
      nodeSelector:
        name: node-1

---
apiVersion: v1
kind: Service
metadata:
  name: qa-backend-service
  namespace: kra-qa
spec:
  selector:
    app: qa-backend
  ports:
    - protocol: TCP
      port: 8080
      targetPort: 8080
      nodePort: 31003
  type: NodePort

---

apiVersion: v1
kind: PersistentVolume
metadata:
  name: qa-backend-data-pv-volume
  namespace: kra-qa
  labels:
    type: local
spec:
  storageClassName: standard
  capacity:
    storage: 500Mi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/kra-data/data/dev/kra-qa/backend"


---


apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: qa-backend-data-pv-claim
  namespace: kra-qa
spec:
  storageClassName: standard
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 500Mi
