What Desginated Name (DN) fields are used by Kubernetes when generating custom certificates from a provided CA Cert or PKI tool?
This document (000020306) is provided subject to the disclaimer at the end of this document.
Environment
Situation
rke up
a user might experience the error message below.
INFO[0092] [authz] Creating rke-job-deployer ServiceAccount FATA[0119] Failed to apply the ServiceAccount needed for job execution: clusterrolebindings.rbac.authorization.k8s.io is forbidden: User "kube-admin" cannot create resource "clusterrolebindings" in API group "rbac.authorization.k8s.io" at the cluster scope
Resolution
check the Organization (O) fields for the generated certificates Common Names (CN) and their signing requests (CSR). The examples here are directly from Kubernetes the Hard Way, and outline a manual process for certificate generation. Where ${Instance} is mentioned, this is a variable for the name of the node that represents each kubelet, with every node having its own certificate.
Kubernetes Component Certificates | Common Name (CN) | Organization (O) |
---|---|---|
CA Root | kubernetes | Kubernetes |
Admin | admin | system:masters |
Kubelet | system:node:${Instance} | system:nodes |
Controller Manager | system:kube-controller-manager | system:kube-controller-manager |
Kube Proxy | system:kube-proxy | system:node-proxier |
Scheduler | system:kube-schedluer | system:kube-scheduler |
API Server | kubernetes | Kubernetes |
Service Account Key Pair | service-accounts | Kubernetes |
Cause
If the proper Organization fields are not set, Kubernetes cannot assign compatible permissions to the different underlying components. With self-signed certificates these fields are generated automatically. With custom certificates, it's important to verfiy these fields are correct, as they may have been set by external tooling or automation.
Sometimes a Kubernetes administrator may leave all the fields of their certificates or CSRs blank or with predefined values, it can be easy to overlook the O field for a specific CN, an the proper kubernetes permissions will not get applied.
Additional Information
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000020306
- Creation Date: 28-Jun-2021
- Modified Date:29-Sep-2022
-
- SUSE Rancher
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com