k8s native config mgmt
This commit is contained in:
27
bin/secret-push
Executable file
27
bin/secret-push
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$1" == "" ]; then
|
||||
echo 'usage: secret-push {config_name} [secret_name]'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CONFIG=$1
|
||||
shift
|
||||
|
||||
if [ "$1" != "" ]; then
|
||||
KEY=backend-$1
|
||||
else
|
||||
KEY=backend
|
||||
fi
|
||||
|
||||
FILE="conf/dexorder-$CONFIG.toml"
|
||||
|
||||
if [ ! -f "$FILE" ]; then
|
||||
FILE="conf/$CONFIG/dexorder-$CONFIG.toml"
|
||||
fi
|
||||
if [ ! -f "$FILE" ]; then
|
||||
echo Could not find config file for $1
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
kubectl create secret generic "$KEY" --from-file ".secret.toml=$FILE" --dry-run=client -o yaml | kubectl apply -f -
|
||||
Reference in New Issue
Block a user