apiVersion: apps/v1
kind: Deployment
metadata:
  name: shipwright-build-controller
  namespace: shipwright-build
spec:
  replicas: 1
  selector:
    matchLabels:
      name: shipwright-build
  template:
    metadata:
      labels:
        name: shipwright-build
    spec:
      serviceAccountName: shipwright-build-controller
      containers:
        - name: shipwright-build
          image: ko://github.com/shipwright-io/build/cmd/shipwright-build-controller
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: BUILD_CONTROLLER_LEADER_ELECTION_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: CONTROLLER_NAME
              value: "shipwright-build"
            - name: GIT_CONTAINER_IMAGE
              value: ko://github.com/shipwright-io/build/cmd/git
            - name: MUTATE_IMAGE_CONTAINER_IMAGE
              value: ko://github.com/shipwright-io/build/cmd/mutate-image
            - name: BUNDLE_CONTAINER_IMAGE
              value: ko://github.com/shipwright-io/build/cmd/bundle
          ports:
            - containerPort: 8383
              name: metrics-port
          livenessProbe:
            httpGet:
              path: /metrics
              port: metrics-port
            initialDelaySeconds: 5
            periodSeconds: 10
          readinessProbe:
            httpGet:
              path: /metrics
              port: metrics-port
            initialDelaySeconds: 5
            periodSeconds: 10
