Skip to content

Latest commit

 

History

History
103 lines (80 loc) · 1.98 KB

spec_examples.md

File metadata and controls

103 lines (80 loc) · 1.98 KB

Cluster Spec Examples

Three member cluster

spec:
  size: 3

This will use the default version chosen by the etcd-operator.

Three member cluster with version specified

spec:
  size: 3
  version: "3.2.13"

Three member cluster with node selector and anti-affinity across nodes

Note: change $cluster_name to the EtcdCluster's name.

spec:
  size: 3
  pod:
    nodeSelector:
      diskType: ssd
    affinity:
      podAntiAffinity:
        requiredDuringSchedulingIgnoredDuringExecution:
        - labelSelector:
            matchExpressions:
            - key: etcd_cluster
              operator: In
              values: ["$cluster_name"]
          topologyKey: kubernetes.io/hostname

For other topology keys, see https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ .

Three member cluster with resource requirement

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

Custom etcd configuration

etcd members could be configured via env: https://coreos.com/etcd/docs/latest/op-guide/configuration.html

spec:
  size: 3
  pod:
    etcdEnv:
    - name: ETCD_AUTO_COMPACTION_RETENTION
      value: "1"

TLS

For more information on working with TLS, see Cluster TLS policy.

Custom pod annotations

spec:
  size: 3
  pod:
    annotations:
      prometheus.io/scrape: "true"
      prometheus.io/port: "2379"

Custom pod security context

For more information on pod security context see the Kubernetes docs.

spec:
  size: 3
  pod:
    securityContext:
      runAsNonRoot: true
      runAsUser: 9000
      # The FSGroup is needed to let the etcd container access mounted volumes
      fsGroup: 9000