Comments (6)
How are you passing the token through to this client?
from csharp.
token is extracted from aspnet core httpcontext.
below snippet show how the client is initialized
var config = new KubernetesClientConfiguration { // Set your Kubernetes API server endpoint Host = "<cluster-url>", // Set other configuration options as needed SslCaCerts = new X509Certificate2Collection(new[] { new X509Certificate2(Encoding.UTF8.GetBytes( "<CA-CERT>")), }), AccessToken = "<access-token>" }; var client = new Kubernetes(config);
from csharp.
by setting accesstoken, client will send http request with http header Bearer <token>
you mean server side rejected your token?
from csharp.
Yes, the token was rejected as an invalid token appears in cluster logs(k3s) and the api call retuned 401.
I configured the kubectl oidc login plugin and the aspnet core app to use the same oidc client config on keycloak.
I'll try to setup github repo to share the poc code.
from csharp.
Easiest thing to do if you can is to try to export this as a YAML kubeconfig.
If kubectl ...
with that kubeconfig file works, and this client doesn't work, then it's definitely a bug in this client.
If kubectl ...
doesn't work, it's likely an issue with the token.
from csharp.
It was related to the token, it worked when the audience is correctly set, although it works with oidc login without audience.
from csharp.
Related Issues (20)
- watcher: System.Net.Http.HttpRequestException: Error while copying content to a stream. HOT 5
- upload KubernetesClient.Aot and deprecated KubernetesClient.Basic KubernetesClient.Models HOT 4
- Clarifying Version Skew Policy HOT 3
- [KubernetesClient.Aot] .NET 8 AOT compatibility for Scale functions HOT 15
- Prometheus-net is an unnecessary dependency HOT 8
- SlnGen instructions are potentially incomplete HOT 2
- Json serialization exception in .net8 HOT 2
- KubernetesYaml.Serialize Globalization issue
- How do you open the source code in an IDE without a .sln file? HOT 2
- Internal class IntOrStringJsonConverter doesn't work with System.Text.Json Source Generator HOT 9
- KubernetesClientConfiguration.LoadKubeConfig is not thread-safe due to YamlDotNet Deserializer
- Memory Leak with aot package ListDeployments and ListStatefulSet HOT 13
- KubernetesClientConfiguration.BuildConfigFromConfigFile with ExternalExecution deadlocks waiting for exit HOT 2
- Remove polyfil package from net 7/8
- Some generated methods lacking ConfigureAwait(false) HOT 4
- Can not access /metrics endpoint using the IKubernetes.HttpClient. Restults in Unauthorized access. RBAC settings are correct HOT 2
- Log event before Kubernetes de-dups them HOT 2
- IdentityModel 5.2.0 nonsupport IdentityServer4.AccessTokenValidation 3.0.1 HOT 1
- nuget central package version management
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csharp.