# Kubectl keycloak OIDC Integration

**URL:** <https://discuss.kubernetes.io/t/kubectl-keycloak-oidc-integration/32494>\
**Category:** General Discussions\
**Created:** [June 4, 2025, 3:58pm UTC](https://discuss.kubernetes.io/t/kubectl-keycloak-oidc-integration/32494 "2025-06-04T15:58:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nirmesh\_Rastogi](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/nirmesh_rastogi/32/17361_2.png) [@Nirmesh\_Rastogi](https://discuss.kubernetes.io/u/Nirmesh_Rastogi)\
**Post date:** [June 4, 2025, 3:58pm UTC](https://discuss.kubernetes.io/t/kubectl-keycloak-oidc-integration/32494/1 "2025-06-04T15:58:17Z")

</div>

Asking for help? Comment out what you need so we can get more information to help you!

### Cluster information:

Kubernetes version:  
Cloud being used: bare-metal  
Installation method: Microk8s  
Host OS: Ubuntu 20  
CNI and version:  
CRI and version:  
I am trying to integrate kubectl with keycloak OIDC and i have create a user let’s say John in keycloak and on k8s side i have set all necessay setting in kube api server so bassically on this file “/var/snap/microk8s/current/args/kube-apiserver” and kubectl config related setting on this file “/var/snap/microk8s/current/credentials/client.config” . also i created one simple clusterrolebinding file giving pod reader access to that user “john” however i noticed that all token related info is working but when kubectl i do kubectl get pod it says \> [{

> “kind”: “Status”,  
> “apiVersion”: “v1”,  
> “metadata”: {},  
> “status”: “Failure”,  
> “message”: “Unauthorized”,  
> “reason”: “Unauthorized”,  
> “code”: 401  
> }]

no matter whatever command i make with kubectl. Any help would be great. Is kubeapi server not able to get my token or it doesnt like my token. I hope authentication is happening and authorization is what throwing error.
