Documentation
¶
Index ¶
- Constants
- Variables
- func LoadVLAB(basedir string, mngr *cnc.Manager, dryRun bool, size string, ...) (*vlab.Service, error)
- func NewCNCManager() *cnc.Manager
- type Base
- type ControlOS
- func (cfg *ControlOS) Build(_ string, _ cnc.Preset, _ meta.FabricMode, get cnc.GetComponent, ...) error
- func (cfg *ControlOS) Flags() []cli.Flag
- func (cfg *ControlOS) Hydrate(_ cnc.Preset, _ meta.FabricMode) error
- func (cfg *ControlOS) IsEnabled(_ cnc.Preset) bool
- func (cfg *ControlOS) Name() string
- type DasBoot
- type DasBootTLS
- type Fabric
- func (cfg *Fabric) Build(_ string, _ cnc.Preset, fabricMode meta.FabricMode, get cnc.GetComponent, ...) error
- func (cfg *Fabric) Flags() []cli.Flag
- func (cfg *Fabric) Hydrate(_ cnc.Preset, _ meta.FabricMode) error
- func (cfg *Fabric) IsEnabled(_ cnc.Preset) bool
- func (cfg *Fabric) Name() string
- func (cfg *Fabric) Validate(_ string, _ cnc.Preset, fabricMode meta.FabricMode, get cnc.GetComponent, ...) error
- type K3s
- func (cfg *K3s) Build(_ string, _ cnc.Preset, _ meta.FabricMode, get cnc.GetComponent, ...) error
- func (cfg *K3s) ControlNodeName(data *wiring.Data) (string, error)
- func (cfg *K3s) Flags() []cli.Flag
- func (cfg *K3s) Hydrate(_ cnc.Preset, _ meta.FabricMode) error
- func (cfg *K3s) IsEnabled(_ cnc.Preset) bool
- func (cfg *K3s) Name() string
- type Misc
- type ServerOS
- func (cfg *ServerOS) Build(_ string, _ cnc.Preset, _ meta.FabricMode, get cnc.GetComponent, ...) error
- func (cfg *ServerOS) Flags() []cli.Flag
- func (cfg *ServerOS) Hydrate(_ cnc.Preset, _ meta.FabricMode) error
- func (cfg *ServerOS) IsEnabled(preset cnc.Preset) bool
- func (cfg *ServerOS) Name() string
- type VLAB
- type Zot
- type ZotTLS
Constants ¶
View Source
const ( PresetBM cnc.Preset = "lab" PresetVLAB cnc.Preset = "vlab" )
View Source
const ( Stage cnc.Stage = iota // Just a placeholder stage StageInstall0Prep // Preparation for K3s and Zot installation StageInstall1K3sZot // Kube and Registry Installation, wait for registry available StageInstall2Misc // Install misc services and wait for them to be ready StageInstall3Fabric // Install Fabric and wait for it to be ready StageInstall4DasBoot // Install Das Boot and wait for it to be ready StageInstall9Reloader StageMax // Keep it last so we can iterate over all stages )
We expect services installed during the stage to be available at the end of it
View Source
const ( OCIRepoCACN = "OCI Repository CA" OCIRepoServerCN = "localhost" KeyUsageCA = x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign KeyUsageServer = x509.KeyUsageDigitalSignature | x509.KeyUsageKeyEncipherment )
View Source
const ( FlatcarControlUser = "core" ControlOSIgnition = "ignition.json" DefaultVLABSSHKey = "ssh-key" )
View Source
const (
CategoryConfigBaseSuffix = " fabricator options:"
)
Variables ¶
View Source
var ( HHSubnet = "172.30.0.0/16" // All Hedgehog Fabric IPs assignment will happen from this subnet ControlKubeClusterCIDR = "172.28.0.0/16" ControlKubeServiceCIDR = "172.29.0.0/16" ControlKubeClusterDNS = "172.29.0.10" ControlVIP = "172.30.1.1" ControlVIPMask = "/32" ASNSpine uint32 = 65100 ASNLeafStart uint32 = 65101 ZotCheckURL = fmt.Sprintf("https://%s:%d/v2/_catalog", ControlVIP, ZotNodePort) K3sAPIPort = 6443 ZotNodePort = 31000 DasBootNTPNodePort = 30123 DasBootSyslogNodePort = 30514 ControlProxyNodePort = 31028 DevSSHKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGpF2+9I1Nj4BcN7y6DjzTbq1VcUYIRGyfzId5ZoBEFj" // 1P: Fabric Dev SSH Key Shared DevPassword = "$5$8nAYPGcl4l6G7Av1$Qi4/gnM0yPtGv9kjpMh78NuNSfQWy7vR1rulHpurL36" //nolint:gosec // 1P: Fabric Dev SONiC Admin DevSonicUsers = []meta.UserCreds{ { Name: "admin", Password: "$5$8nAYPGcl4l6G7Av1$Qi4/gnM0yPtGv9kjpMh78NuNSfQWy7vR1rulHpurL36", Role: "admin", }, { Name: "op", Password: "$5$oj/NxDtFw3eTyini$VHwdjWXSNYRxlFMu.1S5ZlGJbUF/CGmCAZIBroJlax4", Role: "operator", }, } OCIScheme = "oci://" // Base RefSource = cnc.Ref{Repo: "ghcr.io/githedgehog"} RefTarget = cnc.Ref{Repo: fmt.Sprintf("%s:%d/githedgehog", ControlVIP, ZotNodePort)} RefTargetInCluster = RefTarget // K3s RefK3s = cnc.Ref{Name: "k3s", Tag: "v1.30.0-k3s1"} // Zot RefZot = cnc.Ref{Name: "zot", Tag: "v1.4.3"} RefZotTargetImage = cnc.Ref{Repo: "ghcr.io/project-zot", Name: "zot-minimal-linux-amd64"} // Das Boot DasBootSeederClusterIP = "172.29.42.42" RefDasBootVersion = cnc.Ref{Tag: "v0.12.2"} RefDasBootCRDsChart = cnc.Ref{Name: "das-boot/charts/das-boot-crds"} RefDasBootSeederChart = cnc.Ref{Name: "das-boot/charts/das-boot-seeder"} RefDasBootSeederImage = cnc.Ref{Name: "das-boot/das-boot-seeder"} RefDasBootRegCtrlChart = cnc.Ref{Name: "das-boot/charts/das-boot-registration-controller"} RefDasBootRegCtrlImage = cnc.Ref{Name: "das-boot/das-boot-registration-controller"} RefDasBootRsyslogChart = cnc.Ref{Name: "das-boot/charts/rsyslog", Tag: "0.1.2"} RefDasBootRsyslogImage = cnc.Ref{Name: "das-boot/rsyslog", Tag: "0.1.0"} RefDasBootNTPChart = cnc.Ref{Name: "das-boot/charts/ntp", Tag: "0.0.3"} RefDasBootNTPImage = cnc.Ref{Name: "das-boot/ntp", Tag: "latest"} // ONIE RefHONIEVersion = cnc.Ref{Tag: "0.1.3"} RefONIETargetVersion = cnc.Ref{Tag: "latest"} // the target tag currently *must* always be "latest" as this is hardcoded in DAS BOOT RefONIESrcTargetsPairs = []struct { src cnc.Ref targets []cnc.Ref }{ { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, } // SONiC RefSonicBCMBase = cnc.Ref{Name: "sonic-bcom-private", Tag: "base-bin-4.2.0"} RefSonicBCMCampus = cnc.Ref{Name: "sonic-bcom-private", Tag: "campus-bin-4.2.0"} RefSonicBCMVS = cnc.Ref{Name: "sonic-bcom-private", Tag: "vs-bin-4.2.0"} RefSonicTargetVersion = cnc.Ref{Tag: "latest"} RefSonicTargetsBase = []cnc.Ref{ {Name: "sonic/x86_64-dellemc_s5248f_c3538-r0"}, {Name: "sonic/x86_64-dellemc_s5232f_c3538-r0"}, {Name: "sonic/x86_64-cel_questone_2-r0"}, {Name: "sonic/x86_64-cel_seastone_2-r0"}, {Name: "sonic/x86_64-cel_silverstone-r0"}, {Name: "sonic/x86_64-accton_as7726_32x-r0"}, {Name: "sonic/x86_64-accton_as7326_56x-r0"}, {Name: "sonic/x86_64-accton_as7712_32x-r0"}, } RefSonicTargetsCampus = []cnc.Ref{ {Name: "sonic/x86_64-accton_as4630_54npe-r0"}, } RefSonicTargetsVS = []cnc.Ref{ {Name: "sonic/x86_64-kvm_x86_64-r0"}, } // Fabric RefFabricVersion = cnc.Ref{Tag: "v0.39.5"} RefFabricAPIChart = cnc.Ref{Name: "fabric/charts/fabric-api"} RefFabricChart = cnc.Ref{Name: "fabric/charts/fabric"} RefFabricImage = cnc.Ref{Name: "fabric/fabric"} RefFabricAgent = cnc.Ref{Name: "fabric/agent"} RefFabricControlAgent = cnc.Ref{Name: "fabric/agent"} RefFabricCtl = cnc.Ref{Name: "fabric/hhfctl"} RefFabricDHCPServer = cnc.Ref{Name: "fabric/fabric-dhcp-server"} RefFabricDHCPServerChart = cnc.Ref{Name: "fabric/charts/fabric-dhcp-server"} RefFabricDHCPD = cnc.Ref{Name: "fabric/fabric-dhcpd"} RefFabricDHCPDChart = cnc.Ref{Name: "fabric/charts/fabric-dhcpd"} RefAlloy = cnc.Ref{Name: "fabric/alloy", Tag: "v1.1.1"} RefControlProxy = cnc.Ref{Name: "fabric/fabric-proxy", Tag: "1.9.1"} RefControlProxyChart = cnc.Ref{Name: "fabric/charts/fabric-proxy"} // Misc RefK9s = cnc.Ref{Name: "fabricator/k9s", Tag: "v0.32.4"} RefRBACProxy = cnc.Ref{Name: "fabricator/kube-rbac-proxy", Tag: "v0.14.1"} RefToolbox = cnc.Ref{Name: "fabricator/toolbox", Tag: "latest"} // Cert manager RefCertManagerVersion = cnc.Ref{Tag: "v1.13.0"} RefCertManagerCAInjector = cnc.Ref{Name: "fabricator/cert-manager-cainjector"} RefCertManagerController = cnc.Ref{Name: "fabricator/cert-manager-controller"} RefCertManagerACMESolver = cnc.Ref{Name: "fabricator/cert-manager-acmesolver"} RefCertManagerWebhook = cnc.Ref{Name: "fabricator/cert-manager-webhook"} RefCertManagerCtl = cnc.Ref{Name: "fabricator/cert-manager-ctl"} RefCertManagerChart = cnc.Ref{Name: "fabricator/charts/cert-manager"} // Reloader RefMiscReloader = cnc.Ref{Name: "fabricator/reloader", Tag: "v1.0.40"} RefMiscReloaderChart = cnc.Ref{Name: "fabricator/charts/reloader", Tag: "1.0.40"} // VLAB RefVLABONIE = cnc.Ref{Name: "honie", Tag: "lldp"} RefVLABFlarcar = cnc.Ref{Name: "flatcar", Tag: "3815.2.2"} RefVLABEEPROMEdit = cnc.Ref{Name: "onie-qcow2-eeprom-edit", Tag: "latest"} )
View Source
var ( BundleControlInstall = cnc.Bundle{ Name: "control-install", IsInstaller: true, } BundleControlOS = cnc.Bundle{ Name: "control-os", } BundleServerInstall = cnc.Bundle{ Name: "server-install", IsInstaller: true, } BundleServerOS = cnc.Bundle{ Name: "server-os", } BundleVlabFiles = cnc.Bundle{ Name: "vlab-files", } BundleVlabVMs = cnc.Bundle{ Name: "vlab-vms", } BundleHlabFiles = cnc.Bundle{ Name: "hlab-files", } )
View Source
var Presets = []cnc.Preset{PresetBM, PresetVLAB}
Functions ¶
func NewCNCManager ¶
Types ¶
type Base ¶
type Base struct { cnc.NoValidationComponent Source cnc.Ref `json:"source,omitempty"` Target cnc.Ref `json:"target,omitempty"` TargetInCluster cnc.Ref `json:"targetInCluster,omitempty"` AuthorizedKeys []string `json:"authorizedKeys,omitempty"` Dev bool `json:"dev,omitempty"` // contains filtered or unexported fields }
func BaseConfig ¶
func BaseConfig(get cnc.GetComponent) *Base
type ControlOS ¶
type ControlOS struct { cnc.NoValidationComponent PasswordHash string `json:"passwordHash,omitempty"` }
type DasBoot ¶
type DasBoot struct { cnc.NoValidationComponent Ref cnc.Ref `json:"ref,omitempty"` RsyslogChartRef cnc.Ref `json:"rsyslogChartRef,omitempty"` RsyslogImageRef cnc.Ref `json:"rsyslogImageRef,omitempty"` NTPChartRef cnc.Ref `json:"ntpChartRef,omitempty"` NTPImageRef cnc.Ref `json:"ntpImageRef,omitempty"` CRDsChartRef cnc.Ref `json:"crdsChartRef,omitempty"` SeederChartRef cnc.Ref `json:"seederChartRef,omitempty"` SeederImageRef cnc.Ref `json:"seederImageRef,omitempty"` RegCtrlChartRef cnc.Ref `json:"regCtrlChartRef,omitempty"` RegCtrlImageRef cnc.Ref `json:"regCtrlImageRef,omitempty"` SONiCBaseRef cnc.Ref `json:"sonicBaseRef,omitempty"` SONiCCampusRef cnc.Ref `json:"sonicCampusRef,omitempty"` SONiCVSRef cnc.Ref `json:"sonicVSRef,omitempty"` TLS DasBootTLS `json:"tls,omitempty"` ClusterIP string `json:"clusterIP,omitempty"` NTPServers string `json:"ntpServers,omitempty"` }
type DasBootTLS ¶
type Fabric ¶
type Fabric struct { Ref cnc.Ref `json:"ref,omitempty"` FabricAPIChartRef cnc.Ref `json:"fabricApiChartRef,omitempty"` FabricChartRef cnc.Ref `json:"fabricChartRef,omitempty"` FabricImageRef cnc.Ref `json:"fabricImageRef,omitempty"` AgentRef cnc.Ref `json:"agentRef,omitempty"` ControlAgentRef cnc.Ref `json:"controlAgentRef,omitempty"` CtlRef cnc.Ref `json:"ctlRef,omitempty"` FabricDHCPServerRef cnc.Ref `json:"dhcpServerRef,omitempty"` FabricDHCPServerChartRef cnc.Ref `json:"dhcpServerChartRef,omitempty"` FabricDHCPDRef cnc.Ref `json:"dhcpdRef,omitempty"` FabricDHCPDChartRef cnc.Ref `json:"dhcpdChartRef,omitempty"` BaseVPCCommunity string `json:"baseVPCCommunity,omitempty"` ServerFacingMTUOffset uint `json:"serverFacingMTUOffset,omitempty"` DHCPServer string `json:"dhcpServer,omitempty"` AlloyRef cnc.Ref `json:"alloyRef,omitempty"` Alloy meta.AlloyConfig `json:"alloy,omitempty"` ControlProxyRef cnc.Ref `json:"controlProxyRef,omitempty"` ControlProxyChartRef cnc.Ref `json:"controlProxyChartRef,omitempty"` ControlProxy bool `json:"controlProxy,omitempty"` SwitchUsers []meta.UserCreds `json:"switchUsers,omitempty"` }
type K3s ¶
type K3s struct { cnc.NoValidationComponent Ref cnc.Ref `json:"ref,omitempty"` ClusterCIDR string `json:"clusterCIDR,omitempty"` ServiceCIDR string `json:"serviceCIDR,omitempty"` ClusterDNS string `json:"clusterDNS,omitempty"` TLSSAN []string `json:"tlsSAN,omitempty"` // contains filtered or unexported fields }
func K3sConfig ¶ added in v0.6.0
func K3sConfig(get cnc.GetComponent) *K3s
type Misc ¶
type Misc struct { cnc.NoValidationComponent K9sRef cnc.Ref `json:"k9sRef,omitempty"` RBACProxyImageRef cnc.Ref `json:"rbacProxyRef,omitempty"` CertManagerRef cnc.Ref `json:"certManagerRef,omitempty"` CertManagerCAInjectorRef cnc.Ref `json:"certManagerCAInjectorRef,omitempty"` CertManagerControllerRef cnc.Ref `json:"certManagerControllerRef,omitempty"` CertManagerAcmeSolverRef cnc.Ref `json:"certManagerAcmeSolverRef,omitempty"` CertManagerWebhookRef cnc.Ref `json:"certManagerWebhookRef,omitempty"` CertManagerCtlRef cnc.Ref `json:"certManagerCtlRef,omitempty"` CertManagerChartRef cnc.Ref `json:"certManagerChartRef,omitempty"` ReloaderImageRef cnc.Ref `json:"reloaderImageRef,omitempty"` ReloaderChartRef cnc.Ref `json:"reloaderChartRef,omitempty"` }
func MiscConfig ¶
func MiscConfig(get cnc.GetComponent) *Misc
type ServerOS ¶ added in v0.5.3
type ServerOS struct { cnc.NoValidationComponent PasswordHash string `json:"passwordHash,omitempty"` ToolboxRef cnc.Ref `json:"toolboxRef,omitempty"` }
func (*ServerOS) Build ¶ added in v0.5.3
func (cfg *ServerOS) Build(_ string, _ cnc.Preset, _ meta.FabricMode, get cnc.GetComponent, data *wiring.Data, run cnc.AddBuildOp, install cnc.AddRunOp) error
type VLAB ¶
type VLAB struct { cnc.NoValidationComponent ONIERef cnc.Ref `json:"onieRef,omitempty"` FlatcarRef cnc.Ref `json:"flatcarRef,omitempty"` EEPROMEditRef cnc.Ref `json:"eepromEditRef,omitempty"` }
type Zot ¶
type Zot struct { cnc.NoValidationComponent Ref cnc.Ref `json:"ref,omitempty"` TLS ZotTLS `json:"tls,omitempty"` }
func ZotConfig ¶
func ZotConfig(get cnc.GetComponent) *Zot
Source Files
¶
Click to show internal directories.
Click to hide internal directories.