kubernetes

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdaptFunc

func AdaptFunc(
	clusterID string,
	oneoff bool,
	deployOrbiter bool,
	destroyProviders func() (map[string]interface{}, error),
	whitelist func(whitelist []*orbiter.CIDR)) orbiter.AdaptFunc

func EnsureBoomArtifacts added in v0.21.0

func EnsureBoomArtifacts(monitor mntr.Monitor, client *Client, version string, tolerations k8s.Tolerations, nodeselector map[string]string, resources *k8s.Resources) error

func EnsureCommonArtifacts added in v0.21.0

func EnsureCommonArtifacts(monitor mntr.Monitor, client *Client) error

func EnsureConfigArtifacts added in v0.21.0

func EnsureConfigArtifacts(monitor mntr.Monitor, client *Client, orb *orb.Orb) error

func EnsureOrbiterArtifacts added in v0.21.0

func EnsureOrbiterArtifacts(monitor mntr.Monitor, client *Client, orbiterversion string) error

func EnsureZitadelArtifacts added in v0.30.0

func EnsureZitadelArtifacts(
	monitor mntr.Monitor,
	client *Client,
	version string,
	nodeselector map[string]string,
	tolerations []core.Toleration) error

func GetProviderInfos added in v0.26.0

func GetProviderInfos(desired *DesiredV0, providerCurrents map[string]interface{}) (map[string]map[string]infra.Pool, *infra.Address, error)

func KubernetesSoftware

func KubernetesSoftware(current common.Software) common.Software

func ScaleZitadelOperator added in v0.30.0

func ScaleZitadelOperator(
	monitor mntr.Monitor,
	client *Client,
	replicaCount int,
) error

Types

type Client

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

func NewK8sClient

func NewK8sClient(monitor mntr.Monitor, kubeconfig *string) *Client

func (*Client) ApplyClusterRole

func (c *Client) ApplyClusterRole(rsc *rbac.ClusterRole) error

func (*Client) ApplyClusterRoleBinding

func (c *Client) ApplyClusterRoleBinding(rsc *rbac.ClusterRoleBinding) error

func (*Client) ApplyConfigmap added in v0.30.0

func (c *Client) ApplyConfigmap(rsc *core.ConfigMap) error

func (*Client) ApplyCronJob added in v0.30.0

func (c *Client) ApplyCronJob(rsc *v1beta1.CronJob) error

func (*Client) ApplyDeployment

func (c *Client) ApplyDeployment(rsc *apps.Deployment) error

func (*Client) ApplyJob added in v0.30.0

func (c *Client) ApplyJob(rsc *batch.Job) error

func (*Client) ApplyNamespace

func (c *Client) ApplyNamespace(rsc *core.Namespace) error

func (*Client) ApplyNamespacedCRDResource added in v0.30.0

func (c *Client) ApplyNamespacedCRDResource(group, version, kind, namespace, name string, crd *unstructured.Unstructured) error

func (*Client) ApplyPodDisruptionBudget added in v0.30.0

func (c *Client) ApplyPodDisruptionBudget(rsc *policy.PodDisruptionBudget) error

func (*Client) ApplyRole

func (c *Client) ApplyRole(rsc *rbac.Role) error

func (*Client) ApplyRoleBinding

func (c *Client) ApplyRoleBinding(rsc *rbac.RoleBinding) error

func (*Client) ApplySecret

func (c *Client) ApplySecret(rsc *core.Secret) error

func (*Client) ApplyService

func (c *Client) ApplyService(rsc *core.Service) error

func (*Client) ApplyServiceAccount

func (c *Client) ApplyServiceAccount(rsc *core.ServiceAccount) error

func (*Client) ApplyStatefulSet added in v0.30.0

func (c *Client) ApplyStatefulSet(rsc *apps.StatefulSet) error

func (*Client) Available

func (c *Client) Available() bool

func (*Client) CheckCRD added in v0.30.0

func (c *Client) CheckCRD(name string) (*apixv1beta1.CustomResourceDefinition, error)

func (*Client) DeleteClusterRole added in v0.30.0

func (c *Client) DeleteClusterRole(name string) error

func (*Client) DeleteClusterRoleBinding added in v0.30.0

func (c *Client) DeleteClusterRoleBinding(name string) error

func (*Client) DeleteConfigmap added in v0.30.0

func (c *Client) DeleteConfigmap(namespace, name string) error

func (*Client) DeleteCronJob added in v0.30.0

func (c *Client) DeleteCronJob(namespace string, name string) error

func (*Client) DeleteDeployment

func (c *Client) DeleteDeployment(namespace, name string) error

func (*Client) DeleteJob added in v0.30.0

