You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-2
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,12 @@ This is just a small program that can be used to create and approve a Client Sig
4
4
5
5
The code is heavily based on [this article](https://medium.com/@elfakharany/automate-kubernetes-user-creation-using-the-native-go-client-e2d20dcdc9de) with some modifications for new CSR API versions and things I needed for this example. Setting `expirationSeconds` will add that to the CSR. Kubernetes servers tend to have upper limits for how long they'll issue a certificate for (although these times vary wildly), and generally `600` is the lower bound for what you can set.
6
6
7
-
It connects to a cluster based on the current context in a provided Kubeconfig file. If no file is provided then $HOME/.kube/config is used.
7
+
It connects to a cluster based on the current Kubernetes context for the running user.
8
8
9
9
There are five command line parameters :-
10
10
11
11
*`--username` - The username for the certificate. (MANDATORY)
12
12
*`--group` - The group for the certificate. Defaults to none. (OPTIONAL)
13
-
*`--kubeconfig` - The kubeconfig to use to connect to the cluster. Default is `$HOME/.kube/config` (OPTIONAL)
14
13
*`--output-file` - Filename for the output kubeconfig file. Default is [username].config (OPTIONAL)
15
14
*`--expirationSeconds` - Number of seconds for the certificate to be valid. If not specified this will take the server's default setting. (OPTIONAL)
fmt.Printf("Certificate Successfully issued to username %s in group %s , signed by %s, valid until %s\n", issued_cert.Subject.CommonName, issued_group, issued_cert.Issuer.CommonName, issued_cert.NotAfter.String())
0 commit comments