firelens

package
v1.43.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 22 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// ResourceName is the name of the firelens resource.
	ResourceName = "firelens"

	// ExternalConfigTypeOption is the option that specifies the type of an external config file to be included as
	// part of the config file generated by agent. Its allowed values are "s3" and "file".
	ExternalConfigTypeOption = "config-file-type"
	// ExternalConfigTypeS3 means the firelens container is using a config file from S3.
	ExternalConfigTypeS3 = "s3"
	// ExternalConfigTypeFile means the firelens container is using a config file inside the container.
	ExternalConfigTypeFile = "file"
)
View Source
const (
	// FirelensConfigTypeFluentd is the type of a fluentd firelens container.
	FirelensConfigTypeFluentd = "fluentd"

	// FirelensConfigTypeFluentbit is the type of a fluentbit firelens container.
	FirelensConfigTypeFluentbit = "fluentbit"

	// S3ConfigPathFluentd and S3ConfigPathFluentbit are the paths where we bind mount the config downloaded from S3 to.
	S3ConfigPathFluentd   = "/fluentd/etc/external.conf"
	S3ConfigPathFluentbit = "/fluent-bit/etc/external.conf"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FirelensResource

type FirelensResource struct {
	// contains filtered or unexported fields
}

FirelensResource models fluentd/fluentbit firelens container related resources as a task resource.

func NewFirelensResource

func NewFirelensResource(cluster, taskARN, taskDefinition, ec2InstanceID, dataDir, firelensConfigType, region, networkMode string,
	firelensOptions map[string]string, containerToLogOptions map[string]map[string]string, credentialsManager credentials.Manager,
	executionCredentialsID string) (*FirelensResource, error)

NewFirelensResource returns a new FirelensResource.

func (*FirelensResource) ApplyTransition

func (firelens *FirelensResource) ApplyTransition(nextState resourcestatus.ResourceStatus) error

ApplyTransition calls the function required to move to the specified status.

func (*FirelensResource) BuildContainerDependency added in v1.38.0

func (firelens *FirelensResource) BuildContainerDependency(containerName string, satisfied apicontainerstatus.ContainerStatus,
	dependent resourcestatus.ResourceStatus)

func (*FirelensResource) Cleanup

func (firelens *FirelensResource) Cleanup() error

Cleanup performs resource cleanup.

func (*FirelensResource) Create

func (firelens *FirelensResource) Create() error

Create performs resource creation. This includes creating a config directory, a socket directory, and generating a config file under the config directory.

func (*FirelensResource) DependOnTaskNetwork added in v1.38.0

func (firelens *FirelensResource) DependOnTaskNetwork() bool

func (*FirelensResource) DesiredTerminal

func (firelens *FirelensResource) DesiredTerminal() bool

DesiredTerminal returns true if the resource's desired status is REMOVED.

func (*FirelensResource) GetAppliedStatus

func (firelens *FirelensResource) GetAppliedStatus() resourcestatus.ResourceStatus

GetAppliedStatus returns the applied status.

func (*FirelensResource) GetCluster

func (firelens *FirelensResource) GetCluster() string

GetCluster returns the cluster.

func (*FirelensResource) GetContainerDependencies added in v1.38.0

func (firelens *FirelensResource) GetContainerDependencies(dependent resourcestatus.ResourceStatus) []apicontainer.ContainerDependency

func (*FirelensResource) GetContainerToLogOptions

func (firelens *FirelensResource) GetContainerToLogOptions() map[string]map[string]string

GetContainerToLogOptions returns a map of containers' log options.

func (*FirelensResource) GetCreatedAt

func (firelens *FirelensResource) GetCreatedAt() time.Time

GetCreatedAt returns the timestamp for resource's creation time.

func (*FirelensResource) GetDesiredStatus

func (firelens *FirelensResource) GetDesiredStatus() resourcestatus.ResourceStatus

GetDesiredStatus safely returns the desired status of the task.

func (*FirelensResource) GetEC2InstanceID

func (firelens *FirelensResource) GetEC2InstanceID() string

GetEC2InstanceID returns the ec2 instance id.

func (*FirelensResource) GetECSMetadataEnabled

func (firelens *FirelensResource) GetECSMetadataEnabled() bool

GetECSMetadataEnabled returns whether ecs metadata is enabled.

func (*FirelensResource) GetExecutionCredentialsID added in v1.31.0

func (firelens *FirelensResource) GetExecutionCredentialsID() string

func (*FirelensResource) GetExternalConfigType added in v1.31.0

func (firelens *FirelensResource) GetExternalConfigType() string

func (*FirelensResource) GetExternalConfigValue added in v1.31.0

func (firelens *FirelensResource) GetExternalConfigValue() string

func (*FirelensResource) GetKnownStatus

func (firelens *FirelensResource) GetKnownStatus() resourcestatus.ResourceStatus

GetKnownStatus safely returns the currently known status of the task.

func (*FirelensResource) GetName

func (firelens *FirelensResource) GetName() string

GetName returns the name of the resource.

func (*FirelensResource) GetNetworkMode added in v1.31.0

func (firelens *FirelensResource) GetNetworkMode() string

GetNetworkMode returns the network mode of the task.

func (*FirelensResource) GetRegion added in v1.31.0

func (firelens *FirelensResource) GetRegion() string

func (*FirelensResource) GetResourceDir

func (firelens *FirelensResource) GetResourceDir() string

GetResourceDir returns the resource dir.

func (*FirelensResource) GetTaskARN

func (firelens *FirelensResource) GetTaskARN() string

GetTaskARN returns the task arn.

func (*FirelensResource) GetTaskDefinition

func (firelens *FirelensResource) GetTaskDefinition() string

GetTaskDefinition returns the task definition.

func (*FirelensResource) GetTerminalReason

func (firelens *FirelensResource) GetTerminalReason() string

GetTerminalReason returns an error string to propagate up through to task state change messages.

func (*FirelensResource) Initialize

func (firelens *FirelensResource) Initialize(resourceFields *taskresource.ResourceFields,
	taskKnownStatus status.TaskStatus, taskDesiredStatus status.TaskStatus)

Initialize initializes the resource.

func (*FirelensResource) KnownCreated

func (firelens *FirelensResource) KnownCreated() bool

KnownCreated returns true if the resource's known status is CREATED.

func (*FirelensResource) MarshalJSON

func (firelens *FirelensResource) MarshalJSON() ([]byte, error)

MarshalJSON marshals a FirelensResource object into bytes of json.

func (*FirelensResource) NextKnownState

func (firelens *FirelensResource) NextKnownState() resourcestatus.ResourceStatus

NextKnownState returns the state that the resource should progress to based on its `KnownState`.

func (*FirelensResource) SetAppliedStatus

func (firelens *FirelensResource) SetAppliedStatus(status resourcestatus.ResourceStatus) bool

SetAppliedStatus sets the applied status of resource and returns whether the resource is already in a transition.

func (*FirelensResource) SetCreatedAt

func (firelens *FirelensResource) SetCreatedAt(createdAt time.Time)

SetCreatedAt sets the timestamp for resource's creation time.

func (*FirelensResource) SetDesiredStatus

func (firelens *FirelensResource) SetDesiredStatus(status resourcestatus.ResourceStatus)

SetDesiredStatus safely sets the desired status of the resource.

func (*FirelensResource) SetKnownStatus

func (firelens *FirelensResource) SetKnownStatus(status resourcestatus.ResourceStatus)

SetKnownStatus safely sets the currently known status of the resource.

func (*FirelensResource) StatusString

func (firelens *FirelensResource) StatusString(status resourcestatus.ResourceStatus) string

StatusString returns the string representation of the resource status.

func (*FirelensResource) SteadyState

func (firelens *FirelensResource) SteadyState() resourcestatus.ResourceStatus

SteadyState returns the transition state of the resource defined as "ready".

func (*FirelensResource) TerminalStatus

func (firelens *FirelensResource) TerminalStatus() resourcestatus.ResourceStatus

TerminalStatus returns the last transition state of resource.

func (*FirelensResource) UnmarshalJSON

func (firelens *FirelensResource) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals bytes of json into a FirelensResource object.

type FirelensStatus

type FirelensStatus resourcestatus.ResourceStatus
const (
	// FirelensStatusNone is the zero state of a firelens task resource.
	FirelensStatusNone FirelensStatus = iota
	// FirelensCreated represents the status of a firelens task resource which has been created.
	FirelensCreated
	// FirelensRemoved represents the status of a firelens task resource which has been cleaned up.
	FirelensRemoved
)

func (*FirelensStatus) MarshalJSON

func (as *FirelensStatus) MarshalJSON() ([]byte, error)

MarshalJSON overrides the logic for JSON-encoding the ResourceStatus type.

func (FirelensStatus) String

func (as FirelensStatus) String() string

String returns a human readable string representation of this object.

func (*FirelensStatus) UnmarshalJSON

func (as *FirelensStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON overrides the logic for parsing the JSON-encoded ResourceStatus data.

Jump to

Keyboard shortcuts

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