Skip to content

Commit

Permalink
Re-instantuate the bind9 backend into the desigante-operator
Browse files Browse the repository at this point in the history
  • Loading branch information
dkehn committed Oct 24, 2023
1 parent 0c25640 commit 49f6c3f
Show file tree
Hide file tree
Showing 26 changed files with 1,197 additions and 634 deletions.
2 changes: 1 addition & 1 deletion api/bases/designate.openstack.org_designateapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: designateapis.designate.openstack.org
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: designatebackendbind9s.designate.openstack.org
spec:
Expand Down
2 changes: 1 addition & 1 deletion api/bases/designate.openstack.org_designatecentrals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: designatecentrals.designate.openstack.org
spec:
Expand Down
2 changes: 1 addition & 1 deletion api/bases/designate.openstack.org_designatemdnses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: designatemdnses.designate.openstack.org
spec:
Expand Down
2 changes: 1 addition & 1 deletion api/bases/designate.openstack.org_designateproducers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: designateproducers.designate.openstack.org
spec:
Expand Down
187 changes: 186 additions & 1 deletion api/bases/designate.openstack.org_designates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: designates.designate.openstack.org
spec:
Expand Down Expand Up @@ -465,6 +465,186 @@ spec:
required:
- containerImage
type: object
designateBackendbind9:
description: DesignateBackendbind9 - Spec definition for the Backendbind9
service of this Designate deployment
properties:
None:
description: BackendType - Defines the backend service/configuration
we are using, i.e. bind9, unhbound, PowerDNS, BYO, etc.. Helps
maintain a single init container/init.sh to do container setup
type: string
backendMdnsServerProtocol:
description: 'BackendTypeProtocol - Defines the backend protocol
to be used between the designate-worker & designate_mdns to/from
the DNS server. Acceptable values are: "UDP", "TCP" Please Note:
this MUST match what is in the /etc/designate.conf [''service:mdns'']'
type: string
backendWorkerServerProtocol:
description: 'BackendTypeProtocol - Defines the backend protocol
to be used between the designate-worker & designate_mdns to/from
the DNS server. Acceptable values are: "UDP", "TCP" Please Note:
this MUST match what is in the /etc/designate.conf [''service:worker'']'
type: string
containerImage:
description: ContainerImage - Designate Container Image URL (will
be set to environmental default if empty)
type: string
customServiceConfig:
description: CustomServiceConfig - customize the service config
using this parameter to change service defaults, or overwrite
rendered information using raw OpenStack config format. The
content gets added to to /etc/<service>/<service>.conf.d directory
as a custom config file.
type: string
customServiceConfigSecrets:
description: CustomServiceConfigSecrets - customize the service
config using this parameter to specify Secrets that contain
sensitive service config data. The content of each Secret gets
added to the /etc/<service>/<service>.conf.d directory as a
custom config file.
items:
type: string
type: array
databaseHostname:
description: DatabaseHostname - Designate Database Hostname
type: string
databaseUser:
default: designate
description: 'DatabaseUser - optional username used for designate
DB, defaults to designate TODO: -> implement needs work in mariadb-operator,
right now only designate'
type: string
debug:
description: Debug - enable debug for different deploy stages.
If an init container is used, it runs and the actual action
pod gets started with sleep infinity
properties:
initContainer:
default: false
description: initContainer enable debug (waits until /tmp/stop-init-container
disappears)
type: boolean
service:
default: false
description: service enable debug
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
description: 'ConfigOverwrite - interface to overwrite default
config files like e.g. policy.json. But can also be used to
add additional files. Those get added to the service config
dir in /etc/<service> . TODO: -> implement'
type: object
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment
resource names to expose the services to the given network
items:
type: string
type: array
nodeSelector:
additionalProperties:
type: string
description: NodeSelector to target subset of worker nodes running
this service. Setting here overrides any global NodeSelector
settings within the Designate CR.
type: object
passwordSelectors:
default:
database: DesignateDatabasePassword
service: DesignatePassword
description: PasswordSelectors - Selectors to identify the DB
and ServiceUser password from the Secret
properties:
database:
default: DesignateDatabasePassword
description: 'Database - Selector to get the designate database
user password from the Secret TODO: not used, need change
in mariadb-operator'
type: string
service:
default: DesignatePassword
description: Service - Selector to get the designate service
password from the Secret
type: string
type: object
replicas:
default: 1
description: Replicas - Designate Backendbind9 Replicas
format: int32
maximum: 32
minimum: 0
type: integer
resources:
description: Resources - Compute Resources required by this service
(Limits/Requests). https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
properties:
claims:
description: "Claims lists the names of resources, defined
in spec.resourceClaims, that are used by this container.
\n This is an alpha field and requires enabling the DynamicResourceAllocation
feature gate. \n This field is immutable. It can only be
set for containers."
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
properties:
name:
description: Name must match the name of one entry in
pod.spec.resourceClaims of the Pod where this field
is used. It makes that resource available inside a
container.
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Limits describes the maximum amount of compute
resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Requests describes the minimum amount of compute
resources required. If Requests is omitted for a container,
it defaults to Limits if that is explicitly specified, otherwise
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
secret:
description: Secret containing OpenStack password information
for DesignateDatabasePassword
type: string
serviceAccount:
description: ServiceAccount - service account name used internally
to provide Designate services the default SA name
type: string
serviceUser:
default: designate
description: ServiceUser - optional username used for this service
to register in designate
type: string
transportURLSecret:
description: Secret containing RabbitMq transport URL
type: string
required:
- containerImage
type: object
designateCentral:
description: DesignateCentral - Spec definition for the Central service
of this Designate deployment
Expand Down Expand Up @@ -1279,6 +1459,7 @@ spec:
type: string
required:
- designateAPI
- designateBackendbind9
- designateCentral
- designateMdns
- designateProducer
Expand Down Expand Up @@ -1344,6 +1525,10 @@ spec:
description: ReadyCount of Designate API instance
format: int32
type: integer
designateBackendbind9ReadyCount:
description: ReadyCount of Designate Backendbind9 instance
format: int32
type: integer
designateCentralReadyCount:
description: ReadyCount of Designate Central instance
format: int32
Expand Down
2 changes: 1 addition & 1 deletion api/bases/designate.openstack.org_designateworkers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: designateworkers.designate.openstack.org
spec:
Expand Down
10 changes: 9 additions & 1 deletion api/v1beta1/designate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ type DesignateSpec struct {
// +kubebuilder:validation:Required
// DesignateProducer - Spec definition for the Producer service of this Designate deployment
DesignateProducer DesignateProducerSpec `json:"designateProducer"`

// +kubebuilder:validation:Required
// DesignateBackendbind9 - Spec definition for the Backendbind9 service of this Designate deployment
DesignateBackendbind9 DesignateBackendbind9Spec `json:"designateBackendbind9"`
}

