apiVersion: apps/v1
kind: Deployment
metadata:
  name: crux-web-qa
  namespace: crux-qa
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-qa-web-config-pv-volume
        - mountPath: "/usr/share/nginx/html"
          name: crux-qa-web-data-pv-volume
      volumes:
        - name: crux-qa-web-config-pv-volume
          persistentVolumeClaim:
            claimName: crux-qa-web-config-pv-claim
        - name: crux-qa-web-data-pv-volume
          persistentVolumeClaim:
            claimName: crux-qa-web-data-pv-claim
      nodeSelector:
        name: node-1

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


---

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


---

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


---


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


---

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