{"modulePath":"github.com/squeed/kubernetes","version":"v1.3.6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package node\n\nPackage node contains code for syncing cloud instances with node registry\n\n## Variables\n\n```go\nvar (\n\tErrCloudInstance = errors.New(\"cloud provider doesn't support instances.\")\n)\n```\n\n## Types\n\n```go\ntype ActionFunc func(TimedValue) (bool, time.Duration)\n```\nActionFunc takes a timed value and returns false if the item must be retried, with an optional time.Duration if some minimum wait interval should be used.\n\n```go\ntype CIDRAllocator interface {\n\tAllocateOrOccupyCIDR(node *api.Node) error\n\tReleaseCIDR(node *api.Node) error\n}\n```\nCIDRAllocator is an interface implemented by things that know how to allocate/occupy/recycle CIDR for nodes.\n\n```go\nfunc NewCIDRRangeAllocator(client clientset.Interface, clusterCIDR *net.IPNet, serviceCIDR *net.IPNet, subNetMaskSize int, nodeList *api.NodeList) (CIDRAllocator, error)\n```\nNewCIDRRangeAllocator returns a CIDRAllocator to allocate CIDR for node Caller must ensure subNetMaskSize is not less than cluster CIDR mask size. Caller must always pass in a list of existing nodes so the new allocator can initialize its CIDR map. NodeList is only nil in testing.\n\n```go\ntype FakeLegacyHandler struct {\n\tunversionedcore.CoreInterface\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (m *FakeLegacyHandler) Nodes() unversionedcore.NodeInterface\n```\n\n```go\ntype FakeNodeHandler struct {\n\t*fake.Clientset\n\n\t// Input: Hooks determine if request is valid or not\n\tCreateHook func(*FakeNodeHandler, *api.Node) bool\n\tExisting   []*api.Node\n\n\t// Output\n\tCreatedNodes        []*api.Node\n\tDeletedNodes        []*api.Node\n\tUpdatedNodes        []*api.Node\n\tUpdatedNodeStatuses []*api.Node\n\tRequestCount        int\n\t// contains filtered or unexported fields\n}\n```\nFakeNodeHandler is a fake implementation of NodesInterface and NodeInterface. It allows test cases to have fine-grained control over mock behaviors. We also need PodsInterface and PodInterface to test list \u0026 delet pods, which is implemented in the embedded client.Fake field.\n\n```go\nfunc (c *FakeNodeHandler) Core() unversionedcore.CoreInterface\n```\n\n```go\nfunc (m *FakeNodeHandler) Create(node *api.Node) (*api.Node, error)\n```\n\n```go\nfunc (m *FakeNodeHandler) Delete(id string, opt *api.DeleteOptions) error\n```\n\n```go\nfunc (m *FakeNodeHandler) DeleteCollection(opt *api.DeleteOptions, listOpts api.ListOptions) error\n```\n\n```go\nfunc (m *FakeNodeHandler) Get(name string) (*api.Node, error)\n```\n\n```go\nfunc (m *FakeNodeHandler) List(opts api.ListOptions) (*api.NodeList, error)\n```\n\n```go\nfunc (m *FakeNodeHandler) Patch(name string, pt api.PatchType, data []byte) (*api.Node, error)\n```\n\n```go\nfunc (m *FakeNodeHandler) PatchStatus(nodeName string, data []byte) (*api.Node, error)\n```\n\n```go\nfunc (m *FakeNodeHandler) Update(node *api.Node) (*api.Node, error)\n```\n\n```go\nfunc (m *FakeNodeHandler) UpdateStatus(node *api.Node) (*api.Node, error)\n```\n\n```go\nfunc (m *FakeNodeHandler) Watch(opts api.ListOptions) (watch.Interface, error)\n```\n\n```go\ntype NodeController struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewNodeController(\n\tcloud cloudprovider.Interface,\n\tkubeClient clientset.Interface,\n\tpodEvictionTimeout time.Duration,\n\tdeletionEvictionLimiter flowcontrol.RateLimiter,\n\tterminationEvictionLimiter flowcontrol.RateLimiter,\n\tnodeMonitorGracePeriod time.Duration,\n\tnodeStartupGracePeriod time.Duration,\n\tnodeMonitorPeriod time.Duration,\n\tclusterCIDR *net.IPNet,\n\tserviceCIDR *net.IPNet,\n\tnodeCIDRMaskSize int,\n\tallocateNodeCIDRs bool) (*NodeController, error)\n```\nNewNodeController returns a new node controller to sync instances from cloudprovider. This method returns an error if it is unable to initialize the CIDR bitmap with podCIDRs it has already allocated to nodes. Since we don't allow podCIDR changes currently, this should be handled as a fatal error.\n\n```go\nfunc (nc *NodeController) Run(period time.Duration)\n```\nRun starts an asynchronous loop that monitors the status of cluster nodes.\n\n```go\ntype RateLimitedTimedQueue struct {\n\t// contains filtered or unexported fields\n}\n```\nRateLimitedTimedQueue is a unique item priority queue ordered by the expected next time of execution. It is also rate limited.\n\n```go\nfunc NewRateLimitedTimedQueue(limiter flowcontrol.RateLimiter) *RateLimitedTimedQueue\n```\nCreates new queue which will use given RateLimiter to oversee execution.\n\n```go\nfunc (q *RateLimitedTimedQueue) Add(value string) bool\n```\nAdds value to the queue to be processed. Won't add the same value a second time if it was already added and not removed.\n\n```go\nfunc (q *RateLimitedTimedQueue) Clear()\n```\nRemoves all items from the queue\n\n```go\nfunc (q *RateLimitedTimedQueue) Remove(value string) bool\n```\nRemoves Node from the Evictor. The Node won't be processed until added again.\n\n```go\nfunc (q *RateLimitedTimedQueue) Try(fn ActionFunc)\n```\nTry processes the queue. Ends prematurely if RateLimiter forbids an action and leak is true. Otherwise, requeues the item to be processed. Each value is processed once if fn returns true, otherwise it is added back to the queue. The returned remaining is used to identify the minimum time to execute the next item in the queue.\n\n```go\ntype TimedQueue []*TimedValue\n```\nTimedQueue is a priority heap where the lowest ProcessAt is at the front of the queue\n\n```go\nfunc (h TimedQueue) Len() int\n```\n\n```go\nfunc (h TimedQueue) Less(i, j int) bool\n```\n\n```go\nfunc (h *TimedQueue) Pop() interface{}\n```\n\n```go\nfunc (h *TimedQueue) Push(x interface{})\n```\n\n```go\nfunc (h TimedQueue) Swap(i, j int)\n```\n\n```go\ntype TimedValue struct {\n\tValue     string\n\tAddedAt   time.Time\n\tProcessAt time.Time\n}\n```\nTimedValue is a value that should be processed at a designated time.\n\n```go\ntype UniqueQueue struct {\n\t// contains filtered or unexported fields\n}\n```\nA FIFO queue which additionally guarantees that any element can be added only once until it is removed.\n\n```go\nfunc (q *UniqueQueue) Add(value TimedValue) bool\n```\nAdds a new value to the queue if it wasn't added before, or was explicitly removed by the Remove call. Returns true if new value was added.\n\n```go\nfunc (q *UniqueQueue) Clear()\n```\nClear removes all items from the queue and duplication preventing set.\n\n```go\nfunc (q *UniqueQueue) Get() (TimedValue, bool)\n```\nReturns the oldest added value that wasn't returned yet.\n\n```go\nfunc (q *UniqueQueue) Head() (TimedValue, bool)\n```\nHead returns the oldest added value that wasn't returned yet without removing it.\n\n```go\nfunc (q *UniqueQueue) Remove(value string) bool\n```\nRemoves the value from the queue, so Get() call won't return it, and allow subsequent addition of the given value. If the value is not present does nothing and returns false.\n\n```go\nfunc (q *UniqueQueue) Replace(value TimedValue) bool\n```\nReplace replaces an existing value in the queue if it already exists, otherwise it does nothing. Returns true if the item was found.\n\n","path":"github.com/squeed/kubernetes/pkg/controller/node","name":"node","synopsis":"Package node contains code for syncing cloud instances with node registry","isRedistributable":true}
