system

package
v0.0.0-...-a4cc1bd Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: Apache-2.0 Imports: 3 Imported by: 439

Documentation

Index

Constants

View Source
const (
	// NamespaceEnvKey is the environment variable that specifies the system namespace.
	NamespaceEnvKey = "SYSTEM_NAMESPACE"

	// ResourceLabelEnvKey is the environment variable that specifies the system resource
	// label. This label should be used to limit the number of configmaps that are watched
	// in the system namespace.
	ResourceLabelEnvKey = "SYSTEM_RESOURCE_LABEL"
)

Variables

This section is empty.

Functions

func Namespace

func Namespace() string

Namespace returns the name of the K8s namespace where our system components run.

func PodName

func PodName() string

PodName will read various env vars to determine the name of the running pod before falling back

First it will read 'POD_NAME' this is expected to be populated using the Kubernetes downward API.

env:
- name: MY_POD_NAME
  valueFrom:
    fieldRef:
      fieldPath: metadata.name

As a fallback it will read HOSTNAME. This is undocumented Kubernetes behaviour that podman, cri-o and containerd have inherited from docker.

If none of these env-vars is set PodName will return an empty string

func ResourceLabel

func ResourceLabel() string

ResourceLabel returns the label key identifying K8s objects our system components source their configuration from.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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