k8sapi

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: AGPL-3.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseJoinCommand

func ParseJoinCommand(joinCommand string) (*kubeadm.BootstrapTokenDiscovery, error)

Types

type Client

type Client interface {
	Apply(resources kubernetes.Marshaler, forceConflicts bool) error
	SetKubeconfig(kubeconfig []byte)
	CreateConfigMap(ctx context.Context, configMap corev1.ConfigMap) error
	AddTolerationsToDeployment(ctx context.Context, tolerations []corev1.Toleration, name string, namespace string) error
	AddNodeSelectorsToDeployment(ctx context.Context, selectors map[string]string, name string, namespace string) error
	WaitForCRDs(ctx context.Context, crds []string) error
	ListAllNamespaces(ctx context.Context) (*corev1.NamespaceList, error)
}

Client provides the functions to talk to the k8s API.

type KubdeadmConfiguration added in v2.2.0

type KubdeadmConfiguration struct{}

func (*KubdeadmConfiguration) InitConfiguration added in v2.2.0

func (c *KubdeadmConfiguration) InitConfiguration(externalCloudProvider bool, k8sVersion versions.ValidK8sVersion) KubeadmInitYAML

func (*KubdeadmConfiguration) JoinConfiguration added in v2.2.0

func (c *KubdeadmConfiguration) JoinConfiguration(externalCloudProvider bool) KubeadmJoinYAML

type KubeadmInitYAML

type KubeadmInitYAML struct {
	InitConfiguration    kubeadm.InitConfiguration
	ClusterConfiguration kubeadm.ClusterConfiguration
	KubeletConfiguration kubeletconf.KubeletConfiguration
}

func (*KubeadmInitYAML) Marshal

func (k *KubeadmInitYAML) Marshal() ([]byte, error)

func (*KubeadmInitYAML) SetAPIServerAdvertiseAddress

func (k *KubeadmInitYAML) SetAPIServerAdvertiseAddress(apiServerAdvertiseAddress string)

func (*KubeadmInitYAML) SetCertSANs

func (k *KubeadmInitYAML) SetCertSANs(certSANs []string)

SetCertSANs sets the SANs for the certificate.

func (*KubeadmInitYAML) SetControlPlaneEndpoint

func (k *KubeadmInitYAML) SetControlPlaneEndpoint(controlPlaneEndpoint string)

SetControlPlaneEndpoint sets the control plane endpoint if controlPlaneEndpoint is not empty.

func (*KubeadmInitYAML) SetNodeIP

func (k *KubeadmInitYAML) SetNodeIP(nodeIP string)

func (*KubeadmInitYAML) SetNodeName

func (k *KubeadmInitYAML) SetNodeName(nodeName string)

func (*KubeadmInitYAML) SetPodNetworkCIDR

func (k *KubeadmInitYAML) SetPodNetworkCIDR(podNetworkCIDR string)

func (*KubeadmInitYAML) SetProviderID

func (k *KubeadmInitYAML) SetProviderID(providerID string)

func (*KubeadmInitYAML) SetServiceCIDR

func (k *KubeadmInitYAML) SetServiceCIDR(serviceCIDR string)

func (*KubeadmInitYAML) SetServiceDNSDomain

func (k *KubeadmInitYAML) SetServiceDNSDomain(serviceDNSDomain string)

func (*KubeadmInitYAML) Unmarshal

func (k *KubeadmInitYAML) Unmarshal(yamlData []byte) (KubeadmInitYAML, error)

type KubeadmJoinYAML

type KubeadmJoinYAML struct {
	JoinConfiguration    kubeadm.JoinConfiguration
	KubeletConfiguration kubeletconf.KubeletConfiguration
}

func (*KubeadmJoinYAML) AppendDiscoveryTokenCaCertHash

func (k *KubeadmJoinYAML) AppendDiscoveryTokenCaCertHash(discoveryTokenCaCertHash string)

func (*KubeadmJoinYAML) Marshal

func (k *KubeadmJoinYAML) Marshal() ([]byte, error)

func (*KubeadmJoinYAML) SetAPIServerEndpoint

func (k *KubeadmJoinYAML) SetAPIServerEndpoint(apiServerEndpoint string)

func (*KubeadmJoinYAML) SetControlPlane

func (k *KubeadmJoinYAML) SetControlPlane(advertiseAddress string)

func (*KubeadmJoinYAML) SetNodeIP

