Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/v1alpha1/clickhousecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ type ClickHouseClusterSpec struct {
// +optional
// +kubebuilder:validation:Pattern=`^(lts|stable|\d+\.\d+)?$`
UpgradeChannel string `json:"upgradeChannel,omitempty"`

// VersionProbe defines configuration for the version detection Job.
// +optional
VersionProbe *VersionProbeSpec `json:"versionProbe,omitempty"`
}

// WithDefaults sets default values for ClickHouseClusterSpec fields.
Expand Down
59 changes: 59 additions & 0 deletions api/v1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

corev1 "k8s.io/api/core/v1"
policyv1 "k8s.io/api/policy/v1"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/util/intstr"
)

Expand Down Expand Up @@ -210,6 +211,14 @@ type PodTemplateSpec struct {
// +optional
ServiceAccountName string `json:"serviceAccountName,omitempty"`

// PriorityClassName is the name of the PriorityClass to use for this pod.
// +optional
PriorityClassName string `json:"priorityClassName,omitempty"`

// RuntimeClassName is the name of the RuntimeClass to use for this pod.
// +optional
RuntimeClassName string `json:"runtimeClassName,omitempty"`

// Volumes defines the list of volumes that can be mounted by containers belonging to the pod.
// More info: https://kubernetes.io/docs/concepts/storage/volumes
// +optional
Expand Down Expand Up @@ -348,6 +357,56 @@ type DefaultPasswordSelector struct {
ConfigMap *ConfigMapKeySelector `json:"configMap,omitempty"`
}

const (
// DefaultVersionProbeCPU is the default CPU request and limit for the version probe Job.
DefaultVersionProbeCPU = "100m"
// DefaultVersionProbeMemory is the default memory request and limit for the version probe Job.
DefaultVersionProbeMemory = "128Mi"
)

// MetadataItem defines a single key-value pair for labels or annotations.
type MetadataItem struct {
// Key of the metadata item.
Key string `json:"key"`
// Value of the metadata item.
Value string `json:"value"`
}

// VersionProbeSpec describes the configuration for the version probe task.
type VersionProbeSpec struct {
// Additional labels to apply specifically to the version probe Job and Pod.
// +optional
// +listType=map
// +listMapKey=key
Labels []MetadataItem `json:"labels,omitempty"`

// Additional annotations to apply specifically to the version probe Job and Pod.
// +optional
// +listType=map
// +listMapKey=key
Annotations []MetadataItem `json:"annotations,omitempty"`

// CPURequest defines the CPU request for the version probe container.
// +optional
// +kubebuilder:default:="100m"
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`

// CPULimit defines the CPU limit for the version probe container.
// +optional
// +kubebuilder:default:="100m"
CPULimit *resource.Quantity `json:"cpuLimit,omitempty"`

// MemoryRequest defines the memory request for the version probe container.
// +optional
// +kubebuilder:default:="128Mi"
MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"`

// MemoryLimit defines the memory limit for the version probe container.
// +optional
// +kubebuilder:default:="128Mi"
MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"`
}

// Validate validates the DefaultPasswordSelector configuration.
func (s *DefaultPasswordSelector) Validate() error {
if s == nil {
Expand Down
4 changes: 4 additions & 0 deletions api/v1alpha1/keepercluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ type KeeperClusterSpec struct {
// +optional
// +kubebuilder:validation:Pattern=`^(lts|stable|\d+\.\d+)?$`
UpgradeChannel string `json:"upgradeChannel,omitempty"`

// VersionProbe defines configuration for the version detection Job.
// +optional
VersionProbe *VersionProbeSpec `json:"versionProbe,omitempty"`
}

// WithDefaults sets default values for KeeperClusterSpec fields.
Expand Down
70 changes: 70 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

91 changes: 91 additions & 0 deletions config/crd/bases/clickhouse.com_clickhouseclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1802,6 +1802,14 @@ spec:
More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
type: object
x-kubernetes-map-type: atomic
priorityClassName:
description: PriorityClassName is the name of the PriorityClass
to use for this pod.
type: string
runtimeClassName:
description: RuntimeClassName is the name of the RuntimeClass
to use for this pod.
type: string
schedulerName:
description: |-
If specified, the pod will be dispatched by specified scheduler.
Expand Down Expand Up @@ -4368,6 +4376,89 @@ spec:
When empty, only minor updates will be proposed. Allowed values are: stable, lts or specific major.minor version (e.g. 25.8).
pattern: ^(lts|stable|\d+\.\d+)?$
type: string
versionProbe:
description: VersionProbe defines configuration for the version detection
Job.
properties:
annotations:
description: Additional annotations to apply specifically to the
version probe Job and Pod.
items:
description: MetadataItem defines a single key-value pair for
labels or annotations.
properties:
key:
description: Key of the metadata item.
type: string
value:
description: Value of the metadata item.
type: string
required:
- key
- value
type: object
type: array
x-kubernetes-list-map-keys:
- key
x-kubernetes-list-type: map
cpuLimit:
anyOf:
- type: integer
- type: string
default: 100m
description: CPULimit defines the CPU limit for the version probe
container.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
cpuRequest:
anyOf:
- type: integer
- type: string
default: 100m
description: CPURequest defines the CPU request for the version
probe container.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
labels:
description: Additional labels to apply specifically to the version
probe Job and Pod.
items:
description: MetadataItem defines a single key-value pair for
labels or annotations.
properties:
key:
description: Key of the metadata item.
type: string
value:
description: Value of the metadata item.
type: string
required:
- key
- value
type: object
type: array
x-kubernetes-list-map-keys:
- key
x-kubernetes-list-type: map
memoryLimit:
anyOf:
- type: integer
- type: string
default: 128Mi
description: MemoryLimit defines the memory limit for the version
probe container.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryRequest:
anyOf:
- type: integer
- type: string
default: 128Mi
description: MemoryRequest defines the memory request for the
version probe container.
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
required:
- keeperClusterRef
type: object
Expand Down
Loading
Loading