config

package
v0.0.0-...-4779486 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareFeatures

func CompareFeatures(source, destination Features) bool

func CompareLabels

func CompareLabels(source, destination Labels) bool

Types

type AssetConfig

type AssetConfig struct {
	Directories map[string]*AssetDirectory
	Files       map[string]*AssetFile
}

type AssetDirectory

type AssetDirectory struct {
	Labels    Labels `yaml:"labels,omitempty"`
	Directory string `yaml:"directory"`
	Absolute  bool   `yaml:"absolute,omitempty"`
}

func NewAssetDirectory

func NewAssetDirectory(labels []string, directory string, absolute bool) *AssetDirectory

type AssetFile

type AssetFile struct {
	Labels    Labels `yaml:"labels,omitempty"`
	Filename  string `yaml:"filename,omitempty"`
	Directory string `yaml:"directory"`
}

func NewAssetFile

func NewAssetFile(labels []string, filename, directory string) *AssetFile

type Command

type Command struct {
	Name     string   `yaml:"name"`
	Command  string   `yaml:"command,omitempty"`
	Manifest string   `yaml:"manifest,omitempty"`
	Labels   Labels   `yaml:"labels,omitempty"`
	Features Features `yaml:"features,omitempty"`
	OS       OS       `yaml:"os,omitempty"`
}

func NewCommand

func NewCommand(name string, labels Labels, features Features, os OS, command string) *Command

func NewManifest

func NewManifest(name string, labels Labels, features Features, os OS, manifest string) *Command

type Commands

type Commands []*Command

type Config

type Config struct {
	Version                      string      `yaml:"version"`
	ClusterID                    string      `yaml:"cluster-id"`
	ClusterName                  string      `yaml:"cluster-name"`
	Email                        string      `yaml:"email"`
	IngressDomain                string      `yaml:"ingress-domain"`
	LoadBalancerPort             uint16      `yaml:"load-balancer-port"`
	VIPRaftControllerPort        uint16      `yaml:"vip-raft-controller-port"`
	VIPRaftWorkerPort            uint16      `yaml:"vip-raft-worker-port"`
	KubernetesDashboardPort      uint16      `yaml:"kubernetes-dashboard-port"`
	APIServerPort                uint16      `yaml:"apiserver-port,omitempty"`
	PublicNetwork                string      `yaml:"public-network"`
	ControllerVirtualIP          string      `yaml:"controller-virtual-ip,omitempty"`
	ControllerVirtualIPInterface string      `yaml:"controller-virtual-ip-interface,omitempty"`
	WorkerVirtualIP              string      `yaml:"worker-virtual-ip,omitempty"`
	WorkerVirtualIPInterface     string      `yaml:"worker-virtual-ip-interface,omitempty"`
	ClusterDomain                string      `yaml:"cluster-domain"`
	ClusterIPRange               string      `yaml:"cluster-ip-range"`
	ClusterDNSIP                 string      `yaml:"cluster-dns-ip"`
	ClusterCIDR                  string      `yaml:"cluster-cidr"`
	CalicoTyphaIP                string      `yaml:"calico-typha-ip"`
	CephClusterName              string      `yaml:"ceph-cluster-name"`
	CephPlacementGroups          uint        `yaml:"ceph-placement-groups"`
	CephExpectedNumberOfObjects  uint        `yaml:"ceph-expected-number-of-objects"`
	MetalLBAddresses             string      `yaml:"metallb-addresses"`
	ResolvConf                   string      `yaml:"resolv-conf"`
	DeploymentDirectory          string      `yaml:"deployment-directory,omitempty"`
	MaxPods                      uint16      `yaml:"max-pods"`
	SANIPAddresses               string      `yaml:"san-ip-addresses,omitempty"`
	SANDNSNames                  string      `yaml:"san-dns-names,omitempty"`
	RSASize                      uint16      `yaml:"rsa-size"`
	CAValidityPeriod             uint        `yaml:"ca-validity-period"`
	ClientValidityPeriod         uint        `yaml:"client-validity-period"`
	GrafanaSize                  uint16      `yaml:"grafana-size"`
	PrometheusSize               uint16      `yaml:"prometheus-size"`
	MinioSize                    uint16      `yaml:"minio-size"`
	ElasticsearchCount           uint16      `yaml:"elasticsearch-count"`
	ElasticsearchSize            uint16      `yaml:"elasticsearch-size"`
	AlertManagerCount            uint16      `yaml:"alert-manager-count"`
	AlertManagerSize             uint16      `yaml:"alert-manager-size"`
	KubeStateMetricsCount        uint16      `yaml:"kube-state-metrics-count"`
	DrainGracePeriodSeconds      uint16      `yaml:"drain-grace-period-seconds"`
	Versions                     Versions    `yaml:"versions"`
	Assets                       AssetConfig `yaml:"assets,omitempty"`
	Nodes                        Nodes       `yaml:"nodes"`
	Commands                     Commands    `yaml:"commands,omitempty"`
	Servers                      Servers     `yaml:"servers,omitempty"`
}

