Skip to content

Instantly share code, notes, and snippets.

@niusmallnan
Created May 11, 2023 08:46
Show Gist options
  • Save niusmallnan/6f10849a22eafb536a7e3b9dfe9fdb17 to your computer and use it in GitHub Desktop.
Save niusmallnan/6f10849a22eafb536a7e3b9dfe9fdb17 to your computer and use it in GitHub Desktop.
#!/bin/bash
NS=test
NUM=2000
n=1
while [ $n -le $NUM ]; do
kubectl create serviceaccount test$n -n $NS
kubectl create -f - <<EOF
apiVersion: v1
kind: Secret
type: kubernetes.io/service-account-token
metadata:
name: test$n
namespace: test
annotations:
kubernetes.io/service-account.name: test$n
EOF
let n++
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment