node

package
v0.0.0-...-8d0eeec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Copyright 2018 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// RETRY_COUNT controls the number of retries of writing NodeStatus update.
	RETRY_COUNT = 5

	// NODE_CONTROLLER name of node controller
	NODE_CONTROLLER = "cloud-node-controller"

	// MAX_BATCH_NUM batch process per loop.
	MAX_BATCH_NUM = 50
)

Variables

This section is empty.

Functions

func HandlerForNode

func HandlerForNode(
	cnc *CloudNodeController,
	ninformer coreinformers.NodeInformer,
)

func PatchNode

func PatchNode(
	kdm kubernetes.Interface,
	origined, patched *v1.Node,
) (*v1.Node, error)

Types

type CloudInstance

type CloudInstance interface {
	// SetInstanceTags set instance tags for instance id
	SetInstanceTags(insid string, tags map[string]string) error

	// ListInstances list instance by given ids.
	ListInstances(ids []string) (map[string]*CloudNodeAttribute, error)
}

CloudInstance is an interface to interact with cloud api

type CloudNodeAttribute

type CloudNodeAttribute struct {
	InstanceID   string
	Addresses    []v1.NodeAddress
	InstanceType string
}

CloudNodeAttribute node attribute from cloud instance

type CloudNodeController

type CloudNodeController struct {
	// contains filtered or unexported fields
}

func NewCloudNodeController

func NewCloudNodeController(
	ninformer coreinformers.NodeInformer,
	kubeClient clientset.Interface,
	cloud cloudprovider.Interface,
	nodeMonitorPeriod time.Duration,
	nodeStatusUpdateFrequency time.Duration,
) *CloudNodeController

NewCloudNodeController creates a CloudNodeController object

func (*CloudNodeController) AddCloudNode

func (cnc *CloudNodeController) AddCloudNode(node *v1.Node) error

func (*CloudNodeController) Run

func (cnc *CloudNodeController) Run(stopCh <-chan struct{})

This controller deletes a node if kubelet is not reporting and the node is gone from the cloud provider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL