v1alpha1

package
v0.0.4-0...-cb4b663 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package Package v1alpha1 is the v1alpha1 version of the Core ACK API. +groupName=services.k8s.aws

Index

Constants

View Source
const (
	// AnnotationPrefix is the prefix for all ACK annotations
	AnnotationPrefix = "services.k8s.aws/"
	// AnnotationAdopted is an annotation whose value is a boolean value,
	// If this annotation is set to true on a CR, that means the user is
	// indicating to the ACK service controller that it should expect a backend
	// AWS service API resource to already exist (and that ACK should "adopt"
	// the resource into its management). If this annotation is set to false on
	// a CR, that means the user expects the ACK service controller to create
	// the backend AWS service API resource.
	AnnotationAdopted = AnnotationPrefix + "adopted"
	// AnnotationOwnerAccountID is an annotation whose value is the identifier
	// for the AWS account to which the resource belongs.  If this annotation
	// is set on a CR, the Kubernetes user is indicating that the ACK service
	// controller should create/patch/delete the resource in the specified AWS
	// Account. In order for this cross-account resource management to succeed,
	// the AWS IAM Role that the ACK service controller runs as needs to have
	// the ability to call the AWS STS::AssumeRole API call and assume an IAM
	// Role in the target AWS Account.
	// TODO(jaypipes): Link to documentation on cross-account resource
	// management
	AnnotationOwnerAccountID = AnnotationPrefix + "owner-account-id"
	// AnnotationRegion is an annotation whose value is the identifier for the
	// the AWS region in which the resources should be created. If this annotation
	// is set on a CR metadata, that means the user is indicating to the ACK service
	// controller that the CR should be created on specific region. ACK service
	// controller will not override the resource region if this annotation is set.
	AnnotationRegion = AnnotationPrefix + "region"
	// AnnotationDefaultRegion is an annotation whose value is the identifier
	// for the default AWS region in which resources should be created. If this
	// annotation is set on a namespace, the Kubernetes user is indicating that
	// the ACK service controller should set the regions in which the resource
	// should be created, if a region annotation is not set on the CR metadata.
	// If this annotation - and AnnotationRegion - are not set, ACK service
	// controllers look for controller binary flags and environment variables
	// injected by POD IRSA, to decide in which region the resources should be
	// created.
	AnnotationDefaultRegion = AnnotationPrefix + "default-region"
)

Variables

View Source
var (
	// GroupVersion is the API Group Version used to register the objects
	GroupVersion = schema.GroupVersion{Group: "services.k8s.aws", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type AWSAccountID

type AWSAccountID string

AWSAccountID represents an AWS account identifier

type AWSIdentifiers

type AWSIdentifiers struct {
	// ARN is the AWS Resource Name for the resource. It is a globally
	// unique identifier.
	ARN *AWSResourceName `json:"arn,omitempty"`
	// NameOrId is a user-supplied string identifier for the resource. It may
	// or may not be globally unique, depending on the type of resource.
	NameOrID *string `json:"nameOrID,omitempty"`
}

AWSIdentifiers provide all unique ways to reference an AWS resource.

func (*AWSIdentifiers) DeepCopy

func (in *AWSIdentifiers) DeepCopy() *AWSIdentifiers

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

func (*AWSIdentifiers) DeepCopyInto

func (in *AWSIdentifiers) DeepCopyInto(out *AWSIdentifiers)

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

type AWSRegion

type AWSRegion string

AWSRegion represents an AWS regional identifier

type AWSResourceName

type AWSResourceName string

AWSResourceName represents an AWS Resource Name (ARN)

type AdoptedResource

type AdoptedResource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              AdoptedResourceSpec   `json:"spec,omitempty"`
	Status            AdoptedResourceStatus `json:"status,omitempty"`
}

AdoptedResource is the schema for the AdoptedResource API. +kubebuilder:object:root=true +kubebuilder:subresource:status

func (*AdoptedResource) DeepCopy

func (in *AdoptedResource) DeepCopy() *AdoptedResource

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

func (*AdoptedResource) DeepCopyInto

func (in *AdoptedResource) DeepCopyInto(out *AdoptedResource)

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

func (*AdoptedResource) DeepCopyObject

func (in *AdoptedResource) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type AdoptedResourceList

type AdoptedResourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []AdoptedResource `json:"items"`
}

AdoptedResourceList defines a list of AdoptedResources. +kubebuilder:object:root=true +kubebuilder:printcolumn:name="AdoptionStatus",type=string,JSONPath=`.status.adoptionStatus`

func (*AdoptedResourceList) DeepCopy

func (in *AdoptedResourceList) DeepCopy() *AdoptedResourceList

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

func (*AdoptedResourceList) DeepCopyInto

func (in *AdoptedResourceList) DeepCopyInto(out *AdoptedResourceList)

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

func (*AdoptedResourceList) DeepCopyObject

func (in *AdoptedResourceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type AdoptedResourceSpec

type AdoptedResourceSpec struct {
	// +kubebuilder:validation:Required
	Kubernetes *TargetKubernetesResource `json:"kubernetes"`
	// +kubebuilder:validation:Required
	AWS *AWSIdentifiers `json:"aws"`
}

AdoptedResourceSpec defines the desired state of the AdoptedResource.

func (*AdoptedResourceSpec) DeepCopy

func (in *AdoptedResourceSpec) DeepCopy() *AdoptedResourceSpec

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

func (*AdoptedResourceSpec) DeepCopyInto

func (in *AdoptedResourceSpec) DeepCopyInto(out *AdoptedResourceSpec)

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

type AdoptedResourceStatus

type AdoptedResourceStatus struct {
	// A collection of `ackv1alpha1.Condition` objects that describe the various
	// terminal states of the adopted resource CR and its target custom resource
	Conditions []*Condition `json:"conditions"`
}

AdoptedResourceStatus defines the observed status of the AdoptedResource.

func (*AdoptedResourceStatus) DeepCopy

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

func (*AdoptedResourceStatus) DeepCopyInto

func (in *AdoptedResourceStatus) DeepCopyInto(out *AdoptedResourceStatus)

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

type Condition

type Condition struct {
	// Type is the type of the Condition
	Type ConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status corev1.ConditionStatus `json:"status"`
	// Last time the condition transitioned from one status to another.
	// +optional
	LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
	// The reason for the condition's last transition.
	// +optional
	Reason *string `json:"reason,omitempty"`
	// A human readable message indicating details about the transition.
	// +optional
	Message *string `json:"message,omitempty"`
}

Condition is the common struct used by all CRDs managed by ACK service controllers to indicate terminal states of the CR and its backend AWS service API resource

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

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

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

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

type ConditionType

type ConditionType string

ConditionType is a category of ResourceCondition that all CRs managed by an ACK service controller expose in their `Status.Conditions` collection

const (
	// ConditionTypeAdopted indicates that the adopted resource custom resource
	// has been successfully reconciled and the target has been created
	ConditionTypeAdopted ConditionType = "ACK.Adopted"
	// ConditionTypeResourceSynced indicates the state of the resource in the
	// backend service is in sync with the ACK service controller
	ConditionTypeResourceSynced ConditionType = "ACK.ResourceSynced"
	// ConditionTypeTerminal indicates that the custom resource Spec need to be
	// updated before any further sync.
	// Examples include:
	//		- As a result of InvalidArgument in input yaml
	//		- Resource server state is "create-failed"
	ConditionTypeTerminal ConditionType = "ACK.Terminal"
	// ConditionTypeRecoverable indicates that the error may be resolved
	// without needing to update the custom resource spec and sync will continue.
	// Examples include:
	//		- ServiceUnavailable errors that are transient
	//		- AccessDeniedException that needs correct credentials
	ConditionTypeRecoverable ConditionType = "ACK.Recoverable"
)

type PartialObjectMeta

type PartialObjectMeta struct {
	// Name must be unique within a namespace. Is required when creating resources, although
	// some resources may allow a client to request the generation of an appropriate name
	// automatically. Name is primarily intended for creation idempotence and configuration
	// definition.
	// Cannot be updated.
	// More info: http://kubernetes.io/docs/user-guide/identifiers#names
	// +optional
	Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`

	// GenerateName is an optional prefix, used by the server, to generate a unique
	// name ONLY IF the Name field has not been provided.
	// If this field is used, the name returned to the client will be different
	// than the name passed. This value will also be combined with a unique suffix.
	// The provided value has the same validation rules as the Name field,
	// and may be truncated by the length of the suffix required to make the value
	// unique on the server.
	//
	// If this field is specified and the generated name exists, the server will
	// NOT return a 409 - instead, it will either return 201 Created or 500 with Reason
	// ServerTimeout indicating a unique name could not be found in the time allotted, and the client
	// should retry (optionally after the time indicated in the Retry-After header).
	//
	// Applied only if Name is not specified.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency
	// +optional
	GenerateName string `json:"generateName,omitempty" protobuf:"bytes,2,opt,name=generateName"`

	// Namespace defines the space within each name must be unique. An empty namespace is
	// equivalent to the "default" namespace, but "default" is the canonical representation.
	// Not all objects are required to be scoped to a namespace - the value of this field for
	// those objects will be empty.
	//
	// Must be a DNS_LABEL.
	// Cannot be updated.
	// More info: http://kubernetes.io/docs/user-guide/namespaces
	// +optional
	Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"`

	// Map of string keys and values that can be used to organize and categorize
	// (scope and select) objects. May match selectors of replication controllers
	// and services.
	// More info: http://kubernetes.io/docs/user-guide/labels
	// +optional
	Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,4,rep,name=labels"`

	// Annotations is an unstructured key value map stored with a resource that may be
	// set by external tools to store and retrieve arbitrary metadata. They are not
	// queryable and should be preserved when modifying objects.
	// More info: http://kubernetes.io/docs/user-guide/annotations
	// +optional
	Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,5,rep,name=annotations"`

	// List of objects depended by this object. If ALL objects in the list have
	// been deleted, this object will be garbage collected. If this object is managed by a controller,
	// then an entry in this list will point to this controller, with the controller field set to true.
	// There cannot be more than one managing controller.
	// +optional
	// +patchMergeKey=uid
	// +patchStrategy=merge
	OwnerReferences []metav1.OwnerReference `json:"ownerReferences,omitempty" patchStrategy:"merge" patchMergeKey:"uid" protobuf:"bytes,6,rep,name=ownerReferences"`
}

ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. It is not possible to use `metav1.ObjectMeta` inside spec, as the controller-gen automatically converts this to an arbitrary string-string map. https://github.com/kubernetes-sigs/controller-tools/issues/385

Active discussion about inclusion of this field in the spec is happening in this PR: https://github.com/kubernetes-sigs/controller-tools/pull/395

Until this is allowed, or if it never is, we will produce a subset of the object meta that contains only the fields which the user is allowed to modify in the metadata.

func (*PartialObjectMeta) DeepCopy

func (in *PartialObjectMeta) DeepCopy() *PartialObjectMeta

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

func (*PartialObjectMeta) DeepCopyInto

func (in *PartialObjectMeta) DeepCopyInto(out *PartialObjectMeta)

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

type ResourceMetadata

type ResourceMetadata struct {
	// ARN is the Amazon Resource Name for the resource. This is a
	// globally-unique identifier and is set only by the ACK service controller
	// once the controller has orchestrated the creation of the resource OR
	// when it has verified that an "adopted" resource (a resource where the
	// ARN annotation was set by the Kubernetes user on the CR) exists and
	// matches the supplied CR's Spec field values.
	//TODO(vijat@): Find a better strategy for resources that do not have ARN in CreateOutputResponse
	// https://github.com/aws/aws-controllers-k8s/issues/270
	ARN *AWSResourceName `json:"arn,omitempty"`
	// OwnerAccountID is the AWS Account ID of the account that owns the
	// backend AWS service API resource.
	OwnerAccountID *AWSAccountID `json:"ownerAccountID"`
}

ResourceMetadata is common to all custom resources (CRs) managed by an ACK service controller. It is contained in the CR's `Status` member field and comprises various status and identifier fields useful to ACK for tracking state changes between Kubernetes and the backend AWS service API

func (*ResourceMetadata) DeepCopy

func (in *ResourceMetadata) DeepCopy() *ResourceMetadata

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

func (*ResourceMetadata) DeepCopyInto

func (in *ResourceMetadata) DeepCopyInto(out *ResourceMetadata)

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

type SecretKeyReference

type SecretKeyReference struct {
	// Empty JSON tag is required to solve encountered struct field "" without JSON tag  error.
	k8scorev1.SecretReference `json:""`
	// Key is the key within the secret
	Key string `json:"key"`
}

SecretKeyReference combines a k8s corev1.SecretReference with a specific key within the referred-to Secret

type TargetKubernetesResource

type TargetKubernetesResource struct {
	// +kubebuilder:validation:Required
	Group *string `json:"group"`
	// +kubebuilder:validation:Required
	Kind     *string            `json:"kind"`
	Metadata *PartialObjectMeta `json:"metadata,omitempty"`
}

TargetKubernetesResource provides all the values necessary to identify a given ACK type and override any metadata values when creating a resource of that type.

func (*TargetKubernetesResource) DeepCopy

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

func (*TargetKubernetesResource) DeepCopyInto

func (in *TargetKubernetesResource) DeepCopyInto(out *TargetKubernetesResource)

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