Skip to content

Instantly share code, notes, and snippets.

@itsmunim
Created December 18, 2022 08:26
Show Gist options
  • Save itsmunim/152e4f29bc8d70d046a0d4dc348e2e2f to your computer and use it in GitHub Desktop.
Save itsmunim/152e4f29bc8d70d046a0d4dc348e2e2f to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: ConfigMap
metadata:
name: init-container-script
data:
init.sh: |-
#!/bin/sh
echo "Setting up the dependencies..."
# Setup secrethub cli
apk add --repository https://alpine.secrethub.io/alpine/edge/main --allow-untrusted secrethub-cli
# Pick up secrethub service account credential, already mounted by k8s
export SECRETHUB_CREDENTIAL=$(cat /bin/.secrethub-credential)
echo "Injecting secrets into env file..."
# Interpolate the non-interpolated secret values and then put the final file in expected place
secrethub inject -i /bin/secrets.env -o /data/secrets.env -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment