Skip to content

Commit 8dfea6f

Browse files
committed
add option for paperspace credentials
Signed-off-by: David Young <[email protected]>
1 parent ef1fa4e commit 8dfea6f

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

charts/stable/skypilot/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: skypilot
33
description: A Helm chart for deploying SkyPilot API server on Kubernetes
44
icon: "https://raw.githubusercontent.com/skypilot-org/skypilot/master/charts/skypilot/skypilot.svg"
55
type: application
6-
version: 0.0.2-pre-03
6+
version: 0.0.2-pre-04
77
appVersion: "0.0"
88
dependencies:
99
- name: ingress-nginx

charts/stable/skypilot/templates/api-deployment.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ spec:
303303
mountPath: /root/.runpod
304304
readOnly: true
305305
{{- end }}
306+
{{- if .Values.paperspaceCredentials.enabled }}
307+
- name: paperspace-config
308+
mountPath: /root/.paperspace
309+
readOnly: true
310+
{{- end }}
306311
{{- if .Values.cudoCredentials.enabled }}
307312
- name: cudo-config
308313
mountPath: /root/.config/cudo
@@ -460,6 +465,35 @@ spec:
460465
- name: runpod-config
461466
mountPath: /root/.runpod
462467
{{- end }}
468+
{{- if .Values.paperspaceCredentials.enabled }}
469+
- name: create-paperspace-credentials
470+
{{- with .Values.securityContext }}
471+
securityContext:
472+
{{- toYaml . | nindent 10 }}
473+
{{- end }}
474+
image: {{ .Values.apiService.image }}
475+
command: ["/bin/sh", "-c"]
476+
args:
477+
- |
478+
echo "Setting up Paperspace credentials..."
479+
if [ -n "$PAPERSPACE_API_KEY" ]; then
480+
echo "Paperspace credentials found in environment variable."
481+
mkdir -p /root/.paperspace
482+
echo "{\"apiKey\":\"$PAPERSPACE_API_KEY\"}" > /root/.paperspace/config.json
483+
else
484+
echo "Paperspace credentials not found in environment variables. Skipping credentials setup."
485+
sleep 600
486+
fi
487+
env:
488+
- name: PAPERSPACE_API_KEY
489+
valueFrom:
490+
secretKeyRef:
491+
name: {{ .Values.paperspaceCredentials.paperspaceSecretName }}
492+
key: api_key
493+
volumeMounts:
494+
- name: paperspace-config
495+
mountPath: /root/.paperspace
496+
{{- end }}
463497
{{- if .Values.cudoCredentials.enabled }}
464498
- name: create-cudo-credentials
465499
{{- with .Values.securityContext }}
@@ -577,6 +611,10 @@ spec:
577611
- name: runpod-config
578612
emptyDir: {}
579613
{{- end }}
614+
{{- if .Values.paperspaceCredentials.enabled }}
615+
- name: paperspace-config
616+
emptyDir: {}
617+
{{- end }}
580618
{{- if .Values.cudoCredentials.enabled }}
581619
- name: cudo-config
582620
emptyDir: {}

charts/stable/skypilot/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,12 @@ runpodCredentials:
460460
# Name of the secret containing the RunPod credentials. Only used if enabled is true.
461461
runpodSecretName: runpod-credentials
462462

463+
# Populate RunPod credentials from the secret with key `api_key`
464+
paperspaceCredentials:
465+
enabled: false
466+
# Name of the secret containing the RunPod credentials. Only used if enabled is true.
467+
paperspaceSecretName: paperspace-credentials
468+
463469
# Populate CUDO credentials from the secret with key `api_key`
464470
cudoCredentials:
465471
enabled: false

0 commit comments

Comments
 (0)