klutch

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

README

Klutch Demo

This package adds functionality for the klutch CLI command. It allows demoing the creation of a Control Plane Cluster with a8s-framework and an App Cluster, binding to the Control Plane Cluster from the App Cluster, as well as deleting the clusters.

There are three subcommands:

  • deploy
  • bind
  • delete

The following assumptions for using klutch commands are made:

deploy command

a9s klutch deploy --port 8080 --yes

This command uses kind to deploy the Control Plane Cluster with all required components including a8s-framework and an App Cluster.

It has the following command line flags:

  • yes : skips "Wait" prompts, this is inherited from the root command.
  • port: the cluster's ingress will listen on this port. It defaults to 8080.

This command writes a files to the user's configured workspace which contains the IP and port of the Control Plane Cluster. This allows subsequent commands such as bind to correctly connect to the Control Plane Cluster.

bind command

a9s klutch bind

It makes following assumptions:

  • kubectl and the kubectl-bind plugin (v1.3.0) are present in the PATH.

This command automates the interactive binding process where possible. The kubectl bind command is called, opening a browser tab/window where the authorization can be performed. Once this is completed, the automation resumes and finishes the binding process.

It has the following command line flags:

  • yes : skips "Wait" prompts, this is inherited from the root command.

delete command

a9s klutch delete

This command deletes the Control Plane and App kind clusters.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PortFlag int = 8080
)

Functions

func Bind

func Bind()

func DeleteClusters

func DeleteClusters()

func DeployAppCluster added in v0.14.1

func DeployAppCluster(clusterName string)

DeployAppCluster deploys a simple kind cluster with the given name if it doesn't already exists.

func DeployControlPlaneKindCluster added in v0.14.1

func DeployControlPlaneKindCluster(clusterName string, hostIP string, ingressPort string)

DeployControlPlaneKindCluster creates a new kind cluster configured to act as a local Control Plane Cluster. It enables the ingress feature for the provided port and configures the k8s API Server to listen on the provided IP.

func DeployKlutchClusters

func DeployKlutchClusters()

DeployKlutchClusters deploys the Control Plane Cluster with all Klutch components, and a app cluster.

func WaitForKindCluster

func WaitForKindCluster(k8s *k8s.KubeClient)

Types

type ByteGenerator added in v0.14.1

type ByteGenerator interface {
	GenerateRandom32BytesBase64() string
}

ByteGenerator is an interface for a basic random byte generator.

type ControlPlaneClusterInfo added in v0.14.1

type ControlPlaneClusterInfo struct {
	Host        string `yaml:"host"`
	IngressPort string `yaml:"ingressPort"`
}

ControlPlaneClusterInfo contains information about the created Control Plane Cluster.

type KlutchManager

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

func NewKlutchManager

func NewKlutchManager() *KlutchManager

func (*KlutchManager) DeployBindBackend

func (k *KlutchManager) DeployBindBackend(hostIP string)

Deploys dex and the klutch-bind backend.

func (*KlutchManager) DeployCrossplaneComponents

func (k *KlutchManager) DeployCrossplaneComponents()

func (*KlutchManager) DeployCrossplaneHelmChart

func (k *KlutchManager) DeployCrossplaneHelmChart()

func (*KlutchManager) DeployDex

func (k *KlutchManager) DeployDex(hostIP string, ingressPort string)

func (*KlutchManager) DeployIngressNginx

func (k *KlutchManager) DeployIngressNginx()

DeployIngressNginx applies the ingress-nginx manifests and an additional configMap to configure it. The config increases the request header size limit to cope with bind's header sizes becoming very large.

func (*KlutchManager) DeployKlutchCrossplaneConfigPkg

func (k *KlutchManager) DeployKlutchCrossplaneConfigPkg()

Deploys the a8s APIs (CRDs and Compositions).

func (*KlutchManager) DeployKlutchExportTemplates

func (k *KlutchManager) DeployKlutchExportTemplates()

Applies APIServiceExportTemplates for the a8s crossplane APIs.

func (*KlutchManager) DeployProviderKubernetes

func (k *KlutchManager) DeployProviderKubernetes()

func (*KlutchManager) DeployProviderKubernetesConfig

func (k *KlutchManager) DeployProviderKubernetesConfig()

Deploys the Kubernetes Provider Config

func (*KlutchManager) WaitForBindBackend

func (k *KlutchManager) WaitForBindBackend()

Waits for the klutch-bind backend deployment to be ready. Note: the manifests contain an init-container which waits for dex to be ready, because the backend requires dex to be up and running in order to start. This avoids delays/complications due to crash loop backoffs.

func (*KlutchManager) WaitForCrossplaneHelmChart

func (k *KlutchManager) WaitForCrossplaneHelmChart()

func (*KlutchManager) WaitForDex

func (k *KlutchManager) WaitForDex()

Waits for the dex deployment to be ready.

func (*KlutchManager) WaitForIngressNginx

func (k *KlutchManager) WaitForIngressNginx()

func (*KlutchManager) WaitForKlutchCrossplaneConfigPkg

func (k *KlutchManager) WaitForKlutchCrossplaneConfigPkg()

func (*KlutchManager) WaitForProviderKubernetes

func (k *KlutchManager) WaitForProviderKubernetes()

type NamespacedName

type NamespacedName = types.NamespacedName

type RandomByteGenerator added in v0.14.1

type RandomByteGenerator struct{}

RandomByteGenerator implements ByteGenerator.

func (RandomByteGenerator) GenerateRandom32BytesBase64 added in v0.14.1

func (RandomByteGenerator) GenerateRandom32BytesBase64() string

GenerateRandom32BytesBase64 returns a random base64 string of length 32.

Jump to

Keyboard shortcuts

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