本文整理汇总了Golang中github.com/openshift/origin/pkg/cmd/server/kubernetes.BuildKubernetesNodeConfig函数的典型用法代码示例。如果您正苦于以下问题:Golang BuildKubernetesNodeConfig函数的具体用法?Golang BuildKubernetesNodeConfig怎么用?Golang BuildKubernetesNodeConfig使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BuildKubernetesNodeConfig函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: StartNode
func StartNode(nodeConfig configapi.NodeConfig) error {
config, err := kubernetes.BuildKubernetesNodeConfig(nodeConfig)
if err != nil {
return err
}
glog.Infof("Starting node %s (%s)", config.KubeletServer.HostnameOverride, version.Get().String())
// preconditions
config.EnsureVolumeDir()
config.EnsureDocker(docker.NewHelper())
// async starts
config.RunKubelet()
config.RunSDN()
config.RunProxy()
// HACK: RunProxy resets bridge-nf-call-iptables from what openshift-sdn requires
if config.SDNPlugin != nil {
sdnPluginName := nodeConfig.NetworkConfig.NetworkPluginName
if sdnPluginName == osdn.SingleTenantPluginName() || sdnPluginName == osdn.MultiTenantPluginName() {
if err := sysctl.SetSysctl("net/bridge/bridge-nf-call-iptables", 0); err != nil {
glog.Warningf("Could not set net.bridge.bridge-nf-call-iptables sysctl: %s", err)
}
}
}
return nil
}
开发者ID:erinboyd,项目名称:origin,代码行数:28,代码来源:start_node.go
示例2: StartNode
func StartNode(nodeConfig configapi.NodeConfig, components *utilflags.ComponentFlag) error {
config, err := kubernetes.BuildKubernetesNodeConfig(nodeConfig, components.Enabled(ComponentProxy), components.Enabled(ComponentDNS))
if err != nil {
return err
}
// In case of openshift network plugin, nodeConfig.networkPluginName is optional and is auto detected/finalized
// once we build kubernetes node config. So perform plugin name related check here.
if osdn.IsOpenShiftNetworkPlugin(config.KubeletServer.NetworkPluginName) {
// TODO: SDN plugin depends on the Kubelet registering as a Node and doesn't retry cleanly,
// and Kubelet also can't start the PodSync loop until the SDN plugin has loaded.
if components.Enabled(ComponentKubelet) != components.Enabled(ComponentPlugins) {
return fmt.Errorf("the SDN plugin must be run in the same process as the kubelet")
}
}
if components.Enabled(ComponentKubelet) {
glog.Infof("Starting node %s (%s)", config.KubeletServer.HostnameOverride, version.Get().String())
} else {
glog.Infof("Starting node networking %s (%s)", config.KubeletServer.HostnameOverride, version.Get().String())
}
_, kubeClientConfig, err := configapi.GetKubeClient(nodeConfig.MasterKubeConfig)
if err != nil {
return err
}
glog.Infof("Connecting to API server %s", kubeClientConfig.Host)
// preconditions
if components.Enabled(ComponentKubelet) {
config.EnsureKubeletAccess()
config.EnsureVolumeDir()
config.EnsureDocker(docker.NewHelper())
config.EnsureLocalQuota(nodeConfig) // must be performed after EnsureVolumeDir
}
if components.Enabled(ComponentKubelet) {
config.RunKubelet()
}
if components.Enabled(ComponentPlugins) {
config.RunPlugin()
}
if components.Enabled(ComponentProxy) {
config.RunProxy()
}
if components.Enabled(ComponentDNS) {
config.RunDNS()
}
config.RunServiceStores(components.Enabled(ComponentProxy), components.Enabled(ComponentDNS))
return nil
}
开发者ID:rchicoli,项目名称:openshift-origin,代码行数:53,代码来源:start_node.go
示例3: StartNode
func StartNode(nodeConfig configapi.NodeConfig) error {
config, err := kubernetes.BuildKubernetesNodeConfig(nodeConfig)
if err != nil {
return err
}
RunSDNController(config, nodeConfig)
config.EnsureVolumeDir()
config.EnsureDocker(docker.NewHelper())
config.RunProxy()
config.RunKubelet()
return nil
}
开发者ID:cjnygard,项目名称:origin,代码行数:14,代码来源:start_node.go
示例4: StartNode
func StartNode(nodeConfig configapi.NodeConfig) error {
config, err := kubernetes.BuildKubernetesNodeConfig(nodeConfig)
if err != nil {
return err
}
glog.Infof("Starting node %s (%s)", config.KubeletServer.HostnameOverride, version.Get().String())
RunSDNController(config, nodeConfig)
config.EnsureVolumeDir()
config.EnsureDocker(docker.NewHelper())
config.RunProxy()
config.RunKubelet()
return nil
}
开发者ID:Tlacenka,项目名称:origin,代码行数:15,代码来源:start_node.go
示例5: StartNode
func StartNode(nodeConfig configapi.NodeConfig, components *utilflags.ComponentFlag) error {
config, err := kubernetes.BuildKubernetesNodeConfig(nodeConfig)
if err != nil {
return err
}
if components.Enabled(ComponentKubelet) {
glog.Infof("Starting node %s (%s)", config.KubeletServer.HostnameOverride, version.Get().String())
} else {
glog.Infof("Starting node networking %s (%s)", config.KubeletServer.HostnameOverride, version.Get().String())
}
_, kubeClientConfig, err := configapi.GetKubeClient(nodeConfig.MasterKubeConfig)
if err != nil {
return err
}
glog.Infof("Connecting to API server %s", kubeClientConfig.Host)
// preconditions
if components.Enabled(ComponentKubelet) {
config.EnsureKubeletAccess()
config.EnsureVolumeDir()
config.EnsureDocker(docker.NewHelper())
config.EnsureLocalQuota(nodeConfig) // must be performed after EnsureVolumeDir
}
// TODO: SDN plugin depends on the Kubelet registering as a Node and doesn't retry cleanly,
// and Kubelet also can't start the PodSync loop until the SDN plugin has loaded.
if components.Enabled(ComponentKubelet) {
config.RunKubelet()
}
// SDN plugins get the opportunity to filter service rules, so they start first
if components.Enabled(ComponentPlugins) {
config.RunPlugin()
}
if components.Enabled(ComponentProxy) {
config.RunProxy()
}
// if we are running plugins in this process, reset the bridge ip rule
if components.Enabled(ComponentPlugins) {
config.ResetSysctlFromProxy()
}
return nil
}
开发者ID:asiainfoLDP,项目名称:datafactory,代码行数:45,代码来源:start_node.go
注:本文中的github.com/openshift/origin/pkg/cmd/server/kubernetes.BuildKubernetesNodeConfig函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论