func NewConfig

func NewConfig() *Config

type Features

type Features []string

func (Features) HasFeatures

func (features Features) HasFeatures(otherFeatures Features) bool

type Image

type Image struct {
	Name     string
	Features Features
}

func (Image) GetImageFilename

func (image Image) GetImageFilename() (result string)

type Images

type Images []Image

type InternalConfig

type InternalConfig struct {
	BaseDirectory string
	Name          string
	Node          *Node
	Config        *Config
}

func NewInternalConfig

func NewInternalConfig(baseDirectory string) *InternalConfig

func (*InternalConfig) AddNode

func (config *InternalConfig) AddNode(name string, ip string, index uint, storageIndex uint, labels []string) (*Node, string, error)

func (*InternalConfig) ApplyTemplate

func (config *InternalConfig) ApplyTemplate(label string, value string) (string, error)

func (*InternalConfig) Dump

func (config *InternalConfig) Dump()

func (*InternalConfig) Generate

func (config *InternalConfig) Generate()

func (*InternalConfig) GetAPIServerIP

func (config *InternalConfig) GetAPIServerIP() (string, error)

func (*InternalConfig) GetAllowedCommonNames

func (config *InternalConfig) GetAllowedCommonNames() string

func (*InternalConfig) GetControllersCount

func (config *InternalConfig) GetControllersCount() string

func (*InternalConfig) GetETCDClientEndpoints

func (config *InternalConfig) GetETCDClientEndpoints() []string

func (*InternalConfig) GetEtcdCluster

func (config *InternalConfig) GetEtcdCluster() string

func (*InternalConfig) GetEtcdServers

func (config *InternalConfig) GetEtcdServers() string

func (*InternalConfig) GetFullAssetDirectory

func (config *InternalConfig) GetFullAssetDirectory(baseDirectory, name string) string

func (*InternalConfig) GetFullAssetFilename

func (config *InternalConfig) GetFullAssetFilename(baseDirectory, name string) string

func (*InternalConfig) GetFullLocalAssetDirectory

func (config *InternalConfig) GetFullLocalAssetDirectory(name string) string

func (*InternalConfig) GetFullLocalAssetFilename

func (config *InternalConfig) GetFullLocalAssetFilename(name string) string

func (*InternalConfig) GetFullTargetAssetDirectory

func (config *InternalConfig) GetFullTargetAssetDirectory(name string) string

func (*InternalConfig) GetFullTargetAssetFilename

func (config *InternalConfig) GetFullTargetAssetFilename(name string) string

func (*InternalConfig) GetKubeAPIServerAddresses

func (config *InternalConfig) GetKubeAPIServerAddresses() []string

func (*InternalConfig) GetRelativeAssetDirectory

func (config *InternalConfig) GetRelativeAssetDirectory(name string) string

func (*InternalConfig) GetRelativeAssetFilename

func (config *InternalConfig) GetRelativeAssetFilename(name string) string

func (*InternalConfig) GetSortedNodeKeys

func (config *InternalConfig) GetSortedNodeKeys() []string

func (*InternalConfig) GetStorageControllers

func (config *InternalConfig) GetStorageControllers() []NodeData

func (*InternalConfig) GetStorageNodes

func (config *InternalConfig) GetStorageNodes() []NodeData

func (*InternalConfig) GetTemplateAssetDirectory

func (config *InternalConfig) GetTemplateAssetDirectory(name string) string

func (*InternalConfig) GetTemplateAssetFilename

func (config *InternalConfig) GetTemplateAssetFilename(name string) string

func (*InternalConfig) GetWorkerIP

func (config *InternalConfig) GetWorkerIP() (string, error)

func (*InternalConfig) IsDeploymentDirectory

func (config *InternalConfig) IsDeploymentDirectory(name string) bool

func (*InternalConfig) Load

func (config *InternalConfig) Load() error

func (*InternalConfig) RemoveNode

func (config *InternalConfig) RemoveNode(name string) error

func (*InternalConfig) Save

func (config *InternalConfig) Save() error

func (*InternalConfig) SetNode

func (config *InternalConfig) SetNode(nodeName string, node *Node)

type Labels

type Labels []string

func (Labels) HasLabels

func (labels Labels) HasLabels(otherLabels Labels) bool

type LoggerConfig

type LoggerConfig struct {
	Enabled  bool   `yaml:"enabled"`
	Filename string `yaml:"filename"`
}

type Node

type Node struct {
	IP           string `yaml:"ip"`
	Index        uint   `yaml:"index"`
	StorageIndex uint   `yaml:"storage-index",omitempty`
	Labels       Labels `yaml:"labels"`
}

func NewNode

func NewNode(ip string, index, storageIndex uint, labels []string) *Node

func (*Node) IsController

func (node *Node) IsController() bool

func (*Node) IsControllerOnly

func (node *Node) IsControllerOnly() bool

func (*Node) IsStorage

func (node *Node) IsStorage() bool

