dynamo-epp.yaml 5.3 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
{{- $eppImage     := required "extension.image is required - set via --set-string extension.image=$EPP_IMAGE or in values file" .Values.extension.image }}
25

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

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

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

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

91
        env:
92
        {{- if $useDynamo }}
93
94
95
96
97
98
99
100
101
102
103
104
105
          - 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 }}
106
107
          - name: ETCD_ENDPOINTS
            value: "{{ $platformName }}-etcd.{{ $platformNs }}:2379"
108
109
110
111
          {{- else }}
          - name: DYN_DISCOVERY_BACKEND
            value: "kubernetes"
          {{- end }}
112
113
          - name: NATS_SERVER
            value: "nats://{{ $platformName }}-nats.{{ $platformNs }}:4222"
114
          - name: DYN_NAMESPACE
115
            value: "{{ $ns }}"
116
          - name: DYN_KV_BLOCK_SIZE
117
            value: "{{ $kv }}"
118
119
          - name: USE_STREAMING
            value: "true"
120
121
122
123
124
125
126
127
          # 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
128
        {{- end }}
129
130
131
132
        {{- range .Values.epp.extraEnv }}
          - name: {{ .name }}
            value: {{ .value | quote }}
        {{- end }}
133
134
          - name: RUST_LOG
            value: "debug,dynamo_llm::kv_router=trace"
135

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

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