Skip to content

Latest commit

 

History

History
50 lines (39 loc) · 895 Bytes

27.CertificatesAPI.md

File metadata and controls

50 lines (39 loc) · 895 Bytes
Add Admin User

akshay.csr
akshay.key

[CertificateSigningRequest]
https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/
https://kubernetes.io/docs/tasks/tls/managing-tls-in-a-cluster/
akshay.csr | base64

cat <<EOF >>test.yaml
apiVersion: certificates.k8s.io/v1beta1
kind: CertificateSigningRequest
metadata:
  name: akshay
spec:
  groups:
  - system:authemticated
  request: $(cat akshay.csr | base64 | tr -d '\n')
  usages:
  - digital signature
  - key encipherment
  - server auth
EOF


kubectl get csr


kubectl certificate --help
kubectl certificate approve akshay

kubectl get csr {csr} -o yaml
spec:
  groups:
  - system:masters
  - system:authenticated
  usages:
  - digital signature
  - key encipherment
  - server auth
  username: agent-x


kubectl certificate deny --help
kubectl certificate deny agent-smith

kubectl delete csr agent-smith