cluster

package
v0.8.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package cluster provides functions to access, check and inspect Talos clusters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIBoostrapper

type APIBoostrapper struct {
	ClientProvider
	Info
}

APIBoostrapper bootstraps cluster via Talos API.

func (*APIBoostrapper) Bootstrap

func (s *APIBoostrapper) Bootstrap(ctx context.Context, out io.Writer) error

Bootstrap the cluster via the API.

Bootstrap implements Bootstrapper interface.

type APICrashDumper

type APICrashDumper struct {
	ClientProvider
	Info
}

APICrashDumper collects crash dump via Talos API.

func (*APICrashDumper) CrashDump

func (s *APICrashDumper) CrashDump(ctx context.Context, out io.Writer)

CrashDump produces information to help with debugging.

CrashDump implements CrashDumper interface.

type Bootstrapper

type Bootstrapper interface {
	Bootstrap(ctx context.Context, out io.Writer) error
}

Bootstrapper performs Talos cluster bootstrap.

type ClientProvider

type ClientProvider interface {
	// Client returns Talos client instance for default (if no endpoints are given) or
	// specific endpoint.
	Client(endpoints ...string) (*client.Client, error)
	// Close client connections.
	Close() error
}

ClientProvider builds Talos client by endpoint.

Client instance should be cached and closed when Close() is called.

type ConfigClientProvider

type ConfigClientProvider struct {
	// DefaultClient to be used when using default endpoints.
	//
	// Not required, if missing client will be constructed from the config.
	DefaultClient *client.Client

	// TalosConfig is a client Talos configuration.
	TalosConfig *config.Config
	// contains filtered or unexported fields
}

ConfigClientProvider builds Talos client from client config.

func (*ConfigClientProvider) Client

func (c *ConfigClientProvider) Client(endpoints ...string) (*client.Client, error)

Client returns Talos client instance for default (if no endpoints are given) or specific endpoints.

Client implements ClientProvider interface.

func (*ConfigClientProvider) Close

func (c *ConfigClientProvider) Close() error

Close all the client connections.

type CrashDumper

type CrashDumper interface {
	CrashDump(ctx context.Context, out io.Writer)
}

CrashDumper captures Talos cluster state to the specified writer for debugging.

type Info

type Info interface {
	// Nodes returns list of all node endpoints (IPs).
	Nodes() []string
	// NodesByType return list of node endpoints by type.
	NodesByType(machine.Type) []string
}

Info describes the Talos cluster.

type K8sProvider

type K8sProvider interface {
	Kubeconfig(ctx context.Context) ([]byte, error)
	K8sRestConfig(ctx context.Context) (*rest.Config, error)
	K8sClient(ctx context.Context) (*kubernetes.Clientset, error)
}

K8sProvider builds Kubernetes client to access Talos cluster.

type KubernetesClient

type KubernetesClient struct {
	// Base Talos client provider.
	ClientProvider

	// ForceEndpoint overrides default Kubernetes API endpoint.
	ForceEndpoint string

	KubeHelper *k8s.Client
	// contains filtered or unexported fields
}

KubernetesClient provides Kubernetes client built via Talos API Kubeconfig.

func (*KubernetesClient) K8sClient

func (k *KubernetesClient) K8sClient(ctx context.Context) (*kubernetes.Clientset, error)

K8sClient builds Kubernetes client via Talos Kubeconfig API.

Kubernetes client instance is cached.

func (*KubernetesClient) K8sRestConfig

func (k *KubernetesClient) K8sRestConfig(ctx context.Context) (*rest.Config, error)

K8sRestConfig returns *rest.Config (parsed kubeconfig).

func (*KubernetesClient) Kubeconfig

func (k *KubernetesClient) Kubeconfig(ctx context.Context) ([]byte, error)

Kubeconfig returns raw kubeconfig.

Kubeconfig is cached.

type KubernetesFromKubeletClient

type KubernetesFromKubeletClient struct {
	KubeHelper *kubernetes.Client
	// contains filtered or unexported fields
}

KubernetesFromKubeletClient provides Kubernetes client built from local kubelet config.

func (*KubernetesFromKubeletClient) K8sClient

K8sClient builds Kubernetes client from local kubelet config.

Kubernetes client instance is cached.

type LocalClientProvider

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

LocalClientProvider builds Talos client to connect to same-node apid instance over file socket.

func (*LocalClientProvider) Client

func (c *LocalClientProvider) Client(endpoints ...string) (*client.Client, error)

Client returns Talos client instance for default (if no endpoints are given) or specific endpoints.

Client implements ClientProvider interface.

func (*LocalClientProvider) Close

func (c *LocalClientProvider) Close() error

Close all the client connections.

Directories

Path Synopsis
Package check provides set of checks to verify cluster readiness.
Package check provides set of checks to verify cluster readiness.
Package kubernetes provides cluster-wide kubernetes utilities.
Package kubernetes provides cluster-wide kubernetes utilities.
Package sonobuoy provides functions to to run Kubernetes e2e tests.
Package sonobuoy provides functions to to run Kubernetes e2e tests.

Jump to

Keyboard shortcuts

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