about summary refs log tree commit diff
path: root/nginx/replace-config
blob: 2542a2c683e3df63dcbc2bb9fb8a7028641e6c14 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
set -ueo pipefail

readonly main_conf=$(cat conf/main.conf | base64 -w0)
readonly http_conf=$(cat conf/http.conf | base64 -w0)
readonly stream_conf=$(cat conf/stream.conf | base64 -w0)

echo "Replacing nginx configuration ..."
kubectl replace --force -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
  name: nginx-config
data:
  main.conf: ${main_conf}
  http.conf: ${http_conf}
  stream.conf: ${stream_conf}
EOF