Skip to content

Commit 6122fdf

Browse files
committed
Retrieve NIM_ENDPOINT_API_KEY for Guardrail from k8s secret
Signed-off-by: Sheng Lin <shelin@nvidia.com>
1 parent 8e8c7df commit 6122fdf

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

api/apps/v1alpha1/nemo_guardrails_types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,17 @@ func (n *NemoGuardrail) GetStandardEnv() []corev1.EnvVar {
187187
Name: "DEMO",
188188
Value: "False",
189189
},
190+
{
191+
Name: "NIM_ENDPOINT_API_KEY",
192+
ValueFrom: &corev1.EnvVarSource{
193+
SecretKeyRef: &corev1.SecretKeySelector{
194+
Key: "nim-endpoint-api-key",
195+
LocalObjectReference: corev1.LocalObjectReference{
196+
Name: n.Spec.AuthSecret,
197+
},
198+
},
199+
},
200+
},
190201
}
191202

192203
return envVars

config/samples/apps_v1alpha1_nemoguardrails.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ spec:
1212
env:
1313
- name: NIM_ENDPOINT_URL
1414
value: "http://<NIM_SERVICE_ENDPOINT>:<NIM_SERVICE_PORT>/v1"
15-
- name: NIM_ENDPOINT_API_KEY
16-
value: dummy
1715
expose:
1816
ingress:
1917
spec: {}

0 commit comments

Comments
 (0)