configuration

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright 2025 HAProxy Technologies LLC

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.

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 HaproxyDefaults

func HaproxyDefaults() haproxy.HaproxyDirs

Types

type CommaSeparatedValues

type CommaSeparatedValues []string

func (*CommaSeparatedValues) Set

func (c *CommaSeparatedValues) Set(s string) error

func (*CommaSeparatedValues) String

func (c *CommaSeparatedValues) String() string

type External

type External struct {
	CfgDir        string `ff:"                     long: external-config-dir,     usage: 'path to HAProxy configuration directory.'"`
	HaproxyBinary string `ff:"                     long: external-haproxy-binary, usage: 'path to HAProxy binary.'"`
	RuntimeDir    string `ff:"                     long: external-runtime-dir,    usage: 'path to HAProxy runtime directory.'"`
	StateDir      string `ff:"                     long: external-state-dir,      usage: 'path to HAProxy state directory.'"`
	AuxDir        string `ff:"                     long: external-aux-dir,        usage: 'path to HAProxy aux directory.'"`
	External      bool   `ff:"short: e,            long: external,                usage: 'use as external Ingress Controller (out of k8s cluster).'"`
}

type HUGConfig

type HUGConfig struct {
	LogSettings map[v3.Category]slog.Level
	haproxy.HaproxyDirs
	ControllerConfCRD NamespaceNameValue `ff:"          long: hugconf-crd,                         usage: 'namespace/name of the HugConf CRD'"`
	ControllerName    string             `ff:"          long: controller-name,                     usage: 'spec.controllerName' GatewayClass selector'"`
	IPV4BindAddr      string             `ff:"          long: ipv4-bind-address,                   usage: 'IPv4 address to bind to'"`
	IPV6BindAddr      string             `ff:"          long: ipv6-bind-address,	               usage: 'IPv6 address to bind to'"`
	LogType           string             `ff:"          long: log-type,	      		               usage: 'sets up the log output type (possible values: text, json)"`
	External
	Namespaces                   CommaSeparatedValues `` /* 126-byte string literal not displayed */
	StatsPort                    int64                `ff:"          long: stats-port, default: 1024,       usage: 'port to listen on for HAProxy stats'"`
	ControllerPort               int                  `ff:"          long: controller-port,                 usage: 'port to listen on for controller data: prometheus'"`
	SyncPeriod                   time.Duration        `` /* 152-byte string literal not displayed */
	StartupSyncPeriod            time.Duration        `` /* 160-byte string literal not displayed */
	CacheResyncPeriod            time.Duration        `` /* 179-byte string literal not displayed */
	DefaultLogLevel              slog.Level
	AddStatsPortToFrontend       bool `ff:"          long: add-stats-port,default: true,    usage: 'add stats port bind to existing stats frontend'"`
	ForceRestartHaproxyAtStartup bool `ff:"          long: force-restart-haproxy,           usage: 'forces HAProxy restart at controller startup'"`
	Help                         bool `ff:"          long: help,                            usage: 'help'"`
	Test                         bool `ff:"short:t,                                         usage: 'simulate running HAProxy'"`
	LeaderElectionEnabled        bool `ff:"          long: leader-election-enabled,         usage: 'enable leader election'"`
	UseWiths6Overlay             bool `ff:"          long: with-s6-overlay,                 usage: 'use s6 overlay to start/stop/restart HAProxy'"`
	UseWithPebble                bool `ff:"          long: with-pebble,                     usage: 'use pebble start/stop/restart HAProxy'"`
	DisableIPv4                  bool `ff:"          long: disable-ipv4,                    usage: 'disable IPv4 support'"`
	DisableIPv6                  bool `ff:"          long: disable-ipv6,			        usage: 'disable IPv6 support'"`
	Version                      bool `ff:"          long: version,                         usage: 'print version and exit'"`
	JobCheckCRD                  bool `ff:"          long: job-check-crd,                   usage: 'run CRD refresh job and exit'"`
}

func Get

func Get() (HUGConfig, error)

func (*HUGConfig) Init

func (c *HUGConfig) Init(external External) error

type NamespaceNameValue

type NamespaceNameValue struct {
	Namespace, Name string
}

NamespaceNameValue used to automatically distinct namespace/name string

func (*NamespaceNameValue) Set

func (nv *NamespaceNameValue) Set(s string) error

func (*NamespaceNameValue) String

func (nv *NamespaceNameValue) String() string

Jump to

Keyboard shortcuts

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