diff --git a/apis/kubedb/v1alpha2/mssqlserver_types.go b/apis/kubedb/v1alpha2/mssqlserver_types.go index 8b958c780e..05fa896ab4 100644 --- a/apis/kubedb/v1alpha2/mssqlserver_types.go +++ b/apis/kubedb/v1alpha2/mssqlserver_types.go @@ -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 { diff --git a/apis/kubedb/v1alpha2/openapi_generated.go b/apis/kubedb/v1alpha2/openapi_generated.go index 6b54609aba..610a10d5d1 100644 --- a/apis/kubedb/v1alpha2/openapi_generated.go +++ b/apis/kubedb/v1alpha2/openapi_generated.go @@ -29461,12 +29461,18 @@ func schema_apimachinery_apis_kubedb_v1alpha2_MSSQLServerSpec(ref common.Referen Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.Archiver"), }, }, + "arbiter": { + SchemaProps: spec.SchemaProps{ + Description: "Arbiter controls spec for arbiter pods", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ArbiterSpec"), + }, + }, }, Required: []string{"version"}, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.Archiver", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.MSSQLServerTLSConfig", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.MSSQLServerTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ArbiterSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.Archiver", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.MSSQLServerTLSConfig", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.MSSQLServerTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } diff --git a/apis/kubedb/v1alpha2/postgres_types.go b/apis/kubedb/v1alpha2/postgres_types.go index dbbf37dd7f..89a69881c1 100644 --- a/apis/kubedb/v1alpha2/postgres_types.go +++ b/apis/kubedb/v1alpha2/postgres_types.go @@ -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 diff --git a/apis/kubedb/v1alpha2/types.go b/apis/kubedb/v1alpha2/types.go index 3a8aab79e1..f3f27f9e57 100644 --- a/apis/kubedb/v1alpha2/types.go +++ b/apis/kubedb/v1alpha2/types.go @@ -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"` +} diff --git a/apis/kubedb/v1alpha2/zz_generated.deepcopy.go b/apis/kubedb/v1alpha2/zz_generated.deepcopy.go index 392318a88d..2dc05367d9 100644 --- a/apis/kubedb/v1alpha2/zz_generated.deepcopy.go +++ b/apis/kubedb/v1alpha2/zz_generated.deepcopy.go @@ -2446,6 +2446,11 @@ func (in *MSSQLServerSpec) DeepCopyInto(out *MSSQLServerSpec) { *out = new(Archiver) **out = **in } + if in.Arbiter != nil { + in, out := &in.Arbiter, &out.Arbiter + *out = new(ArbiterSpec) + (*in).DeepCopyInto(*out) + } return } diff --git a/crds/kubedb.com_mssqlservers.yaml b/crds/kubedb.com_mssqlservers.yaml index c61e5d671f..bc55635cb8 100644 --- a/crds/kubedb.com_mssqlservers.yaml +++ b/crds/kubedb.com_mssqlservers.yaml @@ -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: