collector

package
v0.0.0-...-43fc741 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsPort     = int32(24231)
	MetricsPortName = "metrics"
)

Variables

View Source
var (
	DefaultPollInterval = 5 * time.Second
	DefaultTimeOut      = 30 * time.Second
)

Functions

func AddConfigmapVolumes

func AddConfigmapVolumes(podSpec *v1.PodSpec, configMaps internalobs.ConfigMaps) (results []string)

AddConfigmapVolumes adds configmap volumes to the pod spec for the unique set of configmaps and returns the list of the named volumes where the names are of the format 'config-<ConfigMap.Name>'

func AddSecretVolumes

func AddSecretVolumes(podSpec *v1.PodSpec, secrets vectorhelpers.Secrets) []string

AddSecretVolumes adds secret volumes to the pod spec for the unique set of output secrets and returns the list of the names

func AddSecurityContextTo

func AddSecurityContextTo(container *v1.Container) *v1.Container

func AddServiceAccountProjectedVolume

func AddServiceAccountProjectedVolume(podSpec *v1.PodSpec, inputs internalobs.Inputs, outputs internalobs.Outputs, audience string) bool

AddServiceAccountProjectedVolume adds ServiceAccountTokenProjection to the podspec and returns the named sa volume

func AddVolumeMounts

func AddVolumeMounts(collector *v1.Container, names []string, path func(string) string)

AddVolumeMounts to the collector container

func AddWebIdentityTokenEnvVars

func AddWebIdentityTokenEnvVars(collector *v1.Container, region, roleARN, tokenPath string)

AddWebIdentityTokenEnvVars Appends web identity env vars based on attributes of the secret and forwarder spec

func ReconcileTrustedCABundleConfigMap

func ReconcileTrustedCABundleConfigMap(er record.EventRecorder, k8sClient client.Client, namespace, name string, owner metav1.OwnerReference) error

ReconcileTrustedCABundleConfigMap creates or returns an existing Trusted CA Bundle ConfigMap. By setting label "config.openshift.io/inject-trusted-cabundle: true", the cert is automatically filled/updated.

func Remove

func Remove(k8sClient client.Client, namespace, name string) (err error)

func RemoveDeployment

func RemoveDeployment(k8sClient client.Client, namespace, name string) (err error)

func RemoveOrphanedInputServices

func RemoveOrphanedInputServices(client kubernetes.Client, reader kubernetes.Reader, namespace string, spec obs.ClusterLogForwarderSpec, resourceNames factory.ForwarderResourceNames, currOwner metav1.OwnerReference, removeAllServices bool) error

RemoveOrphanedInputServices removes receiver input services not owned by the given owner

func WaitForTrustedCAToBePopulated

func WaitForTrustedCAToBePopulated(k8sClient client.Client, namespace, name string, pollInterval, timeout time.Duration) *corev1.ConfigMap

WaitForTrustedCAToBePopulated polls for the given configmap to

Types

type CommonLabelVisitor

type CommonLabelVisitor func(o runtime.Object)

type Factory

type Factory struct {
	ConfigHash             string
	CollectorSpec          obs.CollectorSpec
	ClusterID              string
	ImageName              string
	Visit                  Visitor
	Secrets                map[string]*v1.Secret
	ConfigMaps             map[string]*v1.ConfigMap
	ForwarderSpec          obs.ClusterLogForwarderSpec
	CommonLabelInitializer CommonLabelVisitor
	PodLabelVisitor        PodLabelVisitor
	ResourceNames          *factory.ForwarderResourceNames

	LogLevel string
	// contains filtered or unexported fields
}

func New

func New(confHash, clusterID string, collectorSpec *obs.CollectorSpec, secrets map[string]*v1.Secret, configMaps map[string]*v1.ConfigMap, forwarderSpec obs.ClusterLogForwarderSpec, resNames *factory.ForwarderResourceNames, isDaemonset bool, logLevel string) *Factory

func (*Factory) CollectorResourceRequirements

func (f *Factory) CollectorResourceRequirements() v1.ResourceRequirements

CollectorResourceRequirements returns the resource requirements for a given collector implementation or it's default if none are specified

func (*Factory) NewCollectorContainer

func (f *Factory) NewCollectorContainer(inputs internalobs.Inputs, secretVolumes, configmapVolumes []string, addServiceAccountVolume bool, clusterID string) *v1.Container

NewCollectorContainer is a constructor for creating the collector container spec. Note the secretNames are assumed to be a unique list

func (*Factory) NewDaemonSet

func (f *Factory) NewDaemonSet(namespace, name string, trustedCABundle *v1.ConfigMap, tlsProfileSpec configv1.TLSProfileSpec) *apps.DaemonSet

func (*Factory) NewDeployment

func (f *Factory) NewDeployment(namespace, name string, trustedCABundle *v1.ConfigMap, tlsProfileSpec configv1.TLSProfileSpec) *apps.Deployment

func (*Factory) NewPodSpec

func (f *Factory) NewPodSpec(trustedCABundle *v1.ConfigMap, spec obs.ClusterLogForwarderSpec, clusterID string, tlsProfileSpec configv1.TLSProfileSpec, namespace string) *v1.PodSpec

func (*Factory) NodeSelector

func (f *Factory) NodeSelector() map[string]string

func (*Factory) ReconcileCollectorConfig

func (f *Factory) ReconcileCollectorConfig(er record.EventRecorder, k8sClient client.Client, reader client.Reader, namespace, collectorConfig string, owner metav1.OwnerReference) error

ReconcileCollectorConfig reconciles a collector config specifically for the collector defined by the factory

func (*Factory) ReconcileDaemonset

func (f *Factory) ReconcileDaemonset(er record.EventRecorder, k8sClient client.Client, namespace string, trustedCABundle *corev1.ConfigMap, owner metav1.OwnerReference) error

ReconcileDaemonset reconciles a daemonset specifically for the collector defined by the factory

func (*Factory) ReconcileDeployment

func (f *Factory) ReconcileDeployment(er record.EventRecorder, k8sClient client.Client, namespace string, trustedCABundle *corev1.ConfigMap, owner metav1.OwnerReference) error

ReconcileDeployment reconciles a deployment specifically for the collector defined by the factory

func (*Factory) ReconcileInputServices

func (f *Factory) ReconcileInputServices(er record.EventRecorder, k8sClient kubernetes.Client, k8sReader kubernetes.Reader, namespace, selectorComponent string, owner metav1.OwnerReference, visitors func(o runtime.Object)) error

ReconcileInputServices evaluates receiver inputs and deploys services for them

func (*Factory) Tolerations

func (f *Factory) Tolerations() []v1.Toleration

type PodLabelVisitor

type PodLabelVisitor func(o runtime.Object)

type Visitor

type Visitor func(collector *v1.Container, podSpec *v1.PodSpec, resNames *factory.ForwarderResourceNames, namespace, logLevel string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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