Skip to content

Commit

Permalink
Merge pull request #190 from majst01/enable-profiling
Browse files Browse the repository at this point in the history
Enable profiling of etcd-backup-restore-sidecar
  • Loading branch information
Amshuman K R authored Jun 16, 2021
2 parents f02ff02 + 2ae4649 commit 0aa9de3
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 1 deletion.
3 changes: 3 additions & 0 deletions api/v1alpha1/etcd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ type BackupSpec struct {
// SnapshotCompression defines the specification for compression of Snapshots.
// +optional
SnapshotCompression *CompressionSpec `json:"compression,omitempty"`
// EnableProfiling defines if profiling should be enabled for the etcd-backup-restore-sidecar
// +optional
EnableProfiling *bool `json:"enableProfiling,omitempty"`
}

// EtcdConfig defines parameters associated etcd deployed
Expand Down
3 changes: 3 additions & 0 deletions charts/etcd/templates/etcd-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ spec:
{{- if .Values.backup.etcdQuotaBytes }}
- --embedded-etcd-quota-bytes={{ int $.Values.backup.etcdQuotaBytes }}
{{- end }}
{{- if .Values.backup.enableProfiling }}
- --enable-profiling={{ .Values.backup.enableProfiling }}
{{- end }}
{{- if .Values.etcd.enableTLS }}
- --cert=/var/etcd/ssl/client/tls.crt
- --key=/var/etcd/ssl/client/tls.key
Expand Down
1 change: 1 addition & 0 deletions charts/etcd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ backup:
snapstoreTempDir: "/var/etcd/data/temp"
etcdConnectionTimeout: 5m
etcdQuotaBytes: 8Gi
enableProfiling: false
garbageCollectionPolicy: LimitBased
maxBackups: 7
resources:
Expand Down
6 changes: 5 additions & 1 deletion config/crd/bases/druid.gardener.cloud_etcds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: etcds.druid.gardener.cloud
spec:
Expand Down Expand Up @@ -78,6 +78,10 @@ spec:
description: DeltaSnapshotPeriod defines the period after which
delta snapshots will be taken
type: string
enableProfiling:
description: EnableProfiling defines if profiling should be enabled
for the etcd-backup-restore-sidecar
type: boolean
fullSnapshotSchedule:
description: FullSnapshotSchedule defines the cron standard schedule
for full snapshots.
Expand Down
7 changes: 7 additions & 0 deletions controllers/etcd_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -900,12 +900,19 @@ func (r *EtcdReconciler) getMapFromEtcd(etcd *druidv1alpha1.Etcd) (map[string]in
deltaSnapshotMemoryLimit = etcd.Spec.Backup.DeltaSnapshotMemoryLimit.Value()
}

var enableProfiling = false
if etcd.Spec.Backup.EnableProfiling != nil {
enableProfiling = *etcd.Spec.Backup.EnableProfiling

}

backupValues := map[string]interface{}{
"pullPolicy": corev1.PullIfNotPresent,
"etcdQuotaBytes": quota,
"etcdConnectionTimeout": "5m",
"snapstoreTempDir": "/var/etcd/data/temp",
"deltaSnapshotMemoryLimit": deltaSnapshotMemoryLimit,
"enableProfiling": enableProfiling,
}

if etcd.Spec.Backup.Resources != nil {
Expand Down

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

0 comments on commit 0aa9de3

Please sign in to comment.