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

---
apiVersion: v1
kind: Service
metadata:
  name: uat-backend-service
  namespace: kra-uat
spec:
  selector:
    app: uat-backend
  ports:
    - protocol: TCP
      port: 8085
      targetPort: 8085
      nodePort: 31005
  type: NodePort

---

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


---


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