terraform-oci-oke icon indicating copy to clipboard operation
terraform-oci-oke copied to clipboard

How can I generate user specific kubeconfig?

Open winston0410 opened this issue 2 years ago • 0 comments

Hi, I am trying to generate kubeconfig for non-privileged user to access the cluster. I have followed the Example 3 in the documentation here and created User, Group, Policy and clusterrolebindings.

The last bit that I want to know is, how can I generate the kubeconfig for that new user? I am creating it in Terraform like this:

resource "oci_identity_user" "non_privileged_user" {
  compartment_id = var.compartment_id
  description    = "non priviledged user for access OKE cluster"
  name           = "foo"
}

And with that, I can have the OCID of that user, and pass to a resource that generate kubeconfig.

But the trouble is, data.oci_containerengine_cluster_kube_config does not accept a userId or groupId at the moment. Is there any other expected way to generate the config for the user?

winston0410 avatar Jun 07 '23 14:06 winston0410