plugin

package
v0.5.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// These resource names include a kcp- due to the intended use in pclusters.
	SyncerResourceName = "kcp-syncer"
	SyncerSecretName   = "kcp-syncer-config"

	// The name of the key for the upstream config in the pcluster secret.
	SyncerSecretConfigKey = "kubeconfig"

	// The prefix for syncer-supporting auth resources in kcp.
	SyncerAuthResourcePrefix = "syncer-"

	// Max length of service account name (cluster role has no limit)
	MaxSyncerAuthResourceName = 254

	// SyncerIDPrefix is the syncer id prefix is only 7 characters so that the 224 bits
	// of an sha hash can be suffixed and still be within kube's 63
	// char resource name limit.
	//
	// TODO(marun) This prefix should be reserved to avoid user resources being misidentified as syncer resources.
	// TODO(marun) Would a shorter hash be sufficient?
	SyncerIDPrefix = "kcpsync"
)

Variables

This section is empty.

Functions

func GetSyncerID

func GetSyncerID(logicalClusterName string, workloadClusterName string) string

GetSyncerID returns the resource identifier of a syncer for the given logical cluster and workload cluster. The ID is unique for unique pairs of inputs to ensure a pcluster can be configured with multiple syncers for a given kcp instance.

Types

type Config

type Config struct {
	genericclioptions.IOStreams
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(opts *Options) (*Config, error)

NewConfig load a kubeconfig with default config access

func (*Config) Cordon

func (c *Config) Cordon(ctx context.Context, workloadClusterName string) error

Cordon the workload cluster and mark it as unschedulable

func (*Config) Drain

func (c *Config) Drain(ctx context.Context, workloadClusterName string) error

Start draining the workload cluster and mark it as unschedulable

func (*Config) Sync

func (c *Config) Sync(ctx context.Context, workloadClusterName, kcpNamespaceName, image string, resourcesToSync []string, replicas int) error

Sync prepares a kcp workspace for use with a syncer and outputs the configuration required to deploy a syncer to the pcluster to stdout.

func (*Config) Uncordon

func (c *Config) Uncordon(ctx context.Context, workloadClusterName string) error

Uncordon the workload cluster and mark it as schedulable

type Options

type Options struct {
	KubectlOverrides *clientcmd.ConfigOverrides

	genericclioptions.IOStreams
}

Options for the workload commands.

func NewOptions

func NewOptions(streams genericclioptions.IOStreams) *Options

NewOptions provides an instance of Options with default values

func (*Options) BindFlags

func (o *Options) BindFlags(cmd *cobra.Command)

BindFlags binds the arguments common to all sub-commands, to the corresponding main command flags

func (*Options) Validate

func (o *Options) Validate() error

Jump to

Keyboard shortcuts

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