Documentation ¶
Overview ¶
Package loggingscope is a generated GoMock package.
Index ¶
- Constants
- Variables
- func BuildWLSLogHome(name string) string
- func BuildWLSLogPath(name string) string
- func CreateFluentdConfigMap(namespace, name, fluentdConfig string) *kcore.ConfigMap
- func CreateFluentdConfigMapVolume(workloadName string) kcore.Volume
- func CreateFluentdContainer(spec vzapi.LoggingScopeSpec, namespace, workloadName string) kcore.Container
- func CreateFluentdHostPathVolumes() []kcore.Volume
- func CreateFluentdSecretVolume(secretName string) kcore.Volume
- func FetchLoggingScopeFromWorkloadLabels(ctx context.Context, cli client.Reader, log logr.Logger, namespace string, ...) (*vzapi.LoggingScope, error)
- func GetFluentdConfiguration(templateConfig string, requiresCABundle bool) string
- func GetWlsSpecificContainerEnv() []v1.EnvVar
- type Fluentd
- type FluentdManager
- type FluentdPod
- type Handler
- type HelidonHandler
- func (h *HelidonHandler) Apply(ctx context.Context, workload vzapi.QualifiedResourceRelation, ...) (*ctrl.Result, error)
- func (h *HelidonHandler) ApplyToDeployment(ctx context.Context, workload vzapi.QualifiedResourceRelation, ...) (*ctrl.Result, error)
- func (h *HelidonHandler) Remove(ctx context.Context, workload vzapi.QualifiedResourceRelation, ...) (bool, error)
- type MockFluentdManager
- func (m *MockFluentdManager) Apply(arg0 *v1alpha1.LoggingScope, arg1 v1alpha1.QualifiedResourceRelation, ...) (bool, error)
- func (m *MockFluentdManager) EXPECT() *MockFluentdManagerMockRecorder
- func (m *MockFluentdManager) Remove(arg0 *v1alpha1.LoggingScope, arg1 v1alpha1.QualifiedResourceRelation, ...) bool
- type MockFluentdManagerMockRecorder
- type Reconciler
Constants ¶
const ( FluentdContainerName = "fluentd" CAFileConfig = "\n ca_file /fluentd/secret/ca-bundle" )
const ( // DefaultElasticSearchURL defines the default Elasticsearch URL used if it is not specified in the logging scope DefaultElasticSearchURL = "http://vmi-system-es-ingest.verrazzano-system.svc.cluster.local:9200" // DefaultSecretName defines the default Elasticsearch secret name used if it is not specified in the logging scope DefaultSecretName = "verrazzano-es-internal" )
const ElasticSearchIndex = "#{ENV['NAMESPACE']}-#{ENV['APP_CONF_NAME']}-#{ENV['COMPONENT_NAME']}"
ElasticSearchIndex defines the common index pattern
const HelidonFluentdConfiguration = `` /* 636-byte string literal not displayed */
HelidonFluentdConfiguration FLUENTD rules for reading/parsing generic component log files
const WlsFluentdParsingRules = `` /* 1803-byte string literal not displayed */
WlsFluentdParsingRules defines the FLUENTD parsing rules for WLS
Variables ¶
var DefaultFluentdImage string
DefaultFluentdImage holds the default FLUENTD image that will be used if it is not specified in the logging scope
Functions ¶
func BuildWLSLogHome ¶
BuildWLSLogHome builds a log home give a resource name
func BuildWLSLogPath ¶
BuildWLSLogPath builds a log path given a resource name
func CreateFluentdConfigMap ¶
CreateFluentdConfigMap creates the FLUENTD configmap for a given OAM application
func CreateFluentdConfigMapVolume ¶
CreateFluentdConfigMapVolume create a config map volume for FLUENTD.
func CreateFluentdContainer ¶
func CreateFluentdContainer(spec vzapi.LoggingScopeSpec, namespace, workloadName string) kcore.Container
CreateFluentdContainer creates a FLUENTD sidecar container.
func CreateFluentdHostPathVolumes ¶
CreateFluentdHostPathVolumes creates hostPath volumes to access container logs.
func CreateFluentdSecretVolume ¶
CreateFluentdSecretVolume create a secret volume for FLUENTD.
func FetchLoggingScopeFromWorkloadLabels ¶
func FetchLoggingScopeFromWorkloadLabels(ctx context.Context, cli client.Reader, log logr.Logger, namespace string, labels map[string]string, fluentdImageOrverride string) (*vzapi.LoggingScope, error)
FetchLoggingScopeFromWorkloadLabels returns the LoggingScope object associated with the workload or nil if there is no associated logging scope. The workload lookup is done using the OAM labels from the workload metadata.
func GetFluentdConfiguration ¶ added in v0.13.0
func GetWlsSpecificContainerEnv ¶
GetWlsSpecificContainerEnv builds WLS specific env vars
Types ¶
type Fluentd ¶
type Fluentd struct { k8sclient.Client Log logr.Logger Context context.Context ParseRules string StorageVolumeName string StorageVolumeMountPath string WorkloadType string }
Fluentd is an implementation of FluentdManager.
func (*Fluentd) Apply ¶
func (f *Fluentd) Apply(scope *vzapi.LoggingScope, resource vzapi.QualifiedResourceRelation, fluentdPod *FluentdPod) (bool, error)
Apply applies FLUENTD configuration to create/update FLUENTD container, configmap, volumes and volume mounts. Returns true if any changes are made; false otherwise.
func (*Fluentd) Remove ¶
func (f *Fluentd) Remove(scope *vzapi.LoggingScope, resource vzapi.QualifiedResourceRelation, fluentdPod *FluentdPod) bool
Remove removes FLUENTD container, configmap, volumes and volume mounts. Returns whether the remove action has been verified so that the caller knows when it is safe to forget the association.
type FluentdManager ¶
type FluentdManager interface { Apply(scope *vzapi.LoggingScope, resource vzapi.QualifiedResourceRelation, fluentdPod *FluentdPod) (bool, error) Remove(scope *vzapi.LoggingScope, resource vzapi.QualifiedResourceRelation, fluentdPod *FluentdPod) bool }
FluentdManager is a general interface to interact with FLUENTD related resources
func GetFluentd ¶
GetFluentd creates an instance of FluentManager
type FluentdPod ¶
type FluentdPod struct { Containers []v1.Container Volumes []v1.Volume VolumeMounts []v1.VolumeMount HandlerEnv []v1.EnvVar LogPath string }
FluentdPod contains pod information for pods which require FLUENTD integration
type Handler ¶
type Handler interface { Apply(ctx context.Context, resource vzapi.QualifiedResourceRelation, scope *vzapi.LoggingScope) (*ctrl.Result, error) Remove(ctx context.Context, resource vzapi.QualifiedResourceRelation, scope *vzapi.LoggingScope) (bool, error) }
Handler abstracts the FLUENTD integration for components
type HelidonHandler ¶
HelidonHandler injects FLUENTD sidecar container for generic Kubernetes Deployment
func (*HelidonHandler) Apply ¶
func (h *HelidonHandler) Apply(ctx context.Context, workload vzapi.QualifiedResourceRelation, scope *vzapi.LoggingScope) (*ctrl.Result, error)
Apply applies a logging scope to a Kubernetes Deployment
func (*HelidonHandler) ApplyToDeployment ¶
func (h *HelidonHandler) ApplyToDeployment(ctx context.Context, workload vzapi.QualifiedResourceRelation, scope *vzapi.LoggingScope, deploy *kapps.Deployment) (*ctrl.Result, error)
ApplyToDeployment applies a logging scope to an existing in-memory Kubernetes Deployment
func (*HelidonHandler) Remove ¶
func (h *HelidonHandler) Remove(ctx context.Context, workload vzapi.QualifiedResourceRelation, scope *vzapi.LoggingScope) (bool, error)
Remove removes a logging scope from a Kubernetes Deployment
type MockFluentdManager ¶
type MockFluentdManager struct {
// contains filtered or unexported fields
}
MockFluentdManager is a mock of FluentdManager interface
func NewMockFluentdManager ¶
func NewMockFluentdManager(ctrl *gomock.Controller) *MockFluentdManager
NewMockFluentdManager creates a new mock instance
func (*MockFluentdManager) Apply ¶
func (m *MockFluentdManager) Apply(arg0 *v1alpha1.LoggingScope, arg1 v1alpha1.QualifiedResourceRelation, arg2 *FluentdPod) (bool, error)
Apply mocks base method
func (*MockFluentdManager) EXPECT ¶
func (m *MockFluentdManager) EXPECT() *MockFluentdManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockFluentdManager) Remove ¶
func (m *MockFluentdManager) Remove(arg0 *v1alpha1.LoggingScope, arg1 v1alpha1.QualifiedResourceRelation, arg2 *FluentdPod) bool
Remove mocks base method
type MockFluentdManagerMockRecorder ¶
type MockFluentdManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockFluentdManagerMockRecorder is the mock recorder for MockFluentdManager
func (*MockFluentdManagerMockRecorder) Apply ¶
func (mr *MockFluentdManagerMockRecorder) Apply(arg0, arg1, arg2 interface{}) *gomock.Call
Apply indicates an expected call of Apply
func (*MockFluentdManagerMockRecorder) Remove ¶
func (mr *MockFluentdManagerMockRecorder) Remove(arg0, arg1, arg2 interface{}) *gomock.Call
Remove indicates an expected call of Remove
type Reconciler ¶
type Reconciler struct { client.Client Log logr.Logger Scheme *runtime.Scheme Handlers map[string]Handler }
Reconciler reconciles a LoggingScope object
func NewReconciler ¶
NewReconciler creates a new Logging Scope reconciler
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager creates a controller and adds it to the manager