Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

2.6 KB
Raw Blame
apiVersion: apps/v1
kind: Deployment
metadata:
  name: openlit
  namespace: openlit
  labels:
    app: openlit
spec:
  replicas: 1
  selector:
    matchLabels:
      app: openlit
  template:
    metadata:
      labels:
        app: openlit
    spec:
      containers:
        - name: openlit
          image: openlit:local
          imagePullPolicy: IfNotPresent
          env:
            - name: INIT_DB_HOST
              value: "clickhouse.openlit.svc.cluster.local"
            - name: INIT_DB_PORT
              value: "8123"
            - name: INIT_DB_DATABASE
              value: "openlit"
            - name: INIT_DB_USERNAME
              value: "default"
            - name: INIT_DB_PASSWORD
              value: "OPENLIT"
            - name: SQLITE_DATABASE_URL
              value: "file:/app/client/data/data.db"
            - name: PORT
              value: "3000"
            - name: DOCKER_PORT
              value: "3000"
            - name: HOSTNAME
              value: "0.0.0.0"
          ports:
            - containerPort: 3000
              name: http
            - containerPort: 4317
              name: otlp-grpc
            - containerPort: 4318
              name: otlp-http
          volumeMounts:
            - name: data
              mountPath: /app/client/data
          readinessProbe:
            exec:
              command:
                - node
                - -e
                - "const ui=process.env.DOCKER_PORT||process.env.PORT||3000;let raw=process.env.OTLP_HTTP_ADDR||'0.0.0.0:4318',host='127.0.0.1',port='4318';if(raw.startsWith('[')){const end=raw.indexOf(']');if(end>1&&raw[end+1]===':'){host=raw.slice(1,end);port=raw.slice(end+2)}}else{const i=raw.lastIndexOf(':');if(i>=0){host=raw.slice(0,i);port=raw.slice(i+1)}}if(host===''||host==='0.0.0.0'||host==='::')host='127.0.0.1';const h=host.includes(':')?'['+host+']':host;Promise.all([fetch('http://127.0.0.1:'+ui),fetch('http://'+h+':'+port+'/health')]).then(rs=>process.exit(rs.every(r=>r.ok)?0:1)).catch(()=>process.exit(1))"
            initialDelaySeconds: 30
            periodSeconds: 10
          resources:
            requests:
              cpu: 200m
              memory: 512Mi
            limits:
              cpu: "1"
              memory: 1Gi
      volumes:
        - name: data
          emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
  name: openlit
  namespace: openlit
spec:
  selector:
    app: openlit
  ports:
    - name: http
      port: 3000
      targetPort: 3000
    - name: otlp-grpc
      port: 4317
      targetPort: 4317
    - name: otlp-http
      port: 4318
      targetPort: 4318