Skip to content

Commit 33951b9

Browse files
committed
add support for DO credentials
1 parent d259fdf commit 33951b9

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
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-08
6+
version: 0.0.2-pre-09
77
appVersion: "0.0"
88
dependencies:
99
- name: ingress-nginx

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

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,12 @@ spec:
312312
- name: cudo-config
313313
mountPath: /root/.config/cudo
314314
readOnly: true
315-
{{- end }}
315+
{{- end }}
316+
{{- if .Values.digitaloceanCredentials.enabled }}
317+
- name: digitalocean-config
318+
mountPath: /root/.config/doctl
319+
readOnly: true
320+
{{- end }}
316321
{{- if .Values.ociCredentials.enabled }}
317322
- name: oci-config
318323
mountPath: /root/.oci
@@ -530,6 +535,37 @@ spec:
530535
- name: cudo-config
531536
mountPath: /root/.config/cudo
532537
{{- end }}
538+
{{- if .Values.digitaloceanCredentials.enabled }}
539+
- name: create-digitalocean-credentials
540+
{{- with .Values.securityContext }}
541+
securityContext:
542+
{{- toYaml . | nindent 10 }}
543+
{{- end }}
544+
image: {{ .Values.apiService.image }}
545+
command: ["/bin/sh", "-c"]
546+
args:
547+
- |
548+
echo "Setting up DIGITALOCEAN credentials..."
549+
if [ -n "$DIGITALOCEAN_CREDENTIALS" ]; then
550+
echo "DIGITALOCEAN credentials found in environment variable."
551+
mkdir -p /.config/doctl
552+
cat > /.config/doctl/config.yaml <<EOF
553+
access-token: $DIGITALOCEAN_CREDENTIALS
554+
EOF
555+
else
556+
echo "DIGITALOCEAN credentials not found in environment variables. Skipping credentials setup."
557+
sleep 600
558+
fi
559+
env:
560+
- name: DIGITALOCEAN_CREDENTIALS
561+
valueFrom:
562+
secretKeyRef:
563+
name: {{ .Values.digitaloceanCredentials.digitaloceanSecretName }}
564+
key: config
565+
volumeMounts:
566+
- name: digitalocean-config
567+
mountPath: /.config/doctl
568+
{{- end }}
533569
{{- if .Values.ociCredentials.enabled }}
534570
- name: create-oci-credentials
535571
{{- with .Values.securityContext }}
@@ -663,6 +699,10 @@ spec:
663699
- name: cudo-config
664700
emptyDir: {}
665701
{{- end }}
702+
{{- if .Values.digitaloceanCredentials.enabled }}
703+
- name: digitalocean-config
704+
emptyDir: {}
705+
{{- end }}
666706
{{- if .Values.ociCredentials.enabled }}
667707
- name: oci-config
668708
emptyDir: {}

charts/stable/skypilot/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,12 @@ cudoCredentials:
474474
# Name of the secret containing the CUDO credentials. Only used if enabled is true.
475475
cudoSecretName: cudo-credentials
476476

477+
# Populate Digital Ocean credentials from the secret with key `api_key`
478+
digitaloceanCredentials:
479+
enabled: false
480+
# Name of the secret containing the CUDO credentials. Only used if enabled is true.
481+
digitaloceanSecretName: digitalocean-credentials
482+
477483
# Populate OCI credentials from the secret with key `api_key`
478484
ociCredentials:
479485
enabled: false

0 commit comments

Comments
 (0)