protokube

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2016 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const TagNameEtcdClusterPrefix = "k8s.io/etcd/"
View Source
const TagNameKubernetesCluster = "KubernetesCluster"

The tag name we use to differentiate multiple logically independent clusters running in the same region

View Source
const TagNameMasterId = "k8s.io/master/id"
View Source
const TagNameRoleMaster = "k8s.io/role/master"

The tag name we use for specifying that something is in the master role

Variables

View Source
var Containerized = false
View Source
var RootFS = "/"

Functions

func AWSErrorCode

func AWSErrorCode(err error) string

AWSErrorCode returns the aws error code, if it is an awserr.Error, otherwise ""

func ApplyChannel

func ApplyChannel(channel string) error

func ApplyMasterTaints

func ApplyMasterTaints(kubeContext *KubernetesContext) error

ApplyMasterTaints finds masters that have not yet been tainted, and applies the master taint Once the kubelet support --taints (like --labels) this can probably go away entirely. It also sets the unschedulable flag to false, so pods (with a toleration) can target the node

func DebugString

func DebugString(o interface{}) string

func ExecuteTemplate

func ExecuteTemplate(key string, templateDefinition string, model interface{}) ([]byte, error)

ExecuteTemplate renders the specified template with the model

func PathFor

func PathFor(hostPath string) string

Types

type AWSVolumes

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

func NewAWSVolumes

func NewAWSVolumes() (*AWSVolumes, error)

func (*AWSVolumes) AttachVolume

func (a *AWSVolumes) AttachVolume(volume *Volume) error

AttachVolume attaches the specified volume to this instance, returning the mountpoint & nil if successful

func (*AWSVolumes) ClusterID

func (a *AWSVolumes) ClusterID() string

func (*AWSVolumes) FindVolumes

func (a *AWSVolumes) FindVolumes() ([]*Volume, error)

func (*AWSVolumes) InternalIP

func (a *AWSVolumes) InternalIP() net.IP

type DNSProvider

type DNSProvider interface {
	Set(fqdn string, recordType string, value string, ttl time.Duration) error
}

type EtcdCluster

type EtcdCluster struct {
	PeerPort     int
	ClientPort   int
	LogFile      string
	DataDirName  string
	ClusterName  string
	ClusterToken string
	Me           *EtcdNode
	Nodes        []*EtcdNode
	PodName      string
	CPURequest   string

	Spec *EtcdClusterSpec

	VolumeMountPath string
}

func (*EtcdCluster) String

func (e *EtcdCluster) String() string

type EtcdClusterSpec

type EtcdClusterSpec struct {
	ClusterKey string

	NodeName  string
	NodeNames []string
}

func ParseEtcdClusterSpec

func ParseEtcdClusterSpec(clusterKey, v string) (*EtcdClusterSpec, error)

Parses a tag on a volume that encodes an etcd cluster role The format is "<myname>/<allnames>", e.g. "node1/node1,node2,node3"

func (*EtcdClusterSpec) String

func (e *EtcdClusterSpec) String() string

type EtcdController

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

func (*EtcdController) RunSyncLoop

func (k *EtcdController) RunSyncLoop()

type EtcdNode

type EtcdNode struct {
	Name         string
	InternalName string
}

func (*EtcdNode) String

func (e *EtcdNode) String() string

type KubeBoot

type KubeBoot struct {
	Master            bool
	InternalDNSSuffix string
	InternalIP        net.IP

	DNS DNSProvider

	ModelDir string

	Channels []string

	Kubernetes *KubernetesContext
	// contains filtered or unexported fields
}

func (*KubeBoot) BuildInternalDNSName

func (k *KubeBoot) BuildInternalDNSName(key string) string

BuildInternalDNSName builds a DNS name for use inside the cluster, adding our internal DNS suffix to the key,

func (*KubeBoot) CreateInternalDNSNameRecord

func (k *KubeBoot) CreateInternalDNSNameRecord(fqdn string) error

CreateInternalDNSNameRecord maps a FQDN to the internal IP address of the current machine

func (*KubeBoot) Init

func (k *KubeBoot) Init(volumesProvider Volumes)

func (*KubeBoot) RunSyncLoop

func (k *KubeBoot) RunSyncLoop()

func (*KubeBoot) String

func (k *KubeBoot) String() string

type KubernetesContext

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

func NewKubernetesContext

func NewKubernetesContext() *KubernetesContext

func (*KubernetesContext) KubernetesClient

func (c *KubernetesContext) KubernetesClient() (*release_1_3.Clientset, error)

type Route53DNSProvider

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

func NewRoute53DNSProvider

func NewRoute53DNSProvider(zoneName string) (*Route53DNSProvider, error)

func (*Route53DNSProvider) Set

func (p *Route53DNSProvider) Set(fqdn string, recordType string, value string, ttl time.Duration) error

type Volume

type Volume struct {
	// ID is the cloud-provider identifier for the volume
	ID string

	// Device is set if the volume is attached to the local machine
	LocalDevice string

	// AttachedTo is set to the ID of the machine the volume is attached to, or "" if not attached
	AttachedTo string

	// Mountpoint is the path on which the volume is mounted, if mounted
	// It will likely be "/mnt/master-" + ID
	Mountpoint string

	// Status is a volume provider specific Status string; it makes it easier for the volume provider
	Status string

	Info VolumeInfo
}

func (*Volume) String

func (v *Volume) String() string

type VolumeInfo

type VolumeInfo struct {
	Description string
	MasterID    int
	// TODO: Maybe the events cluster can just be a PetSet - do we need it for boot?
	EtcdClusters []*EtcdClusterSpec
}

func (*VolumeInfo) String

func (v *VolumeInfo) String() string

type VolumeMountController

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

type Volumes

type Volumes interface {
	AttachVolume(volume *Volume) error
	FindVolumes() ([]*Volume, error)
}

Jump to

Keyboard shortcuts

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