// DesignateStatus defines the observed state of Designate
Expand Down Expand Up @@ -175,6 +179,9 @@ type DesignateStatus struct {

// ReadyCount of Designate Producer instance
DesignateProducerReadyCount int32 `json:"designateProducerReadyCount,omitempty"`

// ReadyCount of Designate Backendbind9 instance
DesignateBackendbind9ReadyCount int32 `json:"designateBackendbind9ReadyCount,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down Expand Up @@ -210,7 +217,8 @@ func (instance Designate) IsReady() bool {
instance.Status.Conditions.IsTrue(DesignateCentralReadyCondition) &&
instance.Status.Conditions.IsTrue(DesignateWorkerReadyCondition) &&
instance.Status.Conditions.IsTrue(DesignateMdnsReadyCondition) &&
instance.Status.Conditions.IsTrue(DesignateProducerReadyCondition)
instance.Status.Conditions.IsTrue(DesignateProducerReadyCondition) &&
instance.Status.Conditions.IsTrue(DesignateBackendbind9ReadyCondition)
}

// DesignateExtraVolMounts exposes additional parameters processed by the designate-operator
Expand Down
36 changes: 18 additions & 18 deletions api/v1beta1/designatebackendbind9_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
// Container image fall-back defaults
// const (
// // Container image fall-back defaults

// DesignateBackendbind9ContainerImage is the fall-back container image for DesignateBackendbind9
DesignateBackendbind9ContainerImage =
"quay.io/tripleowallabycentos9/openstack-designate-backend-bind9:current-tripleo"
)
// // DesignateBackendbind9ContainerImage is the fall-back container image for DesignateBackendbind9
// DesignateBackendbind9ContainerImage =
// "quay.io/tripleowallabycentos9/openstack-designate-backend-bind9:current-tripleo"
// )

// DesignateBackendbind9Template defines the input parameters for the Designate Scheduler service
type DesignateBackendbind9Template struct {
Expand Down Expand Up @@ -113,20 +113,20 @@ func (instance DesignateBackendbind9) IsReady() bool {
return instance.Status.ReadyCount == *(instance.Spec.Replicas)
}

// RbacConditionsSet - set the conditions for the rbac object
func (instance DesignateBackendbind9) RbacConditionsSet(c *condition.Condition) {
instance.Status.Conditions.Set(c)
}
// // RbacConditionsSet - set the conditions for the rbac object
// func (instance DesignateBackendbind9) RbacConditionsSet(c *condition.Condition) {
// instance.Status.Conditions.Set(c)
// }

// RbacNamespace - return the namespace
func (instance DesignateBackendbind9) RbacNamespace() string {
return instance.Namespace
}
// // RbacNamespace - return the namespace
// func (instance DesignateBackendbind9) RbacNamespace() string {
// return instance.Namespace
// }

// RbacResourceName - return the name to be used for rbac objects (serviceaccount, role, rolebinding)
func (instance DesignateBackendbind9) RbacResourceName() string {
return "designatebackendbind9-" + instance.Name
}
// // RbacResourceName - return the name to be used for rbac objects (serviceaccount, role, rolebinding)
// func (instance DesignateBackendbind9) RbacResourceName() string {
// return "designatebackendbind9-" + instance.Name
// }

// SetupDefaults - initializes any CRD field defaults based on environment variables (the defaulting mechanism itself is implemented via webhooks)
// func SetupDefaults() {
Expand Down
1 change: 1 addition & 0 deletions api/v1beta1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: designateapis.designate.openstack.org
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: designatebackendbind9s.designate.openstack.org
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: designatecentrals.designate.openstack.org
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: designatemdnses.designate.openstack.org
spec:
Expand Down
Loading

0 comments on commit 49f6c3f

Please sign in to comment.