This repository has been archived by the owner on Jun 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Example with Port Forwarding #9
Comments
You should be able to get this to work if you're a bit adventurous. Can you give this a try:
|
I've tried the following with no success: private static void Main(string[] args) => MainAsync().GetAwaiter().GetResult();
private static async Task MainAsync()
{
var kubeConfig = KubernetesClientConfiguration.BuildConfigFromConfigFile();
kubeConfig.SkipTlsVerify = true;
var kubernetes = new Kubernetes(kubeConfig);
var selector = "app=helm,name=tiller";
var pod = (await kubernetes.ListNamespacedPodAsync("kube-system", labelSelector: selector))?.Items.FirstOrDefault();
if (pod == null)
{
return;
}
using (var webSocket = await kubernetes.WebSocketNamespacedPodPortForwardAsync(
name: pod.Metadata.Name,
@namespace: "kube-system",
ports: new[] {44134}
))
using (var muxer = new StreamDemuxer(webSocket))
{
muxer.Start();
using (var stream = muxer.GetStream(0, 1))
{
TillerClient client = new TillerClient(() => stream);
var version = await client.GetVersion();
Console.WriteLine(version.SemVer);
}
}
} |
@stephenwilliams did you end up figuring this out? I'm in the same boat. My workaround right now is shelling out to |
@jpoon I did not, I ended up doing the same in my testing but I've also moved away from using Helm due to a few bugs that concerned me. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've attempted to figure out how to get this working with Port Forwarding from the Kubernetes-Client/csharp library but I've yet to have any success. Would you be able to provide an example for connecting over that method?
The text was updated successfully, but these errors were encountered: