Documentation
¶
Index ¶
- Constants
- Variables
- func AddConfigReloadAuthKeyToApp(container *corev1.Container, extraArgs map[string]string, ...)
- func AddConfigReloadAuthKeyVolume(dst []corev1.Volume, spec *vmv1beta1.CommonConfigReloaderParams) []corev1.Volume
- func AddDefaults(scheme *runtime.Scheme)
- func AddExtraArgsOverrideDefaults(args []string, extraArgs map[string]string, dashes string) []string
- func AddServiceAccountTokenVolume(dst []corev1.Volume, params *vmv1beta1.CommonApplicationDeploymentParams) []corev1.Volume
- func AddServiceAccountTokenVolumeMount(dst *corev1.Container, automount bool)
- func AddStrictSecuritySettingsToContainers(p *vmv1beta1.SecurityContext, containers []corev1.Container, ...)
- func AddStrictSecuritySettingsToPod(p *vmv1beta1.SecurityContext, enableStrictSecurity bool) *corev1.PodSecurityContext
- func AddStrictSecuritySettingsWithRootToContainers(p *vmv1beta1.SecurityContext, containers []corev1.Container, ...)
- func AddStrictSecuritySettingsWithRootToPod(p *vmv1beta1.SecurityContext, enableStrictSecurity bool) *corev1.PodSecurityContext
- func AddSyslogArgsTo(dst []string, syslogSpec *vmv1.SyslogServerSpec, ...) []string
- func AddSyslogPortsTo(dst []corev1.ContainerPort, syslogSpec *vmv1.SyslogServerSpec) []corev1.ContainerPort
- func AddSyslogPortsToService(svc *corev1.Service, syslogSpec *vmv1.SyslogServerSpec)
- func AddSyslogTLSConfigToVolumes(dstVolumes []corev1.Volume, dstMounts []corev1.VolumeMount, ...) ([]corev1.Volume, []corev1.VolumeMount)
- func AdditionalServiceFromDefault(defaultSvc *corev1.Service, svcSpec *vmv1beta1.AdditionalServiceSpec) *corev1.Service
- func AppendArgsForInsertPorts(args []string, ip *vmv1beta1.InsertPorts) []string
- func AppendFlagsToArgs(args []string, total int, fss ...*Flag) []string
- func AppendInsertPorts(ports []corev1.ContainerPort, ip *vmv1beta1.InsertPorts) []corev1.ContainerPort
- func AppendInsertPortsToService(ip *vmv1beta1.InsertPorts, svc *corev1.Service)
- func ConfigReloaderContainer(isInit bool, cr reloadable, mounts []corev1.VolumeMount, ...) corev1.Container
- func DaemonSetAddCommonParams(dst *appsv1.DaemonSet, useStrictSecurity bool, ...)
- func DeploymentAddCommonParams(dst *appsv1.Deployment, useStrictSecurity bool, ...)
- func HPA(opts builderOpts, targetRef autoscalingv2.CrossVersionObjectReference, ...) *autoscalingv2.HorizontalPodAutoscaler
- func HTTPRoute(cr builderOpts, port string, httpRoute *vmv1beta1.EmbeddedHTTPRoute) (*gwapiv1.HTTPRoute, error)
- func IsNotFound(err error) bool
- func LicenseArgsTo(args []string, l *vmv1beta1.License, secretMountDir string) []string
- func LicenseDoubleDashArgsTo(args []string, l *vmv1beta1.License, secretMountDir string) []string
- func LicenseVolumeTo(volumes []corev1.Volume, mounts []corev1.VolumeMount, l *vmv1beta1.License, ...) ([]corev1.Volume, []corev1.VolumeMount)
- func OrderByKeys[T any](target []T, sorter []string)
- func PodDNSAddress(baseName string, podIndex int32, namespace string, portName string, ...) string
- func PodDisruptionBudget(cr builderOpts, spec *vmv1beta1.EmbeddedPodDisruptionBudgetSpec) *policyv1.PodDisruptionBudget
- func Probe(container corev1.Container, cr probeCRD) corev1.Container
- func RelabelArgsTo(args []string, flag string, keys []string, ...) []string
- func RelabelVolumeTo(volumes []corev1.Volume, mounts []corev1.VolumeMount, cr relabelOpts) ([]corev1.Volume, []corev1.VolumeMount)
- func RenderShard[T any](resource *T, num int) (*T, error)
- func ResourceMeta(kind ResourceKind, cr builderOpts) metav1.ObjectMeta
- func ResourceName(kind ResourceKind, cr builderOpts) string
- func Resources(crdResources corev1.ResourceRequirements, defaultResources config.Resource, ...) corev1.ResourceRequirements
- func Service(cr builderOpts, defaultPort string, setOptions func(svc *corev1.Service)) *corev1.Service
- func ServiceAccount(cr objectForServiceAccountBuilder) *corev1.ServiceAccount
- func SetSkipRuntimeValidation(mustSkip bool)
- func SetSpaceTrim(disabled bool)
- func ShardName(cr shardOpts) string
- func ShardNumIter(backward bool, shardCount int) iter.Seq[int]
- func ShardPodDisruptionBudget(cr shardOpts, spec *vmv1beta1.EmbeddedPodDisruptionBudgetSpec, num int) *policyv1.PodDisruptionBudget
- func ShardPodLabels(cr shardOpts) map[string]string
- func ShardSelectorLabels(cr shardOpts) map[string]string
- func StatefulSetAddCommonParams(dst *appsv1.StatefulSet, useStrictSecurity bool, ...)
- func StorageVolumeMountsTo(volumes []corev1.Volume, mounts []corev1.VolumeMount, ...) ([]corev1.Volume, []corev1.VolumeMount, error)
- func StreamAggrArgsTo(args []string, prefix string, keys []string, cs ...*vmv1beta1.StreamAggrConfig) []string
- func StreamAggrVolumeTo(volumes []corev1.Volume, mounts []corev1.VolumeMount, cr streamAggrOpts) ([]corev1.Volume, []corev1.VolumeMount)
- func VMBackupManager(ctx context.Context, cr *vmv1beta1.VMBackup, port string, storagePath string, ...) (*corev1.Container, error)
- func VMPodScrapeForObjectWithSpec(psb podScrapeBuilder, serviceScrapeSpec *vmv1beta1.VMServiceScrapeSpec, ...) *vmv1beta1.VMPodScrape
- func VMRestore(cr *vmv1beta1.VMBackup, storagePath string, mounts []corev1.VolumeMount) (*corev1.Container, error)
- func VMServiceScrapeForAlertmanager(service *corev1.Service, amCR *vmv1beta1.VMAlertmanager) *vmv1beta1.VMServiceScrape
- func VMServiceScrapeForServiceWithSpec(service *corev1.Service, builder serviceScrapeBuilder, ...) *vmv1beta1.VMServiceScrape
- type AssetsCache
- func (ac *AssetsCache) AuthorizationToYAML(ns string, cfg *vmv1beta1.Authorization) (yaml.MapSlice, error)
- func (ac *AssetsCache) BasicAuthToYAML(ns string, cfg *vmv1beta1.BasicAuth) (yaml.MapSlice, error)
- func (ac *AssetsCache) BuildBasicAuthCreds(ns string, cfg *vmv1beta1.BasicAuth) (*BasicAuthCreds, error)
- func (ac *AssetsCache) BuildTLSCreds(ns string, cfg *vmv1beta1.TLSConfig) (*TLSCreds, error)
- func (ac *AssetsCache) GetOutput() map[ResourceKind]corev1.Secret
- func (ac *AssetsCache) LoadKeyFromConfigMap(ns string, cs *corev1.ConfigMapKeySelector) (string, error)
- func (ac *AssetsCache) LoadKeyFromSecret(ns string, ss *corev1.SecretKeySelector) (string, error)
- func (ac *AssetsCache) LoadKeyFromSecretOrConfigMap(ns string, soc *vmv1beta1.SecretOrConfigMap) (string, error)
- func (ac *AssetsCache) LoadPathFromSecret(kind ResourceKind, ns string, ss *corev1.SecretKeySelector) (string, error)
- func (ac *AssetsCache) LoadPathFromSecretOrConfigMap(kind ResourceKind, ns string, soc *vmv1beta1.SecretOrConfigMap) (string, error)
- func (ac *AssetsCache) LoadSecret(ns, name string) (*corev1.Secret, error)
- func (ac *AssetsCache) OAuth2ToYAML(ns string, cfg *vmv1beta1.OAuth2) (yaml.MapSlice, error)
- func (ac *AssetsCache) ProxyAuthToYAML(ns string, cfg *vmv1beta1.ProxyAuth) (yaml.MapSlice, error)
- func (ac *AssetsCache) TLSToYAML(ns, prefix string, cfg *vmv1beta1.TLSConfig) (yaml.MapSlice, error)
- func (ac *AssetsCache) VolumeTo(volumes []corev1.Volume, mounts []corev1.VolumeMount) ([]corev1.Volume, []corev1.VolumeMount)
- type BasicAuthCreds
- type ChildBuilder
- func (b *ChildBuilder) FinalLabels() map[string]string
- func (b *ChildBuilder) GetAdditionalService() *vmv1beta1.AdditionalServiceSpec
- func (b *ChildBuilder) PrefixedName() string
- func (b *ChildBuilder) SelectorLabels() map[string]string
- func (b *ChildBuilder) SetFinalLabels(ls map[string]string)
- func (b *ChildBuilder) SetSelectorLabels(ls map[string]string)
- type ChildObjects
- func (co *ChildObjects[T]) All() []T
- func (co *ChildObjects[T]) Broken() []T
- func (co *ChildObjects[T]) ForEachCollectSkipInvalid(validate func(s T) error)
- func (co *ChildObjects[T]) ForEachCollectSkipNotFound(validate func(s T) error) error
- func (co *ChildObjects[T]) Get(t T) T
- func (co *ChildObjects[T]) UpdateMetrics(ctx context.Context)
- type Flag
- type KeyNotFoundError
- type ParentOpts
- type ResourceCfg
- type ResourceKind
- type TLSCreds
Constants ¶
const DataVolumeName = "data"
Variables ¶
var MustSkipRuntimeValidation bool
MustSkipRuntimeValidation defines whether runtime object validation must be skipped the most usual case for it, if webhook validation is configured
Functions ¶
func AddConfigReloadAuthKeyToApp ¶ added in v0.57.0
func AddConfigReloadAuthKeyToApp(container *corev1.Container, extraArgs map[string]string, spec *vmv1beta1.CommonConfigReloaderParams)
AddConfigReloadAuthKeyToApp adds authKey env var to the given application container
func AddConfigReloadAuthKeyVolume ¶ added in v0.57.0
func AddConfigReloadAuthKeyVolume(dst []corev1.Volume, spec *vmv1beta1.CommonConfigReloaderParams) []corev1.Volume
AddConfigReloadAuthKeyVolume conditionally adds volume with config reload auth secret
func AddDefaults ¶ added in v0.48.0
AddDefaults adds defaulting functions to the runtimeScheme
func AddExtraArgsOverrideDefaults ¶
func AddExtraArgsOverrideDefaults(args []string, extraArgs map[string]string, dashes string) []string
AddExtraArgsOverrideDefaults adds extraArgs for given source args it trims in-place args if it was set via extraArgs no need to check for extraEnvs, it has priority over args at VictoriaMetrics apps dashes is either "-" or "--", depending on the process. alertmanager needs two dashes.
func AddServiceAccountTokenVolume ¶ added in v0.54.0
func AddServiceAccountTokenVolume(dst []corev1.Volume, params *vmv1beta1.CommonApplicationDeploymentParams) []corev1.Volume
AddServiceAccountTokenVolume conditionally adds volume "kube-api-access" with ServiceAccountToken projection
func AddServiceAccountTokenVolumeMount ¶ added in v0.54.0
AddServiceAccountTokenVolumeMount conditionally adds volumeMount to the provided container if automount is not set
func AddStrictSecuritySettingsToContainers ¶
func AddStrictSecuritySettingsToContainers(p *vmv1beta1.SecurityContext, containers []corev1.Container, enableStrictSecurity bool)
AddStrictSecuritySettingsToContainers conditionally adds Security settings to given containers
func AddStrictSecuritySettingsToPod ¶
func AddStrictSecuritySettingsToPod(p *vmv1beta1.SecurityContext, enableStrictSecurity bool) *corev1.PodSecurityContext
AddStrictSecuritySettingsToPod conditionally creates security context for pod or returns predefined one
func AddStrictSecuritySettingsWithRootToContainers ¶ added in v0.67.0
func AddStrictSecuritySettingsWithRootToContainers(p *vmv1beta1.SecurityContext, containers []corev1.Container, enableStrictSecurity bool)
AddStrictSecuritySettingsWithRootToContainers conditionally adds Security settings to given containers
func AddStrictSecuritySettingsWithRootToPod ¶ added in v0.67.0
func AddStrictSecuritySettingsWithRootToPod(p *vmv1beta1.SecurityContext, enableStrictSecurity bool) *corev1.PodSecurityContext
AddStrictSecuritySettingsWithRootToPod conditionally creates security context for pod or returns predefined one
func AddSyslogArgsTo ¶ added in v0.61.0
func AddSyslogArgsTo(dst []string, syslogSpec *vmv1.SyslogServerSpec, tlsServerConfigMountPath string) []string
AddSyslogArgsTo adds syslog flag args into provided dst
func AddSyslogPortsTo ¶ added in v0.61.0
func AddSyslogPortsTo(dst []corev1.ContainerPort, syslogSpec *vmv1.SyslogServerSpec) []corev1.ContainerPort
AddSyslogPortsTo adds syslog ports into provided dst
func AddSyslogPortsToService ¶ added in v0.61.0
func AddSyslogPortsToService(svc *corev1.Service, syslogSpec *vmv1.SyslogServerSpec)
AddSyslogPortsToService adds syslog ports to the provided service
func AddSyslogTLSConfigToVolumes ¶ added in v0.61.0
func AddSyslogTLSConfigToVolumes(dstVolumes []corev1.Volume, dstMounts []corev1.VolumeMount, syslogSpec *vmv1.SyslogServerSpec, tlsServerConfigMountPath string) ([]corev1.Volume, []corev1.VolumeMount)
AddSyslogTLSConfigToVolumes adds syslog tlsConfig volumes and mounts to the provided dsts
func AdditionalServiceFromDefault ¶
func AdditionalServiceFromDefault(defaultSvc *corev1.Service, svcSpec *vmv1beta1.AdditionalServiceSpec) *corev1.Service
AdditionalServiceFromDefault builds service from given exist service and overrides params if needed
func AppendArgsForInsertPorts ¶
func AppendArgsForInsertPorts(args []string, ip *vmv1beta1.InsertPorts) []string
AppendArgsForInsertPorts conditionally appends insert ports as flags to the given args
func AppendFlagsToArgs ¶ added in v0.61.0
func AppendInsertPorts ¶
func AppendInsertPorts(ports []corev1.ContainerPort, ip *vmv1beta1.InsertPorts) []corev1.ContainerPort
AppendInsertPorts conditionally adds ingestPorts to the given ports slice
func AppendInsertPortsToService ¶
func AppendInsertPortsToService(ip *vmv1beta1.InsertPorts, svc *corev1.Service)
AppendInsertPortsToService conditionally appends insert ports to the given service definition
func ConfigReloaderContainer ¶ added in v0.67.0
func ConfigReloaderContainer(isInit bool, cr reloadable, mounts []corev1.VolumeMount, ss *corev1.SecretKeySelector) corev1.Container
func DaemonSetAddCommonParams ¶ added in v0.55.0
func DaemonSetAddCommonParams(dst *appsv1.DaemonSet, useStrictSecurity bool, params *vmv1beta1.CommonApplicationDeploymentParams)
DeploymentAddCommonParams adds common params for all deployments
func DeploymentAddCommonParams ¶ added in v0.48.0
func DeploymentAddCommonParams(dst *appsv1.Deployment, useStrictSecurity bool, params *vmv1beta1.CommonApplicationDeploymentParams)
DeploymentAddCommonParams adds common params for all deployments
func HPA ¶
func HPA(opts builderOpts, targetRef autoscalingv2.CrossVersionObjectReference, spec *vmv1beta1.EmbeddedHPA) *autoscalingv2.HorizontalPodAutoscaler
HPA creates HorizontalPodAutoscaler object
func HTTPRoute ¶ added in v0.66.0
func HTTPRoute(cr builderOpts, port string, httpRoute *vmv1beta1.EmbeddedHTTPRoute) (*gwapiv1.HTTPRoute, error)
HTTPRoute creates HTTPRoute object
func IsNotFound ¶ added in v0.60.0
IsNotFound performs a check if provided error is KeyNotFoundError
func LicenseArgsTo ¶ added in v0.60.0
LicenseArgsTo conditionally adds license commandline args into given args
func LicenseDoubleDashArgsTo ¶ added in v0.60.0
LicenseDoubleDashArgsTo conditionally adds double-dash license commandline args into given args
func LicenseVolumeTo ¶ added in v0.60.0
func LicenseVolumeTo(volumes []corev1.Volume, mounts []corev1.VolumeMount, l *vmv1beta1.License, secretMountDir string) ([]corev1.Volume, []corev1.VolumeMount)
LicenseVolumeTo conditionally mounts secret with license key into given volumes and volume mounts
func OrderByKeys ¶ added in v0.60.0
OrderByKeys orders targets slice according sorter slice sorting result
func PodDNSAddress ¶ added in v0.51.0
func PodDNSAddress(baseName string, podIndex int32, namespace string, portName string, domain string) string
PodDNSAddress formats pod dns address with optional domain name
func PodDisruptionBudget ¶
func PodDisruptionBudget(cr builderOpts, spec *vmv1beta1.EmbeddedPodDisruptionBudgetSpec) *policyv1.PodDisruptionBudget
PodDisruptionBudget creates object for given CRD
func RelabelArgsTo ¶ added in v0.67.0
func RelabelArgsTo(args []string, flag string, keys []string, cs ...*vmv1beta1.CommonRelabelParams) []string
RelabelArgsTo conditionally adds relabel commandline args into given args
func RelabelVolumeTo ¶ added in v0.67.0
func RelabelVolumeTo(volumes []corev1.Volume, mounts []corev1.VolumeMount, cr relabelOpts) ([]corev1.Volume, []corev1.VolumeMount)
RelabelVolumeTo conditionally mounts configmap with relabel config into given volumes and volume mounts
func RenderShard ¶ added in v0.66.0
RenderShard replaces resource's shard number placeholder with a given shard number
func ResourceMeta ¶ added in v0.60.0
func ResourceMeta(kind ResourceKind, cr builderOpts) metav1.ObjectMeta
ResourceMeta return kubernetes metadata object for given kind and cr
func ResourceName ¶ added in v0.60.0
func ResourceName(kind ResourceKind, cr builderOpts) string
ResourceName returns a name for provided resource and corresponding cr object
func Resources ¶
func Resources(crdResources corev1.ResourceRequirements, defaultResources config.Resource, useDefault bool) corev1.ResourceRequirements
Resources creates container resources with conditional defaults values
func Service ¶
func Service(cr builderOpts, defaultPort string, setOptions func(svc *corev1.Service)) *corev1.Service
Service builds service for the given args and applies optional callback for it
func ServiceAccount ¶
func ServiceAccount(cr objectForServiceAccountBuilder) *corev1.ServiceAccount
ServiceAccount builds service account for CRD
func SetSkipRuntimeValidation ¶ added in v0.54.0
func SetSkipRuntimeValidation(mustSkip bool)
SetSkipRuntimeValidation configures MustSkipRuntimeValidation param
func SetSpaceTrim ¶ added in v0.60.0
func SetSpaceTrim(disabled bool)
SetSpaceTrim configures option to trim space at Secret/ConfigMap keys
Must called before any method from cache.go file could be used
func ShardName ¶ added in v0.66.0
func ShardName(cr shardOpts) string
ShardName adds shard suffix to a name if shards count is > 1
func ShardNumIter ¶ added in v0.66.0
ShardNumIter iterates over shardCount in order defined in backward
func ShardPodDisruptionBudget ¶ added in v0.66.0
func ShardPodDisruptionBudget(cr shardOpts, spec *vmv1beta1.EmbeddedPodDisruptionBudgetSpec, num int) *policyv1.PodDisruptionBudget
ShardPodDisruptionBudget creates object for given CRD and shard num
func ShardPodLabels ¶ added in v0.66.0
ShardPodLabels adds shard label pair if sharding enabled
func ShardSelectorLabels ¶ added in v0.66.0
ShardSelectorLabels adds shard label pair if sharding enabled
func StatefulSetAddCommonParams ¶ added in v0.48.0
func StatefulSetAddCommonParams(dst *appsv1.StatefulSet, useStrictSecurity bool, params *vmv1beta1.CommonApplicationDeploymentParams)
StatefulSetAddCommonParams adds common params to given statefulset
func StorageVolumeMountsTo ¶ added in v0.67.0
func StorageVolumeMountsTo(volumes []corev1.Volume, mounts []corev1.VolumeMount, pvcSrc *corev1.PersistentVolumeClaimVolumeSource, storagePath, dataVolumeName string) ([]corev1.Volume, []corev1.VolumeMount, error)
func StreamAggrArgsTo ¶ added in v0.61.0
func StreamAggrArgsTo(args []string, prefix string, keys []string, cs ...*vmv1beta1.StreamAggrConfig) []string
StreamAggrArgsTo conditionally adds stream aggregation commandline args into given args
func StreamAggrVolumeTo ¶ added in v0.61.0
func StreamAggrVolumeTo(volumes []corev1.Volume, mounts []corev1.VolumeMount, cr streamAggrOpts) ([]corev1.Volume, []corev1.VolumeMount)
StreamAggrVolumeTo conditionally mounts configmap with stream aggregation config into given volumes and volume mounts
func VMBackupManager ¶
func VMBackupManager( ctx context.Context, cr *vmv1beta1.VMBackup, port string, storagePath string, mounts []corev1.VolumeMount, extraArgs map[string]string, isCluster bool, license *vmv1beta1.License, ) (*corev1.Container, error)
VMBackupManager conditionally creates vmbackupmanager container
func VMPodScrapeForObjectWithSpec ¶ added in v0.55.0
func VMPodScrapeForObjectWithSpec(psb podScrapeBuilder, serviceScrapeSpec *vmv1beta1.VMServiceScrapeSpec, extraArgs map[string]string) *vmv1beta1.VMPodScrape
VMPodScrapeForObjectWithSpec build VMPodScrape for given podScrapeBuilder with provided args optionally could filter out ports from service
func VMRestore ¶
func VMRestore( cr *vmv1beta1.VMBackup, storagePath string, mounts []corev1.VolumeMount, ) (*corev1.Container, error)
VMRestore conditionally creates vmrestore container
func VMServiceScrapeForAlertmanager ¶ added in v0.47.0
func VMServiceScrapeForAlertmanager(service *corev1.Service, amCR *vmv1beta1.VMAlertmanager) *vmv1beta1.VMServiceScrape
VMServiceScrapeForServiceWithSpec build VMServiceScrape for VMAlertmanager
func VMServiceScrapeForServiceWithSpec ¶
func VMServiceScrapeForServiceWithSpec(service *corev1.Service, builder serviceScrapeBuilder, additionalPortNames ...string) *vmv1beta1.VMServiceScrape
VMServiceScrapeForServiceWithSpec creates corresponding object with `http` port endpoint obtained from given service add additionalPortNames to the monitoring if needed
Types ¶
type AssetsCache ¶ added in v0.60.0
type AssetsCache struct {
// contains filtered or unexported fields
}
AssetsCache is a shared cache for all CR assets that stores configmaps and secrets during reconcile loop
It's mostly needed to reduce pressure on Kubernetes API server because by default, operator disables client.Cache for those objects. Since it greatly increases memory usage.
func NewAssetsCache ¶ added in v0.60.0
func NewAssetsCache(ctx context.Context, client client.Client, cfg map[ResourceKind]*ResourceCfg) *AssetsCache
NewAssetsCache returns a new cache instance
func (*AssetsCache) AuthorizationToYAML ¶ added in v0.60.0
func (ac *AssetsCache) AuthorizationToYAML(ns string, cfg *vmv1beta1.Authorization) (yaml.MapSlice, error)
AuthorizationToYAML returns yaml representation of provided Authorization config Please note all secret values will be added as a plain text to it.
func (*AssetsCache) BasicAuthToYAML ¶ added in v0.60.0
BasicAuthToYAML returns yaml representation of provided BasicAuth configuration Please note all secret values will be added as a plain text to it.
func (*AssetsCache) BuildBasicAuthCreds ¶ added in v0.60.0
func (ac *AssetsCache) BuildBasicAuthCreds(ns string, cfg *vmv1beta1.BasicAuth) (*BasicAuthCreds, error)
BuildBasicAuthCreds fetches basic auth credentials object by given secret selectors
func (*AssetsCache) BuildTLSCreds ¶ added in v0.60.0
BuildTLSCreds fetches content of provided TLSConfig Returns an object with paths to the fetched secret values mounted on disk
func (*AssetsCache) GetOutput ¶ added in v0.60.0
func (ac *AssetsCache) GetOutput() map[ResourceKind]corev1.Secret
GetOutput returns Secret objects with cached content of fetched secrets grouped by ResourceKind
func (*AssetsCache) LoadKeyFromConfigMap ¶ added in v0.60.0
func (ac *AssetsCache) LoadKeyFromConfigMap(ns string, cs *corev1.ConfigMapKeySelector) (string, error)
LoadKeyFromConfigMap fetches content of configmap by given selector and namespace
Caller must check SecretOrConfigMap PrefixedName to be non-empty
func (*AssetsCache) LoadKeyFromSecret ¶ added in v0.60.0
func (ac *AssetsCache) LoadKeyFromSecret(ns string, ss *corev1.SecretKeySelector) (string, error)
LoadKeyFromSecret fetch content of secret by given selector and namespace returns plain text secret value
func (*AssetsCache) LoadKeyFromSecretOrConfigMap ¶ added in v0.60.0
func (ac *AssetsCache) LoadKeyFromSecretOrConfigMap(ns string, soc *vmv1beta1.SecretOrConfigMap) (string, error)
LoadKeyFromSecretOrConfigMap fetches content of secret or configmap by given selector and namespace returns plain text value
func (*AssetsCache) LoadPathFromSecret ¶ added in v0.60.0
func (ac *AssetsCache) LoadPathFromSecret(kind ResourceKind, ns string, ss *corev1.SecretKeySelector) (string, error)
LoadPathFromSecret loads content of the secret by given selector and namespace returns path to the secret content file mounted on pod volume
func (*AssetsCache) LoadPathFromSecretOrConfigMap ¶ added in v0.60.0
func (ac *AssetsCache) LoadPathFromSecretOrConfigMap(kind ResourceKind, ns string, soc *vmv1beta1.SecretOrConfigMap) (string, error)
LoadPathFromSecretOrConfigMap fetches content of the configmap by given selector and namespace returns path to the configmap content file mounted on pod volume
Caller must check SecretOrConfigMap PrefixedName to be non-empty
func (*AssetsCache) LoadSecret ¶ added in v0.60.0
func (ac *AssetsCache) LoadSecret(ns, name string) (*corev1.Secret, error)
LoadSecret returns secret object by given namespace and name
func (*AssetsCache) OAuth2ToYAML ¶ added in v0.60.0
OAuth2ToYAML returns yaml representation of provided oauth2 configuration Please note all secret values will be added as a plain text to it.
func (*AssetsCache) ProxyAuthToYAML ¶ added in v0.60.0
ProxyAuthToYAML returns yaml representation of provided ProxyAuth config Please note all secret values will be added as a plain text to it.
func (*AssetsCache) TLSToYAML ¶ added in v0.60.0
func (ac *AssetsCache) TLSToYAML(ns, prefix string, cfg *vmv1beta1.TLSConfig) (yaml.MapSlice, error)
TLSToYAML returns yaml representation of provided TLSConfig config Please note all secret values will be added as a plain text to it.
func (*AssetsCache) VolumeTo ¶ added in v0.60.0
func (ac *AssetsCache) VolumeTo(volumes []corev1.Volume, mounts []corev1.VolumeMount) ([]corev1.Volume, []corev1.VolumeMount)
VolumeTo adds volumes and volume Mounts to the provided destinations
type BasicAuthCreds ¶ added in v0.60.0
BasicAuthCreds defines basic auth credentials object
type ChildBuilder ¶ added in v0.66.0
type ChildBuilder struct {
ParentOpts
// contains filtered or unexported fields
}
func NewChildBuilder ¶ added in v0.66.0
func NewChildBuilder(cr ParentOpts, kind vmv1beta1.ClusterComponent) *ChildBuilder
func (*ChildBuilder) FinalLabels ¶ added in v0.66.0
func (b *ChildBuilder) FinalLabels() map[string]string
FinalLabels implements build.svcBuilderArgs interface
func (*ChildBuilder) GetAdditionalService ¶ added in v0.66.0
func (b *ChildBuilder) GetAdditionalService() *vmv1beta1.AdditionalServiceSpec
GetAdditionalService implements build.svcBuilderArgs interface
func (*ChildBuilder) PrefixedName ¶ added in v0.66.0
func (b *ChildBuilder) PrefixedName() string
PrefixedName implements build.svcBuilderArgs interface
func (*ChildBuilder) SelectorLabels ¶ added in v0.66.0
func (b *ChildBuilder) SelectorLabels() map[string]string
SelectorLabels implements build.svcBuilderArgs interface
func (*ChildBuilder) SetFinalLabels ¶ added in v0.66.0
func (b *ChildBuilder) SetFinalLabels(ls map[string]string)
func (*ChildBuilder) SetSelectorLabels ¶ added in v0.66.0
func (b *ChildBuilder) SetSelectorLabels(ls map[string]string)
type ChildObjects ¶ added in v0.67.0
type ChildObjects[T scrapeObjectWithStatus] struct {
// contains filtered or unexported fields
}
ChildObjects represents collected by parent CR child objects and provides interface for validating them using externally defined callbacks and updating metrics, that represent current status.
func NewChildObjects ¶ added in v0.67.0
func NewChildObjects[T scrapeObjectWithStatus](name string, valid []T, nsn []string) *ChildObjects[T]
NewChildObjects creates new ChildObject instance
func (*ChildObjects[T]) All ¶ added in v0.67.0
func (co *ChildObjects[T]) All() []T
All returns slice of valid and broken objects
func (*ChildObjects[T]) Broken ¶ added in v0.67.0
func (co *ChildObjects[T]) Broken() []T
Broken returns slice of broken objects
func (*ChildObjects[T]) ForEachCollectSkipInvalid ¶ added in v0.67.0
func (co *ChildObjects[T]) ForEachCollectSkipInvalid(validate func(s T) error)
ForEachCollectSkipInvalid iterates over all valid objects applying validate to each of them object is added to broken slice of validation failed, but it doesn't break a loop
func (*ChildObjects[T]) ForEachCollectSkipNotFound ¶ added in v0.67.0
func (co *ChildObjects[T]) ForEachCollectSkipNotFound(validate func(s T) error) error
ForEachCollectSkipNotFound iterates over all valid objects applying validate to each of them object is added to broken slice of validation failed and breaks a loop if error type is not NotFound
func (*ChildObjects[T]) Get ¶ added in v0.67.0
func (co *ChildObjects[T]) Get(t T) T
Get returns first valid or broken object with same name and namespace as of t, returns nil if not found
func (*ChildObjects[T]) UpdateMetrics ¶ added in v0.67.0
func (co *ChildObjects[T]) UpdateMetrics(ctx context.Context)
UpdateMetrics updates internal metrics depending on current ChildObjects instance state
type Flag ¶ added in v0.61.0
type Flag struct {
// contains filtered or unexported fields
}
func NewEmptyFlag ¶ added in v0.61.0
NewEmptyFlag builds Flag with empty string default value
type KeyNotFoundError ¶ added in v0.60.0
type KeyNotFoundError struct {
// contains filtered or unexported fields
}
KeyNotFoundError represents an error if expected key was not found at secret or configmap data
func (*KeyNotFoundError) Error ¶ added in v0.60.0
func (ke *KeyNotFoundError) Error() string
Error implements errors.Error interface
type ParentOpts ¶ added in v0.66.0
type ParentOpts interface {
client.Object
PrefixedInternalName(vmv1beta1.ClusterComponent) string
PrefixedName(vmv1beta1.ClusterComponent) string
SelectorLabels(vmv1beta1.ClusterComponent) map[string]string
GetServiceAccountName() string
GetAdditionalService(vmv1beta1.ClusterComponent) *vmv1beta1.AdditionalServiceSpec
IsOwnsServiceAccount() bool
FinalAnnotations() map[string]string
FinalLabels(vmv1beta1.ClusterComponent) map[string]string
AsOwner() metav1.OwnerReference
}
type ResourceCfg ¶ added in v0.60.0
type ResourceKind ¶ added in v0.60.0
type ResourceKind string
ResourceKind defines a type of resource to perform build operations on
const ( // TLSAssetsResourceKind defines build type for tls configuration assets TLSAssetsResourceKind ResourceKind = "tls-assets" // SecretConfigResourceKind defines build for configuration secret object SecretConfigResourceKind ResourceKind = "config" // StreamAggrConfigResourceKind defines build for stream aggregation configmap object StreamAggrConfigResourceKind ResourceKind = "stream-aggr" // RelabelConfigResourceKind defines build for relabelling configmap object RelabelConfigResourceKind ResourceKind = "relabelings-assets" )