Skip to content

Commit 17ae5f2

Browse files
committed
add oci support to skypilot helm chart
1 parent dbfd774 commit 17ae5f2

File tree

3 files changed

+57
-3
lines changed

3 files changed

+57
-3
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-05
6+
version: 0.0.2-pre-06
77
appVersion: "0.0"
88
dependencies:
99
- name: ingress-nginx

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

Lines changed: 50 additions & 2 deletions
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.ociCredentials.enabled }}
317+
- name: oci-config
318+
mountPath: /root/.oci
319+
readOnly: true
320+
{{- end }}
316321
{{- if .Values.lambdaCredentials.enabled }}
317322
- name: lambda-config
318323
mountPath: /root/.lambda_cloud
@@ -525,6 +530,45 @@ spec:
525530
- name: cudo-config
526531
mountPath: /root/.config/cudo
527532
{{- end }}
533+
{{- if .Values.ociCredentials.enabled }}
534+
- name: create-oci-credentials
535+
{{- with .Values.securityContext }}
536+
securityContext:
537+
{{- toYaml . | nindent 10 }}
538+
{{- end }}
539+
image: {{ .Values.apiService.image }}
540+
command: ["/bin/sh", "-c"]
541+
args:
542+
- |
543+
echo "Setting up OCI credentials..."
544+
if [ -n "$OCI_CREDENTIALS_CONFIG" && -n "$OCI_CREDENTIALS_KEY" ]; then
545+
echo "OCI credentials found in environment variable."
546+
mkdir -p /root/.oci
547+
cat > /root/.oci/config <<EOF
548+
$OCI_CREDENTIALS_CONFIG
549+
EOF
550+
cat > /root/.oci/oci_api_key.pem <<EOF
551+
$OCI_CREDENTIALS_KEY
552+
EOF
553+
else
554+
echo "OCI credentials not found in environment variables. Skipping credentials setup."
555+
sleep 600
556+
fi
557+
env:
558+
- name: OCI_CREDENTIALS_CONFIG
559+
valueFrom:
560+
secretKeyRef:
561+
name: {{ .Values.ociCredentials.ociSecretName }}
562+
key: config
563+
- name: OCI_CREDENTIALS_KEY
564+
valueFrom:
565+
secretKeyRef:
566+
name: {{ .Values.ociCredentials.cudoSecretName }}
567+
key: key
568+
volumeMounts:
569+
- name: oci-config
570+
mountPath: /root/.oci
571+
{{- end }}
528572
{{- if .Values.lambdaCredentials.enabled }}
529573
- name: create-lambda-credentials
530574
{{- with .Values.securityContext }}
@@ -618,7 +662,11 @@ spec:
618662
{{- if .Values.cudoCredentials.enabled }}
619663
- name: cudo-config
620664
emptyDir: {}
621-
{{- end }}
665+
{{- end }}
666+
{{- if .Values.ociCredentials.enabled }}
667+
- name: oci-config
668+
emptyDir: {}
669+
{{- end }}
622670
{{- if .Values.lambdaCredentials.enabled }}
623671
- name: lambda-config
624672
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 CUDO credentials from the secret with key `api_key`
478+
ociCredentials:
479+
enabled: false
480+
# Name of the secret containing the OCI credentials, with required keys "config" and "key". Only used if enabled is true.
481+
ociSecretName: oci-credentials
482+
477483
# Populate Lambda credentials from the secret with key `api_key`
478484
lambdaCredentials:
479485
enabled: false

0 commit comments

Comments
 (0)