func (c *Client) DeleteJob(namespace string, name string) error

func (*Client) DeleteNamespace added in v0.30.0

func (c *Client) DeleteNamespace(name string) error

func (*Client) DeleteNamespacedCRDResource added in v0.30.0

func (c *Client) DeleteNamespacedCRDResource(group, version, kind, namespace, name string) error

func (*Client) DeletePod added in v0.30.0

func (c *Client) DeletePod(namespace, name string) error

func (*Client) DeletePodDisruptionBudget added in v0.30.0

func (c *Client) DeletePodDisruptionBudget(namespace string, name string) error

func (*Client) DeletePodsByLabels added in v0.30.0

func (c *Client) DeletePodsByLabels(namespace string, labels map[string]string) error

func (*Client) DeleteRole added in v0.30.0

func (c *Client) DeleteRole(namespace, name string) error

func (*Client) DeleteRoleBinding added in v0.30.0

func (c *Client) DeleteRoleBinding(namespace, name string) error

func (*Client) DeleteSecret added in v0.30.0

func (c *Client) DeleteSecret(namespace, name string) error

func (*Client) DeleteService added in v0.30.0

func (c *Client) DeleteService(namespace, name string) error

func (*Client) DeleteServiceAccount added in v0.30.0

func (c *Client) DeleteServiceAccount(namespace, name string) error

func (*Client) DeleteStatefulset added in v0.30.0

func (c *Client) DeleteStatefulset(namespace, name string) error

func (*Client) Drain

func (c *Client) Drain(machine *Machine, node *core.Node, reason drainReason) (err error)

func (*Client) EnsureDeleted

func (c *Client) EnsureDeleted(name string, machine *Machine, node NodeWithKubeadm) (err error)

func (*Client) ExecInPod added in v0.30.0

func (c *Client) ExecInPod(namespace, name, container, command string) error

func (*Client) ExecInPodOfDeployment added in v0.30.0

func (c *Client) ExecInPodOfDeployment(namespace, name, container, command string) error

func (*Client) GetConfigMap added in v0.30.0

func (c *Client) GetConfigMap(namespace, name string) (*core.ConfigMap, error)

func (*Client) GetDeployment added in v0.30.0

func (c *Client) GetDeployment(namespace, name string) (*apps.Deployment, error)

func (*Client) GetJob added in v0.30.0

func (c *Client) GetJob(namespace, name string) (*batch.Job, error)

func (*Client) GetNamespacedCRDResource added in v0.30.0

func (c *Client) GetNamespacedCRDResource(group, version, kind, namespace, name string) (*unstructured.Unstructured, error)

func (*Client) GetNode

func (c *Client) GetNode(id string) (node *core.Node, err error)

func (*Client) ListNamespaces added in v0.30.0

func (c *Client) ListNamespaces() (*core.NamespaceList, error)

func (*Client) ListNodes

func (c *Client) ListNodes(filterID ...string) (nodes []core.Node, err error)

func (*Client) ListSecrets added in v0.30.0

func (c *Client) ListSecrets(namespace string, labels map[string]string) (*core.SecretList, error)

func (*Client) Refresh

func (c *Client) Refresh(kubeconfig *string) (err error)

func (*Client) RefreshConfig added in v0.25.0

func (c *Client) RefreshConfig(config *rest.Config) (err error)

func (*Client) RemoveFromTaints added in v0.29.0

func (c *Client) RemoveFromTaints(taints []core.Taint, reason drainReason) (result []core.Taint)

func (*Client) ScaleDeployment added in v0.30.0

func (c *Client) ScaleDeployment(namespace, name string, replicaCount int) error

func (*Client) Tainted added in v0.29.0

func (c *Client) Tainted(node *core.Node, reason drainReason) bool

func (*Client) WaitForConfigMap added in v0.30.0

func (c *Client) WaitForConfigMap(namespace string, name string, timeoutSeconds time.Duration) error

func (*Client) WaitForSecret added in v0.30.0

func (c *Client) WaitForSecret(namespace string, name string, timeoutSeconds time.Duration) error

func (*Client) WaitUntilDeploymentReady added in v0.30.0

func (c *Client) WaitUntilDeploymentReady(namespace string, name string, containerCheck, readyCheck bool, timeoutSeconds time.Duration) error

func (*Client) WaitUntilJobCompleted added in v0.30.0

func (c *Client) WaitUntilJobCompleted(namespace string, name string, timeoutSeconds time.Duration) error

func (*Client) WaitUntilStatefulsetIsReady added in v0.30.0

func (c *Client) WaitUntilStatefulsetIsReady(namespace string, name string, containerCheck, readyCheck bool, timeoutSeconds time.Duration) error

