Files
csharp/examples/simple/PodList.cs

26 lines
672 B
C#
Raw Normal View History

using System;
using k8s;
2017-09-14 10:47:41 -07:00
namespace simple
2017-06-12 22:54:30 -07:00
{
internal class PodList
2017-06-12 22:54:30 -07:00
{
private static void Main(string[] args)
2017-06-12 22:54:30 -07:00
{
var config = KubernetesClientConfiguration.BuildConfigFromConfigFile();
IKubernetes client = new Kubernetes(config);
Console.WriteLine("Starting Request!");
var list = client.ListNamespacedPod("default");
foreach (var item in list.Items)
{
2017-06-12 22:54:30 -07:00
Console.WriteLine(item.Metadata.Name);
}
if (list.Items.Count == 0)
{
Console.WriteLine("Empty!");
}
2017-06-12 22:54:30 -07:00
}
}
}