shared

package
v0.0.0-...-540bb61 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Arango constants
	ArangoPort           = 8529
	ArangoSyncMasterPort = 8629
	ArangoSyncWorkerPort = 8729
	ArangoExporterPort   = 9101

	ArangoExporterStatusEndpoint        = "/_api/version"
	ArangoExporterClusterHealthEndpoint = "/_admin/cluster/health"
	ArangoExporterInternalEndpoint      = "/_admin/metrics"
	ArangoExporterInternalEndpointV2    = "/_admin/metrics/v2"
	ArangoExporterDefaultEndpoint       = "/metrics"

	ArangoSyncStatusEndpoint = "/_api/version"

	// K8s constants
	ClusterIPNone       = "None"
	TopologyKeyHostname = "kubernetes.io/hostname"

	NodeArchAffinityLabel     = "kubernetes.io/arch"
	NodeArchAffinityLabelBeta = "beta.kubernetes.io/arch"

	// Pod constants
	ServerContainerName             = "server"
	ExporterContainerName           = "exporter"
	ArangodVolumeName               = "arangod-data"
	TlsKeyfileVolumeName            = "tls-keyfile"
	ClientAuthCAVolumeName          = "client-auth-ca"
	ClusterJWTSecretVolumeName      = "cluster-jwt"
	MasterJWTSecretVolumeName       = "master-jwt"
	LifecycleVolumeName             = "lifecycle"
	FoxxAppEphemeralVolumeName      = "ephemeral-apps"
	TMPEphemeralVolumeName          = "ephemeral-tmp"
	ArangoDTimezoneVolumeName       = "arangod-timezone"
	RocksdbEncryptionVolumeName     = "rocksdb-encryption"
	ExporterJWTVolumeName           = "exporter-jwt"
	ArangodVolumeMountDir           = "/data"
	RocksDBEncryptionVolumeMountDir = "/secrets/rocksdb/encryption"
	TLSKeyfileVolumeMountDir        = "/secrets/tls"
	TLSSNIKeyfileVolumeMountDir     = "/secrets/sni"
	ClientAuthCAVolumeMountDir      = "/secrets/client-auth/ca"
	ClusterJWTSecretVolumeMountDir  = "/secrets/cluster/jwt"
	ExporterJWTVolumeMountDir       = "/secrets/exporter/jwt"
	MasterJWTSecretVolumeMountDir   = "/secrets/master/jwt"

	ServerPortName   = "server"
	ExporterPortName = "exporter"
)

Variables

This section is empty.

Functions

func CreatePersistentVolumeClaimName

func CreatePersistentVolumeClaimName(deploymentName, role, id string) string

CreatePersistentVolumeClaimName returns the name of the persistent volume claim for a member with a given id in a deployment with a given name.

func CreatePodHostName

func CreatePodHostName(deploymentName, role, id string) string

CreatePodHostName returns the hostname of the pod for a member with a given id in a deployment with a given name.

func FixupResourceName

func FixupResourceName(name string) string

FixupResourceName ensures that the given name complies with kubernetes name requirements. If the name is too long or contains invalid characters, it will be adjusted and a hash will be added.

func PrefixResourceError

func PrefixResourceError(prefix string, err error) error

PrefixResourceError creates new prefixed error. If error is already prefixed then current key is appended

func PrefixResourceErrors

func PrefixResourceErrors(prefix string, errs ...error) error

PrefixResourceErrors creates new prefixed errors. If error is already prefixed then current key is appended

func RenderResourceName

func RenderResourceName(in string, keys map[string]string) string

func StripArangodPrefix

func StripArangodPrefix(id string) string

StripArangodPrefix removes well know arangod ID prefixes from the given id.

func ValidateOptionalResourceName

func ValidateOptionalResourceName(name string) error

ValidateOptionalResourceName validates a kubernetes resource name. If not empty and not valid, an error is returned.

func ValidateResourceName

func ValidateResourceName(name string) error

ValidateResourceName validates a kubernetes resource name. If not valid, an error is returned. See https://kubernetes.io/docs/concepts/overview/working-with-objects/names/

func WithErrors

func WithErrors(errs ...error) error

WithErrors filter out nil errors

Types

type MergedErrors

type MergedErrors struct {
	// contains filtered or unexported fields
}

func (MergedErrors) Error

func (m MergedErrors) Error() string

func (MergedErrors) Errors

func (m MergedErrors) Errors() []error

type ResourceError

type ResourceError struct {
	Prefix string
	Err    error
}

func (ResourceError) Error

func (p ResourceError) Error() string

Error return string representation of error

func (*ResourceError) Format

func (p *ResourceError) Format(s fmt.State, verb rune)

Format formats error with verbs

Directories

Path Synopsis
+k8s:deepcopy-gen=package
+k8s:deepcopy-gen=package

Jump to

Keyboard shortcuts

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