From f72cb2dc59008b8375887754ec9682e3a50af010 Mon Sep 17 00:00:00 2001 From: Ryan Luckie Date: Wed, 21 Feb 2018 09:33:39 -0600 Subject: [PATCH] [incubator/etcd] Add pod assignment configuration options (#3542) * [incubator/etcd] Add pod assignment configuration options - update statefulset template to add affinity, nodeSelector and tolerations - add sane default values - update README - bump chart version * Change case of values to match existing style --- incubator/etcd/Chart.yaml | 2 +- incubator/etcd/README.md | 31 +++++++++++++---------- incubator/etcd/templates/statefulset.yaml | 12 +++++++++ incubator/etcd/values.yaml | 7 +++++ 4 files changed, 37 insertions(+), 15 deletions(-) diff --git a/incubator/etcd/Chart.yaml b/incubator/etcd/Chart.yaml index 87318a68d9..1c68810b73 100755 --- a/incubator/etcd/Chart.yaml +++ b/incubator/etcd/Chart.yaml @@ -1,6 +1,6 @@ name: etcd home: https://github.com/coreos/etcd -version: 0.3.6 +version: 0.3.7 description: Distributed reliable key-value store for the most critical data of a distributed system. icon: https://raw.githubusercontent.com/coreos/etcd/master/logos/etcd-horizontal-color.png diff --git a/incubator/etcd/README.md b/incubator/etcd/README.md index fbe4a75f44..b921d4d20c 100644 --- a/incubator/etcd/README.md +++ b/incubator/etcd/README.md @@ -35,20 +35,23 @@ $ helm install --name my-release incubator/etcd The following tables lists the configurable parameters of the etcd chart and their default values. -| Parameter | Description | Default | -| ----------------------- | ---------------------------------- | ---------------------------------------------------------- | -| `Name` | Spark master name | `etcd` | -| `Image` | Container image name | `k8s.gcr.io/etcd-amd64` | -| `ImageTag` | Container image tag | `2.2.5` | -| `ImagePullPolicy` | Container pull policy | `Always` | -| `Replicas` | k8s statefulset replicas | `3` | -| `Component` | k8s selector key | `etcd` | -| `Cpu` | container requested cpu | `100m` | -| `Memory` | container requested memory | `512Mi` | -| `ClientPort` | k8s service port | `2379` | -| `PeerPorts` | Container listening port | `2380` | -| `Storage` | Persistent volume size | `1Gi` | -| `StorageClass` | Persistent volume storage class | `anything` | +| Parameter | Description | Default | +| ----------------------- | ------------------------------------ | -------------------------------------------------- | +| `Name` | Spark master name | `etcd` | +| `Image` | Container image name | `k8s.gcr.io/etcd-amd64` | +| `ImageTag` | Container image tag | `2.2.5` | +| `ImagePullPolicy` | Container pull policy | `Always` | +| `Replicas` | k8s statefulset replicas | `3` | +| `Component` | k8s selector key | `etcd` | +| `Cpu` | container requested cpu | `100m` | +| `Memory` | container requested memory | `512Mi` | +| `ClientPort` | k8s service port | `2379` | +| `PeerPorts` | Container listening port | `2380` | +| `Storage` | Persistent volume size | `1Gi` | +| `StorageClass` | Persistent volume storage class | `anything` | +| `Affinity` | Affinity settings for pod assignment | `{}` | +| `NodeSelector` | Node labels for pod assignment | `{}` | +| `Tolerations` | Toleration labels for pod assignment | `[]` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. diff --git a/incubator/etcd/templates/statefulset.yaml b/incubator/etcd/templates/statefulset.yaml index 67232b7079..e72ef97024 100644 --- a/incubator/etcd/templates/statefulset.yaml +++ b/incubator/etcd/templates/statefulset.yaml @@ -19,6 +19,18 @@ spec: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" component: "{{ .Release.Name }}-{{ .Values.Component }}" spec: +{{- if .Values.Affinity }} + affinity: +{{ toYaml .Values.Affinity | indent 8 }} +{{- end }} +{{- if .Values.NodeSelector }} + nodeSelector: +{{ toYaml .Values.NodeSelector | indent 8 }} +{{- end }} +{{- if .Values.Tolerations }} + tolerations: +{{ toYaml .Values.Tolerations | indent 8 }} +{{- end }} containers: - name: {{ template "etcd.fullname" . }} image: "{{ .Values.Image }}:{{ .Values.ImageTag }}" diff --git a/incubator/etcd/values.yaml b/incubator/etcd/values.yaml index 5bca0a47e8..912626ae11 100644 --- a/incubator/etcd/values.yaml +++ b/incubator/etcd/values.yaml @@ -22,3 +22,10 @@ Storage: "1Gi" ## GKE, AWS & OpenStack) ## # storageClass: "-" + +## Node labels and tolerations for pod assignment +## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector +## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#taints-and-tolerations-beta-feature +NodeSelector: {} +Tolerations: [] +Affinity: {}