config

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GeneralConfigFileContents []byte

	ParsedGeneralConfig = &GeneralConfig{}
	ParsedSecretsConfig = &SecretsConfig{}
)
View Source
var SampleConfigs embed.FS

Functions

func ControlPlaneInHCloud added in v0.15.0

func ControlPlaneInHCloud() bool

func ControlPlaneInHetznerBareMetal added in v0.15.0

func ControlPlaneInHetznerBareMetal() bool

func GenerateSampleConfig

func GenerateSampleConfig(ctx context.Context, args *GenerateSampleConfigArgs)

func GetGeneralConfigFilePath added in v0.14.0

func GetGeneralConfigFilePath() string

func GetSecretsConfigFilePath added in v0.14.0

func GetSecretsConfigFilePath() string

func MustGetHetznerProviderMode added in v0.15.0

func MustGetHetznerProviderMode() string

Returns the Hetzner provider mode being used. Panics, if the Hetzner provider isn't being used.

func UsingHCloud added in v0.15.0

func UsingHCloud() bool

func UsingHetznerBareMetal added in v0.15.0

func UsingHetznerBareMetal() bool

Types

type AADApplication

type AADApplication struct {
	PrincipalID string `yaml:"principalID" validate:"notblank"`
}

Azure specific.

type AMIConfig

type AMIConfig struct {
	ID string `yaml:"id" validate:"notblank"`
}

AWS specific.

type APIServerConfig

type APIServerConfig struct {
	ExtraArgs    map[string]string     `yaml:"extraArgs"    default:"{}"`
	ExtraVolumes []HostPathMountConfig `yaml:"extraVolumes" default:"[]"`
	Files        []FileConfig          `yaml:"files"        default:"[]"`
}

REFER : https://github.com/kubernetes-sigs/cluster-api/blob/main/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml.

NOTE : Generally, refer to the KubeadmControlPlane CRD instead of the corresponding GoLang

source types linked below.
There are some configuration options which appear in the corresponding GoLang source
type, but not in the CRD. If you set those fields, then they get removed by the Kubeadm
control-plane provider. This causes the capi-cluster ArgoCD App to always be in an
OutOfSync state, resulting to the KubeAid Bootstrap Script not making any progress!

type AWSAutoScalableNodeGroup added in v0.12.0

type AWSAutoScalableNodeGroup struct {
	AutoScalableNodeGroup `yaml:",inline"`

	AMI            AMIConfig `yaml:"ami"            validate:"required"`
	InstanceType   string    `yaml:"instanceType"   validate:"notblank"`
	RootVolumeSize uint32    `yaml:"rootVolumeSize" validate:"required"`
	SSHKeyName     string    `yaml:"sshKeyName"     validate:"notblank"`
}

AWS specific.

type AWSConfig

type AWSConfig struct {
	Region string `yaml:"region" validate:"notblank"`

	SSHKeyName     string                     `yaml:"sshKeyName"     validate:"notblank"`
	VPCID          *string                    `yaml:"vpcID"`
	BastionEnabled bool                       `yaml:"bastionEnabled"                     default:"True"`
	ControlPlane   AWSControlPlane            `yaml:"controlPlane"   validate:"required"`
	NodeGroups     []AWSAutoScalableNodeGroup `yaml:"nodeGroups"`
}

AWS specific.

type AWSControlPlane

type AWSControlPlane struct {
	LoadBalancerScheme string    `yaml:"loadBalancerScheme" default:"internet-facing" validate:"notblank"`
	Replicas           uint32    `yaml:"replicas"                                     validate:"required"`
	InstanceType       string    `yaml:"instanceType"                                 validate:"notblank"`
	AMI                AMIConfig `yaml:"ami"                                          validate:"required"`
}

AWS specific.

type AWSCredentials

type AWSCredentials struct {
	AWSAccessKeyID     string `yaml:"accessKeyID"     validate:"notblank"`
	AWSSecretAccessKey string `yaml:"secretAccessKey" validate:"notblank"`
	AWSSessionToken    string `yaml:"sessionToken"`
}

type ArgoCDConfig added in v0.15.2

type ArgoCDConfig struct {
	UseSSHPrivateKeyAuth bool   `yaml:"useSSHPrivateKeyAuth"`
	KubeaidConfigURL     string `yaml:"kubeaidConfigURL"`
	KubeaidURL           string `yaml:"kubeaidURL"`
	ExtraKnownHosts      string
}

type AutoScalableNodeGroup added in v0.12.0

type AutoScalableNodeGroup struct {
	NodeGroup `yaml:",inline"`

	CPU    uint32 `validate:"required"`
	Memory uint32 `validate:"required"`

	MinSize uint `yaml:"minSize" validate:"required"`
	Maxsize uint `yaml:"maxSize" validate:"required"`
}

type AzureAutoScalableNodeGroup added in v0.12.0

type AzureAutoScalableNodeGroup struct {
	AutoScalableNodeGroup `yaml:",inline"`

	VMSize     string `yaml:"vmSize"     validate:"notblank"`
	DiskSizeGB uint32 `yaml:"diskSizeGB" validate:"required"`
}

Azure specific.

type AzureConfig

type AzureConfig struct {
	TenantID       string         `yaml:"tenantID"       validate:"notblank"`
	SubscriptionID string         `yaml:"subscriptionID" validate:"notblank"`
	AADApplication AADApplication `yaml:"aadApplication" validate:"required"`
	Location       string         `yaml:"location"       validate:"notblank"`

	StorageAccount string `yaml:"storageAccount" validate:"notblank"`

	WorkloadIdentity WorkloadIdentity `yaml:"workloadIdentity" validate:"required"`

	SSHPublicKey string `yaml:"sshPublicKey" validate:"notblank"`

	CanonicalUbuntuImage CanonicalUbuntuImage `yaml:"canonicalUbuntuImage" validate:"required"`

	ControlPlane AzureControlPlane            `yaml:"controlPlane" validate:"required"`
	NodeGroups   []AzureAutoScalableNodeGroup `yaml:"nodeGroups"`
}

Azure specific.

type AzureControlPlane

type AzureControlPlane struct {
	LoadBalancerType string `yaml:"loadBalancerType" validate:"notblank"        default:"Public"`
	DiskSizeGB       uint32 `yaml:"diskSizeGB"       validate:"required,gt=100"`
	VMSize           string `yaml:"vmSize"           validate:"notblank"`
	Replicas         uint32 `yaml:"replicas"         validate:"required,gt=0"`
}

Azure specific.

type AzureCredentials added in v0.7.2

type AzureCredentials struct {
	ClientID     string `yaml:"clientID"     validate:"notblank"`
	ClientSecret string `yaml:"clientSecret" validate:"notblank"`
}

type BareMetalConfig added in v0.12.0

type BareMetalConfig struct {
	SSH BareMetalSSHConfig `yaml:"ssh"`

	ControlPlane BareMetalControlPlane `yaml:"controlPlane" validate:"required"`
	NodeGroups   []BareMetalNodeGroup  `yaml:"nodeGroups"`
}

type BareMetalControlPlane added in v0.12.0

type BareMetalControlPlane struct {
	Endpoint BareMetalControlPlaneEndpoint `yaml:"endpoint" validate:"required"`
	Hosts    []*BareMetalHost              `yaml:"hosts"    validate:"required"`
}

type BareMetalControlPlaneEndpoint added in v0.12.0

type BareMetalControlPlaneEndpoint struct {
	Host string `yaml:"host" validate:"notblank"`
	Port uint   `yaml:"port" validate:"required" default:"6443"`
}

type BareMetalHost added in v0.12.0

type BareMetalHost struct {
	PublicAddress  *string `yaml:"publicAddress"  validate:"notblank"`
	PrivateAddress *string `yaml:"privateAddress" validate:"notblank"`

	SSH *BareMetalSSHConfig `yaml:"ssh"`
}

type BareMetalNodeGroup added in v0.12.0

type BareMetalNodeGroup struct {
	NodeGroup `yaml:",inline"`

	Hosts []*BareMetalHost `yaml:"hosts" validate:"required"`
}

type BareMetalSSHConfig added in v0.12.0

type BareMetalSSHConfig struct {
	Port       uint                 `yaml:"port"       validate:"required" default:"22"`
	PrivateKey *SSHPrivateKeyConfig `yaml:"privateKey"`
}

type CanonicalUbuntuImage added in v0.12.2

type CanonicalUbuntuImage struct {
	Offer string `yaml:"offer" validate:"notblank"`
	SKU   string `yaml:"sku"   validate:"notblank"`
}

Azure specific.

type CloudConfig

type CloudConfig struct {
	AWS       *AWSConfig       `yaml:"aws"`
	Azure     *AzureConfig     `yaml:"azure"`
	Hetzner   *HetznerConfig   `yaml:"hetzner"`
	BareMetal *BareMetalConfig `yaml:"bare-metal"`
	Local     *LocalConfig     `yaml:"local"`

	DisasterRecovery *DisasterRecoveryConfig `yaml:"disasterRecovery"`
}

type ClusterConfig

type ClusterConfig struct {
	Name           string `yaml:"name"           validate:"notblank"`
	K8sVersion     string `yaml:"k8sVersion"     validate:"notblank"`
	KubeaidVersion string `yaml:"kubeaidVersion" validate:"notblank"`

	EnableAuditLogging bool `yaml:"enableAuditLogging" default:"True"`

	APIServer APIServerConfig `yaml:"apiServer"`

	AdditionalUsers []UserConfig `yaml:"additionalUsers"`
}

type DisasterRecoveryConfig added in v0.9.0

type DisasterRecoveryConfig struct {
	VeleroBackupsBucketName        string `yaml:"veleroBackupsBucketName"        validate:"notblank"`
	SealedSecretsBackupsBucketName string `yaml:"sealedSecretsBackupsBucketName" validate:"notblank"`
}

type FileConfig

type FileConfig struct {
	Path    string `yaml:"path"    validate:"notblank"`
	Content string `yaml:"content" validate:"notblank"`
}

REFER : "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1".File

type ForksConfig

type ForksConfig struct {
	KubeaidForkURL       string `yaml:"kubeaid"       default:"https://github.com/Obmondo/KubeAid" validate:"notblank"`
	KubeaidConfigForkURL string `yaml:"kubeaidConfig"                                              validate:"notblank"`
}

type GeneralConfig added in v0.7.2

type GeneralConfig struct {
	Git            GitConfig            `yaml:"git"`
	Cluster        ClusterConfig        `yaml:"cluster"        validate:"required"`
	Forks          ForksConfig          `yaml:"forkURLs"       validate:"required"`
	Cloud          CloudConfig          `yaml:"cloud"          validate:"required"`
	KubePrometheus KubePrometheusConfig `yaml:"kubePrometheus"`
	Obmondo        *ObmondoConfig       `yaml:"obmondo"`
	ArgoCDConfig   ArgoCDConfig         `yaml:"argocd"`
}

type GeneralConfigTemplateValues added in v0.13.0

type GeneralConfigTemplateValues struct {
	KubeAidVersion string
}

type GenerateSampleConfigArgs added in v0.12.0

type GenerateSampleConfigArgs struct {
	CloudProvider string

	HetznerMode *string
}

type GitConfig

type GitConfig struct {
	CABundlePath         string `yaml:"caBundlePath"`
	CABundle             []byte `yaml:"caBundle"`
	UseSSHAgentAuth      bool   `yaml:"useSSHAgentAuth"`
	UseSSHPrivateKeyAuth bool   `yaml:"useSSHPrivateKeyAuth"`
	*SSHPrivateKeyConfig `       yaml:",inline"`
	HostKey              string
}

type GitCredentials added in v0.7.2

type GitCredentials struct {
	*GitUsernameAndPassword `yaml:",inline"`
}

type GitUsernameAndPassword added in v0.12.0

type GitUsernameAndPassword struct {
	Username string `yaml:"username" validate:"notblank"`
	Password string `yaml:"password"`
}

type HCloudAutoScalableNodeGroup added in v0.12.0

type HCloudAutoScalableNodeGroup struct {
	AutoScalableNodeGroup `yaml:",inline"`

	MachineType    string `yaml:"machineType" validate:"notblank"`
	RootVolumeSize uint32 `                   validate:"required"`
}

Hetzner specific.

type HCloudControlPlane

type HCloudControlPlane struct {
	MachineType  string                         `yaml:"machineType"  validate:"notblank"`
	Replicas     uint                           `yaml:"replicas"     validate:"notblank"`
	LoadBalancer HCloudControlPlaneLoadBalancer `yaml:"loadBalancer" validate:"required"`
}

Hetzner specific.

type HCloudControlPlaneLoadBalancer added in v0.11.0

type HCloudControlPlaneLoadBalancer struct {
	Enabled bool   `yaml:"enabled" validate:"required"`
	Region  string `yaml:"region"  validate:"notblank"`
}

Hetzner specific.

type HetznerBareMetalConfig added in v0.12.0

type HetznerBareMetalConfig struct {
	WipeDisks  bool                       `yaml:"wipeDisks"  default:"false"`
	ImagePath  string                     `yaml:"imagePath"  default:"/root/.oldroot/nfs/images/Ubuntu-2404-noble-amd64-base.tar.gz" validate:"notblank"`
	SSHKeyPair HetznerBareMetalSSHKeyPair `yaml:"sshKeyPair"                                                                         validate:"required"`
}

Hetzner specific.

type HetznerBareMetalControlPlane

type HetznerBareMetalControlPlane struct {
	Endpoint       HetznerBareMetalControlPlaneEndpoint `yaml:"endpoint"       validate:"required"`
	BareMetalHosts []HetznerBareMetalHost               `yaml:"bareMetalHosts" validate:"required,gt=0"`
}

Hetzner specific.

type HetznerBareMetalControlPlaneEndpoint added in v0.12.0

type HetznerBareMetalControlPlaneEndpoint struct {
	IsFailoverIP bool   `yaml:"isFailoverIP" validate:"required"`
	Host         string `yaml:"host"         validate:"ip"`
}

Hetzner specific.

type HetznerBareMetalHost added in v0.12.0

type HetznerBareMetalHost struct {
	ServerID string   `yaml:"serverID" validate:"notblank"`
	WWNs     []string `yaml:"wwns"     validate:"required,gt=0"`
}

Hetzner specific.

type HetznerBareMetalNodeGroup

type HetznerBareMetalNodeGroup struct {
	NodeGroup `yaml:",inline"`

	BareMetalHosts []HetznerBareMetalHost `yaml:"bareMetalHosts" validate:"required,gt=0"`
}

Hetzner specific.

type HetznerBareMetalSSHKeyPair added in v0.12.0

type HetznerBareMetalSSHKeyPair struct {
	Name             string `yaml:"name"    validate:"notblank"`
	SSHKeyPairConfig `       yaml:",inline"`
}

Hetzner specific.

type HetznerConfig

type HetznerConfig struct {
	Mode string `yaml:"mode" default:"hcloud" validate:"notblank,oneof=bare-metal hcloud hybrid"`

	HCloud    *HetznerHCloudConfig    `yaml:"hcloud"`
	BareMetal *HetznerBareMetalConfig `yaml:"bareMetal"`

	ControlPlane HetznerControlPlane `yaml:"controlPlane" validate:"required"`
	NodeGroups   HetznerNodeGroups   `yaml:"nodeGroups"`
}

Hetzner specific.

type HetznerControlPlane added in v0.11.0

type HetznerControlPlane struct {
	HCloud    *HCloudControlPlane           `yaml:"hcloud"`
	BareMetal *HetznerBareMetalControlPlane `yaml:"bareMetal"`

	Regions []string `yaml:"regions" validate:"required"`
}

Hetzner specific.

type HetznerCredentials

