-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
CLUSTER_NAME="kvs-test" | ||
|
||
# Check if kind & kubectl are installed | ||
which kind &>/dev/null || { echo "failed to find 'kind' binary, please install it" && exit 1; } | ||
which kubectl &>/dev/null || { echo "failed to find 'kubectl' binary, please install it" && exit 1; } | ||
|
||
# Ensure the cluster exists | ||
[[ $(kind get clusters) == *$CLUSTER_NAME* ]] || kind create cluster --name $CLUSTER_NAME | ||
|
||
# Set context in case there are mulitple | ||
kubectl config set-context kind-${CLUSTER_NAME} | ||
|
||
# Seed test secrets | ||
|
||
## secret 'test' in namespace 'default' (multiple keys) | ||
kubectl apply -f - <<EOF | ||
apiVersion: v1 | ||
data: | ||
key1: dmFsdWUxCg== | ||
key2: dmFsdWUyCg== | ||
kind: Secret | ||
metadata: | ||
name: test | ||
namespace: default | ||
type: Opaque | ||
EOF | ||
|
||
## secret 'test2' in namespace 'default' (single key) | ||
kubectl apply -f - <<EOF | ||
apiVersion: v1 | ||
data: | ||
key1: dmFsdWUx | ||
kind: Secret | ||
metadata: | ||
name: test2 | ||
namespace: default | ||
type: Opaque | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters