Skip to content

Commit

Permalink
added support for DNSPolicy, DNSConfig, HostAliases
Browse files Browse the repository at this point in the history
  • Loading branch information
rda3mon committed Mar 25, 2023
1 parent 9891b77 commit 931b5e7
Show file tree
Hide file tree
Showing 7 changed files with 425 additions and 6 deletions.
4 changes: 2 additions & 2 deletions operator/api/v1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ limitations under the License.
*/

// Package v1 contains API Schema definitions for the kvstore v1 API group
//+kubebuilder:object:generate=true
//+groupName=kvstore.flipkart.com
// +kubebuilder:object:generate=true
// +groupName=kvstore.flipkart.com
package v1

import (
Expand Down
9 changes: 8 additions & 1 deletion operator/api/v1/hbasecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ limitations under the License.
package v1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type HbaseClusterContainerPort struct {
Expand Down Expand Up @@ -158,6 +159,12 @@ type HbaseClusterDeployment struct {
Hostname string `json:"hostname,omitempty"`
// +optional
Subdomain string `json:"subdomain,omitempty"`
// +optional
DNSPolicy corev1.DNSPolicy `json:"dnsPolicy,omitempty"`
// +optional
DNSConfig *corev1.PodDNSConfig `json:"dnsConfig,omitempty"`
// +optional
HostAliases []corev1.HostAlias `json:"hostAliases,omitempty" patchStrategy:"merge" patchMergeKey:"ip"`
}

type HbaseClusterConfiguration struct {
Expand Down
13 changes: 13 additions & 0 deletions operator/api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

280 changes: 280 additions & 0 deletions operator/config/crd/bases/kvstore.flipkart.com_hbaseclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,62 @@ spec:
- securityContext
type: object
type: array
dnsConfig:
description: PodDNSConfig defines the DNS parameters of a
pod in addition to those generated from DNSPolicy.
properties:
nameservers:
description: A list of DNS name server IP addresses. This
will be appended to the base nameservers generated from
DNSPolicy. Duplicated nameservers will be removed.
items:
type: string
type: array
options:
description: A list of DNS resolver options. This will
be merged with the base options generated from DNSPolicy.
Duplicated entries will be removed. Resolution options
given in Options will override those that appear in
the base DNSPolicy.
items:
description: PodDNSConfigOption defines DNS resolver
options of a pod.
properties:
name:
description: Required.
type: string
value:
type: string
type: object
type: array
searches:
description: A list of DNS search domains for host-name
lookup. This will be appended to the base search paths
generated from DNSPolicy. Duplicated search paths will
be removed.
items:
type: string
type: array
type: object
dnsPolicy:
description: DNSPolicy defines how a pod's DNS will be configured.
type: string
hostAliases:
items:
description: HostAlias holds the mapping between IP and
hostnames that will be injected as an entry in the pod's
hosts file.
properties:
hostnames:
description: Hostnames for the above IP address.
items:
type: string
type: array
ip:
description: IP address of the host file entry.
type: string
type: object
type: array
hostname:
type: string
initContainers:
Expand Down Expand Up @@ -595,6 +651,62 @@ spec:
- securityContext
type: object
type: array
dnsConfig:
description: PodDNSConfig defines the DNS parameters of a
pod in addition to those generated from DNSPolicy.
properties:
nameservers:
description: A list of DNS name server IP addresses. This
will be appended to the base nameservers generated from
DNSPolicy. Duplicated nameservers will be removed.
items:
type: string
type: array
options:
description: A list of DNS resolver options. This will
be merged with the base options generated from DNSPolicy.
Duplicated entries will be removed. Resolution options
given in Options will override those that appear in
the base DNSPolicy.
items:
description: PodDNSConfigOption defines DNS resolver
options of a pod.
properties:
name:
description: Required.
type: string
value:
type: string
type: object
type: array
searches:
description: A list of DNS search domains for host-name
lookup. This will be appended to the base search paths
generated from DNSPolicy. Duplicated search paths will
be removed.
items:
type: string
type: array
type: object
dnsPolicy:
description: DNSPolicy defines how a pod's DNS will be configured.
type: string
hostAliases:
items:
description: HostAlias holds the mapping between IP and
hostnames that will be injected as an entry in the pod's
hosts file.
properties:
hostnames:
description: Hostnames for the above IP address.
items:
type: string
type: array
ip:
description: IP address of the host file entry.
type: string
type: object
type: array
hostname:
type: string
initContainers:
Expand Down Expand Up @@ -949,6 +1061,62 @@ spec:
- securityContext
type: object
type: array
dnsConfig:
description: PodDNSConfig defines the DNS parameters of a
pod in addition to those generated from DNSPolicy.
properties:
nameservers:
description: A list of DNS name server IP addresses. This
will be appended to the base nameservers generated from
DNSPolicy. Duplicated nameservers will be removed.
items:
type: string
type: array
options:
description: A list of DNS resolver options. This will
be merged with the base options generated from DNSPolicy.
Duplicated entries will be removed. Resolution options
given in Options will override those that appear in
the base DNSPolicy.
items:
description: PodDNSConfigOption defines DNS resolver
options of a pod.
properties:
name:
description: Required.
type: string
value:
type: string
type: object
type: array
searches:
description: A list of DNS search domains for host-name
lookup. This will be appended to the base search paths
generated from DNSPolicy. Duplicated search paths will
be removed.
items:
type: string
type: array
type: object
dnsPolicy:
description: DNSPolicy defines how a pod's DNS will be configured.
type: string
hostAliases:
items:
description: HostAlias holds the mapping between IP and
hostnames that will be injected as an entry in the pod's
hosts file.
properties:
hostnames:
description: Hostnames for the above IP address.
items:
type: string
type: array
ip:
description: IP address of the host file entry.
type: string
type: object
type: array
hostname:
type: string
initContainers:
Expand Down Expand Up @@ -1303,6 +1471,62 @@ spec:
- securityContext
type: object
type: array
dnsConfig:
description: PodDNSConfig defines the DNS parameters of a
pod in addition to those generated from DNSPolicy.
properties:
nameservers:
description: A list of DNS name server IP addresses. This
will be appended to the base nameservers generated from
DNSPolicy. Duplicated nameservers will be removed.
items:
type: string
type: array
options:
description: A list of DNS resolver options. This will
be merged with the base options generated from DNSPolicy.
Duplicated entries will be removed. Resolution options
given in Options will override those that appear in
the base DNSPolicy.
items:
description: PodDNSConfigOption defines DNS resolver
options of a pod.
properties:
name:
description: Required.
type: string
value:
type: string
type: object
type: array
searches:
description: A list of DNS search domains for host-name
lookup. This will be appended to the base search paths
generated from DNSPolicy. Duplicated search paths will
be removed.
items:
type: string
type: array
type: object
dnsPolicy:
description: DNSPolicy defines how a pod's DNS will be configured.
type: string
hostAliases:
items:
description: HostAlias holds the mapping between IP and
hostnames that will be injected as an entry in the pod's
hosts file.
properties:
hostnames:
description: Hostnames for the above IP address.
items:
type: string
type: array
ip:
description: IP address of the host file entry.
type: string
type: object
type: array
hostname:
type: string
initContainers:
Expand Down Expand Up @@ -1657,6 +1881,62 @@ spec:
- securityContext
type: object
type: array
dnsConfig:
description: PodDNSConfig defines the DNS parameters of a
pod in addition to those generated from DNSPolicy.
properties:
nameservers:
description: A list of DNS name server IP addresses. This
will be appended to the base nameservers generated from
DNSPolicy. Duplicated nameservers will be removed.
items:
type: string
type: array
options:
description: A list of DNS resolver options. This will
be merged with the base options generated from DNSPolicy.
Duplicated entries will be removed. Resolution options
given in Options will override those that appear in
the base DNSPolicy.
items:
description: PodDNSConfigOption defines DNS resolver
options of a pod.
properties:
name:
description: Required.
type: string
value:
type: string
type: object
type: array
searches:
description: A list of DNS search domains for host-name
lookup. This will be appended to the base search paths
generated from DNSPolicy. Duplicated search paths will
be removed.
items:
type: string
type: array
type: object
dnsPolicy:
description: DNSPolicy defines how a pod's DNS will be configured.
type: string
hostAliases:
items:
description: HostAlias holds the mapping between IP and
hostnames that will be injected as an entry in the pod's
hosts file.
properties:
hostnames:
description: Hostnames for the above IP address.
items:
type: string
type: array
ip:
description: IP address of the host file entry.
type: string
type: object
type: array
hostname:
type: string
initContainers:
Expand Down
Loading

0 comments on commit 931b5e7

Please sign in to comment.