apiVersion: apps/v1
kind: Deployment
metadata:
  name: uat-frontend
  namespace: kra-uat
spec:
  replicas: 1  # Set the desired number of replicas
  selector:
    matchLabels:
      app: kra-web
  template:
    metadata:
      labels:
        app: kra-web
    spec:
      containers:
      - name: nginx
        image: private-repo:5000/nginx:1.25
        ports:
        - containerPort: 80
        volumeMounts:
        - mountPath: "/etc/nginx"
          name: uat-web-config-pv-volume
        - mountPath: "/usr/share/nginx/html"
          name: uat-web-data-pv-volume
      volumes:
        - name: uat-web-config-pv-volume
          persistentVolumeClaim:
            claimName: uat-web-config-pv-claim
        - name: uat-web-data-pv-volume
          persistentVolumeClaim:
            claimName: uat-web-data-pv-claim
      nodeSelector:
        name: node-1

---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: kra-web
  name: uat-frontend-service
  namespace: kra-uat
spec:
  type: NodePort
  ports:
  - name: "nginx"
    port: 8084
    targetPort: 80
    nodePort: 31004
  selector:
    app: kra-web


---

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


---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: uat-web-config-pv-claim
  namespace: kra-uat
spec:
  storageClassName: standard
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 50Mi


---


apiVersion: v1
kind: PersistentVolume
metadata:
  name: uat-web-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/data"


---

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