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

---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: nginx-1
  name: crux-ui-service-uat
  namespace: crux-uat
spec:
  type: NodePort
  ports:
  - name: "nginx"
    port: 8084
    targetPort: 80
    nodePort: 31014
  selector:
    app: nginx-1


---

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


---

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


---


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


---

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