Skip to content

Commit

Permalink
Add MS SQL Server Arbiter APIs
Browse files Browse the repository at this point in the history
Signed-off-by: Neaj Morshad <[email protected]>
  • Loading branch information
Neaj-Morshad-101 committed Dec 9, 2024
1 parent cac99cb commit 3eaf1bf
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 16 deletions.
4 changes: 4 additions & 0 deletions apis/kubedb/v1alpha2/mssqlserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ type MSSQLServerSpec struct {
// Archiver controls database backup using Archiver CR
// +optional
Archiver *Archiver `json:"archiver,omitempty"`

// Arbiter controls spec for arbiter pods
// +optional
Arbiter *ArbiterSpec `json:"arbiter,omitempty"`
}

type MSSQLServerTLSConfig struct {
Expand Down
8 changes: 7 additions & 1 deletion apis/kubedb/v1alpha2/openapi_generated.go

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

15 changes: 0 additions & 15 deletions apis/kubedb/v1alpha2/postgres_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,6 @@ type PostgresReplication struct {
MaxSlotWALKeepSizeInMegaBytes *int32 `json:"maxSlotWALKeepSize,omitempty"`
}

type ArbiterSpec struct {
// Compute Resources required by the sidecar container.
// +optional
Resources core.ResourceRequirements `json:"resources,omitempty"`
// NodeSelector is a selector which must be true for the pod to fit on a node.
// Selector which must match a node's labels for the pod to be scheduled on that node.
// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
// +optional
// +mapType=atomic
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// If specified, the pod's tolerations.
// +optional
Tolerations []core.Toleration `json:"tolerations,omitempty"`
}

// PostgreLeaderElectionConfig contains essential attributes of leader election.
type PostgreLeaderElectionConfig struct {
// LeaseDuration is the duration in second that non-leader candidates will
Expand Down
15 changes: 15 additions & 0 deletions apis/kubedb/v1alpha2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,18 @@ type ArchiverRecovery struct {
FullDBRepository *kmapi.ObjectReference `json:"fullDBRepository,omitempty"`
ReplicationStrategy *PITRReplicationStrategy `json:"replicationStrategy,omitempty"`
}

type ArbiterSpec struct {
// Compute Resources required by the sidecar container.
// +optional
Resources core.ResourceRequirements `json:"resources,omitempty"`
// NodeSelector is a selector which must be true for the pod to fit on a node.
// Selector which must match a node's labels for the pod to be scheduled on that node.
// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
// +optional
// +mapType=atomic
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// If specified, the pod's tolerations.
// +optional
Tolerations []core.Toleration `json:"tolerations,omitempty"`
}
5 changes: 5 additions & 0 deletions apis/kubedb/v1alpha2/zz_generated.deepcopy.go

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

55 changes: 55 additions & 0 deletions crds/kubedb.com_mssqlservers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,61 @@ spec:
type: object
spec:
properties:
arbiter:
properties:
nodeSelector:
additionalProperties:
type: string
type: object
x-kubernetes-map-type: atomic
resources:
properties:
claims:
items:
properties:
name:
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
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
type: object
type: object
tolerations:
items:
properties:
effect:
type: string
key:
type: string
operator:
type: string
tolerationSeconds:
format: int64
type: integer
value:
type: string
type: object
type: array
type: object
archiver:
properties:
pause:
Expand Down

0 comments on commit 3eaf1bf

Please sign in to comment.