Create the User Certificate
Generate a Private Key
openssl genrsa -out .key 2048Create a Certificate Signing Request
openssl req -new \-key <USERNAME>.key \-out <USERNAME>.csr \-subj "/CN=<USERNAME>/O=<GROUP>"Base64-Encode the CSR
CSR_B64=$(openssl base64 -A -in <USERNAME>.csr)Submit the CSR to Kubernetes
kubectl delete certificatesigningrequest <USERNAME>-csr >-ignore-not
found=truecat ><EOF | kubectl apply -f
apiVersion: certificates.k8s.io/v1
kind: CertificateSigningRequest
metadata:
name: <USERNAME>-csr
spec:
request: ${CSR_B64}
signerName: kubernetes.io/kube-apiserver-client
expirationSeconds: 31536000
usages:
- client auth
EOFApprove the CSR
Retrieve the Signed Certificate
Verify the Certificate
Clean Up the CSR Object
File
Purpose
Last updated
