Documentation ¶
Index ¶
- Constants
- Variables
- func BuildEtcdManifest(c *EtcdCluster) *v1.Pod
- func DebugString(o interface{}) string
- func ExecuteTemplate(key string, templateDefinition string, model interface{}) ([]byte, error)
- func GetDropletInternalIP() (net.IP, error)
- func NewNsEnterExec() mount.Exec
- type AWSVolumes
- func (a *AWSVolumes) AttachVolume(volume *Volume) error
- func (a *AWSVolumes) ClusterID() string
- func (v *AWSVolumes) FindMountedVolume(volume *Volume) (string, error)
- func (a *AWSVolumes) FindVolumes() ([]*Volume, error)
- func (a *AWSVolumes) GossipSeeds() (gossip.SeedProvider, error)
- func (a *AWSVolumes) InstanceID() string
- func (a *AWSVolumes) InternalIP() net.IP
- type ByEtcdClusterName
- type DNSProvider
- type DOVolumes
- type EtcdCluster
- type EtcdController
- type EtcdNode
- type GCEVolumes
- func (v *GCEVolumes) AttachVolume(volume *Volume) error
- func (a *GCEVolumes) ClusterID() string
- func (v *GCEVolumes) FindMountedVolume(volume *Volume) (string, error)
- func (v *GCEVolumes) FindVolumes() ([]*Volume, error)
- func (g *GCEVolumes) GossipSeeds() (gossip.SeedProvider, error)
- func (g *GCEVolumes) InstanceName() string
- func (a *GCEVolumes) InternalIP() net.IP
- func (a *GCEVolumes) Project() string
- type GossipDnsProvider
- type KopsDnsProvider
- type KubeBoot
- type KubernetesContext
- type VSphereVolumes
- type Volume
- type VolumeInfo
- type VolumeMountController
- type Volumes
Constants ¶
const ( // KubeProxyClusterRoleName sets the name for the kube-proxy ClusterRole KubeProxyClusterRoleName = "system:node-proxier" // Constants for what we name our ServiceAccounts with limited access to the cluster in case of RBAC KubeDNSServiceAccountName = "kube-dns" KubeProxyServiceAccountName = "kube-proxy" )
The below code should mirror the code in kubeadm. We'll develop it here then contribute it back once they are out of core - otherwise it is using the wrong version of the k8s client.
const TaintsAnnotationKey string = "scheduler.alpha.kubernetes.io/taints"
TaintsAnnotationKey represents the key of taints data (json serialized) in the Annotations of a Node. Note that this is for k8s <= 1.5 only
const VolStatusValue = "attached"
const VolumeMetaDataFile = "/vol-metadata/metadata.json"
Variables ¶
var ( // Containerized indicates the etcd is containerized Containerized = false // RootFS is the root fs path RootFS = "/" )
Functions ¶
func BuildEtcdManifest ¶ added in v1.10.0
func BuildEtcdManifest(c *EtcdCluster) *v1.Pod
BuildEtcdManifest creates the pod spec, based on the etcd cluster
func DebugString ¶
func DebugString(o interface{}) string
func ExecuteTemplate ¶
ExecuteTemplate renders the specified template with the model
func GetDropletInternalIP ¶ added in v1.10.0
GetDropletInternalIP gets the private IP of the droplet running this program This function is exported so it can be called from protokube
func NewNsEnterExec ¶ added in v1.10.0
NewNsEnterExec builds a mount.Exec implementation that nsenters into the host process It is very similar to mount.NewNsenterMounter, but execs into the host
Types ¶
type AWSVolumes ¶
type AWSVolumes struct {
// contains filtered or unexported fields
}
AWSVolumes defines the aws volume implementation
func NewAWSVolumes ¶
func NewAWSVolumes() (*AWSVolumes, error)
NewAWSVolumes returns a new aws volume provider
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) FindMountedVolume ¶ added in v1.10.0
func (v *AWSVolumes) FindMountedVolume(volume *Volume) (string, error)
FindMountedVolume implements Volumes::FindMountedVolume
func (*AWSVolumes) FindVolumes ¶
func (a *AWSVolumes) FindVolumes() ([]*Volume, error)
func (*AWSVolumes) GossipSeeds ¶ added in v1.10.0
func (a *AWSVolumes) GossipSeeds() (gossip.SeedProvider, error)
func (*AWSVolumes) InstanceID ¶ added in v1.10.0
func (a *AWSVolumes) InstanceID() string
func (*AWSVolumes) InternalIP ¶
func (a *AWSVolumes) InternalIP() net.IP
type ByEtcdClusterName ¶ added in v1.10.0
type ByEtcdClusterName []*Volume
ByEtcdClusterName sorts volumes so that we mount in a consistent order, and in addition we try to mount the main etcd volume before the events etcd volume
func (ByEtcdClusterName) Len ¶ added in v1.10.0
func (a ByEtcdClusterName) Len() int
func (ByEtcdClusterName) Less ¶ added in v1.10.0
func (a ByEtcdClusterName) Less(i, j int) bool
func (ByEtcdClusterName) Swap ¶ added in v1.10.0
func (a ByEtcdClusterName) Swap(i, j int)
type DNSProvider ¶
type DOVolumes ¶ added in v1.10.0
type DOVolumes struct { ClusterID string Cloud *digitalocean.Cloud // contains filtered or unexported fields }
func NewDOVolumes ¶ added in v1.10.0
func (*DOVolumes) AttachVolume ¶ added in v1.10.0
func (*DOVolumes) FindMountedVolume ¶ added in v1.10.0
func (*DOVolumes) FindVolumes ¶ added in v1.10.0
type EtcdCluster ¶
type EtcdCluster struct { // ClientPort is the incoming ports for client ClientPort int // ClusterName is the cluster name ClusterName string // ClusterToken is the cluster token ClusterToken string // CPURequest is the pod limits CPURequest resource.Quantity // DataDirName is the path to the data directory DataDirName string // ImageSource is the docker image to use ImageSource string // LogFile is the location of the logfile LogFile string // Me is the node that we will be in the cluster Me *EtcdNode // Nodes is a list of nodes in the cluster (including the self-node, Me) Nodes []*EtcdNode // PeerPort is the port for peers to connect PeerPort int // PodName is the name given to the pod PodName string // ProxyMode indicates we are running in proxy mode ProxyMode bool // Spec is the specification found from the volumes Spec *etcd.EtcdClusterSpec // VolumeMountPath is the mount path VolumeMountPath string // TLSAuth indicates we should enforce peer and client verification TLSAuth bool // TLSCA is the path to a client ca for etcd clients TLSCA string // TLSCert is the path to a client certificate for etcd TLSCert string // TLSKey is the path to a client private key for etcd TLSKey string // PeerCA is the path to a peer ca for etcd PeerCA string // PeerCert is the path to a peer ca for etcd PeerCert string // PeerKey is the path to a peer ca for etcd PeerKey string // ElectionTimeout is the leader election timeout ElectionTimeout string // HeartbeatInterval is the heartbeat interval HeartbeatInterval string // BackupImage is the image to use for backing up etcd BackupImage string // BackupStore is a VFS path for backing up etcd BackupStore string }
EtcdCluster is the configuration for the etcd cluster
type EtcdController ¶
type EtcdController struct {
// contains filtered or unexported fields
}
EtcdController defines the etcd controller
func (*EtcdController) RunSyncLoop ¶
func (k *EtcdController) RunSyncLoop()
RunSyncLoop is responsible for managing the etcd sign loop
type GCEVolumes ¶ added in v1.10.0
type GCEVolumes struct {
// contains filtered or unexported fields
}
GCEVolumes is the Volumes implementation for GCE
func NewGCEVolumes ¶ added in v1.10.0
func NewGCEVolumes() (*GCEVolumes, error)
NewGCEVolumes builds a GCEVolumes
func (*GCEVolumes) AttachVolume ¶ added in v1.10.0
func (v *GCEVolumes) AttachVolume(volume *Volume) error
AttachVolume attaches the specified volume to this instance, returning the mountpoint & nil if successful
func (*GCEVolumes) ClusterID ¶ added in v1.10.0
func (a *GCEVolumes) ClusterID() string
ClusterID implements Volumes ClusterID
func (*GCEVolumes) FindMountedVolume ¶ added in v1.10.0
func (v *GCEVolumes) FindMountedVolume(volume *Volume) (string, error)
FindMountedVolume implements Volumes::FindMountedVolume
func (*GCEVolumes) FindVolumes ¶ added in v1.10.0
func (v *GCEVolumes) FindVolumes() ([]*Volume, error)
func (*GCEVolumes) GossipSeeds ¶ added in v1.10.0
func (g *GCEVolumes) GossipSeeds() (gossip.SeedProvider, error)
func (*GCEVolumes) InstanceName ¶ added in v1.10.0
func (g *GCEVolumes) InstanceName() string
func (*GCEVolumes) InternalIP ¶ added in v1.10.0
func (a *GCEVolumes) InternalIP() net.IP
InternalIP implements Volumes InternalIP
func (*GCEVolumes) Project ¶ added in v1.10.0
func (a *GCEVolumes) Project() string
Project returns the current GCE project
type GossipDnsProvider ¶ added in v1.10.0
type GossipDnsProvider struct { DNSView *dns.DNSView Zone dns.DNSZoneInfo }
func (*GossipDnsProvider) Replace ¶ added in v1.10.0
func (p *GossipDnsProvider) Replace(fqdn string, values []string) error
func (*GossipDnsProvider) Run ¶ added in v1.10.0
func (p *GossipDnsProvider) Run()
type KopsDnsProvider ¶ added in v1.10.0
type KopsDnsProvider struct { DNSScope dns.Scope DNSController *dns.DNSController }
func (*KopsDnsProvider) Replace ¶ added in v1.10.0
func (p *KopsDnsProvider) Replace(fqdn string, values []string) error
func (*KopsDnsProvider) Run ¶ added in v1.10.0
func (p *KopsDnsProvider) Run()
type KubeBoot ¶
type KubeBoot struct { // Channels is a list of channel to apply Channels []string // InitializeRBAC should be set to true if we should create the core RBAC roles InitializeRBAC bool // InternalDNSSuffix is the dns zone we are living in InternalDNSSuffix string // InternalIP is the internal ip address of the node InternalIP net.IP // ApplyTaints controls whether we set taints based on the master label ApplyTaints bool // DNS is the dns provider DNS DNSProvider // ModelDir is the model directory ModelDir string // Kubernetes is the context methods for kubernetes Kubernetes *KubernetesContext // Master indicates we are a master node Master bool // ManageEtcd is true if we should manage etcd. // Deprecated in favor of etcd-manager. ManageEtcd bool // EtcdBackupImage is the image to use for backing up etcd EtcdBackupImage string // EtcdBackupStore is the VFS path to which we should backup etcd EtcdBackupStore string // Etcd container registry location. EtcdImageSource string // EtcdElectionTimeout is the leader election timeout EtcdElectionTimeout string // EtcdHeartbeatInterval is the heartbeat interval EtcdHeartbeatInterval string // TLSAuth indicates we should enforce peer and client verification TLSAuth bool // TLSCA is the path to a client ca for etcd TLSCA string // TLSCert is the path to a tls certificate for etcd TLSCert string // TLSKey is the path to a tls private key for etcd TLSKey string // PeerCA is the path to a peer ca for etcd PeerCA string // PeerCert is the path to a peer certificate for etcd PeerCert string // PeerKey is the path to a peer private key for etcd PeerKey string // contains filtered or unexported fields }
KubeBoot is the options for the protokube service
func (*KubeBoot) BuildInternalDNSName ¶
BuildInternalDNSName builds a DNS name for use inside the cluster, adding our internal DNS suffix to the key
func (*KubeBoot) CreateInternalDNSNameRecord ¶
CreateInternalDNSNameRecord maps a FQDN to the internal IP address of the current machine
func (*KubeBoot) RunSyncLoop ¶
func (k *KubeBoot) RunSyncLoop()
RunSyncLoop is responsible for provision the cluster
type KubernetesContext ¶
type KubernetesContext struct {
// contains filtered or unexported fields
}
KubernetesContext is the kubernetes context
func NewKubernetesContext ¶
func NewKubernetesContext() *KubernetesContext
NewKubernetesContext returns a new KubernetesContext
func (*KubernetesContext) KubernetesClient ¶
func (c *KubernetesContext) KubernetesClient() (kubernetes.Interface, error)
KubernetesClient returns a new kubernetes api client
type VSphereVolumes ¶ added in v1.10.0
type VSphereVolumes struct{}
VSphereVolumes represents vSphere volume and implements Volumes interface.
func NewVSphereVolumes ¶ added in v1.10.0
func NewVSphereVolumes() (*VSphereVolumes, error)
NewVSphereVolumes returns instance of VSphereVolumes type.
func (*VSphereVolumes) AttachVolume ¶ added in v1.10.0
func (v *VSphereVolumes) AttachVolume(volume *Volume) error
AttachVolume attaches given volume. In case of vSphere, volumes are statically mounted, so no operation is performed.
func (*VSphereVolumes) FindMountedVolume ¶ added in v1.10.0
func (v *VSphereVolumes) FindMountedVolume(volume *Volume) (string, error)
FindMountedVolume implements Volumes::FindMountedVolume
func (*VSphereVolumes) FindVolumes ¶ added in v1.10.0
func (v *VSphereVolumes) FindVolumes() ([]*Volume, error)
FindVolumes returns Volume instances associated with this VSphereVolumes. EtcdClusterSpec is populated using vSphere volume metadata.
func (*VSphereVolumes) InternalIp ¶ added in v1.10.0
func (v *VSphereVolumes) InternalIp() net.IP
InternalIp returns IP of machine associated with this volume.
type Volume ¶
type Volume struct { // ID is the cloud-provider identifier for the volume ID string // LocalDevice 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 }
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 []*etcd.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) // FindMountedVolume returns the device (e.g. /dev/sda) where the volume is mounted // If not found, it returns "", nil // On error, it returns "", err FindMountedVolume(volume *Volume) (device string, err error) }