node

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InstanceCores = map[string]int{}/* 164 elements not displayed */

InstanceCores contains a mapping of instance types to the number of cores Based on info from https://aws.amazon.com/ec2/instance-types/ and https://aws.amazon.com/ec2/previous-generation/

View Source
var InstanceENIsAvailable = map[string]int{}/* 164 elements not displayed */

InstanceENIsAvailable contains a mapping of instance types to the number of ENIs available which is described at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI

View Source
var InstanceIPsAvailable = map[string]int{}/* 164 elements not displayed */

InstanceIPsAvailable contains a mapping of instance types to the number of IPs per ENI https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI

View Source
var InstanceMemory = map[string]int{}/* 164 elements not displayed */

InstanceMemory contains a mapping of instance types to the amount of memory Based on info from https://aws.amazon.com/ec2/instance-types/ and https://aws.amazon.com/ec2/previous-generation/

Functions

This section is empty.

Types

type Node

type Node struct {
	*ec2.Instance
	Region           string
	ContainerRuntime string
}

Node represents and EC2 instance.

func New

func New(e ec2iface.EC2API, m metadataClient, region *string, containerRuntime string) (*Node, error)

New returns a Node instance.

If the EC2 instance doesn't have the expected kubernetes tag, it will backoff and retry. If it isn't able to query EC2 or there are any other errors, an error will be returned.

func (*Node) ClusterDNS added in v0.0.5

func (n *Node) ClusterDNS() string

ClusterDNS returns the in cluster IP address that kube-dns should avalible at

func (*Node) ClusterName

func (n *Node) ClusterName() string

ClusterName returns the cluster name.

It reads the cluster name from a tag on the EC2 instance.

func (*Node) Labels added in v0.0.10

func (n *Node) Labels() []string

Labels returns list of kubernetes labels for this node

If the node is a spot instance the node-role.kubernetes.io/spot-worker label will be set, otherwise the node-role.kubernetes.io/worker is set.

Other custom labels can be set using EC2 tags with the k8s.io/cluster-autoscaler/node-template/label/ prefix

func (*Node) MaxPods added in v0.0.3

func (n *Node) MaxPods() int

MaxPods returns the maximum number of pods that can be scheduled to this node

see https://github.com/aws/amazon-vpc-cni-k8s#setup for more info

func (*Node) ReservedCPU added in v0.0.8

func (n *Node) ReservedCPU() string

ReservedCPU returns the CPU in millicores that should be reserved for Kuberntes own use on this node

The calculation here is based on information found in the GKE documentation here: https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture I think that it should also apply to AWS

func (*Node) ReservedMemory added in v0.0.8

func (n *Node) ReservedMemory() string

ReservedMemory returns the memory that should be reserved for Kuberntes own use on this node

The calculation here is based on information found in the GKE documentation here: https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture I think that it should also apply to AWS

func (*Node) Spot added in v0.0.9

func (n *Node) Spot() bool

Spot returns true is this node is a spot instance

func (*Node) Taints added in v0.0.10

func (n *Node) Taints() []string

Taints returns a list of kuberntes taints for this node

Taints can be set using EC2 tags with the k8s.io/cluster-autoscaler/node-template/taint/ prefix

Jump to

Keyboard shortcuts

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