Skip to content

Commit

Permalink
Merge pull request #235 from abdasgupta/job
Browse files Browse the repository at this point in the history
Enabled jobs instead of cronjobs to take care of running compaction.
  • Loading branch information
timuthy committed Nov 15, 2021
2 parents 2ee4773 + f5a2929 commit 1c2d8ab
Show file tree
Hide file tree
Showing 18 changed files with 2,024 additions and 1,251 deletions.
7 changes: 4 additions & 3 deletions api/v1alpha1/etcd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ type BackupSpec struct {
// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
// +optional
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
// CompactionResources defines the compute Resources required by compaction job.
// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
// +optional
CompactionResources *corev1.ResourceRequirements `json:"compactionResources,omitempty"`
// FullSnapshotSchedule defines the cron standard schedule for full snapshots.
// +optional
FullSnapshotSchedule *string `json:"fullSnapshotSchedule,omitempty"`
Expand All @@ -159,9 +163,6 @@ type BackupSpec struct {
// EnableProfiling defines if profiling should be enabled for the etcd-backup-restore-sidecar
// +optional
EnableProfiling *bool `json:"enableProfiling,omitempty"`
// BackupCompactionSchedule defines the cron standard for compacting the snapstore
// +optional
BackupCompactionSchedule *string `json:"backupCompactionSchedule,omitempty"`
// EtcdSnapshotTimeout defines the timeout duration for etcd FullSnapshot operation
// +optional
EtcdSnapshotTimeout *metav1.Duration `json:"etcdSnapshotTimeout,omitempty"`
Expand Down
10 changes: 5 additions & 5 deletions api/v1alpha1/zz_generated.deepcopy.go

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

241 changes: 0 additions & 241 deletions charts/etcd/templates/etcd-compaction-cronjob.yaml

This file was deleted.

12 changes: 3 additions & 9 deletions charts/etcd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: test
uid: uuid-of-etcd-resource
serviceName: test
configMapName: test
jobName: test

replicas: 1
#priorityClassName: foo
Expand Down Expand Up @@ -51,17 +52,10 @@ backup:
compactionResources:
limits:
cpu: 700m
memory: 3Gi
memory: 4Gi
requests:
cpu: 500m
memory: 2Gi
compactionResourcesTempFS:
limits:
cpu: 900m
memory: 12Gi
requests:
cpu: 700m
memory: 10Gi
memory: 3Gi
# compression:
# enabled: true
# policy: "gzip"
Expand Down
25 changes: 22 additions & 3 deletions config/crd/bases/druid.gardener.cloud_etcds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,28 @@ spec:
backup:
description: BackupSpec defines parametes associated with the full and delta snapshots of etcd
properties:
backupCompactionSchedule:
description: BackupCompactionSchedule defines the cron standard for compacting the snapstore
type: string
compactionResources:
description: 'CompactionResources defines the compute Resources required by compaction job. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/'
properties:
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-compute-resources-container/'
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-compute-resources-container/'
type: object
type: object
compression:
description: SnapshotCompression defines the specification for compression of Snapshots.
properties:
Expand Down
24 changes: 24 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@ metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- druid.gardener.cloud
resources:
Expand Down
Loading

0 comments on commit 1c2d8ab

Please sign in to comment.