v1.2.0 Latest Latest

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

Go to latest
Published: May 25, 2016 License: Apache-2.0 Imports: 131 Imported by: 0



Package kubernetes provides objects for starting the Kubernetes master and node code.



View Source
const (
	KubeAPIPrefix                  = "/api"
	KubeAPIPrefixV1                = KubeAPIPrefix + "/v1"
	KubeAPIGroupPrefix             = "/apis"
	KubeAPIExtensionsPrefixV1beta1 = KubeAPIGroupPrefix + "/extensions/v1beta1"


View Source
var AdmissionPlugins = []string{"RunOnceDuration", lifecycle.PluginName, "PodNodeConstraints", "OriginPodNodeEnvironment", overrideapi.PluginName, serviceadmit.ExternalIPPluginName, "LimitRanger", "ServiceAccount", "SecurityContextConstraint", "BuildDefaults", "BuildOverrides", "ResourceQuota", "SCCExecRestrictions"}

AdmissionPlugins is the full list of admission control plugins to enable in the order they must run


func NewEtcdStorage added in v1.1.2

func NewEtcdStorage(client newetcdclient.Client, version unversioned.GroupVersion, prefix string) (helper storage.Interface, err error)

NewEtcdStorage returns a storage interface for the provided storage version.

func SetFakeCadvisorInterfaceForIntegrationTest added in v1.0.7

func SetFakeCadvisorInterfaceForIntegrationTest()

SetFakeCadvisorInterfaceForIntegrationTest sets a fake cadvisor implementation to allow the node to run in integration tests

func SetFakeContainerManagerInterfaceForIntegrationTest added in v1.1.2

func SetFakeContainerManagerInterfaceForIntegrationTest()

SetFakeContainerManagerInterfaceForIntegrationTest sets a fake container manager implementation to allow the node to run in integration tests


type MasterConfig

type MasterConfig struct {
	Options    configapi.KubernetesMasterConfig
	KubeClient *kclient.Client

	Master            *master.Config
	ControllerManager *cmapp.CMServer
	CloudProvider     cloudprovider.Interface

MasterConfig defines the required values to start a Kubernetes master

func BuildKubernetesMasterConfig added in v0.4.2

func BuildKubernetesMasterConfig(options configapi.MasterConfig, requestContextMapper kapi.RequestContextMapper, kubeClient *kclient.Client, pluginInitializer oadmission.PluginInitializer) (*MasterConfig, error)

func (*MasterConfig) InstallAPI

func (c *MasterConfig) InstallAPI(container *restful.Container) ([]string, error)

InstallAPI starts a Kubernetes master and registers the supported REST APIs into the provided mux, then returns an array of strings indicating what endpoints were started (these are format strings that will expect to be sent a single string value).

func (*MasterConfig) RunDaemonSetsController added in v1.1.2

func (c *MasterConfig) RunDaemonSetsController(client *client.Client)

func (*MasterConfig) RunEndpointController

func (c *MasterConfig) RunEndpointController()

RunEndpointController starts the Kubernetes replication controller sync loop

func (*MasterConfig) RunGCController added in v1.1.5

func (c *MasterConfig) RunGCController(client *client.Client)

func (*MasterConfig) RunHPAController added in v1.0.7

func (c *MasterConfig) RunHPAController(oc *osclient.Client, kc *client.Client, heapsterNamespace string)

RunHPAController starts the Kubernetes hpa controller sync loop

func (*MasterConfig) RunJobController added in v1.0.7

func (c *MasterConfig) RunJobController(client *client.Client)

RunJobController starts the Kubernetes job controller sync loop

func (*MasterConfig) RunNamespaceController added in v0.4.3

func (c *MasterConfig) RunNamespaceController(kubeClient internalclientset.Interface, clientPool dynamic.ClientPool)

RunNamespaceController starts the Kubernetes Namespace Manager

func (*MasterConfig) RunNodeController added in v0.5.3

func (c *MasterConfig) RunNodeController()

RunNodeController starts the node controller

func (*MasterConfig) RunPersistentVolumeClaimBinder added in v0.5.2

func (c *MasterConfig) RunPersistentVolumeClaimBinder(client *client.Client)

RunPersistentVolumeClaimBinder starts the Kubernetes Persistent Volume Claim Binder

func (*MasterConfig) RunPersistentVolumeClaimRecycler added in v0.6.1

func (c *MasterConfig) RunPersistentVolumeClaimRecycler(recyclerImageName string, client *client.Client, namespace string)

func (*MasterConfig) RunPersistentVolumeProvisioner added in v1.1.1

func (c *MasterConfig) RunPersistentVolumeProvisioner(client *client.Client)

func (*MasterConfig) RunReplicationController

func (c *MasterConfig) RunReplicationController(client *client.Client)

RunReplicationController starts the Kubernetes replication controller sync loop

func (*MasterConfig) RunResourceQuotaManager added in v0.3.2

func (c *MasterConfig) RunResourceQuotaManager()

RunResourceQuotaManager starts the resource quota manager

func (*MasterConfig) RunScheduler

func (c *MasterConfig) RunScheduler()

RunScheduler starts the Kubernetes scheduler

type NodeAuthorizerAttributesGetter added in v1.0.7

type NodeAuthorizerAttributesGetter struct {
	// contains filtered or unexported fields

func (NodeAuthorizerAttributesGetter) GetRequestAttributes added in v1.0.7

GetRequestAttributes populates authorizer attributes for the requests to the kubelet API. Default attributes are {apiVersion=v1,verb=proxy,resource=nodes,resourceName=<node name>} More specific verb/resource is set for the following request patterns:

/stats/*   => verb=<api verb from request>, resource=nodes/stats
/metrics/* => verb=<api verb from request>, resource=nodes/metrics
/logs/*    => verb=<api verb from request>, resource=nodes/log

type NodeConfig

type NodeConfig struct {
	// BindAddress is the address to bind to
	BindAddress string
	// VolumeDir is the directory that volumes will be stored under
	VolumeDir string
	// AllowDisabledDocker if true, will make the Kubelet ignore errors from Docker
	AllowDisabledDocker bool
	// Containerized is true if we are expected to be running inside of a container
	Containerized bool

	// Client to connect to the master.
	Client *client.Client
	// DockerClient is a client to connect to Docker
	DockerClient dockertools.DockerInterface
	// KubeletServer contains the KubeletServer configuration
	KubeletServer *kubeletoptions.KubeletServer
	// KubeletConfig is the configuration for the kubelet, fully initialized
	KubeletConfig *kubeletapp.KubeletConfig
	// ProxyConfig is the configuration for the kube-proxy, fully initialized
	ProxyConfig *proxyoptions.ProxyServerConfig
	// IPTablesSyncPeriod is how often iptable rules are refreshed
	IPTablesSyncPeriod string

	// Maximum transmission unit for the network packets
	MTU uint
	// SDNPlugin is an optional SDN plugin
	SDNPlugin osdnapi.OsdnPlugin
	// EndpointsFilterer is an optional endpoints filterer
	FilteringEndpointsHandler osdnapi.FilteringEndpointsConfigHandler

NodeConfig represents the required parameters to start the OpenShift node through Kubernetes. All fields are required.

func BuildKubernetesNodeConfig added in v0.4.2

func BuildKubernetesNodeConfig(options configapi.NodeConfig) (*NodeConfig, error)

func (*NodeConfig) EnsureDocker

func (c *NodeConfig) EnsureDocker(docker *dockerutil.Helper)

EnsureDocker attempts to connect to the Docker daemon defined by the helper, and if it is unable to it will print a warning.

func (*NodeConfig) EnsureKubeletAccess added in v1.1.4

func (c *NodeConfig) EnsureKubeletAccess()

EnsureKubeletAccess performs a number of test operations that the Kubelet requires to properly function. All errors here are fatal.

func (*NodeConfig) EnsureLocalQuota added in v1.1.5

func (c *NodeConfig) EnsureLocalQuota(nodeConfig configapi.NodeConfig)

EnsureLocalQuota checks if the node config specifies a local storage perFSGroup quota, and if so will test that the volumeDirectory is on a filesystem suitable for quota enforcement. If checks pass the k8s emptyDir volume plugin will be replaced with a wrapper version which adds quota functionality.

func (*NodeConfig) EnsureVolumeDir

func (c *NodeConfig) EnsureVolumeDir()

EnsureVolumeDir attempts to convert the provided volume directory argument to an absolute path and create the directory if it does not exist. Will exit if an error is encountered.

func (*NodeConfig) HandleDockerError added in v0.5.1

func (c *NodeConfig) HandleDockerError(message string)

HandleDockerError handles an an error from the docker daemon

func (*NodeConfig) ResetSysctlFromProxy added in v1.1.4

func (c *NodeConfig) ResetSysctlFromProxy()

ResetSysctlFromProxy resets the bridge-nf-call-iptables systctl that the Kube proxy sets, which is required for normal Docker containers to talk to the SDN plugin on the local system. Resolution is https://github.com/kubernetes/kubernetes/pull/20647

func (*NodeConfig) RunKubelet

func (c *NodeConfig) RunKubelet()

RunKubelet starts the Kubelet.

func (*NodeConfig) RunPlugin added in v1.1.4

func (c *NodeConfig) RunPlugin()

RunPlugin starts the local SDN plugin, if enabled in configuration.

func (*NodeConfig) RunProxy

func (c *NodeConfig) RunProxy()

RunProxy starts the proxy

type ProxyConfig added in v0.2.2

type ProxyConfig struct {
	ClientConfig *restclient.Config

func (*ProxyConfig) InstallAPI added in v0.2.2

func (c *ProxyConfig) InstallAPI(container *restful.Container) ([]string, error)

Jump to

Keyboard shortcuts

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