common

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// NamespaceDefault is the default namespace.
	NamespaceDefault = "default"
	// NamespaceKubeSystem is the kube-system namespace.
	NamespaceKubeSystem = "kube-system"
	// NameKubernetesService is the kubernetes service name.
	NameKubernetesService = "kubernetes"
	// DomainNameKubernetesService is the Kubernetes service domain name.
	DomainNameKubernetesService = "kubernetes.default.svc.cluster.local."
	// NameGardenerShootInfo is the name of the shoot info config map from Gardener.
	NameGardenerShootInfo = "shoot-info"
	// AgentConfigFilename is the name of the config file.
	AgentConfigFilename = "agent-config.yaml"
	// ClusterConfigFilename is the name of the config file.
	ClusterConfigFilename = "cluster-config.yaml"
	// EnvNodeName is the env variable to get the node name in an agent pod.
	EnvNodeName = "NODE_NAME"
	// EnvNodeIP is the env variable to get the node ip in an agent pod.
	EnvNodeIP = "NODE_IP"
	// EnvPodIP is the env variable to get the pod ip in an agent pod.
	EnvPodIP = "POD_IP"
	// LabelKeyK8sApp is the label key used to mark the pods.
	LabelKeyK8sApp = "k8s-app"
	// ApplicationName is the application name.
	ApplicationName = "network-problem-detector"
	// NameAgentConfigMap name of the config map for the agents.
	NameAgentConfigMap = ApplicationName + "-config"
	// NameClusterConfigMap name of the config map for the agents containing current nodes and agent pods.
	NameClusterConfigMap = ApplicationName + "-cluster-config"
	// NameDaemonSetAgentHostNet name of the daemon set running in the host network.
	NameDaemonSetAgentHostNet = ApplicationName + "-host"
	// NameDaemonSetAgentPodNet name of the daemon set running in the pod network.
	NameDaemonSetAgentPodNet = ApplicationName + "-pod"
	// NameDeploymentAgentController name of the deployment running the agent controller.
	NameDeploymentAgentController = ApplicationName + "-controller"
	// PathLogDir directory for logs on host file system.
	PathLogDir = "/var/log/nwpd"
	// PathOutputDir path of output directory with observations in pods.
	PathOutputDir = PathLogDir + "/records"
	// MaxLogfileSize is the maximum size of a log file written to the host file system.
	MaxLogfileSize = 5 * 1000 * 1000
	// PodNetPodHTTPPort is the port used for the metrics http server of the pods running in the pod network.
	PodNetPodHTTPPort = 8881
	// HostNetPodHTTPPort is the port used for the metrics http server of the pods running in the host network.
	HostNetPodHTTPPort = 12996
)

Variables

This section is empty.

Functions

func FormatAsUTC

func FormatAsUTC(t time.Time) string

func MergeMaps

func MergeMaps(map1, map2 map[string]string) map[string]string

MergeMaps merges two maps. If key is contained in both maps, the value of the second map is used.

Types

type ClientsetBase

type ClientsetBase struct {
	Kubeconfig string
	InCluster  bool
	Clientset  *kubernetes.Clientset
}

func (*ClientsetBase) AddInClusterFlag

func (b *ClientsetBase) AddInClusterFlag(flags *pflag.FlagSet)

func (*ClientsetBase) AddKubeConfigFlag

func (b *ClientsetBase) AddKubeConfigFlag(flags *pflag.FlagSet)

func (*ClientsetBase) RestConfig

func (b *ClientsetBase) RestConfig() (*rest.Config, error)

func (*ClientsetBase) SetupClientSet

func (b *ClientsetBase) SetupClientSet() error

type StringSet

type StringSet map[string]struct{}

func (StringSet) Add

func (s StringSet) Add(key string)

func (StringSet) AddAll

func (s StringSet) AddAll(keys ...string)

func (StringSet) AddSet

func (s StringSet) AddSet(other StringSet)

func (StringSet) Contains

func (s StringSet) Contains(key string) bool

func (StringSet) Delete

func (s StringSet) Delete(key string)

func (StringSet) Len

func (s StringSet) Len() int

func (StringSet) ToArray

func (s StringSet) ToArray() []string

func (StringSet) ToSortedArray

func (s StringSet) ToSortedArray() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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