eks

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecConfig

func NewExecConfig(cfg *config.Config, clusterName, role string) *api.ExecConfig

Types

type Cluster

type Cluster struct {
	// The Amazon Resource Name (ARN) of the cluster.
	ARN string

	// The name of the cluster.
	Name string

	// The Kubernetes server version for the cluster.
	Version string

	// The endpoint for your Kubernetes API server.
	Endpoint string

	// CAData contains PEM-encoded certificate authority certificates
	CAData []byte
}

An object representing an Amazon EKS cluster.

type ClusterFinder

type ClusterFinder interface {
	Find(name string) ([]Cluster, error)
}

func NewClusterFinder

func NewClusterFinder(cfg *config.Config) ClusterFinder

type ContainerPort added in v0.20.0

type ContainerPort struct {
	// Number of port to expose on the pod's IP address
	Port int32

	// Protocol for port. Must be UDP, TCP, or SCTP.
	Protocol string
}

ContainerPort represents a network port in a single container.

type ExecInput

type ExecInput struct {
	// Namespace of the pod
	Namespace string

	// Name of the pod
	PodName string

	// Name of the container
	Container string

	// Command to run
	Command []string
}

type Kubeclient

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

func NewKubeclient

func NewKubeclient(cfg *config.Config, cluster *Cluster, role string) (*Kubeclient, error)

func (*Kubeclient) Exec

func (k *Kubeclient) Exec(input *ExecInput) error

func (*Kubeclient) GetPod

func (k *Kubeclient) GetPod(namespace, podName string) (*v1.Pod, error)

func (*Kubeclient) ListPods

func (k *Kubeclient) ListPods(namespace, labelSelector string) (*v1.PodList, error)

func (*Kubeclient) PodLogs added in v0.21.0

func (k *Kubeclient) PodLogs(ctx context.Context, input *PodLogsInput) error

func (*Kubeclient) RunPortForward added in v0.20.0

func (k *Kubeclient) RunPortForward(input *PortForwardInput) error

type Kubeconfig

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

func NewKubeconfig

func NewKubeconfig(filename string) (*Kubeconfig, error)

func (*Kubeconfig) Filename

func (k *Kubeconfig) Filename() string

func (*Kubeconfig) Update

func (k *Kubeconfig) Update(alias string, cluster *Cluster, exec *clientcmdapi.ExecConfig)

func (*Kubeconfig) WriteToDisk

func (k *Kubeconfig) WriteToDisk() error

WriteToDisk writes a KubeConfig object down to disk with mode 0600

type Pod

type Pod struct {
	// The name of the pod.
	Name string

	// The namespace of the pod.
	Namespace string

	// The name of the container
	Container string

	// List of ports to expose from the container
	ContainerPorts []ContainerPort
}

An object representing a pod.

type PodFinder

type PodFinder interface {
	Find(namespace, labelSelector string) ([]Pod, error)
	FindByIdentifier(namespace, podName, container string) ([]Pod, error)
}

func NewPodFinder

func NewPodFinder(cfg *config.Config, cluster *Cluster, role string) (PodFinder, error)

type PodLogsInput added in v0.21.0

type PodLogsInput struct {
	// Namespace of the pod
	Namespace string

	// Name of the pod
	PodName string

	// Name of the container
	Container string

	Writer func(line string)
}

type PortForwardInput added in v0.20.0

type PortForwardInput struct {
	// Namespace of the pod
	Namespace string

	// Name of the pod
	PodName string

	// LocalPort is the local port that will be selected to expose the PodPort
	LocalPort int32

	// ContainerPort is the target port for the pod
	ContainerPort int32

	// StopCh is the channel used to manage the port forward lifecycle
	StopCh <-chan struct{}

	// ReadyCh communicates when the tunnel is ready to receive traffic
	ReadyCh chan struct{}
}

type Token

type Token struct {
	Token      string
	Expiration time.Time
}

Token is generated and used by Kubernetes client-go to authenticate with a Kubernetes cluster.

type TokenGen

type TokenGen interface {
	// Get a token using credentials in the default credentials chain.
	Get(clusterName string) (*Token, error)

	// GetWithRole creates a token by assuming the provided role, using the credentials in the default chain.
	GetWithRole(clusterName, role string) (*Token, error)

	// FormatJSON returns the client auth formatted json for the ExecCredential auth.
	FormatJSON(Token) string
}

func NewTokenGen

func NewTokenGen(cfg *config.Config) TokenGen

NewTokenGen creates a TokenGen and returns it.

Jump to

Keyboard shortcuts

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