apiVersion: apps/v1
kind: Deployment
metadata:
  name: uat2-backend
  namespace: kra-uat2
spec:
  replicas: 1
  selector:
    matchLabels:
      app: uat2-backend
  template:
    metadata:
      labels:
        app: uat2-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: 8091
          volumeMounts:
          - mountPath: "/var/kra"
            name: uat2-backend-data-pv-volume
      volumes:
        - name: uat2-backend-data-pv-volume
          persistentVolumeClaim:
            claimName: uat2-backend-data-pv-claim
      nodeSelector:
        name: node-1

---
apiVersion: v1
kind: Service
metadata:
  name: uat2-backend-service
  namespace: kra-uat2
spec:
  selector:
    app: uat2-backend
  ports:
    - protocol: TCP
      port: 8091
      targetPort: 8091
      nodePort: 31019
  type: NodePort

---

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


---


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