apiVersion: v1
kind: Service
metadata:
  name: code-queue-scheduler-dev
  namespace: unidesk-dev
  labels:
    app.kubernetes.io/name: code-queue
    app.kubernetes.io/component: scheduler
    app.kubernetes.io/part-of: unidesk
    app.kubernetes.io/instance: code-queue-scheduler-dev
    unidesk.ai/environment: dev
    unidesk.ai/deployment-mode: k3sctl-managed
    unidesk.ai/deploy-service-id: code-queue
spec:
  type: ClusterIP
  selector:
    app.kubernetes.io/name: code-queue
    app.kubernetes.io/component: scheduler
    app.kubernetes.io/instance: code-queue-scheduler-dev
    unidesk.ai/environment: dev
    unidesk.ai/deploy-service-id: code-queue
  ports:
    - name: http
      port: 4222
      targetPort: http
---
apiVersion: v1
kind: Service
metadata:
  name: code-queue-read-dev
  namespace: unidesk-dev
  labels:
    app.kubernetes.io/name: code-queue
    app.kubernetes.io/component: read
    app.kubernetes.io/part-of: unidesk
    app.kubernetes.io/instance: code-queue-read-dev
    unidesk.ai/environment: dev
    unidesk.ai/deployment-mode: k3sctl-managed
    unidesk.ai/deploy-service-id: code-queue
spec:
  type: ClusterIP
  selector:
    app.kubernetes.io/name: code-queue
    app.kubernetes.io/component: read
    app.kubernetes.io/instance: code-queue-read-dev
    unidesk.ai/environment: dev
    unidesk.ai/deploy-service-id: code-queue
  ports:
    - name: http
      port: 4222
      targetPort: http
---
apiVersion: v1
kind: Service
metadata:
  name: code-queue-write-dev
  namespace: unidesk-dev
  labels:
    app.kubernetes.io/name: code-queue
    app.kubernetes.io/component: write
    app.kubernetes.io/part-of: unidesk
    app.kubernetes.io/instance: code-queue-write-dev
    unidesk.ai/environment: dev
    unidesk.ai/deployment-mode: k3sctl-managed
    unidesk.ai/deploy-service-id: code-queue
spec:
  type: ClusterIP
  selector:
    app.kubernetes.io/name: code-queue
    app.kubernetes.io/component: write
    app.kubernetes.io/instance: code-queue-write-dev
    unidesk.ai/environment: dev
    unidesk.ai/deploy-service-id: code-queue
  ports:
    - name: http
      port: 4222
      targetPort: http
---
apiVersion: v1
kind: Service
metadata:
  name: d601-dev-provider-egress-proxy
  namespace: unidesk-dev
  labels:
    app.kubernetes.io/name: provider-egress-proxy
    app.kubernetes.io/part-of: unidesk
    app.kubernetes.io/instance: d601-dev-provider-egress-proxy
    unidesk.ai/environment: dev
    unidesk.ai/provider-id: D601-dev
    unidesk.ai/deploy-service-id: code-queue
spec:
  type: ClusterIP
  selector:
    app.kubernetes.io/name: provider-egress-proxy
    app.kubernetes.io/instance: d601-dev-provider-egress-proxy
    unidesk.ai/environment: dev
    unidesk.ai/provider-id: D601-dev
    unidesk.ai/deploy-service-id: code-queue
  ports:
    - name: http
      port: 18789
      targetPort: http
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: d601-dev-provider-egress-proxy
  namespace: unidesk-dev
  labels:
    app.kubernetes.io/name: provider-egress-proxy
    app.kubernetes.io/part-of: unidesk
    unidesk.ai/environment: dev
    unidesk.ai/provider-id: D601-dev
    unidesk.ai/deploy-service-id: code-queue
data:
  provider-egress-proxy.js: |
    const net = require("node:net");

    const listenPort = Number(process.env.PROVIDER_EGRESS_LISTEN_PORT || 18790);
    const upstreamHost = process.env.PROVIDER_EGRESS_UPSTREAM_HOST || "127.0.0.1";
    const upstreamPort = Number(process.env.PROVIDER_EGRESS_UPSTREAM_PORT || 18789);

    function closeBoth(left, right) {
      left.destroy();
      right.destroy();
    }

    net.createServer((client) => {
      const upstream = net.connect({ host: upstreamHost, port: upstreamPort });
      client.pipe(upstream);
      upstream.pipe(client);
      client.on("error", () => closeBoth(client, upstream));
      upstream.on("error", () => closeBoth(client, upstream));
    }).listen(listenPort, "0.0.0.0", () => {
      console.log(JSON.stringify({
        ts: new Date().toISOString(),
        service: "provider-egress-proxy-dev",
        level: "info",
        message: "listening",
        data: { listenPort, upstream: `${upstreamHost}:${upstreamPort}` },
      }));
    });
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: d601-dev-provider-egress-proxy
  namespace: unidesk-dev
  labels:
    app.kubernetes.io/name: provider-egress-proxy
    app.kubernetes.io/part-of: unidesk
    app.kubernetes.io/instance: d601-dev-provider-egress-proxy
    unidesk.ai/environment: dev
    unidesk.ai/provider-id: D601-dev
    unidesk.ai/deployment-mode: k3sctl-managed
    unidesk.ai/deploy-service-id: code-queue
  annotations:
    unidesk.ai/deploy-ref: origin/master:deploy.json#environments.dev
    unidesk.ai/image-source: deploy-env-commit
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/name: provider-egress-proxy
      app.kubernetes.io/instance: d601-dev-provider-egress-proxy
      unidesk.ai/environment: dev
      unidesk.ai/provider-id: D601-dev
      unidesk.ai/deploy-service-id: code-queue
  template:
    metadata:
      labels:
        app.kubernetes.io/name: provider-egress-proxy
        app.kubernetes.io/part-of: unidesk
        app.kubernetes.io/instance: d601-dev-provider-egress-proxy
        unidesk.ai/environment: dev
        unidesk.ai/provider-id: D601-dev
        unidesk.ai/node-id: D601
        unidesk.ai/deploy-service-id: code-queue
    spec:
      hostNetwork: true
      dnsPolicy: ClusterFirstWithHostNet
      nodeSelector:
        unidesk.ai/node-id: D601
      containers:
        - name: provider-egress-proxy
          image: unidesk-code-queue:dev-placeholder
          imagePullPolicy: IfNotPresent
          command:
            - bun
            - /etc/unidesk-provider-egress/provider-egress-proxy.js
          ports:
            - name: http
              containerPort: 18791
          env:
            - name: PROVIDER_EGRESS_LISTEN_PORT
              value: "18791"
            - name: PROVIDER_EGRESS_UPSTREAM_HOST
              value: "127.0.0.1"
            - name: PROVIDER_EGRESS_UPSTREAM_PORT
              value: "18789"
            - name: UNIDESK_DEPLOY_SERVICE_ID
              value: code-queue
            - name: UNIDESK_DEPLOY_REPO
              value: https://github.com/pikasTech/unidesk
            - name: UNIDESK_DEPLOY_COMMIT
              value: replace-with-deploy-env-commit
            - name: UNIDESK_DEPLOY_REQUESTED_COMMIT
              value: replace-with-deploy-env-commit
          volumeMounts:
            - name: script
              mountPath: /etc/unidesk-provider-egress
              readOnly: true
          readinessProbe:
            tcpSocket:
              port: http
            periodSeconds: 5
            timeoutSeconds: 3
            failureThreshold: 12
          livenessProbe:
            tcpSocket:
              port: http
            periodSeconds: 10
            timeoutSeconds: 3
            failureThreshold: 6
          resources:
            requests:
              cpu: 25m
              memory: 64Mi
            limits:
              cpu: 100m
              memory: 128Mi
      volumes:
        - name: script
          configMap:
            name: d601-dev-provider-egress-proxy
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: code-queue-scheduler-dev
  namespace: unidesk-dev
  labels:
    app.kubernetes.io/name: code-queue
    app.kubernetes.io/component: scheduler
    app.kubernetes.io/part-of: unidesk
    app.kubernetes.io/instance: code-queue-scheduler-dev
    unidesk.ai/environment: dev
    unidesk.ai/deployment-mode: k3sctl-managed
    unidesk.ai/deploy-service-id: code-queue
  annotations:
    unidesk.ai/deploy-ref: origin/master:deploy.json#environments.dev
    unidesk.ai/image-source: deploy-env-commit
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/name: code-queue
      app.kubernetes.io/component: scheduler
      app.kubernetes.io/instance: code-queue-scheduler-dev
      unidesk.ai/environment: dev
      unidesk.ai/deploy-service-id: code-queue
  template:
    metadata:
      labels:
        app.kubernetes.io/name: code-queue
        app.kubernetes.io/component: scheduler
        app.kubernetes.io/part-of: unidesk
        app.kubernetes.io/instance: code-queue-scheduler-dev
        unidesk.ai/environment: dev
        unidesk.ai/node-id: D601
        unidesk.ai/deploy-service-id: code-queue
    spec:
      nodeSelector:
        unidesk.ai/node-id: D601
      terminationGracePeriodSeconds: 30
      containers:
        - name: code-queue
          image: unidesk-code-queue:dev-placeholder
          imagePullPolicy: IfNotPresent
          ports:
            - name: http
              containerPort: 4222
          envFrom:
            - configMapRef:
                name: unidesk-dev-runtime-config
            - secretRef:
                name: unidesk-dev-runtime-secrets
          env:
            - name: HOST
              value: "0.0.0.0"
            - name: PORT
              value: "4222"
            - name: DATABASE_URL
              valueFrom:
                secretKeyRef:
                  name: unidesk-dev-runtime-secrets
                  key: DATABASE_URL
            - name: UNIDESK_DATABASE_NAME
              value: unidesk_dev
            - name: UNIDESK_DEPLOY_SERVICE_ID
              value: code-queue
            - name: UNIDESK_DEPLOY_REPO
              value: https://github.com/pikasTech/unidesk
            - name: UNIDESK_DEPLOY_COMMIT
              value: replace-with-deploy-env-commit
            - name: UNIDESK_DEPLOY_REQUESTED_COMMIT
              value: replace-with-deploy-env-commit
            - name: CODE_QUEUE_DEPLOY_COMMIT
              value: replace-with-deploy-env-commit
            - name: CODE_QUEUE_DEPLOY_REQUESTED_COMMIT
              value: replace-with-deploy-env-commit
            - name: CODE_QUEUE_INSTANCE_ID
              value: D601-dev
            - name: CODE_QUEUE_SERVICE_ROLE
              value: scheduler
            - name: CODE_QUEUE_SCHEDULER_ENABLED
              value: "true"
            - name: CODE_QUEUE_SCHEDULER_POLL_INTERVAL_MS
              value: "3000"
            - name: CODE_QUEUE_DATABASE_POOL_MAX
              value: "2"
            - name: CODE_QUEUE_MAX_ACTIVE_QUEUES
              value: "1"
            - name: CODE_QUEUE_SANDBOX
              value: danger-full-access
            - name: CODE_QUEUE_APPROVAL_POLICY
              value: never
            - name: UNIDESK_SKILLS_PATH
              value: /root/.agents/skills
            - name: CODE_QUEUE_RUNNER_SKILLS_SOURCE_PATH
              value: /home/ubuntu/.agents/skills
            - name: CODE_QUEUE_EGRESS_PROXY_ENABLED
              value: "true"
            - name: CODE_QUEUE_EGRESS_PROXY_URL
              value: http://d601-dev-provider-egress-proxy.unidesk-dev.svc.cluster.local:18789
            - name: CODE_QUEUE_EGRESS_PROXY_NO_PROXY
              value: localhost,127.0.0.1,::1,host.docker.internal,d601-dev-provider-egress-proxy,d601-dev-provider-egress-proxy.unidesk-dev,d601-dev-provider-egress-proxy.unidesk-dev.svc,d601-dev-provider-egress-proxy.unidesk-dev.svc.cluster.local,postgres-dev,postgres-dev.unidesk-dev,postgres-dev.unidesk-dev.svc,postgres-dev.unidesk-dev.svc.cluster.local,backend-core-dev,frontend-dev
            - name: HTTP_PROXY
              value: http://d601-dev-provider-egress-proxy.unidesk-dev.svc.cluster.local:18789
            - name: HTTPS_PROXY
              value: http://d601-dev-provider-egress-proxy.unidesk-dev.svc.cluster.local:18789
            - name: ALL_PROXY
              value: http://d601-dev-provider-egress-proxy.unidesk-dev.svc.cluster.local:18789
            - name: http_proxy
              value: http://d601-dev-provider-egress-proxy.unidesk-dev.svc.cluster.local:18789
            - name: https_proxy
              value: http://d601-dev-provider-egress-proxy.unidesk-dev.svc.cluster.local:18789
            - name: all_proxy
              value: http://d601-dev-provider-egress-proxy.unidesk-dev.svc.cluster.local:18789
            - name: NO_PROXY
              value: localhost,127.0.0.1,::1,host.docker.internal,d601-dev-provider-egress-proxy,d601-dev-provider-egress-proxy.unidesk-dev,d601-dev-provider-egress-proxy.unidesk-dev.svc,d601-dev-provider-egress-proxy.unidesk-dev.svc.cluster.local,postgres-dev,postgres-dev.unidesk-dev,postgres-dev.unidesk-dev.svc,postgres-dev.unidesk-dev.svc.cluster.local,backend-core-dev,frontend-dev
            - name: no_proxy
              value: localhost,127.0.0.1,::1,host.docker.internal,d601-dev-provider-egress-proxy,d601-dev-provider-egress-proxy.unidesk-dev,d601-dev-provider-egress-proxy.unidesk-dev.svc,d601-dev-provider-egress-proxy.unidesk-dev.svc.cluster.local,postgres-dev,postgres-dev.unidesk-dev,postgres-dev.unidesk-dev.svc,postgres-dev.unidesk-dev.svc.cluster.local,backend-core-dev,frontend-dev
            - name: OA_EVENT_FLOW_BASE_URL
              value: http://127.0.0.1:9
            - name: CODE_QUEUE_NOTIFY_CLAUDEQQ_ENABLED
              value: "false"
            - name: CODE_QUEUE_CODEX_SQLITE_LOG_EXPORT_ENABLED
              value: "false"
            - name: NODE_OPTIONS
              value: --max-old-space-size=1024
            - name: LOG_FILE
              value: /var/log/unidesk-dev/code-queue-scheduler-dev.jsonl
          volumeMounts:
            - name: docker-sock
              mountPath: /var/run/docker.sock
            - name: workspace
              mountPath: /workspace-dev
            - name: workspace
              mountPath: /home/ubuntu/unidesk-dev-workspace
            - name: repo
              mountPath: /root/unidesk
              readOnly: true
            - name: codex-config
              mountPath: /root/.codex/config.toml
              readOnly: true
            - name: codex-auth
              mountPath: /root/.codex/auth.json
              readOnly: true
            - name: skills-dir
              mountPath: /root/.agents/skills
              readOnly: true
            - name: ssh-dir
              mountPath: /root/.ssh
              readOnly: true
            - name: logs
              mountPath: /var/log/unidesk-dev
            - name: state
              mountPath: /var/lib/unidesk-dev/code-queue
          readinessProbe:
            httpGet:
              path: /health
              port: http
            periodSeconds: 5
            timeoutSeconds: 3
            failureThreshold: 20
          livenessProbe:
            httpGet:
              path: /live
              port: http
            periodSeconds: 10
            timeoutSeconds: 3
            failureThreshold: 6
          startupProbe:
            httpGet:
              path: /live
              port: http
            periodSeconds: 5
            timeoutSeconds: 3
            failureThreshold: 60
          resources:
            requests:
              cpu: 150m
              memory: 384Mi
            limits:
              cpu: 800m
              memory: 5Gi
      volumes:
        - name: docker-sock
          hostPath:
            path: /var/run/docker.sock
            type: Socket
        - name: workspace
          hostPath:
            path: /home/ubuntu/unidesk-dev-workspace
            type: DirectoryOrCreate
        - name: repo
          hostPath:
            path: /home/ubuntu/unidesk-dev-code-queue-deploy/code-queue
            type: Directory
        - name: codex-config
          hostPath:
            path: /home/ubuntu/.codex/config.toml
            type: File
        - name: codex-auth
          hostPath:
            path: /home/ubuntu/.codex/auth.json
            type: File
        - name: skills-dir
          hostPath:
            path: /home/ubuntu/.agents/skills
            type: Directory
        - name: ssh-dir
          hostPath:
            path: /home/ubuntu/.ssh
            type: Directory
        - name: logs
          hostPath:
            path: /home/ubuntu/unidesk-dev-code-queue-deploy/state/logs
            type: DirectoryOrCreate
        - name: state
          hostPath:
            path: /home/ubuntu/unidesk-dev-code-queue-deploy/state/code-queue
            type: DirectoryOrCreate
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: code-queue-read-dev
  namespace: unidesk-dev
  labels:
    app.kubernetes.io/name: code-queue
    app.kubernetes.io/component: read
    app.kubernetes.io/part-of: unidesk
    app.kubernetes.io/instance: code-queue-read-dev
    unidesk.ai/environment: dev
    unidesk.ai/deployment-mode: k3sctl-managed
    unidesk.ai/deploy-service-id: code-queue
  annotations:
    unidesk.ai/deploy-ref: origin/master:deploy.json#environments.dev
    unidesk.ai/image-source: deploy-env-commit
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: code-queue
      app.kubernetes.io/component: read
      app.kubernetes.io/instance: code-queue-read-dev
      unidesk.ai/environment: dev
      unidesk.ai/deploy-service-id: code-queue
  template:
    metadata:
      labels:
        app.kubernetes.io/name: code-queue
        app.kubernetes.io/component: read
        app.kubernetes.io/part-of: unidesk
        app.kubernetes.io/instance: code-queue-read-dev
        unidesk.ai/environment: dev
        unidesk.ai/node-id: D601
        unidesk.ai/deploy-service-id: code-queue
    spec:
      nodeSelector:
        unidesk.ai/node-id: D601
      terminationGracePeriodSeconds: 20
      containers:
        - name: code-queue
          image: unidesk-code-queue:dev-placeholder
          imagePullPolicy: IfNotPresent
          ports:
            - name: http
              containerPort: 4222
          envFrom:
            - configMapRef:
                name: unidesk-dev-runtime-config
            - secretRef:
                name: unidesk-dev-runtime-secrets
          env:
            - name: HOST
              value: "0.0.0.0"
            - name: PORT
              value: "4222"
            - name: DATABASE_URL
              valueFrom:
                secretKeyRef:
                  name: unidesk-dev-runtime-secrets
                  key: DATABASE_URL
            - name: UNIDESK_DATABASE_NAME
              value: unidesk_dev
            - name: UNIDESK_DEPLOY_SERVICE_ID
              value: code-queue
            - name: UNIDESK_DEPLOY_REPO
              value: https://github.com/pikasTech/unidesk
            - name: UNIDESK_DEPLOY_COMMIT
              value: replace-with-deploy-env-commit
            - name: UNIDESK_DEPLOY_REQUESTED_COMMIT
              value: replace-with-deploy-env-commit
            - name: CODE_QUEUE_DEPLOY_COMMIT
              value: replace-with-deploy-env-commit
            - name: CODE_QUEUE_DEPLOY_REQUESTED_COMMIT
              value: replace-with-deploy-env-commit
            - name: CODE_QUEUE_INSTANCE_ID
              value: D601-dev-read
            - name: CODE_QUEUE_SERVICE_ROLE
              value: read
            - name: CODE_QUEUE_SCHEDULER_ENABLED
              value: "false"
            - name: CODE_QUEUE_DATABASE_POOL_MAX
              value: "2"
            - name: CODE_QUEUE_EGRESS_PROXY_ENABLED
              value: "false"
            - name: UNIDESK_SKILLS_PATH
              value: /root/.agents/skills
            - name: CODE_QUEUE_RUNNER_SKILLS_SOURCE_PATH
              value: /home/ubuntu/.agents/skills
            - name: CODE_QUEUE_NOTIFY_CLAUDEQQ_ENABLED
              value: "false"
            - name: CODE_QUEUE_CODEX_SQLITE_LOG_EXPORT_ENABLED
              value: "false"
            - name: NODE_OPTIONS
              value: --max-old-space-size=512
            - name: LOG_FILE
              value: /var/log/unidesk-dev/code-queue-read-dev.jsonl
          volumeMounts:
            - name: repo
              mountPath: /root/unidesk
              readOnly: true
            - name: skills-dir
              mountPath: /root/.agents/skills
              readOnly: true
            - name: logs
              mountPath: /var/log/unidesk-dev
            - name: state
              mountPath: /var/lib/unidesk-dev/code-queue
          readinessProbe:
            httpGet:
              path: /live
              port: http
            periodSeconds: 5
            timeoutSeconds: 3
            failureThreshold: 20
          livenessProbe:
            httpGet:
              path: /live
              port: http
            periodSeconds: 10
            timeoutSeconds: 3
            failureThreshold: 6
          startupProbe:
            httpGet:
              path: /live
              port: http
            periodSeconds: 5
            timeoutSeconds: 3
            failureThreshold: 60
          resources:
            requests:
              cpu: 80m
              memory: 192Mi
            limits:
              cpu: 250m
              memory: 768Mi
      volumes:
        - name: repo
          hostPath:
            path: /home/ubuntu/unidesk-dev-code-queue-deploy/code-queue
            type: Directory
        - name: skills-dir
          hostPath:
            path: /home/ubuntu/.agents/skills
            type: Directory
        - name: logs
          hostPath:
            path: /home/ubuntu/unidesk-dev-code-queue-deploy/state/logs
            type: DirectoryOrCreate
        - name: state
          hostPath:
            path: /home/ubuntu/unidesk-dev-code-queue-deploy/state/code-queue
            type: DirectoryOrCreate
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: code-queue-write-dev
  namespace: unidesk-dev
  labels:
    app.kubernetes.io/name: code-queue
    app.kubernetes.io/component: write
    app.kubernetes.io/part-of: unidesk
    app.kubernetes.io/instance: code-queue-write-dev
    unidesk.ai/environment: dev
    unidesk.ai/deployment-mode: k3sctl-managed
    unidesk.ai/deploy-service-id: code-queue
  annotations:
    unidesk.ai/deploy-ref: origin/master:deploy.json#environments.dev
    unidesk.ai/image-source: deploy-env-commit
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: code-queue
      app.kubernetes.io/component: write
      app.kubernetes.io/instance: code-queue-write-dev
      unidesk.ai/environment: dev
      unidesk.ai/deploy-service-id: code-queue
  template:
    metadata:
      labels:
        app.kubernetes.io/name: code-queue
        app.kubernetes.io/component: write
        app.kubernetes.io/part-of: unidesk
        app.kubernetes.io/instance: code-queue-write-dev
        unidesk.ai/environment: dev
        unidesk.ai/node-id: D601
        unidesk.ai/deploy-service-id: code-queue
    spec:
      nodeSelector:
        unidesk.ai/node-id: D601
      terminationGracePeriodSeconds: 20
      containers:
        - name: code-queue
          image: unidesk-code-queue:dev-placeholder
          imagePullPolicy: IfNotPresent
          ports:
            - name: http
              containerPort: 4222
          envFrom:
            - configMapRef:
                name: unidesk-dev-runtime-config
            - secretRef:
                name: unidesk-dev-runtime-secrets
          env:
            - name: HOST
              value: "0.0.0.0"
            - name: PORT
              value: "4222"
            - name: DATABASE_URL
              valueFrom:
                secretKeyRef:
                  name: unidesk-dev-runtime-secrets
                  key: DATABASE_URL
            - name: UNIDESK_DATABASE_NAME
              value: unidesk_dev
            - name: UNIDESK_DEPLOY_SERVICE_ID
              value: code-queue
            - name: UNIDESK_DEPLOY_REPO
              value: https://github.com/pikasTech/unidesk
            - name: UNIDESK_DEPLOY_COMMIT
              value: replace-with-deploy-env-commit
            - name: UNIDESK_DEPLOY_REQUESTED_COMMIT
              value: replace-with-deploy-env-commit
            - name: CODE_QUEUE_DEPLOY_COMMIT
              value: replace-with-deploy-env-commit
            - name: CODE_QUEUE_DEPLOY_REQUESTED_COMMIT
              value: replace-with-deploy-env-commit
            - name: CODE_QUEUE_INSTANCE_ID
              value: D601-dev-write
            - name: CODE_QUEUE_SERVICE_ROLE
              value: write
            - name: CODE_QUEUE_SCHEDULER_ENABLED
              value: "false"
            - name: CODE_QUEUE_DATABASE_POOL_MAX
              value: "2"
            - name: CODE_QUEUE_EGRESS_PROXY_ENABLED
              value: "false"
            - name: UNIDESK_SKILLS_PATH
              value: /root/.agents/skills
            - name: CODE_QUEUE_RUNNER_SKILLS_SOURCE_PATH
              value: /home/ubuntu/.agents/skills
            - name: CODE_QUEUE_NOTIFY_CLAUDEQQ_ENABLED
              value: "false"
            - name: CODE_QUEUE_CODEX_SQLITE_LOG_EXPORT_ENABLED
              value: "false"
            - name: NODE_OPTIONS
              value: --max-old-space-size=512
            - name: LOG_FILE
              value: /var/log/unidesk-dev/code-queue-write-dev.jsonl
          volumeMounts:
            - name: repo
              mountPath: /root/unidesk
              readOnly: true
            - name: skills-dir
              mountPath: /root/.agents/skills
              readOnly: true
            - name: logs
              mountPath: /var/log/unidesk-dev
            - name: state
              mountPath: /var/lib/unidesk-dev/code-queue
          readinessProbe:
            httpGet:
              path: /health
              port: http
            periodSeconds: 5
            timeoutSeconds: 3
            failureThreshold: 20
          livenessProbe:
            httpGet:
              path: /live
              port: http
            periodSeconds: 10
            timeoutSeconds: 3
            failureThreshold: 6
          startupProbe:
            httpGet:
              path: /live
              port: http
            periodSeconds: 5
            timeoutSeconds: 3
            failureThreshold: 60
          resources:
            requests:
              cpu: 80m
              memory: 192Mi
            limits:
              cpu: 250m
              memory: 768Mi
      volumes:
        - name: repo
          hostPath:
            path: /home/ubuntu/unidesk-dev-code-queue-deploy/code-queue
            type: Directory
        - name: skills-dir
          hostPath:
            path: /home/ubuntu/.agents/skills
            type: Directory
        - name: logs
          hostPath:
            path: /home/ubuntu/unidesk-dev-code-queue-deploy/state/logs
            type: DirectoryOrCreate
        - name: state
          hostPath:
            path: /home/ubuntu/unidesk-dev-code-queue-deploy/state/code-queue
            type: DirectoryOrCreate
