utils

package
v1.23.12 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenKubeConfigForKSA

func GenKubeConfigForKSA(clusterCa, clusterIP, clusterName, saName, accessToken string) []byte

GenKubeConfigForKSA generates a KubeConfig to access the cluster using a Kubernetes service account

func GenKubeConfigForUser

func GenKubeConfigForUser(clusterCa, clusterIP, clusterName, authProvider string) []byte

GenKubeConfigForUser generates a KubeConfig to access the cluster using a third-party identity

Types

type ClusterCredentials

type ClusterCredentials struct {
	// AccessToken is the access token to access the cluster
	AccessToken string `json:"access_token"`
	// TokenExpiry is the expiry time of the access token, in RFC3339 format
	TokenExpiry string `json:"token_expiry"`
}

ClusterCredentials contains the access token to the cluster and its expiry time

type ConnectionHelper

type ConnectionHelper interface {
	// Credentials contain the credentials used for the daemon to access the cluster.
	// This is output to stdout, for Kubernetes clients to use.
	Credentials() (ClusterCredentials, error)
	// KubeConfig yields the config used to create Kubernetes clientset.
	KubeConfig() (*rest.Config, error)
}

ConnectionHelper provides the identity and config used to connect to the cluster

type WorkloadInfo

type WorkloadInfo interface {
	// Name is the name of the workload
	Name() (string, bool)
	// Hostname is the hostname or DNS address of the workload
	Hostname() (string, bool)
	// IP is the IP used to access this workload from the cluster
	IP() (string, bool)
	// Labels are one or more labels associated with the workload
	Labels() map[string]string
	// Region associated with the endpoint.
	Region() (string, bool)
	// Zone associated with the endpoint.
	Zone() (string, bool)
}

WorkloadInfo represents basic information of this workload

Jump to

Keyboard shortcuts

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