示例#1
0
文件: Program.cs 项目: mayuki/Pripod
        static void Main(string[] args)
        {
            try
            {
                Pod.Initialize(throwOnFail: true);

                Console.WriteLine($"IsRunningOnKubernetes: {Pod.Current.IsRunningOnKubernetes}");

                WriteAnnotationsAndLabels(Pod.Current);
                Console.WriteLine($"  HostIP: {Pod.Current.HostIP}");
                Console.WriteLine($"  PodIP: {Pod.Current.PodIP}");

                WriteAnnotationsAndLabels(Pod.Current.StatefulSet);
                WriteAnnotationsAndLabels(Pod.Current.Deployment);
                WriteAnnotationsAndLabels(Pod.Current.DaemonSet);
                WriteAnnotationsAndLabels(Pod.Current.ReplicaSet);
                WriteAnnotationsAndLabels(Pod.Current.Job);
                WriteAnnotationsAndLabels(Pod.Current.CronJob);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }

            System.Threading.Thread.Sleep(45 * 1000);
        }