Documentation ¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the se.quencer.io v1alpha1 API group +kubebuilder:object:generate=true +groupName=se.quencer.io
Index ¶
Constants ¶
const ( // The main condition to talk to the provider. Each provider have finer // states that will be reflected as status for this condition. ProviderCondition konditions.ConditionType = "Provider" IntegrationCondition konditions.ConditionType = "Integration" )
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "se.quencer.io", 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 DNSIntegration ¶ added in v0.3.4
type DNSIntegration struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec DNSIntegrationSpec `json:"spec,omitempty"` Status DNSIntegrationStatus `json:"status,omitempty"` }
+kubebuilder:object:root=true +kubebuilder:resource:path=dnsintegrations,scope=Cluster +kubebuilder:subresource:status DNSProvider is the Schema for the dnsproviders API
func (*DNSIntegration) Conditions ¶ added in v0.3.4
func (d *DNSIntegration) Conditions() *konditions.Conditions
func (*DNSIntegration) DeepCopy ¶ added in v0.3.4
func (in *DNSIntegration) DeepCopy() *DNSIntegration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSIntegration.
func (*DNSIntegration) DeepCopyInto ¶ added in v0.3.4
func (in *DNSIntegration) DeepCopyInto(out *DNSIntegration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*DNSIntegration) DeepCopyObject ¶ added in v0.3.4
func (in *DNSIntegration) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type DNSIntegrationList ¶ added in v0.3.4
type DNSIntegrationList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []DNSIntegration `json:"items"` }
DNSProviderList contains a list of DNSProvider
func (*DNSIntegrationList) DeepCopy ¶ added in v0.3.4
func (in *DNSIntegrationList) DeepCopy() *DNSIntegrationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSIntegrationList.
func (*DNSIntegrationList) DeepCopyInto ¶ added in v0.3.4
func (in *DNSIntegrationList) DeepCopyInto(out *DNSIntegrationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*DNSIntegrationList) DeepCopyObject ¶ added in v0.3.4
func (in *DNSIntegrationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type DNSIntegrationSpec ¶ added in v0.3.4
type DNSIntegrationSpec struct { // Provider that backs this DNSIntegration, ie. cloudflare, aws, azure, etc. // This field is used to figure out what Client to initialize and configure. Provider DNSProviderSpec `json:"provider"` // Zones for which this integration has authority over. However, it doesn't mean // that this provider has exclusivity over the zones. One example would be for // Split-Horizon DNS (1) where the same Zone can be managed by different providers. // // A Provider can own multiple zones. When a DNSRecord is created, it will look for // a provider if the optional value is set. After, it will look at the DNSRecord's zone // and attempt to match it against one of the zone listed here. If there's a match, // the record will be processed by the Provider. // // 1. https://en.wikipedia.org/wiki/Split-horizon_DNS Zones []string `json:"zones"` // Env are passed directly to the Provider as Environment Variables for the deployment. This can // be useful for configurations. It uses native env structure as defined in K8s' docs(1). // // It can be useful to source environment variables from config or to set them directly too. // If you want to source environment variable from secrets, you may use `secretRef` instead as // it is simpler to use, but that's up to you. // // 1. https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/ Env []core.EnvVar `json:"env,omitempty"` // A reference to a Kubernetes Secret that will be passed to the Provider. Each keys // defined will be exported as an environment variable to the provider's deployment. // The SecretRef has precedence over the `Env` field so any keys specified here will override // values that would otherwise be defined in the `Env` field. SecretRef *references.SecretRef `json:"secretRef,omitempty"` }
A DNSIntegrationSpec represents the bridge between Phonebook's DNSRecord and the cloud provider's client that will be in charge of those Records. When a DNSIntegration is created, it will create a new deployment using a Provider's image. The Deployment will then be in charge of any DNSRecord that matches its Provider and Zone, as specified in the DNSRecord.
func (*DNSIntegrationSpec) DeepCopy ¶ added in v0.3.4
func (in *DNSIntegrationSpec) DeepCopy() *DNSIntegrationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSIntegrationSpec.
func (*DNSIntegrationSpec) DeepCopyInto ¶ added in v0.3.4
func (in *DNSIntegrationSpec) DeepCopyInto(out *DNSIntegrationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DNSIntegrationStatus ¶ added in v0.3.4
type DNSIntegrationStatus struct { // Set of conditions that the DNSRecord will go through during its // lifecycle. Conditions konditions.Conditions `json:"conditions,omitempty"` // Reference to the deployment that was created for this // Integration. Deployment *references.Reference `json:"deployment,omitempty"` }
DNSProviderStatus defines the observed state of DNSProvider
func (*DNSIntegrationStatus) DeepCopy ¶ added in v0.3.4
func (in *DNSIntegrationStatus) DeepCopy() *DNSIntegrationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSIntegrationStatus.
func (*DNSIntegrationStatus) DeepCopyInto ¶ added in v0.3.4
func (in *DNSIntegrationStatus) DeepCopyInto(out *DNSIntegrationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DNSProviderSpec ¶ added in v0.3.4
type DNSProviderSpec struct { // Name of the provider as specified in the documentation, ie. cloudflare, aws, azure, etc. // The name has to be a direct match Name string `json:"name"` // Image name if you want to use a different image name than the default one used // by Phonebook. If this value isn't set, Phonebook will generate an image name // based off the Provider's name and Phonebook's default repository. // It will also always use the `latest` tag Image *string `json:"image,omitempty"` // Command can be spceifici Command []string `json:"cmd,omitempty"` Args []string `json:"args,omitempty"` }
func (*DNSProviderSpec) DeepCopy ¶ added in v0.3.4
func (in *DNSProviderSpec) DeepCopy() *DNSProviderSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSProviderSpec.
func (*DNSProviderSpec) DeepCopyInto ¶ added in v0.3.4
func (in *DNSProviderSpec) DeepCopyInto(out *DNSProviderSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DNSRecord ¶
type DNSRecord struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec DNSRecordSpec `json:"spec,omitempty"` Status DNSRecordStatus `json:"status,omitempty"` }
DNSRecord is the Schema for the dnsrecords API
func (*DNSRecord) Conditions ¶
func (d *DNSRecord) Conditions() *konditions.Conditions
This helper method is added to DNSRecord to make it match the konditions.ConditionalObject interface to use the Lock mechanism with konditionner.
func (*DNSRecord) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSRecord.
func (*DNSRecord) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*DNSRecord) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type DNSRecordList ¶
type DNSRecordList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []DNSRecord `json:"items"` }
DNSRecordList contains a list of DNSRecord
func (*DNSRecordList) DeepCopy ¶
func (in *DNSRecordList) DeepCopy() *DNSRecordList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSRecordList.
func (*DNSRecordList) DeepCopyInto ¶
func (in *DNSRecordList) DeepCopyInto(out *DNSRecordList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*DNSRecordList) DeepCopyObject ¶
func (in *DNSRecordList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type DNSRecordSpec ¶
type DNSRecordSpec struct { // Zone is the the DNS Zone that you want to create a record for. // If you want to create a CNAME called foo.mydomain.com, // "mydomain.com" would be your zone. // // The Zone needs to find a match in one of the DNSProvider configured in your // cluster. Unless the optional `Provider` field is set, Phonebook will look // at all the providers configured to try to find a match for the zone. // // If no provider matches the zone, the record won't be created. Zone string `json:"zone"` // RecordType represent the type for the Record you want to create. // Can be A, AAAA, CNAME, TXT, etc. RecordType string `json:"recordType"` // Name of the record represents the subdomain in the CNAME example used for zone. // In that example, the `Name` would be `foo` Name string `json:"name"` // Targets represents where the record should point to. Depending on the record type, // it can be an IP address or some text value. // The reason why targets is plural is because some provider support multiple values for // a given record types. For most cases, it's expected to only have 1 value. Targets []string `json:"targets"` // Provider specific configuration settings that can be used // to configure a DNS Record in accordance to the provider used. // Each provider provides its own set of custom fields. Properties map[string]string `json:"properties,omitempty"` // TTL is the Time To Live for the record. It represents the time // in seconds that the record is cached by resolvers. // If not set, the provider will use its default value (60 seconds). TTL *int64 `json:"ttl,omitempty"` // Optional field to be more specific about which Provider you want to use for // this record. This field is useful if you have more than one Provider serving // the same Zone (ie. Split-Horizon DNS). // // In most cases, this field isn't necessary as the Zone field should be enough // to let Phonebook find the proper Provider. This field only gives a hint to Phonebook // and the Zones has to match as well. Integration *string `json:"integration,omitempty"` }
DNSRecordSpec defines the desired state of DNSRecord and represents a single DNS Record. It is expected that each DNS Record won't conflict with each other and it's the user's job to make sure that each record have a unique spec.
func (*DNSRecordSpec) DeepCopy ¶
func (in *DNSRecordSpec) DeepCopy() *DNSRecordSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSRecordSpec.
func (*DNSRecordSpec) DeepCopyInto ¶
func (in *DNSRecordSpec) DeepCopyInto(out *DNSRecordSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DNSRecordStatus ¶
type DNSRecordStatus struct { // Set of conditions that the DNSRecord will go through during its // lifecycle. Conditions konditions.Conditions `json:"conditions,omitempty"` // RemoteInfo is a field that can be used by DNSIntegration's provider to // store information as the Record is created. Each integration has its own map it can // populate with arbitrary data. Each entries in the root RemoteInfo refers to the name of // the integration that stored the intormation. For instance, if you have a DNSRecord that // is shared between 2 integrations named `cloudflare-dev` and `aws-prod`, RemoteInfo would // look like this: // map[string]map[string]string{ // "cloudflare-dev": map[string]string{ // // cloudflare related information about the record // }, // "aws-prod": map[string]string{ // // aws related information about the record // } // } // // A DNSIntegration can have multiple entries stored in this field and it's up the integration // to make sure those fields are not stale. RemoteInfo map[string]IntegrationInfo `json:"remoteInfo,omitempty"` }
DNSRecordStatus defines the observed state of DNSRecord
func (*DNSRecordStatus) DeepCopy ¶
func (in *DNSRecordStatus) DeepCopy() *DNSRecordStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSRecordStatus.
func (*DNSRecordStatus) DeepCopyInto ¶
func (in *DNSRecordStatus) DeepCopyInto(out *DNSRecordStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type IntegrationInfo ¶ added in v0.3.8
Optional field that a provider can use to keep track of remote data it might need in the future, eg. Remote ID for deleting the record. Values can only be string.
func (IntegrationInfo) DeepCopy ¶ added in v0.3.8
func (in IntegrationInfo) DeepCopy() IntegrationInfo
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationInfo.
func (IntegrationInfo) DeepCopyInto ¶ added in v0.3.8
func (in IntegrationInfo) DeepCopyInto(out *IntegrationInfo)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StagingUpdater ¶ added in v0.3.8
type StagingUpdater interface { // StageCondition lets an integration update the condition that is attached to the // DNSIntegration. // For instance, if the DNSIntegration was created with the name `my-test-123` and the provider // is AWS, calling // StageCondition(konditions.ConditionCreated, "Resource created") // // would mean that the condition with the condition type `my-test-123` will // have the status and reason set at the end of the reconciliation loop. StageCondition(status konditions.ConditionStatus, reason string) // StagingRemoteInfo lets the provider store provider-related information in // the DNSRecord's RemoteInfo field. This is an optional field. StageRemoteInfo(IntegrationInfo) }
StagingUpdater is an interface used by providers to safely update DNSRecord's status. Since DNSRecord can interact with multiple DNSIntegrations, the DNSRecord's status needs to be scoped for each DNSIntegration so they can all keep the DNSRecord status updated without conflicting with each other.
StagingUpdater is a proxy that will scope all changes to the specific condition/IntegrationInfo. It's rather simple, each DNSIntegration that has authority over the zone will have its own Condition in the DSNRecord's Conditions as well its own entry in the IntegrationInfo map. Both of those will have the name of the DNSIntegration as the unique key, which means that even if there's more than one integration for a given provider (aws, cloudflare, etc.), the uniqueness of the key is still valid.
As the name of the methods and interface suggest, these operations are only staging. As a result, they aren't persisted when those method returns. In fact, multiple calls overwrite the previously set values during the **same reconciliation loop**.
When Create/Destroy returns, the server's reconciliation loop will update the Condition and the IntegrationInfo.
It is important to note that in case of an error returning from Create/Destroy, the error will take precedence over the staged condition. The Status will be set to Error and the reason will be set to the error message. +kubebuilder:object:generate=false