-
Notifications
You must be signed in to change notification settings - Fork 23
chore: Add s3 custom CA airgapped support #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
6971cea
3927af9
dd11e05
ce3782d
ce372cb
8a7679e
fed4085
d36af6f
52d6139
d9d7fc6
b7164c0
64d4c78
0a884e3
a31934c
5d598db
ee44a31
7a9fb30
4a72ffb
701a46e
640329b
3c8aabe
3b2c051
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,64 @@ spec: | |
| annotations: | ||
| timestamp: {{ now | quote }} | ||
| spec: | ||
| volumes: | ||
| {{- if and .Values.airgapped.enabled .Values.airgapped.s3SecretName }} | ||
| - name: s3-custom-ca | ||
| secret: | ||
| secretName: {{ .Values.airgapped.s3SecretName }} | ||
| items: | ||
| - key: {{ (.Values.airgapped.s3CrtFileLocation | default "/s3-custom-ca/s3-custom-ca.crt") | base }} | ||
| path: {{ (.Values.airgapped.s3CrtFileLocation | default "/s3-custom-ca/s3-custom-ca.crt") | base }} | ||
| {{- end }} | ||
| - name: ca-certificates | ||
| emptyDir: {} | ||
| initContainers: | ||
| - name: install-ca-certs | ||
| image: ubuntu:22.04 | ||
| command: | ||
| - /bin/bash | ||
| - -c | ||
| - | | ||
| set -e | ||
| echo "Installing custom CA certificates..." | ||
|
|
||
| # Install ca-certificates package and create directories | ||
| apt-get update && apt-get install -y ca-certificates | ||
| mkdir -p /shared-certs | ||
|
|
||
| # Copy existing system CA certificates to shared directory | ||
| if [ -d /etc/ssl/certs ]; then | ||
| cp -r /etc/ssl/certs/* /shared-certs/ 2>/dev/null || true | ||
| fi | ||
|
|
||
| # Ensure ca-certificates directory exists | ||
| mkdir -p /usr/local/share/ca-certificates | ||
|
|
||
| # Install custom S3 CA if available | ||
| {{- if and .Values.airgapped.enabled .Values.airgapped.s3SecretName }} | ||
| S3_CERT_FILE="{{ (.Values.airgapped.s3CrtFileLocation | default "s3-custom-ca.crt") | base }}" | ||
| if [ -f "/s3-custom-ca/$S3_CERT_FILE" ]; then | ||
| echo "Installing S3 custom CA certificate..." | ||
| cp "/s3-custom-ca/$S3_CERT_FILE" /usr/local/share/ca-certificates/s3-custom-ca.crt | ||
| cp "/s3-custom-ca/$S3_CERT_FILE" /shared-certs/s3-custom-ca.crt | ||
| fi | ||
| {{- end }} | ||
|
|
||
| # Update CA certificates | ||
| update-ca-certificates | ||
|
|
||
| # Copy updated system certificates to shared volume | ||
| cp -r /etc/ssl/certs/* /shared-certs/ 2>/dev/null || true | ||
|
|
||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| echo "CA certificates installed successfully" | ||
| volumeMounts: | ||
| {{- if and .Values.airgapped.enabled .Values.airgapped.s3SecretName }} | ||
| - name: s3-custom-ca | ||
| mountPath: /s3-custom-ca | ||
| readOnly: true | ||
| {{- end }} | ||
| - name: ca-certificates | ||
| mountPath: /shared-certs | ||
| containers: | ||
| - name: {{ .Release.Name }}-api | ||
| imagePullPolicy: {{ .Values.services.api.pullPolicy | default "Always" }} | ||
|
|
@@ -52,6 +110,21 @@ spec: | |
| limits: | ||
| memory: {{ .Values.services.api.memoryLimit | default "1000Mi" | quote }} | ||
| cpu: {{ .Values.services.api.cpuLimit | default "500m" | quote}} | ||
| volumeMounts: | ||
| - name: ca-certificates | ||
| mountPath: /etc/ssl/certs | ||
| readOnly: true | ||
| {{- if and .Values.airgapped.enabled .Values.airgapped.s3SecretName }} | ||
|
||
| env: | ||
| - name: SSL_CERT_FILE | ||
| value: "/etc/ssl/certs/ca-certificates.crt" | ||
| - name: SSL_CERT_DIR | ||
| value: "/etc/ssl/certs" | ||
| - name: REQUESTS_CA_BUNDLE | ||
| value: "/etc/ssl/certs/ca-certificates.crt" | ||
| - name: CURL_CA_BUNDLE | ||
| value: "/etc/ssl/certs/ca-certificates.crt" | ||
| {{- end }} | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| command: | ||
| - ./bin/docker-entrypoint-api-ee.sh | ||
| envFrom: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.