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
- Variables
- func ApplyConfig(cfg *Config)
- func BindFlags(cfg *Config, rootCmd, cmd *cobra.Command)
- func DebugKeepTmpFiles() bool
- func DebugUnixSocket() string
- func DefineDebugCommands(rootCmd *cobra.Command)
- func DownloadedModulesDir() string
- func EmbeddedPackageVersion() string
- func HelmMonitorKubeClientBurst() int
- func HelmMonitorKubeClientQPS() float32
- func KubeClientBurst() int
- func KubeClientQPS() float32
- func KubeConfig() string
- func KubeContext() string
- func LicensingEnabled() bool
- func ListenAddress() string
- func LogProxyHookJSON() bool
- func ModuleV2Enabled() bool
- func ObjectPatcherKubeClientBurst() int
- func ObjectPatcherKubeClientQPS() float32
- func ObjectPatcherKubeClientTimeout() time.Duration
- func PackageSystemEnabled() bool
- func ResolveLicensing(context.Context, dynamic.Interface)
- func ResourceRequestsEnabled() bool
- func SetAddonOperatorVersion(v string)
- func SetAppStartMessage(msg string)
- func SetDebugUnixSocket(path string)
- func SetDeckhouseVersion(v string)
- func SetKubeClientFieldManager(name string)
- func SetShellOperatorVersion(v string)
- func StrictModeEnabled() bool
- type Admission
- type Config
Constants ¶
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".
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.
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.
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.
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.
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.
const DefaultTempDir = adapp.DefaultTempDir
DefaultTempDir is the fallback temporary directory for hook data.
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" )
const EmbeddedModulesDir = "/deckhouse/modules"
EmbeddedModulesDir is the directory with modules shipped in the deckhouse image.
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.
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 ¶
var DummyModules = []string{
"000-common",
"007-registrypackages",
}
DummyModules are entries of the embedded modules dir that hold no module.
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 ¶
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 ¶
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 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 ¶
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
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
Admission carries the settings the validating webhook server starts with.
func TakeOverAdmissionServer ¶ added in v1.78.0
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.