Skip to content
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

Use yq for initscript #61

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 7 additions & 3 deletions charts/matrix-authentication-service/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,21 @@ spec:
mountPath: /data

- name: add-secret-values-to-config
image: debian:bookworm-slim
image: mikefarah/yq:4
imagePullPolicy: IfNotPresent
command:
- /bin/bash
- -exc
- /bin/sh
- '-exc'
- /scripts/templateconfig.sh
volumeMounts:
- name: templating-script
mountPath: /scripts
- name: config
mountPath: /data
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: MATRIX_SECRET
valueFrom:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@ data:
GREEN='\033[1;32m'
NC='\033[0m'

# install stuff
echo -e "\n\n ------------INSTALL STUFF-------------- \n\n"

apt-get update
echo -e "${BLUE}installing curl:${NC} ${GREEN}apt-get install curl${NC}"
apt-get install -y curl

echo -e "${BLUE}installing yq...${NC}"
YQ_URL="https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64"
curl -L "${YQ_URL}" -o /usr/bin/yq && \
chmod +x /usr/bin/yq

echo -e "\n\n ------------END INSTALL STUFF-------------- \n\n"

# templates out the secrets object section of the config.yaml
export SECRETS=`yq '.secrets' /data/config-secrets.yaml`
export EXISTING_SECRET=`cat /data/config.yaml | yq .secrets`
Expand Down
Loading