maidn-cli/internal/config/types.go

88 lines
3.2 KiB
Go

package config
type Config struct {
WorkspaceDir string `yaml:"workspaceDir"`
GitHub GitHubConfig `yaml:"github"`
Flux FluxConfig `yaml:"flux"`
Talos TalosConfig `yaml:"talos"`
}
type GitHubConfig struct {
Org string `yaml:"org"`
}
type FluxConfig struct {
RepoName string `yaml:"repoName"`
Branch string `yaml:"branch"`
ClusterPath string `yaml:"clusterPath"`
ClusterDomain string `yaml:"clusterDomain"`
Owner string `yaml:"owner"`
}
type TalosConfig struct {
RepoURL string `yaml:"repoUrl"`
RepoRef string `yaml:"repoRef"`
RepoDirName string `yaml:"repoDirName"`
TerraformDir string `yaml:"terraformDir"`
GeneratedDir string `yaml:"generatedDir"`
ConfigFileName string `yaml:"configFileName"`
AutoRunTerraform bool `yaml:"autoRunTerraform"`
AutoBootstrap bool `yaml:"autoBootstrap"`
AutoBootstrapFlux bool `yaml:"autoBootstrapFlux"`
BootstrapNode string `yaml:"bootstrapNode"`
KubeconfigNode string `yaml:"kubeconfigNode"`
Proxmox TalosProxmoxConfig `yaml:"proxmox"`
Cluster TalosClusterConfig `yaml:"cluster"`
Image TalosImageConfig `yaml:"image"`
Nodes []TalosNode `yaml:"nodes"`
}
type TalosProxmoxConfig struct {
APIURL string `yaml:"apiUrl"`
APIToken string `yaml:"apiToken"`
DefaultNode string `yaml:"defaultNode"`
Pool string `yaml:"pool"`
NodeInterfaces map[string]string `yaml:"nodeInterfaces"`
}
type TalosClusterConfig struct {
Name string `yaml:"name"`
Domain string `yaml:"domain"`
ControlPlaneVIP string `yaml:"controlPlaneVip"`
CNI string `yaml:"cni"`
DNSServers []string `yaml:"dnsServers"`
DiskStorage string `yaml:"diskStorage"`
AdditionalStorage string `yaml:"additionalStorage"`
CreateVLANInterface bool `yaml:"createVlanInterface"`
}
type TalosImageConfig struct {
FactorySchematicID string `yaml:"factorySchematicId"`
TalosVersion string `yaml:"talosVersion"`
TalosISOFile string `yaml:"talosIsoFile"`
UpdateMode string `yaml:"updateMode"`
Storage string `yaml:"storage"`
Architecture string `yaml:"architecture"`
}
type TalosNode struct {
Name string `yaml:"name"`
VMID int `yaml:"vmid"`
Role string `yaml:"role"`
Cores int `yaml:"cores"`
Memory int `yaml:"memory"`
DiskSize string `yaml:"diskSize"`
AdditionalDiskSize string `yaml:"additionalDiskSize,omitempty"`
Tags []string `yaml:"tags"`
ProxmoxNode string `yaml:"proxmoxNode"`
Networks []TalosNetwork `yaml:"networks"`
}
type TalosNetwork struct {
MACAddress string `yaml:"macAddress"`
CIDR string `yaml:"cidr"`
IP string `yaml:"ip,omitempty"`
Gateway string `yaml:"gateway,omitempty"`
VLANID int `yaml:"vlanId"`
}