Created
February 29, 2024 17:05
-
-
Save skonto/188b2c45c5af449629caaa69a190392c to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
NC=128 | |
SC=128 | |
SIZE=32K # in `head` format | |
generate_namespace_secrets() { | |
local ns=$1 | |
for j in $(seq $SC) | |
do | |
encoded=$(head -c "$SIZE" /dev/urandom | base64 -w0) | |
cat <<EOF | |
--- | |
apiVersion: v1 | |
kind: Secret | |
metadata: | |
namespace: $ns | |
name: $ns-$j | |
data: | |
random.bin: $encoded | |
EOF | |
done | |
} | |
for i in $(seq $NC) | |
do | |
ns="test-random-secret$i" | |
oc create -f - <<EOF | |
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: $ns | |
EOF | |
generate_namespace_secrets "$ns" | oc create -f - | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment