Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript
5.5 KB
Raw Blame
apiVersion: v1
kind: ServiceAccount
metadata:
  name: control-api
  namespace: control-plane
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: control-api
  namespace: control-plane
  labels:
    app: control-api
spec:
  replicas: 1
  # Control API writes the SDK policy/attempt ledger. Recreate prevents an old
  # and a new writer from serving concurrently during an image or config
  # rollout; schema-first pre-gate sync also fences replicas before migrations.
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: control-api
  template:
    metadata:
      labels:
        app: control-api
    spec:
      serviceAccountName: control-api
      securityContext:
        seccompProfile:
          type: RuntimeDefault
      containers:
      - name: control-api
        image: clerum/control-api:0.9.5
        imagePullPolicy: Always
        ports:
        - containerPort: 8090
          name: http
          protocol: TCP
        env:
        - name: CONTROL_API_SESSION_JWT_PRIVATE_KEY
          valueFrom:
            secretKeyRef:
              name: control-api-secrets
              key: CONTROL_API_SESSION_JWT_PRIVATE_KEY
        - name: CONTROL_API_RPC_JWT_PRIVATE_KEY
          valueFrom:
            secretKeyRef:
              name: control-api-secrets
              key: CONTROL_API_RPC_JWT_PRIVATE_KEY
        - name: CONTROL_API_ADMIN_JWT_PRIVATE_KEY
          valueFrom:
            secretKeyRef:
              name: control-api-secrets
              key: CONTROL_API_ADMIN_JWT_PRIVATE_KEY
        - name: CONTROL_API_ADMIN_BOOTSTRAP_PASSWORD_HASH
          valueFrom:
            secretKeyRef:
              name: control-api-secrets
              key: CONTROL_API_ADMIN_BOOTSTRAP_PASSWORD_HASH
        - name: CONTROL_API_OAUTH_STATE_HMAC_SECRET
          valueFrom:
            secretKeyRef:
              name: control-api-secrets
              key: CONTROL_API_OAUTH_STATE_HMAC_SECRET
        - name: CONTROL_API_OAUTH_ENCRYPTION_KEY
          valueFrom:
            secretKeyRef:
              name: control-api-secrets
              key: CONTROL_API_OAUTH_ENCRYPTION_KEY
        - name: TRACING_APPROVAL_PROMPT_HISTORY_ENCRYPTION_KEY
          valueFrom:
            secretKeyRef:
              name: control-api-secrets
              key: TRACING_APPROVAL_PROMPT_HISTORY_ENCRYPTION_KEY
              optional: true
        - name: CONTROL_API_ALLOWED_ISSUANCE_NAMESPACES
          value: "mcp-host,sandbox-recipes"
        - name: CONTROL_API_REMOTE_MCP_EGRESS_PROXY_IMAGE
          value: clerum/nginx-egress-proxy:0.1.0
        # control-api→gfsc proxy fetch timeout (ms). Homologous with the browser
        # client and the control-ui server proxy (all 300s). Raise all three
        # together or none. Guards large GFS uploads from a premature cut.
        - name: CONTROL_API_GFSC_PROXY_TIMEOUT_MS
          value: "300000"
        - name: CONTROL_API_PG_CONNECTION_STRING
          valueFrom:
            secretKeyRef:
              name: control-api-postgres-runtime
              key: connection-string
        envFrom:
        - configMapRef:
            name: control-api-config
        # Inter-service tokens live in a Secret populated out-of-band by
        # `deploy/scripts/apply-inter-service-tokens.sh` (via kubectl patch,
        # which writes outside the last-applied-configuration envelope so
        # `kubectl apply -k` does NOT wipe them on every CI redeploy).
        # Keys projected: CONTROL_API_INTERNAL_SERVICE_TOKENS, CONTROL_API_INTERNAL_TOKENS.
        - secretRef:
            name: control-api-internal-tokens
        # HS256 secrets for WRC/HCC InternalControl JWT verification.
        - secretRef:
            name: internal-control-jwt-secrets
        livenessProbe:
          httpGet:
            path: /health
            port: http
            scheme: HTTP
          initialDelaySeconds: 8
          periodSeconds: 12
          failureThreshold: 3
          successThreshold: 1
          timeoutSeconds: 1
        readinessProbe:
          httpGet:
            path: /health
            port: http
            scheme: HTTP
          initialDelaySeconds: 4
          periodSeconds: 8
          failureThreshold: 3
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          limits:
            cpu: 300m
            # Legacy GFS mutations arrive base64-in-JSON and are fully buffered.
            # v2 part PUTs bypass this parser and stream one bounded part at a time.
            # Keep the existing 768Mi legacy headroom; do not treat it as a reason
            # to raise any JSON cap for the 200 MiB product boundary. EVERY overlay
            # must keep >=768Mi for the legacy path:
            #   - deploy/overlays/minikube/patches/resource-limits.yaml (in this repo)
            #   - keyper-labs/evenfire-infra gcp-dev/gcp-prod patches/resource-limits.yaml
            #     (private infra repo; both pin 768Mi as of 2026-09-24).
            memory: 768Mi
          requests:
            cpu: 50m
            memory: 128Mi
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
            - ALL
          readOnlyRootFilesystem: true
          runAsNonRoot: true
          runAsUser: 10001
          runAsGroup: 10001
          seccompProfile:
            type: RuntimeDefault
---
apiVersion: v1
kind: Service
metadata:
  name: control-api
  namespace: control-plane
  labels:
    app: control-api
spec:
  type: ClusterIP
  selector:
    app: control-api
  ports:
  - name: http
    port: 8090
    targetPort: http
    protocol: TCP