kubernetes

package
v0.0.0-...-9ec3720 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// K8sCloudMicrok8s is the name used for microk8s k8s clouds.
	K8sCloudMicrok8s = "microk8s"

	// K8sCloudGCE is the name used for GCE k8s clouds(GKE, CDK).
	K8sCloudGCE = "gce"

	// K8sCloudAzure is the name used for Azure k8s clouds(AKS, CDK).
	K8sCloudAzure = "azure"

	// K8sCloudEC2 is the name used for AWS k8s clouds(EKS, CDK).
	K8sCloudEC2 = "ec2"

	// K8sCloudOpenStack is the name used for openstack k8s clouds(CDK).
	K8sCloudOpenStack = "openstack"

	// K8sCloudMAAS is the name used for MAAS k8s clouds(CDK).
	K8sCloudMAAS = "maas"

	// K8sCloudLXD is the name used for LXD k8s clouds(Kubernetes Core).
	K8sCloudLXD = "lxd"

	// K8sCloudRackspace is the name used for Rackspace k8s clouds(CDK).
	K8sCloudRackspace = "rackspace"

	// K8sCloudOther is the name used for any other k8s cloud is not listed above.
	K8sCloudOther = "other"

	// Microk8sRegion is the single microk8s cloud region.
	Microk8sRegion = "localhost"

	// MicroK8sClusterName is the cluster named used by microk8s.
	MicroK8sClusterName = "microk8s-cluster"
)
View Source
const (
	TunnelKindPods     = TunnelKind("pods")
	TunnelKindServices = TunnelKind("services")
)

Variables

This section is empty.

Functions

func IsNonPreferredStorageError

func IsNonPreferredStorageError(err error) bool

IsNonPreferredStorageError returns true if err is a NonPreferredStorageError.

Types

type ClusterMetadata

type ClusterMetadata struct {
	NominatedStorageClass *StorageProvisioner
	OperatorStorageClass  *StorageProvisioner
	Cloud                 string
	Regions               set.Strings
}

ClusterMetadata defines metadata about a cluster.

type ClusterMetadataChecker

type ClusterMetadataChecker interface {
	// GetClusterMetadata returns metadata about host cloud and storage for the cluster.
	GetClusterMetadata(storageClass string) (result *ClusterMetadata, err error)

	// CheckDefaultWorkloadStorage returns an error if the opinionated storage defined for
	// the cluster does not match the specified storage.
	CheckDefaultWorkloadStorage(cluster string, storageProvisioner *StorageProvisioner) error

	// EnsureStorageProvisioner creates a storage provisioner with the specified config, or returns an existing one.
	EnsureStorageProvisioner(cfg StorageProvisioner) (*StorageProvisioner, bool, error)
}

ClusterMetadataChecker provides an API to query cluster metadata.

type NonPreferredStorageError

type NonPreferredStorageError struct {
	PreferredStorage
}

NonPreferredStorageError is raised when a cluster does not have the opinionated default storage Juju requires.

func (*NonPreferredStorageError) Error

func (e *NonPreferredStorageError) Error() string

Error implements error.

type PreferredStorage

type PreferredStorage struct {
	Name              string
	Provisioner       string
	Parameters        map[string]string
	VolumeBindingMode string
}

PreferredStorage defines preferred storage attributes on a given cluster.

type StorageProvisioner

type StorageProvisioner struct {
	Name              string
	Provisioner       string
	Parameters        map[string]string
	Namespace         string
	Model             string
	ReclaimPolicy     string
	VolumeBindingMode string
}

StorageProvisioner defines the a storage provisioner available on a cluster.

type Tunnel

type Tunnel struct {
	Kind      TunnelKind
	LocalPort string
	Namespace string
	Out       io.Writer

	RemotePort string

	Target string
	// contains filtered or unexported fields
}

Tunnel represents an ssh like tunnel to a Kubernetes Pod or Service

func NewTunnel

func NewTunnel(
	client rest.Interface,
	c *rest.Config,
	kind TunnelKind,
	namespace,
	target,
	remotePort string) *Tunnel

NewTunnel constructs a new kubernetes tunnel for the provided information

func NewTunnelForConfig

func NewTunnelForConfig(
	c *rest.Config,
	kind TunnelKind,
	namespace,
	target,
	remotePort string) (*Tunnel, error)

NewTunnelForConfig constructs a new tunnel from the provided rest config

func (*Tunnel) Close

func (t *Tunnel) Close()

Close disconnects a tunnel connection

func (*Tunnel) ForwardPort

func (t *Tunnel) ForwardPort() error

func (*Tunnel) IsValidTunnelKind

func (t *Tunnel) IsValidTunnelKind() bool

IsValidTunnelKind tests that the tunnel kind supplied to this tunnel is valid

type TunnelKind

type TunnelKind string

Directories

Path Synopsis
exec/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
resources/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
specs/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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