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


---  # <-- start of actual YAML document
30
31
32
apiVersion: apps/v1
kind: Deployment
metadata:
33
34
  name: {{ .Values.model.shortName }}-epp
  namespace: {{ .Release.Namespace }}
35
  labels:
36
    app: {{ .Values.model.shortName }}-epp
37
38
39
40
spec:
  replicas: 1
  selector:
    matchLabels:
41
      app: {{ .Values.model.shortName }}-epp
42
43
44
  template:
    metadata:
      labels:
45
        app: {{ .Values.model.shortName }}-epp
46
47
    spec:
      terminationGracePeriodSeconds: 130
48
49
50
51
52
53
54
55

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

56
57
      containers:
      - name: epp
58
        image: "{{ $eppImage }}"
59
        imagePullPolicy: {{ default "IfNotPresent" .Values.epp.imagePullPolicy }}
60
        args:
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
        {{- if .Values.epp.argsOverride }}
        {{- toYaml .Values.epp.argsOverride | nindent 8 }}
        {{- else }}
          - -poolName
          - "{{ .Values.model.shortName }}-pool"
          - -poolNamespace
          - "{{ .Release.Namespace }}"
          - -v
          - "4"
          - --zap-encoder
          - "json"
          - -grpcPort
          - "9002"
          - -grpcHealthPort
          - "9003"
76
          {{- if $useDynamo }}
77
          - -configFile
78
79
          - "{{ .Values.epp.configFile }}"
          {{- end }}
80
        {{- end }}
81

82
        {{- if $useDynamo }}
83
        volumeMounts:
84
85
86
          - name: epp-config
            mountPath: /etc/epp
            readOnly: true
87
        {{- end }}
88

89
        env:
90
        {{- if $useDynamo }}
91
92
93
94
95
96
97
98
99
100
101
102
103
          - 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 }}
104
105
          - name: ETCD_ENDPOINTS
            value: "{{ $platformName }}-etcd.{{ $platformNs }}:2379"
106
107
108
109
          {{- else }}
          - name: DYN_DISCOVERY_BACKEND
            value: "kubernetes"
          {{- end }}
110
111
          - name: NATS_SERVER
            value: "nats://{{ $platformName }}-nats.{{ $platformNs }}:4222"
112
          - name: DYNAMO_NAMESPACE
113
114
115
            value: "{{ $ns }}"
          - name: DYNAMO_KV_BLOCK_SIZE
            value: "{{ $kv }}"
116
117
          - name: DYNAMO_ROUTER_REPLICA_SYNC
            value: "true"
118
119
          - name: USE_STREAMING
            value: "true"
120
        {{- end }}
121
122
123
124
        {{- range .Values.epp.extraEnv }}
          - name: {{ .name }}
            value: {{ .value | quote }}
        {{- end }}
125

126
        ports:
127
128
129
130
          - containerPort: 9002
          - containerPort: 9003
          - name: metrics
            containerPort: 9090
131
132
133
134
135
136
137
138
139
140
141
        livenessProbe:
          grpc:
            port: 9003
            service: inference-extension
          initialDelaySeconds: 5
          periodSeconds: 10
        readinessProbe:
          grpc:
            port: 9003
            service: inference-extension
          initialDelaySeconds: 5
142
143
          periodSeconds: 10

144
      {{- if $useDynamo }}
145
146
147
148
149
150
151
      volumes:
        - name: epp-config
          configMap:
            name: {{ include "dynamo-gaie.fullname" . }}-epp-config
            items:
              - key: epp-config-dynamo.yaml
                path: epp-config-dynamo.yaml
152
      {{- end }}