klutch

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

README

Klutch Demo

This package adds functionality for the klutch CLI command. It allows demoing the creation of a management cluster with a8s-framework and a consumer cluster, binding to the management cluster from the consumer 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 management cluster with all required components including a8s-framework and a consumer 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 management cluster. This allows subsequent commands such as bind to correctly connect to the management 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 management and consumer 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 DeployConsumerCluster

func DeployConsumerCluster(clusterName string)

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

func DeployKlutchClusters

func DeployKlutchClusters()

DeployKlutchClusters deploys the central management cluster with all Klutch components, and a consumer cluster.

func DeployManagementKindCluster

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

DeployManagementKindCluster creates a new kind cluster configured to act as a local central management cluster. It enables the ingress feature for the provided port and configures the k8s API Server to listen on the provided IP.

func WaitForKindCluster

func WaitForKindCluster(k8s *k8s.KubeClient)

Types

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). Currently uses the `crossplane xpkg` method because the manifests are closed source. Once they are open source, the manifests can be referred directly via URL. This would avoid the dependency on the crossplane CLI, which is poorly featured.

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 ManagementClusterInfo

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

ManagementClusterInfo contains information about the created management cluster.

type NamespacedName

type NamespacedName = types.NamespacedName

Jump to

Keyboard shortcuts

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