apiVersion: apps/v1
kind: Deployment
metadata:
  name: crux-api-uat
  namespace: crux-uat
spec:
  replicas: 1
  selector:
    matchLabels:
      app: backend
  template:
    metadata:
      labels:
        app: backend
    spec: 
      containers:
        - name: utility-container
          image: centos:7.9.2009  # Replace with your Docker image name and tag
          command: ["/bin/bash","-c","--"]
          args: ["while true; do sleep 180; done; mkdir -p /var/crux"]
          ports:
          - containerPort: 8085
          volumeMounts:
          - mountPath: "/var/crux"
            name: crux-uat-api-data-pv-volume
      volumes:
        - name: crux-uat-api-data-pv-volume
          persistentVolumeClaim:
            claimName: crux-uat-api-data-pv-claim
      nodeSelector:
        name: node-1

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

---

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


---


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