-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
KubernetesService discovery by KubernetesService discovery by KubernetesNET9.NET 9 release.NET 9 releaseService DiscoveryOcelot feature: Service DiscoveryOcelot feature: Service DiscoverydocumentationNeeds a documentation updateNeeds a documentation update
Milestone
Description
The Problem
While navigating the docs I saw this rather concerning note:
Note 1: Host, Port and Token are no longer in use.
As my situation is I am routing traffic to pods on a EKS cluster from an Ocelot based gateway running on docker on an EC2 node external to the cluster, this capability was important to me.
Expectation
How to usePodServiceAccount
to configure and use an external Kubernetes cluster should be documented.
Reality
I needed the following code in my Startup.cs
to connect to a cluster the way the documentation implies should be possible
var cfg = Configuration.GetSection("GlobalConfiguration:ServiceDiscoveryProvider");
var Host = cfg.GetValue<string>("Host");
var Port = cfg.GetValue<int>("Port", 443);
var Token = cfg.GetValue<string>("Token");
services.Configure<KubeClientOptions>(options => {
options.ApiEndPoint = new UriBuilder("https",Host,Port).Uri;
options.AuthStrategy = KubeAuthStrategy.BearerToken;
options.AccessToken = Token;
options.AllowInsecure = true;
});
services.AddOcelot(Configuration).AddKubernetes(false);
Metadata
Metadata
Assignees
Labels
KubernetesService discovery by KubernetesService discovery by KubernetesNET9.NET 9 release.NET 9 releaseService DiscoveryOcelot feature: Service DiscoveryOcelot feature: Service DiscoverydocumentationNeeds a documentation updateNeeds a documentation update