1 package v1 2 3 import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 4 5 // +genclient 6 // +genclient:nonNamespaced 7 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 8 9 // DNS holds cluster-wide information about DNS. The canonical name is `cluster` 10 // 11 // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 12 // +openshift:compatibility-gen:level=1 13 type DNS struct { 14 metav1.TypeMeta `json:",inline"` 15 16 // metadata is the standard object's metadata. 17 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 18 metav1.ObjectMeta `json:"metadata,omitempty"` 19 20 // spec holds user settable values for configuration 21 // +kubebuilder:validation:Required 22 // +required 23 Spec DNSSpec `json:"spec"` 24 // status holds observed values from the cluster. They may not be overridden. 25 // +optional 26 Status DNSStatus `json:"status"` 27 } 28 29 type DNSSpec struct { 30 // baseDomain is the base domain of the cluster. All managed DNS records will 31 // be sub-domains of this base. 32 // 33 // For example, given the base domain `openshift.example.com`, an API server 34 // DNS record may be created for `cluster-api.openshift.example.com`. 35 // 36 // Once set, this field cannot be changed. 37 BaseDomain string `json:"baseDomain"` 38 // publicZone is the location where all the DNS records that are publicly accessible to 39 // the internet exist. 40 // 41 // If this field is nil, no public records should be created. 42 // 43 // Once set, this field cannot be changed. 44 // 45 // +optional 46 PublicZone *DNSZone `json:"publicZone,omitempty"` 47 // privateZone is the location where all the DNS records that are only available internally 48 // to the cluster exist. 49 // 50 // If this field is nil, no private records should be created. 51 // 52 // Once set, this field cannot be changed. 53 // 54 // +optional 55 PrivateZone *DNSZone `json:"privateZone,omitempty"` 56 } 57 58 // DNSZone is used to define a DNS hosted zone. 59 // A zone can be identified by an ID or tags. 60 type DNSZone struct { 61 // id is the identifier that can be used to find the DNS hosted zone. 62 // 63 // on AWS zone can be fetched using `ID` as id in [1] 64 // on Azure zone can be fetched using `ID` as a pre-determined name in [2], 65 // on GCP zone can be fetched using `ID` as a pre-determined name in [3]. 66 // 67 // [1]: https://docs.aws.amazon.com/cli/latest/reference/route53/get-hosted-zone.html#options 68 // [2]: https://docs.microsoft.com/en-us/cli/azure/network/dns/zone?view=azure-cli-latest#az-network-dns-zone-show 69 // [3]: https://cloud.google.com/dns/docs/reference/v1/managedZones/get 70 // +optional 71 ID string `json:"id,omitempty"` 72 73 // tags can be used to query the DNS hosted zone. 74 // 75 // on AWS, resourcegroupstaggingapi [1] can be used to fetch a zone using `Tags` as tag-filters, 76 // 77 // [1]: https://docs.aws.amazon.com/cli/latest/reference/resourcegroupstaggingapi/get-resources.html#options 78 // +optional 79 Tags map[string]string `json:"tags,omitempty"` 80 } 81 82 type DNSStatus struct { 83 // dnsSuffix (service-ca amongst others) 84 } 85 86 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 87 88 // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 89 // +openshift:compatibility-gen:level=1 90 type DNSList struct { 91 metav1.TypeMeta `json:",inline"` 92 93 // metadata is the standard list's metadata. 94 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 95 metav1.ListMeta `json:"metadata"` 96 97 Items []DNS `json:"items"` 98 } 99