multicluster

package
v0.0.0-...-edf464d Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 31 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Use a bearer token for authentication to the remote kubernetes cluster.
	RemoteSecretAuthTypeBearerToken RemoteSecretAuthType = "bearer-token"

	// Use a custom authentication plugin for the remote kubernetes cluster.
	RemoteSecretAuthTypePlugin RemoteSecretAuthType = "plugin"

	// Secret generated from remote cluster
	SecretTypeRemote SecretType = "remote"

	// Secret generated from config cluster
	SecretTypeConfig SecretType = "config"
)

Variables

This section is empty.

Functions

func NewCreateRemoteSecretCommand

func NewCreateRemoteSecretCommand(ctx cli.Context) *cobra.Command

NewCreateRemoteSecretCommand creates a new command for joining two contexts together in a multi-cluster mesh.

Types

type KubeOptions

type KubeOptions struct {
	Kubeconfig string
	Context    string
	Namespace  string
}

KubeOptions contains kubernetes options common to all commands.

type RemoteSecretAuthType

type RemoteSecretAuthType string

RemoteSecretAuthType is a strongly typed authentication type suitable for use with pflags.Var().

func (*RemoteSecretAuthType) Set

func (at *RemoteSecretAuthType) Set(in string) error

func (*RemoteSecretAuthType) String

func (at *RemoteSecretAuthType) String() string

func (*RemoteSecretAuthType) Type

func (at *RemoteSecretAuthType) Type() string

type RemoteSecretOptions

type RemoteSecretOptions struct {
	KubeOptions

	// Name of the local cluster whose credentials are stored in the secret. Must be
	// DNS1123 label as it will be used for the k8s secret name.
	ClusterName string

	// Create a secret with this service account's credentials.
	ServiceAccountName string

	// CreateServiceAccount if true, the service account specified by ServiceAccountName
	// will be created if it doesn't exist.
	CreateServiceAccount bool

	// Authentication method for the remote Kubernetes cluster.
	AuthType RemoteSecretAuthType
	// Authenticator plugin configuration
	AuthPluginName   string
	AuthPluginConfig map[string]string

	// Type of the generated secret
	Type SecretType

	// ManifestsPath is a path to a manifestsPath and profiles directory in the local filesystem,
	// or URL with a release tgz. This is only used when no reader service account exists and has
	// to be created.
	ManifestsPath string

	// ServerOverride overrides the server IP/hostname field from the Kubeconfig
	ServerOverride string

	// SecretName selects a specific secret from the remote service account, if there are multiple
	SecretName string
}

RemoteSecretOptions contains the options for creating a remote secret.

type SecretType

type SecretType string

RemoteSecretAuthType is a strongly typed authentication type suitable for use with pflags.Var().

func (*SecretType) Set

func (at *SecretType) Set(in string) error

func (*SecretType) String

func (at *SecretType) String() string

func (*SecretType) Type

func (at *SecretType) Type() string

type Warning

type Warning error

func CreateRemoteSecret

func CreateRemoteSecret(client kube.CLIClient, opt RemoteSecretOptions) (string, Warning, error)

CreateRemoteSecret creates a remote secret with credentials of the specified service account. This is useful for providing a cluster access to a remote apiserver.

Jump to

Keyboard shortcuts

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