apiVersion: apps/v1
kind: Deployment
metadata:
  name: build-deployment
  namespace: build-tool
spec:
  replicas: 1
  selector:
    matchLabels:
      app: build-tool
  template:
    metadata:
      labels:
        app: build-tool
    spec:
      containers:
        - name: build-container
          image: private-repo:5000/build-tool-node:v1.3 # Replace with your Docker image name and tag
          #image: ganeshwalkoli/test-build:v0.4
          command: ["/bin/bash", "-c", "--"]
          args: ["while true; do sleep 180; done;"]
          ports:
            - containerPort: 8082
          volumeMounts:
          - mountPath: "/app"
            name: build-pv-volume
      volumes:
        - name: build-pv-volume
          persistentVolumeClaim:
            claimName: build-pv-claim 
      nodeSelector:
        name: node-1

---
apiVersion: v1
kind: Service
metadata:
  name: build-service
  namespace: build-tool
spec:
  selector:
    app: build-tool
  ports:
    - protocol: TCP
      port: 8083
      targetPort: 8082
      #nodePort: 32119
  #type: NodePort
---

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

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: build-pv-claim
spec:
  storageClassName: standard
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 500Mi
---
