app

package
v1.78.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package app is deckhouse's single entry point for application configuration: constants, settings, CLI flags and environment variables.

The package plays two roles:

  • It owns deckhouse's own well-known values: product identity, the d8-system and kube-system namespaces, image-layout paths, the embedded and downloaded module directories, resource names, the runtime environment-variable contract and feature-gate flags. These are centralized here instead of being scattered across the controller.
  • It is a thin facade over the upstream addon-operator and shell-operator app packages. Deckhouse code imports this package instead of reaching into flant/* directly; the facade delegates to addon-operator, which in turn projects its config onto shell-operator.

Index

Constants

View Source
const (
	EnvEnablePackageSystem    = "DECKHOUSE_ENABLE_PACKAGE_SYSTEM"
	EnvEnableResourceRequests = "DECKHOUSE_ENABLE_RESOURCE_REQUESTS"
	EnvEnableModuleV2         = "DECKHOUSE_ENABLE_MODULE_V2"
)

Feature-gate environment variables. Each turns on a block of controllers in pkg/controller when set to the literal "true".

View Source
const (
	// AppName is the application name.
	AppName = "deckhouse"
	// AppDescription is the short product description shown in CLI help.
	AppDescription = "controller for Kubernetes platform from Flant"

	// DefaultReleaseChannel is the release channel used when none is injected at build time.
	DefaultReleaseChannel = "Stable"
)

Product identity of the deckhouse controller.

View Source
const (
	// NamespaceDeckhouse is the namespace deckhouse and its components run in.
	NamespaceDeckhouse = "d8-system"
	// NamespaceKubeSystem is the Kubernetes system namespace.
	NamespaceKubeSystem = "kube-system"
)

Kubernetes namespaces deckhouse operates in.

View Source
const (
	// VersionFilePath is the file holding the deckhouse version.
	VersionFilePath = "/deckhouse/version"
	// PathDeckhouseCRDs is the glob for deckhouse-controller CRD manifests.
	PathDeckhouseCRDs = "/deckhouse/deckhouse-controller/crds/*.yaml"
	// PathEdition is the file holding the deckhouse edition.
	PathEdition = "/deckhouse/edition"
)

Filesystem paths baked into the deckhouse image layout.

View Source
const (
	PathPythonLib      = "/deckhouse/python_lib"
	PathCandi          = "/deckhouse/candi"
	PathHelmLib        = "/deckhouse/helm_lib"
	PathShellLib       = "/deckhouse/shell_lib"
	PathShellOperator  = "/deckhouse/shell-operator"
	PathShellLibScript = "/deckhouse/shell_lib.sh"
)

Chroot mount sources for shell hooks and enabled scripts.

View Source
const (
	// DeploymentName is the name of the deckhouse Deployment.
	DeploymentName = "deckhouse"
	// SecretRegistry holds the container registry credentials.
	SecretRegistry = "deckhouse-registry"
	// SecretDiscovery holds cluster discovery data.
	SecretDiscovery = "deckhouse-discovery"
)

Well-known names of deckhouse-owned Kubernetes resources in NamespaceDeckhouse.

View Source
const DefaultTempDir = adapp.DefaultTempDir

DefaultTempDir is the fallback temporary directory for hook data.

View Source
const (

	// DevModuleVersion is what a module running from a dev tag reports to dependency checks: a
	// high fixed version, so the lower bounds of its dependents pass.
	DevModuleVersion = "v9.9.9"
)
View Source
const EmbeddedModulesDir = "/deckhouse/modules"

EmbeddedModulesDir is the directory with modules shipped in the deckhouse image.

View Source
const GlobalHooksDir = "/deckhouse/global-hooks"

GlobalHooksDir is the directory with the global module shipped in the deckhouse image. It holds no definition file — only the hooks the binary compiles in and the openapi schemas.

View Source
const PackageRepositoryDeckhouseModules = "deckhouse-modules"

PackageRepositoryDeckhouseModules is the PackageRepository serving the modules of the "deckhouse" ModuleSource; the modules moved out of the image go there.

Variables

View Source
var DummyModules = []string{
	"000-common",
	"007-registrypackages",
}

DummyModules are entries of the embedded modules dir that hold no module.

View Source
var Version string

Functions

func ApplyConfig

func ApplyConfig(cfg *Config)

ApplyConfig mirrors cfg into addon-operator's package-level globals so code that reads them directly, and the debug sub-commands, see the resolved values. Nil-safe and idempotent.

func BindFlags

func BindFlags(cfg *Config, rootCmd, cmd *cobra.Command)

BindFlags registers operator CLI flags on cmd, using the current cfg values as defaults so an explicit flag always wins. rootCmd receives the hidden debug-options helper command.

func DebugKeepTmpFiles

func DebugKeepTmpFiles() bool

DebugKeepTmpFiles reports whether temporary hook files are kept for debugging.

func DebugUnixSocket

func DebugUnixSocket() string

DebugUnixSocket is the path to the debug endpoint unix socket.

func DefineDebugCommands

func DefineDebugCommands(rootCmd *cobra.Command)

DefineDebugCommands attaches addon-operator's global and module debug sub-commands to rootCmd.

func DownloadedModulesDir

func DownloadedModulesDir() string

DownloadedModulesDir is the directory holding externally downloaded modules. The location is environment-configured and read through the d8env package.

func EmbeddedPackageVersion added in v1.78.0

func EmbeddedPackageVersion() string

EmbeddedPackageVersion reduces a Deckhouse version to the one every package the image ships carries: major.minor.patch, so a single version name spans every build of a release. A "dev" binary counts as v2.0.0; a version that is not semver is passed through unchanged, which keeps every caller naming the same version even when the result is no legal object name.

func HelmMonitorKubeClientBurst

func HelmMonitorKubeClientBurst() int

HelmMonitorKubeClientBurst is the burst limit for the Helm resources monitor client.

func HelmMonitorKubeClientQPS

func HelmMonitorKubeClientQPS() float32

HelmMonitorKubeClientQPS is the QPS limit for the Helm resources monitor client.

func KubeClientBurst

func KubeClientBurst() int

KubeClientBurst is the burst limit for the main Kubernetes client.

func KubeClientQPS

func KubeClientQPS() float32

KubeClientQPS is the QPS limit for the main Kubernetes client.

func KubeConfig

func KubeConfig() string

KubeConfig is the path to the kubeconfig file.

func KubeContext

func KubeContext() string

KubeContext is the kubeconfig context name to use.

func LicensingEnabled added in v1.78.0

func LicensingEnabled() bool

LicensingEnabled reports whether this deckhouse runs licensing.

func ListenAddress

func ListenAddress() string

ListenAddress is the address the operator serves Prometheus metrics on.

func LogProxyHookJSON

func LogProxyHookJSON() bool

LogProxyHookJSON reports whether hook stdout/stderr JSON logging is proxied.

func ModuleV2Enabled added in v1.78.0

func ModuleV2Enabled() bool

ModuleV2Enabled reports whether the Module v2 controller is enabled.

func ObjectPatcherKubeClientBurst

func ObjectPatcherKubeClientBurst() int

ObjectPatcherKubeClientBurst is the burst limit for the object patcher client.

func ObjectPatcherKubeClientQPS

func ObjectPatcherKubeClientQPS() float32

ObjectPatcherKubeClientQPS is the QPS limit for the object patcher client.

func ObjectPatcherKubeClientTimeout

func ObjectPatcherKubeClientTimeout() time.Duration

ObjectPatcherKubeClientTimeout is the request timeout for the object patcher client.

func PackageSystemEnabled

func PackageSystemEnabled() bool

PackageSystemEnabled reports whether the package-system controllers (PackageRepository, Application, ApplicationPackageVersion) are enabled.

func ResolveLicensing added in v1.78.0

func ResolveLicensing(context.Context, dynamic.Interface)

ResolveLicensing settles at startup whether licensing runs. CE has no licensing.

func ResourceRequestsEnabled added in v1.78.0

func ResourceRequestsEnabled() bool

ResourceRequestsEnabled reports whether spec.resourceRequests is honoured. When on, the nelm service renders the package chart, overlays the per-workload replicas and container resources onto the rendered manifests, and installs the release from the patched manifests instead of the original chart.

Gated because that install path replaces the chart nelm renders with a fully-rendered synthetic one: charts whose behaviour depends on anything beyond the manifests they produce are affected.

func SetAddonOperatorVersion

func SetAddonOperatorVersion(v string)

SetAddonOperatorVersion sets the version string reported by addon-operator.

func SetAppStartMessage

func SetAppStartMessage(msg string)

SetAppStartMessage overrides the line logged when the operator starts.

func SetDebugUnixSocket

func SetDebugUnixSocket(path string)

SetDebugUnixSocket overrides the unix socket path for the debug endpoint.

func SetDeckhouseVersion added in v1.78.0

func SetDeckhouseVersion(v string)

SetDeckhouseVersion sets the version string reported by deckhouse-controller.

func SetKubeClientFieldManager

func SetKubeClientFieldManager(name string)

SetKubeClientFieldManager sets the field manager name for server-side apply. Must be set before the Kubernetes client is initialized.

func SetShellOperatorVersion

func SetShellOperatorVersion(v string)

SetShellOperatorVersion sets the version string reported by shell-operator.

func StrictModeEnabled

func StrictModeEnabled() bool

StrictModeEnabled reports whether a missing values.yaml is a fatal error.

Types

type Admission added in v1.78.0

type Admission struct {
	ListenPort string
	CertsDir   string
}

Admission carries the settings the validating webhook server starts with.

func TakeOverAdmissionServer added in v1.78.0

func TakeOverAdmissionServer() (Admission, bool)

TakeOverAdmissionServer hands the admission settings to the caller and keeps addon-operator's own admission server down, since both would bind the same port. Reports false when there is nothing to serve: the dhctl bootstrap incarnation mounts no certificates.

type Config

type Config = adapp.Config

Config is the operator configuration. It is an alias of addon-operator's Config, so *app.Config is the exact same type addon-operator expects in WithConfig: there is no conversion at the boundary.

func NewConfig

func NewConfig() *Config

NewConfig returns a Config preset with addon-operator's hardcoded defaults. Layer environment variables on top with envconfig.Load before binding flags.

Jump to

Keyboard shortcuts

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