func (k *KubeadmJoinYAML) SetNodeIP(nodeIP string)

func (*KubeadmJoinYAML) SetNodeName

func (k *KubeadmJoinYAML) SetNodeName(nodeName string)

func (*KubeadmJoinYAML) SetProviderID

func (k *KubeadmJoinYAML) SetProviderID(providerID string)

func (*KubeadmJoinYAML) SetToken

func (k *KubeadmJoinYAML) SetToken(token string)

func (*KubeadmJoinYAML) Unmarshal

func (k *KubeadmJoinYAML) Unmarshal(yamlData []byte) (KubeadmJoinYAML, error)

type KubernetesUtil

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

KubernetesUtil provides low level management of the kubernetes cluster.

func NewKubernetesUtil

func NewKubernetesUtil() *KubernetesUtil

NewKubernetesUtil creates a new KubernetesUtil.

func (*KubernetesUtil) FixCilium

func (k *KubernetesUtil) FixCilium(log *logger.Logger)

FixCilium fixes https://github.com/cilium/cilium/issues/19958 but instead of a rollout restart of the cilium daemonset, it only restarts the local cilium pod.

func (*KubernetesUtil) InitCluster

func (k *KubernetesUtil) InitCluster(
	ctx context.Context, initConfig []byte, nodeName string, ips []net.IP, controlPlaneEndpoint string, conformanceMode bool, log *logger.Logger,
) error

func (*KubernetesUtil) InstallComponents

func (k *KubernetesUtil) InstallComponents(ctx context.Context, version versions.ValidK8sVersion) error

InstallComponents installs kubernetes components in the version specified.

func (*KubernetesUtil) JoinCluster

func (k *KubernetesUtil) JoinCluster(ctx context.Context, joinConfig []byte, peerRole role.Role, controlPlaneEndpoint string, log *logger.Logger) error

JoinCluster joins existing Kubernetes cluster using kubeadm join.

func (*KubernetesUtil) SetupAccessManager

func (k *KubernetesUtil) SetupAccessManager(kubectl Client, accessManagerConfiguration kubernetes.Marshaler) error

SetupAccessManager deploys the constellation-access-manager for deploying SSH keys on control-plane & worker nodes.

func (*KubernetesUtil) SetupAutoscaling

func (k *KubernetesUtil) SetupAutoscaling(kubectl Client, clusterAutoscalerConfiguration kubernetes.Marshaler, secrets kubernetes.Marshaler) error

SetupAutoscaling deploys the k8s cluster autoscaler.

func (*KubernetesUtil) SetupGCPGuestAgent

func (k *KubernetesUtil) SetupGCPGuestAgent(kubectl Client, guestAgentDaemonset kubernetes.Marshaler) error

SetupGCPGuestAgent deploys the GCP guest agent daemon set.

func (*KubernetesUtil) SetupKonnectivity

func (k *KubernetesUtil) SetupKonnectivity(kubectl Client, konnectivityAgentsDaemonSet kubernetes.Marshaler) error

func (*KubernetesUtil) SetupNodeMaintenanceOperator

func (k *KubernetesUtil) SetupNodeMaintenanceOperator(kubectl Client, nodeMaintenanceOperatorConfiguration kubernetes.Marshaler) error

func (*KubernetesUtil) SetupNodeOperator

func (k *KubernetesUtil) SetupNodeOperator(ctx context.Context, kubectl Client, nodeOperatorConfiguration kubernetes.Marshaler) error

func (*KubernetesUtil) SetupOperatorLifecycleManager

func (k *KubernetesUtil) SetupOperatorLifecycleManager(ctx context.Context, kubectl Client, olmCRDs, olmConfiguration kubernetes.Marshaler, crdNames []string) error

func (*KubernetesUtil) SetupVerificationService

func (k *KubernetesUtil) SetupVerificationService(kubectl Client, verificationServiceConfiguration kubernetes.Marshaler) error

SetupVerificationService deploys the verification service.

func (*KubernetesUtil) StartKubelet

func (k *KubernetesUtil) StartKubelet() error

StartKubelet enables and starts the kubelet systemd unit.

type SetupPodNetworkInput

type SetupPodNetworkInput struct {
	CloudProvider        string
	NodeName             string
	FirstNodePodCIDR     string
	SubnetworkPodCIDR    string
	ProviderID           string
	LoadBalancerEndpoint string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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