Skip to content

Instantly share code, notes, and snippets.

@dapi
Created December 10, 2024 12:38
Show Gist options
  • Save dapi/7ef92f64eb127f2692f00fb67ecb2d49 to your computer and use it in GitHub Desktop.
Save dapi/7ef92f64eb127f2692f00fb67ecb2d49 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
K8S_USER="${K8S_USER:-$USER}"
PRIVATE_KEY=${K8S_USER}.key
CSR=${K8S_USER}.csr
echo "Generate private key for ${K8S_USER}"
openssl genpkey -out ${PRIVATE_KEY} -algorithm Ed25519
openssl req -new -key ${PRIVATE_KEY} -out ${CSR} -subj "/CN=${K8S_USER},/O=safeblock.com"
echo "Done."
echo "You next steps are:"
echo "1. Save somewhere private key ${PRIVATE_KEY}"
echo "2. Send this CSR to your k8s admin:"
cat ${CSR}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment