-
Notifications
You must be signed in to change notification settings - Fork 138
DynamicZones (1/4): introduce API, CRD and type registration #2270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kuritka
wants to merge
1
commit into
master
Choose a base branch
from
dynamic-zone-delegation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -64,6 +64,7 @@ DEMO_URL ?= http://failover.cloud.example.com | |||||
| DEMO_DEBUG ?=0 | ||||||
| DEMO_DELAY ?=5 | ||||||
| GSLB_CRD_YAML ?= chart/k8gb/crd/k8gb.absa.oss_gslbs.yaml | ||||||
| DZ_CRD_YAML ?= chart/k8gb/crd/k8gb.io_zonedelegation.yaml | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit:
Suggested change
as we nicely consolidated on ZoneDeletation everywhere |
||||||
|
|
||||||
| # GCP Cloud DNS testing variables | ||||||
| GCP_PROJECT ?= | ||||||
|
|
@@ -651,7 +652,9 @@ endef | |||||
| define crd-manifest | ||||||
| $(call install-controller-gen) | ||||||
| @echo -e "\n$(YELLOW)Generating the CRD manifests$(NC)" | ||||||
| $(GOBIN)/controller-gen crd:crdVersions=v1 paths="./..." output:crd:stdout > $(GSLB_CRD_YAML) | ||||||
| $(GOBIN)/controller-gen crd:crdVersions=v1 paths="./api/v1beta1" output:crd:stdout > $(GSLB_CRD_YAML) | ||||||
| @echo -e "\n$(YELLOW)Generating the k8gb.io CRD manifests$(NC)" | ||||||
| $(GOBIN)/controller-gen crd:crdVersions=v1 paths="./api/k8gb.io/v1beta1" output:crd:stdout > $(DZ_CRD_YAML) | ||||||
| endef | ||||||
|
|
||||||
| define install-controller-gen | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| // Package v1beta1 contains API Schema definitions for the k8gb v1beta1 API group | ||
| // +kubebuilder:object:generate=true | ||
| // +groupName=k8gb.io | ||
| package v1beta1 | ||
|
|
||
| /* | ||
| Copyright 2021-2025 The k8gb Contributors. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
|
|
||
| Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic | ||
| */ | ||
|
|
||
| import ( | ||
| "k8s.io/apimachinery/pkg/runtime/schema" | ||
| "sigs.k8s.io/controller-runtime/pkg/scheme" | ||
| ) | ||
|
|
||
| var ( | ||
| // GroupVersion is group version used to register these objects | ||
| GroupVersion = schema.GroupVersion{Group: "k8gb.io", Version: "v1beta1"} | ||
|
|
||
| // 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 | ||
| ) | ||
|
|
||
| func init() { | ||
| // Register ZoneDelegation types with the runtime scheme so the controller client can use them | ||
| SchemeBuilder.Register(&ZoneDelegation{}, &ZoneDelegationList{}) | ||
| } |
kuritka marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| package v1beta1 | ||
|
|
||
| /* | ||
| Copyright 2021-2025 The k8gb Contributors. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
|
|
||
| Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic | ||
| */ | ||
|
|
||
| import ( | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| // ZoneDelegationSpec defines the desired state of ZoneDelegation | ||
|
|
||
| type ZoneDelegationSpec struct { | ||
| // LoadBalancedZone is the DNS zone managed by this ZoneDelegation | ||
| LoadBalancedZone string `json:"loadBalancedZone"` | ||
|
|
||
| // ParentZone is the zone under which this load-balanced zone is delegated | ||
| ParentZone string `json:"parentZone"` | ||
|
|
||
| // DNSZoneNegTTL specifies the negative TTL for the DNS zone (in seconds) | ||
| DNSZoneNegTTL int `json:"dnsZoneNegTTL"` | ||
| } | ||
|
|
||
| // ZoneDelegationStatus defines the observed state of ZoneDelegation | ||
| type ZoneDelegationStatus struct { | ||
| // DNSServers lists the authoritative DNS servers for the delegated zone | ||
| DNSServers []DNSServer `json:"dnsServers,omitempty"` | ||
| } | ||
|
|
||
| // DNSServer represents a single DNS server for a zone delegation | ||
| type DNSServer struct { | ||
| // Name of the DNS server (FQDN) | ||
| Name string `json:"name"` | ||
|
|
||
| // Address of the DNS server (IPv4 or IPv6) | ||
| Address string `json:"address"` | ||
| } | ||
|
|
||
| // ZoneDelegation is the Schema for the zonedelegations API | ||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:subresource:status | ||
| // +kubebuilder:resource:scope=Cluster,shortName=zd | ||
| // +kubebuilder:printcolumn:name="LoadBalancedZone",type=string,JSONPath=`.spec.loadBalancedZone` | ||
| // +kubebuilder:printcolumn:name="ParentZone",type=string,JSONPath=`.spec.parentZone` | ||
| // +kubebuilder:printcolumn:name="NegTTL",type=integer,JSONPath=`.spec.dnsZoneNegTTL` | ||
| type ZoneDelegation struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| Spec ZoneDelegationSpec `json:"spec,omitempty"` | ||
| Status ZoneDelegationStatus `json:"status,omitempty"` | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
|
|
||
| // ZoneDelegationList contains a list of ZoneDelegation | ||
| type ZoneDelegationList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty"` | ||
| Items []ZoneDelegation `json:"items"` | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.