Created
March 2, 2017 17:49
-
-
Save slashk/7ee7827b535d2cd14b3a61a1b1944850 to your computer and use it in GitHub Desktop.
k8s cluster token generator for kubeadm
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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
) | |
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" | |
func RandStringBytes(n int) string { | |
b := make([]byte, n) | |
for i := range b { | |
b[i] = letterBytes[rand.Intn(len(letterBytes))] | |
} | |
return string(b) | |
} | |
func main() { | |
fmt.Printf("%s.%s", RandStringBytes(6), RandStringBytes(16)) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment