v1alpha1

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Overview

Package v1alpha1 contains interfaces and types common to all TriggerMesh API groups.

Index

Constants

View Source
const (
	// ConditionReady has status True when the component is ready to receive/send events.
	ConditionReady = apis.ConditionReady
	// ConditionSinkProvided has status True when the component has been configured with an event sink.
	ConditionSinkProvided apis.ConditionType = "SinkProvided"
	// ConditionDeployed has status True when the component's adapter is up and running.
	ConditionDeployed apis.ConditionType = "Deployed"
)

Status conditions

View Source
const (
	// ReasonRBACNotBound is set on a Deployed condition when an adapter's
	// ServiceAccount cannot be bound.
	ReasonRBACNotBound = "RBACNotBound"
	// ReasonUnavailable is set on a Deployed condition when an adapter in unavailable.
	ReasonUnavailable = "AdapterUnavailable"

	// ReasonSinkNotFound is set on a SinkProvided condition when a sink does not exist.
	ReasonSinkNotFound = "SinkNotFound"
	// ReasonSinkEmpty is set on a SinkProvided condition when a sink URI is empty.
	ReasonSinkEmpty = "EmptySinkURI"
)

Reasons for status conditions

View Source
const AnnotationEksIAMRole = "eks.amazonaws.com/role-arn"

AnnotationEksIAMRole is the SA annotation used on EKS for IAM authentication.

Variables

View Source
var DefaultConditionSet = NewConditionSet()

DefaultConditionSet is a generic set of status conditions used by default in all components.

View Source
var EventSenderConditionSet = NewConditionSet(
	ConditionSinkProvided,
)

EventSenderConditionSet is a set of conditions for instances that send events to a sink.

Functions

func IsMultiTenant

func IsMultiTenant(r Reconcilable) bool

IsMultiTenant returns whether the given component type is multi-tenant.

func NewConditionSet

func NewConditionSet(cts ...apis.ConditionType) apis.ConditionSet

NewConditionSet returns a set of status conditions for a component type. Default conditions can be augmented by passing condition types as function arguments.

func ServiceAccountOptions

func ServiceAccountOptions(r Reconcilable) []resource.ServiceAccountOption

ServiceAccountOptions returns functional options for mutating the ServiceAccount associated with a given component instance.

func WantsOwnServiceAccount

func WantsOwnServiceAccount(r Reconcilable) bool

WantsOwnServiceAccount returns whether the given component instance should have a dedicated ServiceAccount associated with its receive adapter.

func WithReconcilable

func WithReconcilable(ctx context.Context, r Reconcilable) context.Context

WithReconcilable returns a copy of the parent context in which the value associated with the reconcilableInstanceKey is the given component instance.

Types

type AWSAuth added in v1.23.0

type AWSAuth struct {
	// Security credentials allow AWS to authenticate and authorize
	// requests based on a signature composed of an access key ID and a
	// corresponding secret access key.
	// See https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html
	// +optional
	Credentials *AWSSecurityCredentials `json:"credentials,omitempty"`

	// Deprecation warning: please use IAM object instead.
	// +optional
	EksIAMRole *apis.ARN `json:"iamRole,omitempty"`

	// The IAM role authentication parameters. For Amazon EKS only.
	// +optional
	IAM *EksIAM `json:"iam,omitempty"`
}

AWSAuth contains multiple authentication methods for AWS services.

+k8s:deepcopy-gen=true

func (*AWSAuth) DeepCopy added in v1.23.0

func (in *AWSAuth) DeepCopy() *AWSAuth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSAuth.

func (*AWSAuth) DeepCopyInto added in v1.23.0

func (in *AWSAuth) DeepCopyInto(out *AWSAuth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*AWSAuth) ServiceAccountOptions added in v1.26.0

func (a *AWSAuth) ServiceAccountOptions() []resource.ServiceAccountOption

ServiceAccountOptions returns the set of SA mutations based on the object spec.

func (*AWSAuth) Validate added in v1.26.0

func (a *AWSAuth) Validate(ctx context.Context) *pkgapis.FieldError

Validate method is used to validate AWS objects' Auth spec.

func (*AWSAuth) WantsOwnServiceAccount added in v1.26.0

func (a *AWSAuth) WantsOwnServiceAccount() bool

WantsOwnServiceAccount indicates wether the object requires its own SA.

type AWSEndpoint added in v1.23.0

type AWSEndpoint struct {
	// URL of the endpoint.
	URL *pkgapis.URL `json:"url,omitempty"`
}

AWSEndpoint contains parameters which are used to override the destination of REST API calls to AWS services. It allows, for example, to target API-compatible alternatives to the public AWS cloud (Localstack, Minio, ElasticMQ, ...).

+k8s:deepcopy-gen=true

func (*AWSEndpoint) DeepCopy added in v1.23.0

func (in *AWSEndpoint) DeepCopy() *AWSEndpoint

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSEndpoint.

func (*AWSEndpoint) DeepCopyInto added in v1.23.0

