kubernetes

package
v1.14.1-0...-15fee3b Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APICallRetryInterval defines how long kubeadm should wait before retrying a failed API operation
	APICallRetryInterval = 500 * time.Millisecond
	// PatchNodeTimeout specifies how long kubeadm should wait for applying the label and taint on the control-plane before timing out
	PatchNodeTimeout = 2 * time.Minute
	// KubeletHealthzPort is the port of the kubelet healthz endpoint
	KubeletHealthzPort = 10248
	KubeAPIServer      = "kube-apiserver"
	// KubeControllerManager defines variable used internally when referring to kube-controller-manager component
	KubeControllerManager = "kube-controller-manager"
	// KubeScheduler defines variable used internally when referring to kube-scheduler component
	KubeScheduler = "kube-scheduler"
)

Variables

View Source
var (
	// ControlPlaneComponents defines the control-plane component names
	ControlPlaneComponents = []string{KubeAPIServer, KubeControllerManager, KubeScheduler}
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Kubernetes() kubernetes.Interface
	Discovery() discovery.DiscoveryInterface
	KubernetesDynamic() dynamic.Interface
	Config() *rest.Config
}

func NewKubernetesClient

func NewKubernetesClient(kubeconfig, apiserver string) (Client, error)

NewKubernetesClient creates a KubernetesClient

func NewKubernetesClientByConfig

func NewKubernetesClientByConfig(config *rest.Config) (Client, error)

func NewKubernetesClientSkipTLSVerify

func NewKubernetesClientSkipTLSVerify(kubeconfig, apiserver string) (Client, error)

type Expansion

type Expansion interface {
	FetchStaticPod(ctx context.Context, nodeName string, component string) (*v1.Pod, error)
	FetchKubeadmConfig(ctx context.Context) (string, error)
	UpdateKubeadmConfig(ctx context.Context, clusterConfig string) error
	FetchKubeletConfig(ctx context.Context) (string, error)
	UpdateKubeletConfig(ctx context.Context, kubeletConfig string) error
	FetchHostNameFromInternalIP(ctx context.Context, nodeIP string) (string, error)
}

func NewKubeExpansion

func NewKubeExpansion(client clientset.Interface) Expansion

type Healthy

type Healthy interface {
	// ForAPI waits for the API Server's /healthz endpoint to become "ok"
	ForAPI() error
	// ForHealthyKubelet blocks until the kubelet /healthz endpoint returns 'ok'
	ForHealthyKubelet(initialTimeout time.Duration, host string) error
	// SetTimeout adjusts the timeout to the specified duration
	SetTimeout(timeout time.Duration)
	// ForHealthyPod pod status
	ForHealthyPod(pod *v1.Pod) string
}

Healthy is an interface for waiting for criteria in Kubernetes to happen

func NewKubeHealthy

func NewKubeHealthy(client clientset.Interface, timeout time.Duration) Healthy

NewKubeHealthy returns a new Healthy object that talks to the given Kubernetes cluster

type Idempotency

type Idempotency interface {
	CreateOrUpdateConfigMap(cm *v1.ConfigMap) error
	CreateOrUpdateSecret(secret *v1.Secret) error
	CreateOrUpdateServiceAccount(sa *v1.ServiceAccount) error
	CreateOrUpdateDeployment(deploy *apps.Deployment) error
	CreateOrUpdateDaemonSet(ds *apps.DaemonSet) error
	DeleteDaemonSetForeground(namespace, name string) error
	DeleteDeploymentForeground(namespace, name string) error
	CreateOrUpdateRole(role *rbac.Role) error
	CreateOrUpdateRoleBinding(roleBinding *rbac.RoleBinding) error
	CreateOrUpdateClusterRole(clusterRole *rbac.ClusterRole) error
	CreateOrUpdateClusterRoleBinding(clusterRoleBinding *rbac.ClusterRoleBinding) error
	PatchNode(nodeName string, patchFn func(*v1.Node)) error
}

func NewKubeIdempotency

func NewKubeIdempotency(client clientset.Interface) Idempotency

NewKubeIdempotency returns a new Idempotency object that talks to the given Kubernetes cluster

Jump to

Keyboard shortcuts

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