-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add defrag CronJob #221
Milestone
Comments
@Kirill-Garbar commented:
|
Probably depends on #204 |
---
apiVersion: etcd.aenix.io/v1alpha1
kind: EtcdCluster
metadata:
name: test
namespace: test-tls-auth-etcd-cluster
spec:
options:
defrag:
schedule: "*/15 * * * *"
rule: # TODO: check the common Kubernetes syntax
operator: Or|And
quotaMoreThan: 80%
dbFreeSizeLessThan: 200MB
storage:
volumeClaimTemplate:
spec:
storageClassName: gp3
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 10Gi
security:
enableAuth: true
tls:
peerTrustedCASecret: ca-peer-secret
peerSecret: peer-secret
serverTrustedCASecret: ca-server-secret
serverSecret: server-secret
clientTrustedCASecret: ca-client-secret
clientSecret: client-secret
status:
conditions:
- lastProbeTime: null
lastTransitionTime: "2024-03-06T18:39:45Z"
status: "True"
type: DefragChecked |
@lllamnyp also sugested to use go templates:
|
defragJobTerms:
- matchExpressions:
- key: dbSpaceFree
operator: Lt
values: 200Mi
- key: dbQuotaUsage
operator: Gt
values: 20% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Kubernetes recomends using etcd-defrag to run defragmentation of the cluster.
Since this is expensive operation this tool allows to specify specific rule, eg:
https://github.com/ahrtr/etcd-defrag/blob/main/doc/etcd-defrag-cronjob.yaml
This is slightly diferent from kamaji-etcd implementation
https://github.com/clastix/kamaji-etcd/blob/433989a4badeb8edc0925cfc671fb0cc66448e66/charts/kamaji-etcd/templates/etcd_cronjob_defrag.yaml#L11
In Cozystack we currnelty added it into Helm chart:
https://github.com/aenix-io/cozystack/pull/137/files#diff-0dcf3889fea1c88eb22a0d84208697a4ed71c8cb111d1d29ec714a71529d5822
The text was updated successfully, but these errors were encountered: