dynamo-epp.yaml 5.39 KB
Newer Older
1
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
3
4
5
6
7
8
9
10
11
12
13
14
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
15

16
17
18
19
{{- /* ------------ file-scope vars (no output) ------------ */ -}}
{{- $platformNs   := default .Release.Namespace .Values.platformNamespace -}}
{{- $platformName := default "dynamo-platform" .Values.platformReleaseName -}}
{{- $useDynamo    := default false .Values.epp.useDynamo -}}
20
21
{{- $resolvedDynNs := (include "dynamo-gaie.dynamoNamespace" .) | trim -}}
{{- $ns           := ternary (required "set dynamoGraphDeploymentName when epp.useDynamo=true" $resolvedDynNs) "" $useDynamo -}}
22
{{- $kv           := default "16" .Values.epp.dynamo.kvBlockSize -}}
23
{{- $useEtcd      := default false .Values.epp.dynamo.useEtcd -}}
24
25
26
{{- $std          := .Values.extension.standardImage -}}
{{- $dyn          := .Values.extension.dynamoImage -}}
{{- $fallback     := ternary $dyn $std .Values.epp.useDynamo -}}
27
{{- $eppImage     := default $fallback .Values.extension.image }}
28

29
30
---
# Deployment for the EPP (Endpoint Picker Plugin)
31
32
33
apiVersion: apps/v1
kind: Deployment
metadata:
34
35
  name: {{ .Values.model.shortName }}-epp
  namespace: {{ .Release.Namespace }}
36
  labels:
37
    app: {{ .Values.model.shortName }}-epp
38
39
40
41
spec:
  replicas: 1
  selector:
    matchLabels:
42
      app: {{ .Values.model.shortName }}-epp
43
44
45
  template:
    metadata:
      labels:
46
        app: {{ .Values.model.shortName }}-epp
47
48
    spec:
      terminationGracePeriodSeconds: 130
49
50
51
52
53
54
55
56

      {{- if .Values.imagePullSecrets }}
      imagePullSecrets:
      {{- range .Values.imagePullSecrets }}
        - name: {{ . | quote }}
      {{- end }}
      {{- end }}

57
58
      containers:
      - name: epp
59
        image: "{{ $eppImage }}"
60
        imagePullPolicy: {{ default "IfNotPresent" .Values.epp.imagePullPolicy }}
61
        args:
62
63
64
        {{- if .Values.epp.argsOverride }}
        {{- toYaml .Values.epp.argsOverride | nindent 8 }}
        {{- else }}
65
          - -pool-name
66
          - "{{ .Values.model.shortName }}-pool"
67
          - -pool-namespace
68
          - "{{ .Release.Namespace }}"
69
          - -pool-group
70
          - "inference.networking.k8s.io"
71
72
73
74
          - -v
          - "4"
          - --zap-encoder
          - "json"
75
          - -grpc-port
76
          - "9002"
77
          - -grpc-health-port
78
          - "9003"
79
          {{- if $useDynamo }}
80
          - -config-file
81
82
          - "{{ .Values.epp.configFile }}"
          {{- end }}
83
        {{- end }}
84

85
        volumeMounts:
86
87
88
          - name: hf-cache
            mountPath: /home/nonroot/.cache
        {{- if $useDynamo }}
89
90
91
          - name: epp-config
            mountPath: /etc/epp
            readOnly: true
92
        {{- end }}
93

94
        env:
95
        {{- if $useDynamo }}
96
97
98
99
100
101
102
103
104
105
106
107
108
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: POD_UID
            valueFrom:
              fieldRef:
                fieldPath: metadata.uid
          {{- if $useEtcd }}
109
110
          - name: ETCD_ENDPOINTS
            value: "{{ $platformName }}-etcd.{{ $platformNs }}:2379"
111
112
113
114
          {{- else }}
          - name: DYN_DISCOVERY_BACKEND
            value: "kubernetes"
          {{- end }}
115
116
          - name: NATS_SERVER
            value: "nats://{{ $platformName }}-nats.{{ $platformNs }}:4222"
117
          - name: DYNAMO_NAMESPACE
118
119
120
            value: "{{ $ns }}"
          - name: DYNAMO_KV_BLOCK_SIZE
            value: "{{ $kv }}"
121
122
          - name: USE_STREAMING
            value: "true"
123
124
125
126
127
128
129
130
          # HuggingFace token for downloading model config files
          # Without this, HuggingFace rate-limits requests (429 Too Many Requests)
          - name: HF_TOKEN
            valueFrom:
              secretKeyRef:
                name: hf-token-secret
                key: HF_TOKEN
                optional: true
131
        {{- end }}
132
133
134
135
        {{- range .Values.epp.extraEnv }}
          - name: {{ .name }}
            value: {{ .value | quote }}
        {{- end }}
136
137
          - name: RUST_LOG
            value: "debug,dynamo_llm::kv_router=trace"
138

139
        ports:
140
141
142
143
          - containerPort: 9002
          - containerPort: 9003
          - name: metrics
            containerPort: 9090
144
145
146
147
148
149
150
151
152
153
154
        livenessProbe:
          grpc:
            port: 9003
            service: inference-extension
          initialDelaySeconds: 5
          periodSeconds: 10
        readinessProbe:
          grpc:
            port: 9003
            service: inference-extension
          initialDelaySeconds: 5
155
156
          periodSeconds: 10

157
      volumes:
158
159
160
        - name: hf-cache
          emptyDir: {}
      {{- if $useDynamo }}
161
162
163
164
165
166
        - name: epp-config
          configMap:
            name: {{ include "dynamo-gaie.fullname" . }}-epp-config
            items:
              - key: epp-config-dynamo.yaml
                path: epp-config-dynamo.yaml
167
      {{- end }}