type HetznerCredentials struct {
	APIToken string                   `yaml:"apiToken" validate:"notblank"`
	Robot    *HetznerRobotCredentials `yaml:"robot"`
}

type HetznerHCloudConfig added in v0.12.0

type HetznerHCloudConfig struct {
	Zone           string `yaml:"zone"           validate:"notblank"`
	ImageName      string `yaml:"imageName"      validate:"notblank" default:"ubuntu-24.04"`
	SSHKeyPairName string `yaml:"sshKeyPairName" validate:"notblank"`
}

Hetzner specific.

type HetznerNodeGroups added in v0.11.0

type HetznerNodeGroups struct {
	HCloud    []HCloudAutoScalableNodeGroup `yaml:"hcloud"`
	BareMetal []HetznerBareMetalNodeGroup   `yaml:"bareMetal"`
}

Hetzner specific.

type HetznerRobotCredentials added in v0.12.0

type HetznerRobotCredentials struct {
	User     string `yaml:"user"     validate:"notblank"`
	Password string `yaml:"password" validate:"notblank"`
}

type HostPathMountConfig

type HostPathMountConfig struct {
	Name      string              `yaml:"name"      validate:"notblank"`
	HostPath  string              `yaml:"hostPath"  validate:"notblank"`
	MountPath string              `yaml:"mountPath" validate:"notblank"`
	PathType  coreV1.HostPathType `yaml:"pathType"  validate:"required"`

	/*
		Whether the mount should be read-only or not.
		Defaults to true.

		NOTE : If you want the mount to be read-only, then set this true.
		       Otherwise, omit setting this field. It gets removed by the Kubeadm control-plane
		       provider component, which results to the capi-cluster ArgoCD App always being in
		       OutOfSync state.
	*/
	ReadOnly bool `yaml:"readOnly,omitempty"`
}

REFER : "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1".HostPathMount

type KubePrometheusConfig added in v0.12.0

type KubePrometheusConfig struct {
	Version    string `yaml:"version"              default:"v0.15.0"`
	GrafanaURL string `yaml:"grafanaURL,omitempty"`
}

type LocalConfig

type LocalConfig struct{}

Local specific.

type NodeGroup

type NodeGroup struct {
	Name string `yaml:"name" validate:"notblank"`

	Labels map[string]string `yaml:"labels" default:"[]"`
	Taints []*coreV1.Taint   `yaml:"taints" default:"[]"`
}

type ObmondoConfig added in v0.12.0

type ObmondoConfig struct {
	// nolint: godox
	// TODO: regex validation
	CustomerID string `yaml:"customerID" validate:"notblank"`
	Monitoring bool   `yaml:"monitoring"`
}

type ReleaseDetails added in v0.14.0

type ReleaseDetails struct {
	TagName string `json:"tag_name"`
}

type SSHKeyPairConfig

type SSHKeyPairConfig struct {
	SSHPrivateKeyConfig `yaml:",inline"`

	PublicKeyFilePath string `yaml:"publicKeyFilePath" validate:"notblank"`
	PublicKey         string `                         validate:"notblank"`
}

type SSHPrivateKeyConfig added in v0.12.0

type SSHPrivateKeyConfig struct {
	PrivateKeyFilePath string `yaml:"privateKeyFilePath" validate:"notblank"`
	PrivateKey         string
}

type SecretsConfig added in v0.7.2

type SecretsConfig struct {
	Git     GitCredentials      `yaml:"git"`
	AWS     *AWSCredentials     `yaml:"aws"`
	Azure   *AzureCredentials   `yaml:"azure"`
	Hetzner *HetznerCredentials `yaml:"hetzner"`
}

type UserConfig

type UserConfig struct {
	Name         string `yaml:"name"         validate:"required"`
	SSHPublicKey string `yaml:"sshPublicKey" validate:"required"`
}

type WorkloadIdentity

type WorkloadIdentity struct {
	OpenIDProviderSSHKeyPair SSHKeyPairConfig `yaml:"openIDProviderSSHKeyPair" validate:"notblank"`
}

Azure specific.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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