Add a custom OIDC provider for MKE¶
Available since 17.0.0, 16.0.0, and 14.1.0
By default, MKE uses Keycloak as the OIDC provider. Using the
ClusterOIDCConfiguration
custom resource, you can add your own OpenID
Connect (OIDC) provider for MKE on managed clusters to authenticate user
requests to Kubernetes. For OIDC provider requirements, see OIDC official
specification.
Note
For OpenStack and StackLight, Container Cloud supports only Keycloak, which is configured on the management cluster, as the OIDC provider.
To add a custom OIDC provider for MKE:
Configure the OIDC provider:
Log in to the OIDC provider dashboard.
Create an OIDC client. If you are going to use an existing one, skip this step.
Add the MKE
redirectURL
of the managed cluster to the OIDC client. By default, the URL format ishttps://<MKE IP>:6443/login
.Add the
<Container Cloud web UI IP>/token
to the OIDC client for generation ofkubeconfig
files of the target managed cluster through the Container Cloud web UI.Ensure that the
aud
claim of the issuedid_token
for audience will be equal to the created client ID.Optional. Allow MKE to refresh authentication when
id_token
expires by allowing theoffline_access
claim for the OIDC client.
Create the
ClusterOIDCConfiguration
object in the YAML format containing the OIDC client settings. For details, see API Reference: ClusterOIDCConfiguration resource for MKE.The
ClusterOIDCConfiguration
object is created in the management cluster. Users with them:kaas:ns@operator/writer/member
roles have access to this object.Once done, the following dependent objects are created automatically in the target managed cluster: the
rbac.authorization.k8s.io/v1/ClusterRoleBinding
object that binds the admin group defined inspec:adminRoleCriteria:value
to thecluster-admin
rbac.authorization.k8s.io/v1/ClusterRole
object.In the
Cluster
object of the managed cluster, add the name of theClusterOIDCConfiguration
object to thespec.providerSpec.value.oidc
field.Wait until the cluster machines switch from the
Reconfigure
toReady
state for the changes to apply.