func (*Node) IsStorageOnly

func (node *Node) IsStorageOnly() bool

func (*Node) IsWorker

func (node *Node) IsWorker() bool

func (*Node) IsWorkerOnly

func (node *Node) IsWorkerOnly() bool

type NodeData

type NodeData struct {
	Index        uint
	StorageIndex uint
	Name         string
	IP           string
}

type Nodes

type Nodes map[string]*Node

func (Nodes) HasControllerNode

func (nodes Nodes) HasControllerNode() bool

func (Nodes) HasStorageNode

func (nodes Nodes) HasStorageNode() bool

func (Nodes) HasWorkerNode

func (nodes Nodes) HasWorkerNode() bool

type OS

type OS []string

type ServerConfig

type ServerConfig struct {
	Name        string            `yaml:"name"`
	Enabled     bool              `yaml:"enabled"`
	Labels      Labels            `yaml:"labels"`
	Logger      LoggerConfig      `yaml:"logger"`
	Command     string            `yaml:"command"`
	Arguments   map[string]string `yaml:"arguments"`
	Environment map[string]string `yaml:"environment"`
}

func (ServerConfig) Dump

func (config ServerConfig) Dump()

type Servers

type Servers []ServerConfig

type Versions

type Versions struct {
	Etcd                         string `yaml:"etcd"`
	K8S                          string `yaml:"kubernetes"`
	KubeAPIServer                string `yaml:"kube-apiserver"`
	KubeControllerManager        string `yaml:"kube-controller-manager"`
	KubeScheduler                string `yaml:"kube-scheduler"`
	KubeProxy                    string `yaml:"kube-proxy"`
	Helm                         string `yaml:"helm"`
	Containerd                   string `yaml:"containerd"`
	Runc                         string `yaml:"runc"`
	CriCtl                       string `yaml:"crictl"`
	Gobetween                    string `yaml:"gobetween"`
	VirtualIP                    string `yaml:"virtual-ip"`
	Busybox                      string `yaml:"busybox"`
	Velero                       string `yaml:"velero"`
	VeleroPluginAWS              string `yaml:"velero-plugin-aws"`
	VeleroPluginCSI              string `yaml:"velero-plugin-csi"`
	VeleroResticRestoreHelper    string `yaml:"velero-restic-restore-helper"`
	MinioServer                  string `yaml:"minio-server"`
	MinioClient                  string `yaml:"minio-client"`
	Pause                        string `yaml:"pause"`
	CoreDNS                      string `yaml:"core-dns"`
	Elasticsearch                string `yaml:"elasticsearch"`
	Kibana                       string `yaml:"kibana"`
	Cerebro                      string `yaml:"cerebro"`
	FluentBit                    string `yaml:"fluent-bit"`
	CalicoTypha                  string `yaml:"calico-typha"`
	CalicoNode                   string `yaml:"calico-node"`
	CalicoCNI                    string `yaml:"calico-cni"`
	CalicoKubeControllers        string `yaml:"calico-kube-controllers"`
	MetalLBController            string `yaml:"metallb-controller"`
	MetalLBSpeaker               string `yaml:"metallb-speaker"`
	Ceph                         string `yaml:"ceph"`
	KubernetesDashboard          string `yaml:"kubernetes-dashboard"`
	CertManagerCtl               string `yaml:"cert-manager-ctl"`
	CertManagerController        string `yaml:"cert-manager-controller"`
	CertManagerCAInjector        string `yaml:"cert-manager-cainjector"`
	CertManagerWebHook           string `yaml:"cert-manager-webhook"`
	NginxIngressController       string `yaml:"nginx-ingress-controller"`
	NginxIngressAdmissionWebhook string `yaml:"nginx-ingress-admission-webhook"`
	MetricsScraper               string `yaml:"metrics-scraper"`
	MetricsServer                string `yaml:"metrics-server"`
	ConfigMapReload              string `yaml:"configmap-reload"`
	KubeStateMetrics             string `yaml:"kube-state-metrics"`
	Grafana                      string `yaml:"grafana"`
	Prometheus                   string `yaml:"prometheus"`
	NodeExporter                 string `yaml:"node-exporter"`
	AlertManager                 string `yaml:"alert-manager"`
	CSIAttacher                  string `yaml:"csi-attacher"`
	CSIProvisioner               string `yaml:"csi-provisioner"`
	CSIDriverRegistrar           string `yaml:"csi-driver-registrar"`
	CSISnapshotter               string `yaml:"csi-snapshotter"`
	CSISnapshotController        string `yaml:"csi-snapshot-controller"`
	CSIResizer                   string `yaml:"csi-resizer"`
	CSICephPlugin                string `yaml:"csi-ceph-plugin"`
	WordPress                    string `yaml:"wordpress"`
	MySQL                        string `yaml:"mysql"`
}

func NewVersions

func NewVersions() Versions

func (Versions) GetImages

func (versions Versions) GetImages() []Image

Jump to

Keyboard shortcuts

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