config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Kind               = "Config"
	DefaultClusterName = "kink"
)

Variables

View Source
var (
	APIVersions = []string{"kink.meln5674.github.com/v0"}
)

Functions

This section is empty.

Types

type Bool added in v0.2.0

type Bool bool

func (*Bool) UnmarshalJSON added in v0.2.0

func (b *Bool) UnmarshalJSON(bytes []byte) (err error)

An Int is a int that unmarshals from a JSON string

type Config

type Config struct {
	Helm helm.HelmFlags
	// Kubectl configures the `kubectl` commands used to interact with the external cluster
	Kubectl kubectl.KubectlFlags
	// Kubernetes configures the connection to the external cluster
	Kubernetes kubectl.KubeFlags
	// Docker configures the `docker` commands used to move images from a local daemon into the internal cluster
	Docker docker.DockerFlags
	// Chart configures the Helm Chart used to deploy the cluster
	Chart helm.ChartFlags
	// Release configures the Helm Release of the Chart that is used to deploy the cluster
	Release helm.ClusterReleaseFlags
}

Config contains all of the necessary configuration to run the KinK CLI

func (*Config) Override

func (c *Config) Override(c2 *Config)

Overrides sets any non-zero fields from another config in this one

type Int added in v0.2.0

type Int int

func (*Int) UnmarshalJSON added in v0.2.0

func (i *Int) UnmarshalJSON(bytes []byte) (err error)

An Int is a int that unmarshals from a JSON string

type LoadBalancerIngress added in v0.2.0

type LoadBalancerIngress struct {
	LoadBalancerIngressInner
}

func (*LoadBalancerIngress) UnmarshalJSON added in v0.2.0

func (l *LoadBalancerIngress) UnmarshalJSON(bytes []byte) (err error)

UnmarshalJSON implements json.Unmarshaler

type LoadBalancerIngressClassMapping added in v0.2.0

type LoadBalancerIngressClassMapping struct {
	ClassName   string                                   `json:"className"`
	Annotations map[string]string                        `json:"annotations"`
	NodePort    *LoadBalancerIngressNodePortClassMapping `json:"nodePort,omitempty"`
	HostPort    *LoadBalancerIngressHostPortClassMapping `json:"hostPort,omitempty"`
}

func (*LoadBalancerIngressClassMapping) Port added in v0.2.0

func (l *LoadBalancerIngressClassMapping) Port() (port string, isHttps bool)

func (*LoadBalancerIngressClassMapping) Ports added in v0.2.0

type LoadBalancerIngressHostPortClassMapping added in v0.2.0

type LoadBalancerIngressHostPortClassMapping struct {
	HttpPort  *string `json:"httpPort,omitempty"`
	HttpsPort *string `json:"httpsPort,omitempty"`
}

type LoadBalancerIngressInner added in v0.2.0

type LoadBalancerIngressInner struct {
	Enabled                bool                                       `json:"enabled"`
	HostPortTargetFullname string                                     `json:"hostPortTargetFullname"`
	ClassMappings          map[string]LoadBalancerIngressClassMapping `json:"classMappings"`
}

type LoadBalancerIngressNodePortClassMapping added in v0.2.0

type LoadBalancerIngressNodePortClassMapping struct {
	Namespace string  `json:"namespace"`
	Name      string  `json:"name"`
	HttpPort  *string `json:"httpPort,omitempty"`
	HttpsPort *string `json:"httpsPort,omitempty"`
}

type RawConfig added in v0.2.0

type RawConfig struct {
	metav1.TypeMeta
	// Helm configures the `helm` commands used to manage the internal cluster
	Helm helm.HelmFlags `json:"helm"`
	// Kubectl configures the `kubectl` commands used to interact with the external cluster
	Kubectl kubectl.KubectlFlags `json:"kubectl"`
	// Kubernetes configures the connection to the external cluster
	Kubernetes kubectl.RawKubeFlags `json:"kubernetes"`
	// Docker configures the `docker` commands used to move images from a local daemon into the internal cluster
	Docker docker.DockerFlags `json:"docker"`
	// Chart configures the Helm Chart used to deploy the cluster
	Chart helm.ChartFlags `json:"chart"`
	// Release configures the Helm Release of the Chart that is used to deploy the cluster
	Release helm.ClusterReleaseFlags `json:"release"`
}

RawConfig is the configuration structure as provided by the user

func (*RawConfig) Format added in v0.2.0

func (r *RawConfig) Format() Config

Config is the formatted configuration as usable by the module

func (*RawConfig) LoadFromFile added in v0.2.0

func (c *RawConfig) LoadFromFile(path string) error

type ReleaseConfig added in v0.2.0

type ReleaseConfig struct {
	Fullname                       string              `json:"fullname"`
	Labels                         StringMap           `json:"labels"`
	ControlplaneFullname           string              `json:"controlplane.fullname"`
	ControlplanePort               Int                 `json:"controlplane.port"`
	ControlplaneHostname           string              `json:"controlplane.hostname"`
	ControlplaneIsNodePort         Bool                `json:"controlplane.isNodePort"`
	ControlplaneLabels             StringMap           `json:"controlplane.labels"`
	ControlplaneSelectorLabels     StringMap           `json:"controlplane.selectorLabels"`
	SelectorLabels                 StringMap           `json:"selectorLabels"`
	WorkerFullname                 string              `json:"worker.fullname"`
	WorkerLabels                   StringMap           `json:"worker.labels"`
	WorkerSelectorLabels           StringMap           `json:"worker.selectorLabels"`
	LoadBalancerFullname           string              `json:"load-balancer.fullname"`
	LoadBalancerLabels             StringMap           `json:"load-balancer.labels"`
	LoadBalancerSelectorLabels     StringMap           `json:"load-balancer.selectorLabels"`
	LoadBalancerServiceAnnotations StringMap           `json:"load-balancer.service.annotations"`
	LoadBalancerIngress            LoadBalancerIngress `json:"load-balancer.ingress"`
	LBManagerFullname              string              `json:"lb-manager.fullname"`
	RKE2Enabled                    Bool                `json:"rke2.enabled"`
}

ReleaseConfig are the values kept in the helm ConfigMap

func (*ReleaseConfig) LoadFromConfigMap added in v0.2.0

func (r *ReleaseConfig) LoadFromConfigMap(cm *corev1.ConfigMap) (ok bool, err error)

func (*ReleaseConfig) LoadFromMap added in v0.2.0

func (r *ReleaseConfig) LoadFromMap(data map[string]interface{}) (err error)

func (*ReleaseConfig) LoadFromMount added in v0.2.0

func (r *ReleaseConfig) LoadFromMount(mount string) error

type StringMap added in v0.2.0

type StringMap map[string]string

A StringMap is a map of strings to strings, but unmarshals from JSON by parsing a string, then re-parsing that string as JSON

func (*StringMap) UnmarshalJSON added in v0.2.0

func (s *StringMap) UnmarshalJSON(bytes []byte) (err error)

UnmarshalJSON implements json.Unmarshaler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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