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

---
apiVersion: v1
kind: Service
metadata:
  name: qa2-backend-service
  namespace: kra-qa2
spec:
  selector:
    app: qa2-backend
  ports:
    - protocol: TCP
      port: 8089
      targetPort: 8089
      nodePort: 31009
  type: NodePort

---

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


---


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