Skip to content

Commit

Permalink
fix: load secrets in data-sync cron containers (#3165)
Browse files Browse the repository at this point in the history
fix: load secrets in data-sync cron containers
  • Loading branch information
artsy-peril[bot] authored Dec 11, 2024
2 parents 9bd507c + c24000e commit 5ba5c15
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
25 changes: 25 additions & 0 deletions hokusai/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ spec:
- name: secrets
mountPath: /secrets
readOnly: true
- name: scripts
mountPath: /usr/local/bin/load_secrets_and_run.sh
subPath: load_secrets_and_run.sh
command: ["/usr/local/bin/load_secrets_and_run.sh"]
args:
- sh
- ./export-db.sh
Expand All @@ -323,6 +327,27 @@ spec:
volumes:
- name: secrets
emptyDir: {}
- name: scripts
configMap:
name: positron-scripts
defaultMode: 0755
---
apiVersion: v1
kind: ConfigMap
metadata:
name: positron-scripts
namespace: default
data:
load_secrets_and_run.sh: |
#!/bin/bash
CMD="$@"
if [ ! -z "$SECRETS_FILE" ]
then
echo "SECRETS_FILE env var is defined. Sourcing secrets file..."
source "$SECRETS_FILE"
fi
echo "Running command: $CMD"
$CMD
---
apiVersion: v1
kind: Service
Expand Down
25 changes: 25 additions & 0 deletions hokusai/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ spec:
- name: secrets
mountPath: /secrets
readOnly: true
- name: scripts
mountPath: /usr/local/bin/load_secrets_and_run.sh
subPath: load_secrets_and_run.sh
command: ["/usr/local/bin/load_secrets_and_run.sh"]
args:
- sh
- ./import-db.sh
Expand All @@ -324,6 +328,27 @@ spec:
volumes:
- name: secrets
emptyDir: {}
- name: scripts
configMap:
name: positron-scripts
defaultMode: 0755
---
apiVersion: v1
kind: ConfigMap
metadata:
name: positron-scripts
namespace: default
data:
load_secrets_and_run.sh: |
#!/bin/bash
CMD="$@"
if [ ! -z "$SECRETS_FILE" ]
then
echo "SECRETS_FILE env var is defined. Sourcing secrets file..."
source "$SECRETS_FILE"
fi
echo "Running command: $CMD"
$CMD
---
apiVersion: v1
kind: Service
Expand Down

0 comments on commit 5ba5c15

Please sign in to comment.