kubernetes

package
v1.2.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: MIT Imports: 41 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPodExists added in v0.9.0

func CheckPodExists(client *k8s.Clientset, namespace string, labelSelector map[string]string, deployName string) (bool, string)

CheckPodExists returns a boolean representing the pod's existence and the namespace that the given pod resides in, or empty if not present in the given namespace.

func Client

func Client() (*k8s.Clientset, error)

Client returns a new Kubernetes client.

func DaprClient added in v0.4.0

func DaprClient() (scheme.Interface, error)

DaprClient returns a new Kubernetes Dapr client.

func Expiry added in v0.10.0

func Expiry() (*time.Time, error)

Expiry returns the expiry time for the root cert.

func ExportTrustChain added in v0.10.0

func ExportTrustChain(outputDir string) error

ExportTrustChain takes the root cert, issuer cert and issuer key from a k8s cluster and saves them in a given directory.

func GetDefaultConfiguration added in v0.4.1

func GetDefaultConfiguration() v1alpha1.Configuration

func GetKubeConfigClient added in v0.9.0

func GetKubeConfigClient() (*rest.Config, *k8s.Clientset, error)

GetKubeConfigClient returns the kubeconfig and the client created from the kubeconfig.

func Init

func Init(config InitConfiguration) error

Init deploys the Dapr operator using the supplied runtime version.

func IsMTLSEnabled added in v0.4.0

func IsMTLSEnabled() (bool, error)

func ListPods added in v0.7.0

func ListPods(client *k8s.Clientset, namespace string, labelSelector map[string]string) (*core_v1.PodList, error)

func ListPodsInterface added in v0.11.0

func ListPodsInterface(client k8s.Interface, labelSelector map[string]string) (*core_v1.PodList, error)

func Logs added in v0.4.0

func Logs(appID, podName, namespace string) error

Logs fetches Dapr sidecar logs from Kubernetes.

func PrintComponents added in v1.0.0

func PrintComponents(name, outputFormat string) error

PrintComponents prints all Dapr components.

func PrintConfigurations added in v1.0.0

func PrintConfigurations(name, outputFormat string) error

PrintConfigurations prints all Dapr configurations.

func Uninstall

func Uninstall(namespace string, timeout uint) error

Uninstall removes Dapr from a Kubernetes cluster.

func Upgrade added in v1.0.0

func Upgrade(conf UpgradeConfig) error

Types

type ComponentsOutput added in v0.4.0

type ComponentsOutput struct {
	Name    string `csv:"Name"`
	Type    string `csv:"Type"`
	Version string `csv:"VERSION"`
	Scopes  string `csv:"SCOPES"`
	Created string `csv:"CREATED"`
	Age     string `csv:"AGE"`
}

ComponentsOutput represent a Dapr component.

type InitConfiguration added in v0.10.0

type InitConfiguration struct {
	Version    string
	Namespace  string
	EnableMTLS bool
	EnableHA   bool
	Args       []string
	Wait       bool
	Timeout    uint
}

type ListOutput

type ListOutput struct {
	AppID   string `csv:"APP ID"`
	AppPort string `csv:"APP PORT"`
	Age     string `csv:"AGE"`
	Created string `csv:"CREATED"`
}

ListOutput represents the application ID, application port and creation time.

func List

func List() ([]ListOutput, error)

List outputs all the applications.

type PortForward added in v0.9.0

type PortForward struct {
	Config     *rest.Config
	Method     string
	URL        *url.URL
	Host       string
	LocalPort  int
	RemotePort int
	EmitLogs   bool
	StopCh     chan struct{}
	ReadyCh    chan struct{}
}

PortForward provides a port-forward connection in a kubernetes cluster.

func NewPortForward added in v0.9.0

func NewPortForward(
	config *rest.Config,
	namespace, deployName string,
	host string, localPort, remotePort int,
	emitLogs bool,
) (*PortForward, error)

NewPortForward returns an instance of PortForward struct that can be used for establishing port-forwarding connection to a pod in kubernetes cluster, specified by namespace and deployName.

func (*PortForward) GetStop added in v0.9.0

func (pf *PortForward) GetStop() <-chan struct{}

GetStop returns StopCh for a PortForward instance. Receiving on StopCh will block until the port forwarding stops.

func (*PortForward) Init added in v0.9.0

func (pf *PortForward) Init() error

Init creates and runs a port-forward connection. This function blocks until connection is established. Note: Caller should call Stop() to finish the connection.

func (*PortForward) Stop added in v0.9.0

func (pf *PortForward) Stop()

Stop terminates port-forwarding connection.

type RunConfig

type RunConfig struct {
	AppID         string
	AppPort       int
	HTTPPort      int
	GRPCPort      int
	CodeDirectory string
	Arguments     []string
	Image         string
}

RunConfig represents the application configuration parameters.

type RunOutput

type RunOutput struct {
	Message string
}

RunOutput represents the run output.

func Run

func Run(config *RunConfig) (*RunOutput, error)

Run executes the application based on the run configuration.

type StatusClient added in v0.11.0

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

func NewStatusClient added in v0.11.0

func NewStatusClient() (*StatusClient, error)

Create a new k8s client for status commands.

func (*StatusClient) Status added in v0.11.0

func (s *StatusClient) Status() ([]StatusOutput, error)

List status for Dapr resources.

type StatusOutput added in v0.7.0

type StatusOutput struct {
	Name      string `csv:"NAME"`
	Namespace string `csv:"NAMESPACE"`
	Healthy   string `csv:"HEALTHY"`
	Status    string `csv:"STATUS"`
	Replicas  int    `csv:"REPLICAS"`
	Version   string `csv:"VERSION"`
	Age       string `csv:"AGE"`
	Created   string `csv:"CREATED"`
}

StatusOutput represents the status of a named Dapr resource.

type UpgradeConfig added in v1.0.0

type UpgradeConfig struct {
	RuntimeVersion string
	Args           []string
	Timeout        uint
}

Jump to

Keyboard shortcuts

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