-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User: X does not have appropriate auth credentials in kubeconfig #1113
Comments
could you please it should be something like below
azure rbac calls https://github.com/Azure/kubelogin to login |
I am not sure if this is the correct way, but I got a web-app to to work using Azure.Identity like this: var creds = new DefaultAzureCredential();
// This scope is the "Azure Kubernetes Service AAD Server" app from Microsoft. (az ad sp show --id 6dae42f8-4368-4678-94ff-3960e28e3630)
var token = await creds.GetTokenAsync(new Azure.Core.TokenRequestContext(new string[] { "6dae42f8-4368-4678-94ff-3960e28e3630/.default" }));
var k8sconfig = new K8SConfiguration()
{
Clusters = new List<Cluster>()
{
new Cluster()
{
Name = "spark-cluster",
ClusterEndpoint = new ClusterEndpoint()
{
Server = "https://aks-server-url:443",
CertificateAuthorityData = "b64encoded"
}
}
},
Contexts = new List<Context>() { new Context() { Name = "spark-cluster", ContextDetails = new ContextDetails() { Cluster = "spark-cluster" } } }
};
kubeConfig = KubernetesClientConfiguration.BuildConfigFromConfigObject(k8sconfig, currentContext: "spark-cluster");
kubeConfig.AccessToken = token.Token; |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Describe the bug
I am trying to connect to an AKS cluster using the sample code described in the readme
My AKS cluster have rbac enabled and AAD authentication with Azure RBAC
but I keep getting
User: X does not have appropriate auth credentials in kubeconfig
On a different cluster with "Local accounts with Kubernetes RBAC" everything is working properly
Kubernetes C# SDK Client Version
9.0.38
Server Kubernetes Version
1.23.12
Dotnet Runtime Version
.net6
To Reproduce
use the sample code to connect to a k8s cluster:
`
Expected behavior
k8s client object with no error
Where do you run your app with Kubernetes SDK (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: