File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+
3
+ using k8s ;
4
+
5
+ namespace simple
6
+ {
7
+ class PodList
8
+ {
9
+ static void Main ( string [ ] args )
10
+ {
11
+ IKubernetes client = new Kubernetes ( ) ;
12
+ client . BaseUri = new Uri ( "http://localhost:8001" ) ;
13
+ var listTask = client . ListNamespacedPodWithHttpMessagesAsync ( "default" ) ;
14
+ listTask . Wait ( ) ;
15
+ var list = listTask . Result . Body ;
16
+ foreach ( var item in list . Items ) {
17
+ Console . WriteLine ( item . Metadata . Name ) ;
18
+ }
19
+ }
20
+ }
21
+ }
Original file line number Diff line number Diff line change
1
+ <Project Sdk =" Microsoft.NET.Sdk" >
2
+
3
+ <ItemGroup >
4
+ <PackageReference Include =" Microsoft.Rest.ClientRuntime" Version =" 3.0.3" />
5
+ <PackageReference Include =" Newtonsoft.Json" Version =" 10.0.2" />
6
+ <ProjectReference Include =" ..\..\src\csharp.csproj" />
7
+ </ItemGroup >
8
+
9
+ <PropertyGroup >
10
+ <OutputType >Exe</OutputType >
11
+ <TargetFramework >netcoreapp1.1</TargetFramework >
12
+ </PropertyGroup >
13
+
14
+ </Project >
You can’t perform that action at this time.
0 commit comments