about summary refs log tree commit diff
path: root/scripts/create-secret
blob: d9aa92962b5cf72160bc5ab6a07c32ae2d38a14b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

set -e

function createSecret() {
  local secretName=$1
  local secretKey=$2
  local secretValue=$3

  kubectl create secret generic $secretName --from-literal=$secretKey=$secretValue
}

function help() {
  echo "Usage: create-secret <secret name> <secret key> <secret value>"
}

case "$#" in
  3)
    createSecret $1 $2 $3
    ;;
  *)
    help
    ;;
esac