Skip to content

A desktop coding agent with free access to frontier models.

TypeScript
3.7 KB
Raw Blame
{{- include "omnirush-ee.customCa.validate" . }}
{{- if .Values.inference.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "omnirush-ee.inferenceServiceName" . }}
  labels:
    {{- include "omnirush-ee.componentLabels" (dict "root" . "component" "inference") | nindent 4 }}
  {{- with .Values.inference.service.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  type: {{ .Values.inference.service.type }}
  {{- with .Values.inference.service.loadBalancerClass }}
  loadBalancerClass: {{ . | quote }}
  {{- end }}
  {{- with .Values.inference.service.loadBalancerSourceRanges }}
  loadBalancerSourceRanges:
    {{- toYaml . | nindent 4 }}
  {{- end }}
  ports:
    - name: http
      port: {{ .Values.inference.service.port }}
      targetPort: http
  selector:
    {{- include "omnirush-ee.componentSelectorLabels" (dict "root" . "component" "inference") | nindent 4 }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "omnirush-ee.fullname" . }}-inference
  labels:
    {{- include "omnirush-ee.componentLabels" (dict "root" . "component" "inference") | nindent 4 }}
spec:
  replicas: {{ .Values.inference.replicaCount }}
  selector:
    matchLabels:
      {{- include "omnirush-ee.componentSelectorLabels" (dict "root" . "component" "inference") | nindent 6 }}
  template:
    metadata:
      labels:
        {{- include "omnirush-ee.componentSelectorLabels" (dict "root" . "component" "inference") | nindent 8 }}
        {{- with .Values.inference.podLabels }}
        {{- toYaml . | nindent 8 }}
        {{- end }}
      annotations:
        checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
        checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
        {{- with .Values.inference.podAnnotations }}
        {{- toYaml . | nindent 8 }}
        {{- end }}
    spec:
      {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- if .Values.customCa.enabled }}
      volumes:
        {{- include "omnirush-ee.customCa.volume" . | nindent 8 }}
      {{- end }}
      containers:
        - name: inference
          image: "{{ .Values.inference.image.repository }}:{{ default .Values.image.tag .Values.inference.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          ports:
            - name: http
              containerPort: {{ .Values.inference.containerPort }}
          {{- if .Values.customCa.enabled }}
          volumeMounts:
            {{- include "omnirush-ee.customCa.volumeMount" . | nindent 12 }}
          {{- end }}
          envFrom:
            - configMapRef:
                name: {{ include "omnirush-ee.configName" . }}
            - secretRef:
                name: {{ include "omnirush-ee.secretName" . }}
          env:
            - name: PORT
              value: {{ .Values.inference.containerPort | quote }}
            {{- if .Values.customCa.enabled }}
            {{- include "omnirush-ee.customCa.env" . | nindent 12 }}
            {{- end }}
            {{- range $key, $value := .Values.inference.env }}
            - name: {{ $key }}
              value: {{ $value | quote }}
            {{- end }}
          livenessProbe:
            httpGet:
              path: /health
              port: http
            {{- toYaml .Values.inference.probes.liveness | nindent 12 }}
          readinessProbe:
            httpGet:
              path: /ready
              port: http
            {{- toYaml .Values.inference.probes.readiness | nindent 12 }}
          {{- with .Values.inference.resources }}
          resources:
            {{- toYaml . | nindent 12 }}
          {{- end }}
{{- end }}