Skip to content

Latest commit

 

History

History
191 lines (157 loc) · 3.82 KB

spec_examples.md

File metadata and controls

191 lines (157 loc) · 3.82 KB

Cluster Spec Examples

Three members cluster

spec:
  size: 3

This will use default version that etcd operator chooses.

Three members cluster with version specified

spec:
  size: 3
  version: "3.1.8"

Three members cluster with node selector and anti-affinity

spec:
  size: 3
  pod:
    nodeSelector:
      diskType: ssd
    antiAffinity: true

Three members cluster with resource requirement

spec:
  size: 3
  pod:
    resources:
      limits:
        cpu: 300m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 100Mi

Three members cluster with PV backup

See example .

S3 backup and cluster specific S3 configuration

spec:
  size: 3
  backup:
    backupIntervalInSecond: 1800
    maxBackups: 5
    storageType: "S3"
    s3:
      s3Bucket: <S3-bucket-name>
      awsSecret: <aws-secret-name>
      prefix: <S3-prefix>

See backup config for how to set up S3 related configurations.

Three members cluster that restores from previous PV backup

If a cluster cluster-a was created with backup, but deleted or failed later on, we can recover the cluster as long as the PV still exists. Note that delete cluster-a Cluster resource first if it still exists.

Here's an example:

metadata:
  name: "cluster-a"
spec:
  size: 3
  backup:
    backupIntervalInSecond: 300
    maxBackups: 5
    storageType: "PersistentVolume"
    pv:
      volumeSizeInMB: 512
  restore:
    backupClusterName: "cluster-a"
    storageType: "PersistentVolume"

Three members cluster that restores from previous S3 backup

Same as above but using "S3" as backup storage. The previous s3 backup must exist in order for the restore to work; otherwise, the new cluster doesn't boot.

metadata:
  name: "cluster-a"
spec:
  size: 3
  backup:
    backupIntervalInSecond: 300
    maxBackups: 5
    storageType: "S3"
    s3:
      s3Bucket: <S3-bucket-name>
      awsSecret: <aws-secret-name>
      prefix: <S3-prefix>
  restore:
    backupClusterName: "cluster-a"
    storageType: "S3"

Three members cluster that restores from different cluster's S3 backup

etcd-operator can create a new cluster cluster-b from the backup of another cluster cluster-a. If backup exists, make sure the backup policy of cluster-b has the same S3 configuration as those of cluster-a; etcd operator would also use that config to access snapshots of cluster-a.

metadata:
  name: "cluster-a"
spec:
  size: 3
  backup:
    backupIntervalInSecond: 300
    maxBackups: 5
    storageType: "S3"
    s3:
      s3Bucket: <S3-bucket-name>
      awsSecret: <aws-secret-name>
      prefix: <S3-prefix>
metadata:
  name: "cluster-b"
spec:
  size: 3
  backup:
    backupIntervalInSecond: 300
    maxBackups: 5
    storageType: "S3"
    s3:
      s3Bucket: <S3-bucket-name>
      awsSecret: <aws-secret-name>
      prefix: <S3-prefix>
  restore:
    backupClusterName: "cluster-a"
    storageType: "S3"

Three members cluster that restores from different cluster's PV backup

If user wants to clone a new cluster cluster-b from an existing cluster cluster-a, as long as backup exists, use the following example spec:

metadata:
  name: "cluster-b"
spec:
  size: 3
  backup:
    backupIntervalInSecond: 300
    maxBackups: 5
    storageType: "PersistentVolume"
    pv:
      volumeSizeInMB: 512
  restore:
    backupClusterName: "cluster-a"
    storageType: "PersistentVolume"

ABS spec examples

Three member cluster with ABS backup

spec:
  size: 3
  backup:
    backupIntervalInSecond: 1800
    maxBackups: 5
    storageType: "ABS"
    abs:
      absContainer: <abs-container-name>
      absSecret: <abs-secret-name>

TLS

See cluster TLS docs.