func (in *AWSEndpoint) DeepCopyInto(out *AWSEndpoint)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AWSSecurityCredentials added in v1.23.0

type AWSSecurityCredentials struct {
	AccessKeyID     ValueFromField `json:"accessKeyID"`
	SecretAccessKey ValueFromField `json:"secretAccessKey"`

	// The AWS session token for temporary credentials.
	// See https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken
	// +optional
	SessionToken ValueFromField `json:"sessionToken,omitempty"`

	// The ARN of an IAM role for cross-account or remote impersonation on EKS.
	// Require the access key credentials to create a client session.
	// +optional
	AssumeIAMRole *apis.ARN `json:"assumeIamRole,omitempty"`
}

AWSSecurityCredentials represents a set of AWS security credentials.

+k8s:deepcopy-gen=true

func (*AWSSecurityCredentials) DeepCopy added in v1.23.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSSecurityCredentials.

func (*AWSSecurityCredentials) DeepCopyInto added in v1.23.0

func (in *AWSSecurityCredentials) DeepCopyInto(out *AWSSecurityCredentials)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AdapterConfigurable

type AdapterConfigurable interface {
	// GetAdapterOverrides returns the adapter overrides.
	GetAdapterOverrides() *AdapterOverrides
}

AdapterConfigurable is implemented by types that can override the default configuration of their receive adapter.

type AdapterOverrides

type AdapterOverrides struct {
	// Public value indicates if the adapter backed by a Kn Service should have
	// its network visibility scope set to public. Default scope is cluster-local.
	Public *bool `json:"public,omitempty"`
	// Resources limits and requirements applied on adapter container.
	Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
	// Pod tolerations.
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
	// NodeSelector to control which nodes the pod can be scheduled on.
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// Pod affinity.
	Affinity *corev1.Affinity `json:"affinity,omitempty"`
	// Environment variables applied on adapter container.
	Env []corev1.EnvVar `json:"env,omitempty"`
	// Labels applied on adapter container.
	Labels map[string]string `json:"labels,omitempty"`
	// Annotations applied on adapter container.
	Annotations map[string]string `json:"annotations,omitempty"`
}

AdapterOverrides are applied on top of the default adapter parameters.

+k8s:deepcopy-gen=true

func (*AdapterOverrides) DeepCopy

func (in *AdapterOverrides) DeepCopy() *AdapterOverrides

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdapterOverrides.

func (*AdapterOverrides) DeepCopyInto

func (in *AdapterOverrides) DeepCopyInto(out *AdapterOverrides)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CloudEventStatus

type CloudEventStatus struct {
	// AcceptedEventTypes are the CloudEvent types that a component can process.
	// +optional
	AcceptedEventTypes []string `json:"acceptedEventTypes,omitempty"`
}

CloudEventStatus contains attributes that event receivers can embed to declare the event types they accept.

+k8s:deepcopy-gen=true

func (*CloudEventStatus) DeepCopy

func (in *CloudEventStatus) DeepCopy() *CloudEventStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudEventStatus.

func (*CloudEventStatus) DeepCopyInto

func (in *CloudEventStatus) DeepCopyInto(out *CloudEventStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EksIAM added in v1.26.0

type EksIAM struct {
	// The ARN of an IAM role which can be impersonated
	// to obtain AWS permissions.
	// See https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html
	// +optional
	Role *apis.ARN `json:"roleArn,omitempty"`

	// The name of the service account to be assigned on the receiver adapter.
	// +optional
	ServiceAccount string `json:"serviceAccount,omitempty"`
}

EksIAM contains parameters used for IAM authentication on EKS.

+k8s:deepcopy-gen=true

func (*EksIAM) DeepCopy added in v1.26.0

func (in *EksIAM) DeepCopy() *EksIAM

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EksIAM.

func (*EksIAM) DeepCopyInto added in v1.26.0

func (in *EksIAM) DeepCopyInto(out *EksIAM)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EventReceiver

type EventReceiver interface {
	// AcceptedEventTypes returns the event types accepted by the target.
	AcceptedEventTypes() []string
}

EventReceiver is implemented by types that receive and process events.

type EventSender

type EventSender interface {
	// GetSink returns the component's event sink.
	GetSink() *duckv1.Destination
}

EventSender is implemented by types that send events to a sink.

type EventSource

type EventSource interface {
	// GetEventTypes returns the event types generated by the component.
	GetEventTypes() []string
	// AsEventSource returns a unique reference to the component suitable
	// for use as a CloudEvent 'source' attribute.
	AsEventSource() string
}

EventSource is implemented by types that emit events, either by sending them to a sink or by replying to incoming event requests.

type GoogleCloudAuth added in v1.27.0

type GoogleCloudAuth struct {
	// Service account key in JSON format.
	// https://cloud.google.com/iam/docs/creating-managing-service-account-keys
	ServiceAccountKey *ValueFromField `json:"serviceAccountKey,omitempty"`

	// GCP Service account for Workload Identity.
	// https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
	GCPServiceAccount *string `json:"gcpServiceAccount,omitempty"`

	// Name of the kubernetes service account bound to the gcpServiceAccount to act as an IAM service account.
	KubernetesServiceAccount *string `json:"kubernetesServiceAccount,omitempty"`
}

GoogleCloudAuth contains authentication related attributes.

+k8s:deepcopy-gen=true

func (*GoogleCloudAuth) DeepCopy added in v1.27.0

func (in *GoogleCloudAuth) DeepCopy() *GoogleCloudAuth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GoogleCloudAuth.

func (*GoogleCloudAuth) DeepCopyInto added in v1.27.0

func (in *GoogleCloudAuth) DeepCopyInto(out *GoogleCloudAuth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GoogleCloudAuth) ServiceAccountOptions added in v1.27.0

func (a *GoogleCloudAuth) ServiceAccountOptions() []resource.ServiceAccountOption

ServiceAccountOptions is the set of mutations applied on the service account.

func (*GoogleCloudAuth) WantsOwnServiceAccount added in v1.27.0

func (a *GoogleCloudAuth) WantsOwnServiceAccount() bool

WantsOwnServiceAccount indicates wether the object requires its own SA.

type GroupObject added in v1.25.0

type GroupObject struct {
	Single, List runtime.Object
}

GroupObject holds the API group object types.

+k8s:deepcopy-gen=false

type MultiTenant

type MultiTenant interface {
	IsMultiTenant() bool
}

MultiTenant is implemented by all multi-tenant component types.

type Reconcilable

type Reconcilable interface {
	metav1.Object
	runtime.Object
	// OwnerRefable is used to construct a generic reconciler for each
	// component type, and convert custom objects to owner references.
	kmeta.OwnerRefable
	// KRShaped is used by generated reconcilers to perform pre and
	// post-reconcile status updates.
	duckv1.KRShaped

	// GetStatusManager returns a manager for the component's status.
	GetStatusManager() *StatusManager
}

Reconcilable is implemented by all TriggerMesh components.

func ReconcilableFromContext

func ReconcilableFromContext(ctx context.Context) Reconcilable

ReconcilableFromContext returns the component instance stored in the context.

type ServiceAccountProvider

type ServiceAccountProvider interface {
	WantsOwnServiceAccount() bool
	ServiceAccountOptions() []resource.ServiceAccountOption
}

ServiceAccountProvider is implemented by types which are able to influence the shape of the ServiceAccount used by their own receive adapter.

type Status

type Status struct {
	duckv1.SourceStatus  `json:",inline"`
	duckv1.AddressStatus `json:",inline"`

	// Accepted CloudEvent attributes
	CloudEventStatus `json:",inline"`
}

Status defines the observed state of a component instance.

+k8s:deepcopy-gen=true

func (*Status) DeepCopy

func (in *Status) DeepCopy() *Status

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status.

func (*Status) DeepCopyInto

func (in *Status) DeepCopyInto(out *Status)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StatusManager

type StatusManager struct {
	apis.ConditionSet
	*Status
}

StatusManager manages the status of a TriggerMesh component.

func (*StatusManager) MarkNoSink

func (m *StatusManager) MarkNoSink()

MarkNoSink sets the SinkProvided condition to False.

func (*StatusManager) MarkRBACNotBound

func (m *StatusManager) MarkRBACNotBound()

MarkRBACNotBound sets the Deployed condition to False, indicating that the adapter's ServiceAccount couldn't be bound.

func (*StatusManager) MarkSink

func (m *StatusManager) MarkSink(uri *apis.URL)

MarkSink sets the SinkProvided condition to True using the given URI.

func (*StatusManager) PropagateDeploymentAvailability

func (m *StatusManager) PropagateDeploymentAvailability(ctx context.Context,
	d *appsv1.Deployment, pl corelistersv1.PodNamespaceLister)

PropagateDeploymentAvailability uses the readiness of the provided Deployment to determine whether the Deployed condition should be marked as True or False. Given an optional PodLister interface, the status of dependant Pods is inspected to generate a more meaningful failure reason in case of non-ready status of the Deployment.

func (*StatusManager) PropagateServiceAvailability

func (m *StatusManager) PropagateServiceAvailability(ksvc *servingv1.Service)

PropagateServiceAvailability uses the readiness of the provided Service to determine whether the Deployed condition should be marked as True or False.

func (*StatusManager) SetRoute

func (m *StatusManager) SetRoute(urlPath string)

SetRoute appends the given URL path to the current target's URL.

type ValueFromField

type ValueFromField struct {

	// Field value.
	// +optional
	Value string `json:"value,omitempty"`
	// Field value from a Kubernetes Secret.
	// +optional
	ValueFromSecret *corev1.SecretKeySelector `json:"valueFromSecret,omitempty"`
}

ValueFromField is a struct field that can have its value either defined explicitly or sourced from another entity.

+k8s:deepcopy-gen=true

func (*ValueFromField) DeepCopy

func (in *ValueFromField) DeepCopy() *ValueFromField

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValueFromField.

func (*ValueFromField) DeepCopyInto

func (in *ValueFromField) DeepCopyInto(out *ValueFromField)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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