Skip to content

Instantly share code, notes, and snippets.

Last active Jun 1, 2020
What would you like to do?
config, err := clientcmd.BuildConfigFromFlags("", kubeconfig)
clientset, err := kubernetes.NewForConfig(config)
check("The following error occured while loading the Kube Config file", err)
csr := &certificates.CertificateSigningRequest{
ObjectMeta: v1.ObjectMeta{
Name: "tempcsr",
Spec: certificates.CertificateSigningRequestSpec{
Groups: []string{
Request: pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE REQUEST", Bytes: bytes}),
_, err = clientset.CertificatesV1beta1().CertificateSigningRequests().Create(context.TODO(), csr, v1.CreateOptions{})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment