config

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright 2020 CLOUD&HEAT Technologies GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FillAgentConfig

func FillAgentConfig(cfg *AgentConfig)

func FillControllerConfig

func FillControllerConfig(cfg *ControllerConfig)

func FillKeepalivedConfig

func FillKeepalivedConfig(cfg *Keepalived)

func FillNftablesConfig

func FillNftablesConfig(cfg *Nftables)

func ReadAgentConfig

func ReadAgentConfig(configFile io.Reader, config *AgentConfig) error

func ReadControllerConfig

func ReadControllerConfig(configReader io.Reader, config *ControllerConfig) error

func ValidateAgentConfig

func ValidateAgentConfig(cfg *AgentConfig) error

func ValidateControllerConfig

func ValidateControllerConfig(cfg *ControllerConfig) error

Types

type Agent

type Agent struct {
	URL string `toml:"url"`
}

type AgentConfig

type AgentConfig struct {
	SharedSecret string `toml:"shared-secret"`
	BindAddress  string `toml:"bind-address"`
	BindPort     int32  `toml:"bind-port"`

	Keepalived Keepalived `toml:"keepalived"`
	Nftables   Nftables   `toml:"nftables"`
}

func ReadAgentConfigFromFile

func ReadAgentConfigFromFile(path string, withDefaults bool) (AgentConfig, error)

type Agents

type Agents struct {
	SharedSecret  string  `toml:"shared-secret"`
	TokenLifetime int     `toml:"token-lifetime"`
	Agents        []Agent `toml:"agent"`
}

type BackendLayer

type BackendLayer string
const (
	BackendLayerNodePort  BackendLayer = "NodePort"
	BackendLayerClusterIP BackendLayer = "ClusterIP"
	BackendLayerPod       BackendLayer = "Pod"
)

type ControllerConfig

type ControllerConfig struct {
	BindAddress string `toml:"bind-address"`
	BindPort    int32  `toml:"bind-port"`

	PortManager  PortManager  `toml:"port-manager"`
	BackendLayer BackendLayer `toml:"backend-layer"`

	OpenStack openstack.Config `toml:"openstack"`
	Static    static.Config    `toml:"static"`
	Agents    Agents           `toml:"agents"`
}

func ReadControllerConfigFromFile

func ReadControllerConfigFromFile(path string, withDefaults bool) (ControllerConfig, error)

type Keepalived

type Keepalived struct {
	Enabled bool `toml:"enabled"`

	VRRPPassword string `toml:"vrrp-password"`
	// TODO: allow different priorities per-service so that inbound traffic
	// is being balanced between VMs.
	Priority  int    `toml:"priority"`
	VRIDBase  int    `toml:"virtual-router-id-base"`
	Interface string `toml:"interface"`

	Service ServiceConfig `toml:"service"`
}

type Nftables

type Nftables struct {
	FilterTableName         string   `toml:"filter-table-name"`
	FilterTableType         string   `toml:"filter-table-type"`
	FilterForwardChainName  string   `toml:"filter-forward-chain"`
	NATTableName            string   `toml:"nat-table-name"`
	NATPreroutingChainName  string   `toml:"nat-prerouting-chain"`
	NATPostroutingChainName string   `toml:"nat-postrouting-chain"`
	PolicyPrefix            string   `toml:"policy-prefix"`
	NftCommand              []string `toml:"nft-command"`
	PartialReload           bool     `toml:"partial-reload"`
	EnableSNAT              bool     `toml:"enable-snat"`
	FWMarkBits              uint32   `toml:"fwmark-bits"`
	FWMarkMask              uint32   `toml:"fwmark-mask"`

	Service ServiceConfig `toml:"service"`
}

type PortManager added in v0.6.0

type PortManager string
const (
	PortManagerOpenstack PortManager = "openstack"
	PortManagerStatic    PortManager = "static"
)

type ServiceConfig

type ServiceConfig struct {
	ConfigFile    string   `toml:"config-file"`
	ReloadCommand []string `toml:"reload-command"`
	StatusCommand []string `toml:"status-command"`
	StartCommand  []string `toml:"start-command"`
	CheckDelay    int      `toml:"check-delay"`
}

Jump to

Keyboard shortcuts

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