|
| 1 | +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +{{- if eq .Values.deploymentType "grove" }} |
| 16 | +--- |
| 17 | +apiVersion: grove.io/v1alpha1 |
| 18 | +kind: PodGangSet |
| 19 | +metadata: |
| 20 | + name: {{ $.Release.Name }} |
| 21 | + labels: |
| 22 | + app: {{ $.Release.Name }} |
| 23 | +spec: |
| 24 | + replicas: 1 |
| 25 | + template: |
| 26 | + cliques: |
| 27 | + {{- range $serviceName, $serviceSpec := .Values.spec.services }} |
| 28 | + - name: {{ $serviceName | lower }} |
| 29 | + spec: |
| 30 | + roleName: {{ $serviceName | lower }} |
| 31 | + replicas: {{ $serviceSpec.replicas }} |
| 32 | + podSpec: |
| 33 | + {{- if $.Values.imagePullSecrets }} |
| 34 | + imagePullSecrets: |
| 35 | + {{ $.Values.imagePullSecrets | toYaml | nindent 12 }} |
| 36 | + {{- end }} |
| 37 | + containers: |
| 38 | + - name: main |
| 39 | + image: {{ $serviceSpec.extraPodSpec.mainContainer.image }} |
| 40 | + {{- if $serviceSpec.resources }} |
| 41 | + resources: |
| 42 | + requests: |
| 43 | + {{- if $serviceSpec.resources.cpu }} |
| 44 | + cpu: "{{ $serviceSpec.resources.cpu }}" |
| 45 | + {{- end }} |
| 46 | + {{- if $serviceSpec.resources.memory }} |
| 47 | + memory: "{{ $serviceSpec.resources.memory }}" |
| 48 | + {{- end }} |
| 49 | + {{- if $serviceSpec.resources.gpu }} |
| 50 | + nvidia.com/gpu: "{{ $serviceSpec.resources.gpu }}" |
| 51 | + {{- end }} |
| 52 | + limits: |
| 53 | + {{- if $serviceSpec.resources.cpu }} |
| 54 | + cpu: "{{ $serviceSpec.resources.cpu }}" |
| 55 | + {{- end }} |
| 56 | + {{- if $serviceSpec.resources.memory }} |
| 57 | + memory: "{{ $serviceSpec.resources.memory }}" |
| 58 | + {{- end }} |
| 59 | + {{- if $serviceSpec.resources.gpu }} |
| 60 | + nvidia.com/gpu: "{{ $serviceSpec.resources.gpu }}" |
| 61 | + {{- end }} |
| 62 | + {{- end }} |
| 63 | + workingDir: {{ $serviceSpec.extraPodSpec.mainContainer.workingDir }} |
| 64 | + {{- if $serviceSpec.extraPodSpec.mainContainer.command }} |
| 65 | + command: |
| 66 | + {{- $serviceSpec.extraPodSpec.mainContainer.command | toYaml | nindent 14 }} |
| 67 | + {{- end }} |
| 68 | + {{- if $serviceSpec.extraPodSpec.mainContainer.args }} |
| 69 | + args: |
| 70 | + {{- $serviceSpec.extraPodSpec.mainContainer.args | toYaml | nindent 14 }} |
| 71 | + {{- end }} |
| 72 | + env: |
| 73 | + - name: DYNAMO_PORT |
| 74 | + value: "{{ $.Values.dynamoPort | default 8000 }}" |
| 75 | + {{- if $.Values.etcdAddr }} |
| 76 | + - name: ETCD_ENDPOINTS |
| 77 | + value: "{{ $.Values.etcdAddr }}" |
| 78 | + {{- end }} |
| 79 | + {{- if $.Values.natsAddr }} |
| 80 | + - name: NATS_SERVER |
| 81 | + value: "{{ $.Values.natsAddr }}" |
| 82 | + {{- end }} |
| 83 | + {{- if $serviceSpec.envFromSecret }} |
| 84 | + envFrom: |
| 85 | + - secretRef: |
| 86 | + name: {{ $serviceSpec.envFromSecret }} |
| 87 | + {{- end }} |
| 88 | + ports: |
| 89 | + - name: health |
| 90 | + containerPort: {{ $.Values.healthPort | default 5000 }} |
| 91 | + livenessProbe: |
| 92 | + {{- if $serviceSpec.livenessProbe }} |
| 93 | + {{ $serviceSpec.livenessProbe | toYaml | nindent 14 }} |
| 94 | + {{- else }} |
| 95 | + initialDelaySeconds: 60 |
| 96 | + periodSeconds: 60 |
| 97 | + timeoutSeconds: 5 |
| 98 | + failureThreshold: 10 |
| 99 | + successThreshold: 1 |
| 100 | + httpGet: |
| 101 | + path: /healthz |
| 102 | + port: health |
| 103 | + scheme: HTTP |
| 104 | + {{- end }} |
| 105 | + readinessProbe: |
| 106 | + {{- if $serviceSpec.readinessProbe }} |
| 107 | + {{ $serviceSpec.readinessProbe | toYaml | nindent 14 }} |
| 108 | + {{- else }} |
| 109 | + initialDelaySeconds: 60 |
| 110 | + periodSeconds: 60 |
| 111 | + timeoutSeconds: 5 |
| 112 | + failureThreshold: 10 |
| 113 | + successThreshold: 1 |
| 114 | + httpGet: |
| 115 | + path: /readyz |
| 116 | + port: health |
| 117 | + scheme: HTTP |
| 118 | + {{- end }} |
| 119 | + {{- end }} |
| 120 | +{{- end }} |
0 commit comments