2017-09-14 10:47:41 -07:00
|
|
|
namespace simple
|
2017-06-12 22:54:30 -07:00
|
|
|
{
|
2017-06-17 14:11:52 -07:00
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using k8s;
|
|
|
|
|
|
2017-06-12 22:54:30 -07:00
|
|
|
class PodList
|
|
|
|
|
{
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
{
|
2017-06-17 14:11:52 -07:00
|
|
|
var k8sClientConfig = new KubernetesClientConfiguration();
|
|
|
|
|
IKubernetes client = new Kubernetes(k8sClientConfig);
|
2017-07-23 20:45:09 -07:00
|
|
|
Console.WriteLine("Starting Request!");
|
2017-06-17 14:11:52 -07:00
|
|
|
var listTask = client.ListNamespacedPodWithHttpMessagesAsync("default").Result;
|
|
|
|
|
var list = listTask.Body;
|
2017-06-12 22:54:30 -07:00
|
|
|
foreach (var item in list.Items) {
|
|
|
|
|
Console.WriteLine(item.Metadata.Name);
|
|
|
|
|
}
|
2017-07-23 20:45:09 -07:00
|
|
|
if (list.Items.Count == 0) {
|
|
|
|
|
Console.WriteLine("Empty!");
|
|
|
|
|
}
|
2017-06-12 22:54:30 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|