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

---
apiVersion: v1
kind: Service
metadata:
  name: dev2-backend-service
  namespace: kra-dev2
spec:
  selector:
    app: dev2-backend
  ports:
    - protocol: TCP
      port: 8087
      targetPort: 8087
      nodePort: 31007
  type: NodePort

---

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


---


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