Documentation
¶
Index ¶
- Constants
- func GenerateHTTPBasicAuth(username, password string) (string, error)
- func GetRegistryVIP(infraDriver infradriver.InfraDriver) string
- type Configurator
- type DaemonConfig
- type DaemonLogOpts
- type Driver
- type HostFileConfig
- type Hosts
- type Info
- type Installer
- type LocalRegistryInfo
- type RegistryInfo
Constants ¶
View Source
const (
LvscarePodFileName = "reg-lvscare.yaml"
)
Variables ¶
This section is empty.
Functions ¶
func GenerateHTTPBasicAuth ¶
func GetRegistryVIP ¶ added in v0.10.0
func GetRegistryVIP(infraDriver infradriver.InfraDriver) string
Types ¶
type Configurator ¶
type Configurator interface {
// InstallOn will install registry configuration on each given hosts.
InstallOn(masters, nodes []net.IP) error
// UninstallFrom will uninstall registry configuration on each given hosts.
UninstallFrom(masters, nodes []net.IP) error
GetDriver() (Driver, error)
GetRegistryInfo() RegistryInfo
}
Configurator provide registry configuration management
func NewConfigurator ¶
func NewConfigurator(deployHosts []net.IP, containerRuntimeInfo containerruntime.Info, regConfig v2.Registry, infraDriver infradriver.InfraDriver, distributor imagedistributor.Distributor) (Configurator, error)
func NewExternalConfigurator ¶
func NewExternalConfigurator(regConfig *v2.ExternalRegistry, containerRuntimeInfo containerruntime.Info, driver infradriver.InfraDriver) (Configurator, error)
type DaemonConfig ¶
type DaemonConfig struct {
AllowNonDistributableArtifacts []string `json:"allow-nondistributable-artifacts,omitempty"`
APICorsHeader string `json:"api-cors-header,omitempty"`
AuthorizationPlugins []string `json:"authorization-plugins,omitempty"`
Bip string `json:"bip,omitempty"`
Bridge string `json:"bridge,omitempty"`
CgroupParent string `json:"cgroup-parent,omitempty"`
ClusterAdvertise string `json:"cluster-advertise,omitempty"`
ClusterStore string `json:"cluster-store,omitempty"`
Containerd string `json:"containerd,omitempty"`
ContainerdNamespace string `json:"containerd-namespace,omitempty"`
ContainerdPluginNamespace string `json:"containerd-plugin-namespace,omitempty"`
DataRoot string `json:"data-root,omitempty"`
Debug bool `json:"debug,omitempty"`
DefaultCgroupnsMode string `json:"default-cgroupns-mode,omitempty"`
DefaultGateway string `json:"default-gateway,omitempty"`
DefaultGatewayV6 string `json:"default-gateway-v6,omitempty"`
DefaultRuntime string `json:"default-runtime,omitempty"`
DefaultShmSize string `json:"default-shm-size,omitempty"`
DNS []string `json:"dns,omitempty"`
DNSOpts []string `json:"dns-opts,omitempty"`
DNSSearch []string `json:"dns-search,omitempty"`
ExecOpts []string `json:"exec-opts,omitempty"`
ExecRoot string `json:"exec-root,omitempty"`
Experimental bool `json:"experimental,omitempty"`
FixedCidr string `json:"fixed-cidr,omitempty"`
FixedCidrV6 string `json:"fixed-cidr-v6,omitempty"`
Group string `json:"group,omitempty"`
Hosts []string `json:"hosts,omitempty"`
Icc bool `json:"icc,omitempty"`
Init bool `json:"init,omitempty"`
InitPath string `json:"init-path,omitempty"`
InsecureRegistries []string `json:"insecure-registries,omitempty"`
IP string `json:"ip,omitempty"`
IPForward bool `json:"ip-forward,omitempty"`
IPMasq bool `json:"ip-masq,omitempty"`
Iptables bool `json:"iptables,omitempty"`
IP6Tables bool `json:"ip6tables,omitempty"`
Ipv6 bool `json:"ipv6,omitempty"`
Labels []string `json:"labels,omitempty"`
LiveRestore bool `json:"live-restore,omitempty"`
LogDriver string `json:"log-driver,omitempty"`
LogLevel string `json:"log-level,omitempty"`
MaxConcurrentDownloads int `json:"max-concurrent-downloads,omitempty"`
MaxConcurrentUploads int `json:"max-concurrent-uploads,omitempty"`
MaxDownloadAttempts int `json:"max-download-attempts,omitempty"`
Mtu int `json:"mtu,omitempty"`
NoNewPrivileges bool `json:"no-new-privileges,omitempty"`
NodeGenericResources []string `json:"node-generic-resources,omitempty"`
OomScoreAdjust int `json:"oom-score-adjust,omitempty"`
Pidfile string `json:"pidfile,omitempty"`
RawLogs bool `json:"raw-logs,omitempty"`
RegistryMirrors []string `json:"registry-mirrors,omitempty"`
SeccompProfile string `json:"seccomp-profile,omitempty"`
SelinuxEnabled bool `json:"selinux-enabled,omitempty"`
ShutdownTimeout int `json:"shutdown-timeout,omitempty"`
StorageDriver string `json:"storage-driver,omitempty"`
StorageOpts []string `json:"storage-opts,omitempty"`
SwarmDefaultAdvertiseAddr string `json:"swarm-default-advertise-addr,omitempty"`
TLS bool `json:"tls,omitempty"`
Tlscacert string `json:"tlscacert,omitempty"`
Tlscert string `json:"tlscert,omitempty"`
Tlskey string `json:"tlskey,omitempty"`
Tlsverify bool `json:"tlsverify,omitempty"`
UserlandProxy bool `json:"userland-proxy,omitempty"`
UserlandProxyPath string `json:"userland-proxy-path,omitempty"`
UsernsRemap string `json:"userns-remap,omitempty"`
ClusterStoreOpts map[string]string `json:"cluster-store-opts,omitempty"`
LogOpts *DaemonLogOpts `json:"log-opts,omitempty"`
}
type DaemonLogOpts ¶
type DaemonLogOpts struct {
CacheDisabled string `json:"cache-disabled,omitempty"`
CacheMaxFile string `json:"cache-max-file,omitempty"`
CacheMaxSize string `json:"cache-max-size,omitempty"`
CacheCompress string `json:"cache-compress,omitempty"`
Env string `json:"env,omitempty"`
Labels string `json:"labels,omitempty"`
MaxFile string `json:"max-file,omitempty"`
MaxSize string `json:"max-size,omitempty"`
}
type Driver ¶
type Driver interface {
// UploadContainerImages2Registry :upload src registry filesystem to registry data directory.
UploadContainerImages2Registry() error
GetInfo() Info
}
Driver provide external interaction to work with registry.
type HostFileConfig ¶ added in v0.9.3
type HostFileConfig struct {
// CACert are the public key certificates for TLS
// Accepted types
// - string - Single file with certificate(s)
// - []string - Multiple files with certificates
CACert interface{} `toml:"ca"`
}
type Hosts ¶ added in v0.9.3
type Hosts struct {
// Server specifies the default server. When `host` is
// also specified, those hosts are tried first.
Server string `toml:"server"`
// HostConfigs store the per-host configuration
HostConfigs map[string]HostFileConfig `toml:"host"`
}
type Installer ¶
type Installer interface {
// Reconcile registry deploy hosts thought comparing current deploy host and desiredHosts and return the final registry deploy hosts.
// if current deploy host is less than desiredHosts , means scale-up registry node
// if current deploy host is bigger than desiredHosts , means scale-down registry node
// if current deploy host is equal targetHosts , do nothing
// launch registry node
// scale-up registry node
// scale down registry node
Reconcile(desiredHosts []net.IP) ([]net.IP, error)
// Clean all registry deploy hosts
Clean() error
}
Installer provide registry lifecycle management.
func NewInstaller ¶
func NewInstaller(currentDeployHost []net.IP, regConfig *v2.LocalRegistry, infraDriver infradriver.InfraDriver, distributor imagedistributor.Distributor) Installer
type LocalRegistryInfo ¶ added in v0.10.0
type LocalRegistryInfo struct {
*v2.LocalRegistry
DeployHosts []net.IP `json:"deployHosts,omitempty"`
Vip string `json:"vip,omitempty"`
}
type RegistryInfo ¶ added in v0.10.0
type RegistryInfo struct {
External *v2.ExternalRegistry `json:"external,omitempty"`
Local LocalRegistryInfo `json:"local,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.