定期备份etcd-operator集群

时间:2018-01-29 17:09:51

标签: etcd kubernetes-helm google-kubernetes-engine

我正在尝试使用etcd-operator helm chart在GKE上部署一个etcd群集。

我已成功使群集在线并正常工作,但现在我正在试图弄清楚如何备份这个东西。如果我理解this issuethis issue,是否真的是etcd-operator实际上不支持定期备份?

在我看来,如果您无法持续备份群集,那么包括备份和恢复操作员将毫无用处。

我误解了文档吗?别人怎么解决这个问题?

这是我目前正在使用的图表值:

rbac:
  create: false
  apiVersion: v1beta1
  etcdOperatorServiceAccountName: vault-etcd-operator
  backupOperatorServiceAccountName: vault-etcd-backup
  restoreOperatorServiceAccountName: vault-etcd-restore

deployments:
  etcdOperator: true
  # one time deployment, delete once completed,
  # Ref: https://github.com/coreos/etcd-operator/blob/master/doc/user/walkthrough/backup-operator.md
  backupOperator: true
  # one time deployment, delete once completed
  # Ref: https://github.com/coreos/etcd-operator/blob/master/doc/user/walkthrough/restore-operator.md
  restoreOperator: false

customResources:
  createEtcdClusterCRD: true
  createBackupCRD: true
  createRestoreCRD: false

etcdOperator:
  name: etcd-operator
  replicaCount: 1
  image:
    repository: quay.io/coreos/etcd-operator
    tag: v0.7.0
    pullPolicy: Always
  resources:
    cpu: 100m
    memory: 128Mi
  ## Node labels for etcd-operator pod assignment
  ## Ref: https://kubernetes.io/docs/user-guide/node-selection/
  nodeSelector: {}
  ## additional command arguments go here; will be translated to `--key=value` form
  ## e.g., analytics: true
  commandArgs: {}

backupOperator:
  name: etcd-backup-operator
  replicaCount: 1
  image:
    repository: quay.io/coreos/etcd-operator
    tag: v0.7.0
    pullPolicy: Always
  resources:
    cpu: 100m
    memory: 128Mi
  spec:
    storageType: S3
    s3:
      s3Bucket: my-vault-backups
      awsSecret: aws
  ## Node labels for etcd pod assignment
  ## Ref: https://kubernetes.io/docs/user-guide/node-selection/
  nodeSelector: {}
  ## additional command arguments go here; will be translated to `--key=value` form
  ## e.g., analytics: true
  commandArgs: {}

1 个答案:

答案 0 :(得分:0)

不是一个完整的答案,但是这些资源可能会为您指明正确的方向:
https://labs.consol.de/kubernetes/2018/05/25/kubeadm-backup.html
(这是自动备份etcd的cronjob。)

还有一个独特的Kubernetes灾难恢复工具,叫做Heptio Ark https://www.youtube.com/watch?v=qRPNuT080Hk
它可以根据从api服务器读取的内容进行部分和筛选的备份和还原,还可以备份PV并进行计划。

因为Heptio Ark通过kube-apiserver起作用,所以即使在AKS /托管kubernetes之类的主节点和etcd被抽象化的情况下,它也能起作用。因此,由于它在不直接与etcd交互的情况下备份etcd,因此可能适合您的方案。