type CloudIntegration added in v0.22.0

type CloudIntegration int

type Current

type Current struct {
	Common  tree.Common `yaml:",inline"`
	Current *CurrentCluster
}

type CurrentCluster

type CurrentCluster struct {
	Status   string
	Machines Machines
}

type DesiredV0

type DesiredV0 struct {
	Common tree.Common `yaml:",inline"`
	Spec   Spec
}

type File

type File struct {
	Name    string
	Content []byte
}

type IDFunc

type IDFunc func() string

func (IDFunc) ID

func (i IDFunc) ID() string

type KubernetesVersion

type KubernetesVersion int
const (
	Unknown KubernetesVersion = iota
	V1x15x0
	V1x15x1
	V1x15x2
	V1x15x3
	V1x15x4
	V1x15x5
	V1x15x6
	V1x15x7
	V1x15x8
	V1x15x9
	V1x15x10
	V1x15x11
	V1x15x12
	V1x16x0
	V1x16x1
	V1x16x2
	V1x16x3
	V1x16x4
	V1x16x5
	V1x16x6
	V1x16x7
	V1x16x8
	V1x16x9
	V1x16x10
	V1x16x11
	V1x16x12
	V1x16x13
	V1x16x14
	V1x17x0
	V1x17x1
	V1x17x2
	V1x17x3
	V1x17x4
	V1x17x5
	V1x17x6
	V1x17x7
	V1x17x8
	V1x17x9
	V1x17x10
	V1x17x11
	V1x18x0
	V1x18x1
	V1x18x2
	V1x18x3
	V1x18x4
	V1x18x5
	V1x18x6
	V1x18x7
	V1x18x8
)

func ParseString

func ParseString(version string) KubernetesVersion

func (KubernetesVersion) DefineSoftware

func (k KubernetesVersion) DefineSoftware() common.Software

func (KubernetesVersion) ExtractMinor

func (k KubernetesVersion) ExtractMinor(monitor mntr.Monitor) (int, error)

func (KubernetesVersion) ExtractPatch

func (k KubernetesVersion) ExtractPatch(monitor mntr.Monitor) (int, error)

func (KubernetesVersion) NextHighestMinor

func (k KubernetesVersion) NextHighestMinor() KubernetesVersion

func (KubernetesVersion) String

func (k KubernetesVersion) String() string

type Machine

type Machine struct {
	Joined          bool
	Updating        bool
	Rebooting       bool
	Ready           bool
	FirewallIsReady bool
	Unknown         bool
	Metadata        MachineMetadata `yaml:",inline"`
}

type MachineMetadata

type MachineMetadata struct {
	Tier     Tier
	Provider string
	Pool     string
	Group    string `yaml:",omitempty"`
}

type Machines added in v0.23.0

type Machines struct {
	// M is exported for yaml (de)serialization and not intended to be accessed by any other code outside this package
	M map[string]*Machine `yaml:",inline"`
	// contains filtered or unexported fields
}

func (*Machines) Delete added in v0.23.0

func (m *Machines) Delete(id string)

func (*Machines) Set added in v0.23.0

func (m *Machines) Set(id string, machine *Machine)

type NodeWithKubeadm

type NodeWithKubeadm interface {
	Execute(stdin io.Reader, cmd string) ([]byte, error)
}

type NotAvailableError

type NotAvailableError struct{}

func (*NotAvailableError) Error

func (n *NotAvailableError) Error() string

type Pool

type Pool struct {
	UpdatesDisabled bool
	Provider        string
	Nodes           int
	Pool            string
	Taints          *Taints `yaml:"taints,omitempty"`
}

type Spec

type Spec struct {
	ControlPlane Pool
	Kubeconfig   *secret.Secret `yaml:",omitempty"`
	Networking   struct {
		DNSDomain   string
		Network     string
		ServiceCidr orbiter.CIDR
		PodCidr     orbiter.CIDR
	}
	Verbose  bool
	Versions struct {
		Kubernetes string
		Orbiter    string
	}
	Workers []*Pool
}

type Taint

type Taint struct {
	Key    string           `yaml:"key"`
	Value  string           `yaml:"value,omitempty"`
	Effect core.TaintEffect `yaml:"effect"`
}

type Taints

type Taints []Taint

func (*Taints) ToK8sTaints

func (t *Taints) ToK8sTaints() []core.Taint

type Tier

type Tier string
const (
	Controlplane Tier = "controlplane"
	Workers      Tier = "workers"
)

type Versions

type Versions struct {
	NodeAgent  string
	Kubernetes string
}

Jump to

Keyboard shortcuts

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