2018-09-27 10:50:39 -07:00
|
|
|
using k8s;
|
2022-09-16 01:21:21 +02:00
|
|
|
using System;
|
2017-11-24 12:19:44 +08:00
|
|
|
|
2025-04-29 16:55:55 -07:00
|
|
|
var config = KubernetesClientConfiguration.BuildDefaultConfig();
|
|
|
|
|
IKubernetes client = new Kubernetes(config);
|
|
|
|
|
Console.WriteLine("Starting Request!");
|
2018-09-27 10:50:39 -07:00
|
|
|
|
2025-04-29 16:55:55 -07:00
|
|
|
var list = client.CoreV1.ListNamespacedPod("default");
|
|
|
|
|
foreach (var item in list.Items)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(item.Metadata.Name);
|
|
|
|
|
}
|
2020-04-23 11:40:06 -07:00
|
|
|
|
2025-04-29 16:55:55 -07:00
|
|
|
if (list.Items.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("Empty!");
|
2018-09-27 10:50:39 -07:00
|
|
|
}
|