@@ -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 : {}
0 commit comments