当前位置: 首页>>代码示例>>Golang>>正文


Golang framework.GetMasterAndWorkerNodesOrDie函数代码示例

本文整理汇总了Golang中k8s/io/kubernetes/test/e2e/framework.GetMasterAndWorkerNodesOrDie函数的典型用法代码示例。如果您正苦于以下问题:Golang GetMasterAndWorkerNodesOrDie函数的具体用法?Golang GetMasterAndWorkerNodesOrDie怎么用?Golang GetMasterAndWorkerNodesOrDie使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetMasterAndWorkerNodesOrDie函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: increaseFluentdVerbosity

func increaseFluentdVerbosity(f *framework.Framework) error {
	masters, nodeList := framework.GetMasterAndWorkerNodesOrDie(f.ClientSet)

	for master := range masters {
		if err := increaseFluentdVerbosityOnNode(f, master); err != nil {
			return err
		}
	}

	for _, node := range nodeList.Items {
		if err := increaseFluentdVerbosityOnNode(f, node.Name); err != nil {
			return err
		}
	}

	return nil
}
开发者ID:hpcloud,项目名称:kubernetes,代码行数:17,代码来源:cluster_logging_gcl.go

示例2:

		rc, err := c.ReplicationControllers(ns).Get(RCName)
		if err == nil && rc.Spec.Replicas != 0 {
			By("Cleaning up the replication controller")
			err := framework.DeleteRCAndPods(c, f.ClientSet, ns, RCName)
			framework.ExpectNoError(err)
		}
	})

	BeforeEach(func() {
		c = f.Client
		cs = f.ClientSet
		ns = f.Namespace.Name
		nodeList = &api.NodeList{}

		framework.WaitForAllNodesHealthy(c, time.Minute)
		masterNodes, nodeList = framework.GetMasterAndWorkerNodesOrDie(c)

		err := framework.CheckTestingNSDeletedExcept(c, ns)
		framework.ExpectNoError(err)

		// Every test case in this suite assumes that cluster add-on pods stay stable and
		// cannot be run in parallel with any other test that touches Nodes or Pods.
		// It is so because we need to have precise control on what's running in the cluster.
		systemPods, err := framework.GetPodsInNamespace(c, ns, ignoreLabels)
		Expect(err).NotTo(HaveOccurred())
		systemPodsNo = 0
		for _, pod := range systemPods {
			if !masterNodes.Has(pod.Spec.NodeName) && pod.DeletionTimestamp == nil {
				systemPodsNo++
			}
		}
开发者ID:Random-Liu,项目名称:kubernetes,代码行数:31,代码来源:scheduler_predicates.go

示例3:

	})

	// Explicitly put here, to delete namespace at the end of the test
	// (after measuring latency metrics, etc.).
	f := framework.NewDefaultFramework("density")
	f.NamespaceDeletionTimeout = time.Hour

	BeforeEach(func() {
		c = f.Client
		ns = f.Namespace.Name

		// In large clusters we may get to this point but still have a bunch
		// of nodes without Routes created. Since this would make a node
		// unschedulable, we need to wait until all of them are schedulable.
		framework.ExpectNoError(framework.WaitForAllNodesSchedulable(c))
		masters, nodes = framework.GetMasterAndWorkerNodesOrDie(c)
		nodeCount = len(nodes.Items)
		Expect(nodeCount).NotTo(BeZero())
		if nodeCount == 30 {
			f.AddonResourceConstraints = func() map[string]framework.ResourceConstraint { return density30AddonResourceVerifier(nodeCount) }()
		}

		nodeCpuCapacity = nodes.Items[0].Status.Allocatable.Cpu().MilliValue()
		nodeMemCapacity = nodes.Items[0].Status.Allocatable.Memory().Value()

		// Terminating a namespace (deleting the remaining objects from it - which
		// generally means events) can affect the current run. Thus we wait for all
		// terminating namespace to be finally deleted before starting this test.
		err := framework.CheckTestingNSDeletedExcept(c, ns)
		framework.ExpectNoError(err)
开发者ID:CodeJuan,项目名称:kubernetes,代码行数:30,代码来源:density.go


注:本文中的k8s/io/kubernetes/test/e2e/framework.GetMasterAndWorkerNodesOrDie函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。