Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions helm/fence/templates/fence-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,26 @@ spec:
args:
- "-c"
- |
echo "${FENCE_PUBLIC_CONFIG:-""}" > "/var/www/fence/fence-config-public.yaml"
python /var/www/fence/yaml_merge.py /var/www/fence/fence-config-public.yaml /var/www/fence/fence-config-secret.yaml > /var/www/fence/fence-config.yaml
if [[ -f /fence/keys/key/jwt_private_key.pem ]]; then
set -euo pipefail
echo "${FENCE_PUBLIC_CONFIG:-""}" > /var/www/fence/fence-config-public.yaml

if [[ -f /var/www/fence/yaml_merge.py ]]; then
python /var/www/fence/yaml_merge.py \
/var/www/fence/fence-config-public.yaml \
/var/run/fence-secrets/fence-config-secret.yaml \
> /var/www/fence/fence-config.yaml
else
# If yaml_merge.py doesn't exist, just use the secret config
cp /var/run/fence-secrets/fence-config-secret.yaml /var/www/fence/fence-config.yaml
fi

if [[ -f /var/run/fence-secrets/jwt_private_key.pem ]]; then
mkdir -p /fence/keys/key
cp /var/run/fence-secrets/jwt_private_key.pem /fence/keys/key/jwt_private_key.pem
chmod 600 /fence/keys/key/jwt_private_key.pem
openssl rsa -in /fence/keys/key/jwt_private_key.pem -pubout > /fence/keys/key/jwt_public_key.pem
fi

bash /fence/dockerrun.bash && if [[ -f /dockerrun.sh ]]; then bash /dockerrun.sh; fi
Comment thread
lbeckman314 marked this conversation as resolved.
env:
{{- if .Values.global.ddEnabled }}
Expand Down
21 changes: 18 additions & 3 deletions helm/fence/templates/presigned-url-fence.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,26 @@ spec:
args:
- "-c"
- |
echo "${FENCE_PUBLIC_CONFIG:-""}" > "/var/www/fence/fence-config-public.yaml"
python /var/www/fence/yaml_merge.py /var/www/fence/fence-config-public.yaml /var/www/fence/fence-config-secret.yaml > /var/www/fence/fence-config.yaml
if [[ -f /fence/keys/key/jwt_private_key.pem ]]; then
set -euo pipefail
echo "${FENCE_PUBLIC_CONFIG:-""}" > /var/www/fence/fence-config-public.yaml

if [[ -f /var/www/fence/yaml_merge.py ]]; then
python /var/www/fence/yaml_merge.py \
/var/www/fence/fence-config-public.yaml \
/var/run/fence-secrets/fence-config-secret.yaml \
> /var/www/fence/fence-config.yaml
else
# If yaml_merge.py doesn't exist, just use the secret config
cp /var/run/fence-secrets/fence-config-secret.yaml /var/www/fence/fence-config.yaml
fi

if [[ -f /var/run/fence-secrets/jwt_private_key.pem ]]; then
mkdir -p /fence/keys/key
cp /var/run/fence-secrets/jwt_private_key.pem /fence/keys/key/jwt_private_key.pem
chmod 600 /fence/keys/key/jwt_private_key.pem
openssl rsa -in /fence/keys/key/jwt_private_key.pem -pubout > /fence/keys/key/jwt_public_key.pem
fi
Comment thread
lbeckman314 marked this conversation as resolved.

bash /fence/dockerrun.bash && if [[ -f /dockerrun.sh ]]; then bash /dockerrun.sh; fi
env:
{{- toYaml .Values.env | nindent 12 }}
Expand Down
24 changes: 16 additions & 8 deletions helm/fence/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,14 @@ volumes:

# -- (list) Volumes to mount to the container.
volumeMounts:
- name: config-volume
readOnly: true
Comment thread
lbeckman314 marked this conversation as resolved.
mountPath: /var/run/fence-secrets/fence-config-secret.yaml
subPath: fence-config.yaml
- name: fence-jwt-keys
readOnly: true
mountPath: /var/run/fence-secrets/jwt_private_key.pem
subPath: jwt_private_key.pem
- name: "old-config-volume"
readOnly: true
mountPath: "/var/www/fence/local_settings.py"
Expand All @@ -405,10 +413,10 @@ volumeMounts:
readOnly: true
mountPath: "/fence/fence/static/privacy_policy.md"
subPath: "privacy_policy.md"
- name: "config-volume"
readOnly: true
mountPath: "/var/www/fence/fence-config.yaml"
subPath: fence-config.yaml
# - name: "config-volume"
# readOnly: true
# mountPath: "/var/www/fence/fence-config.yaml"
# subPath: fence-config.yaml
- name: "yaml-merge"
readOnly: true
mountPath: "/var/www/fence/yaml_merge.py"
Expand All @@ -421,10 +429,10 @@ volumeMounts:
readOnly: true
mountPath: "/var/www/fence/fence_google_storage_creds_secret.json"
subPath: fence_google_storage_creds_secret.json
- name: "fence-jwt-keys"
readOnly: true
mountPath: "/fence/keys/key/jwt_private_key.pem"
subPath: "jwt_private_key.pem"
# - name: "fence-jwt-keys"
# readOnly: true
# mountPath: "/fence/keys/key/jwt_private_key.pem"
# subPath: "jwt_private_key.pem"

# -- (list) Volumes to mount to the init container.
initVolumeMounts:
Expand Down
Loading