diff --git a/stable/consul/Chart.yaml b/stable/consul/Chart.yaml index 170a4c9edc..4b68bdbd05 100755 --- a/stable/consul/Chart.yaml +++ b/stable/consul/Chart.yaml @@ -1,7 +1,7 @@ name: consul home: https://github.com/hashicorp/consul -version: 0.4.2 -appVersion: 0.8.3 +version: 1.0.0 +appVersion: 1.0.0 description: Highly available and distributed service discovery and key-value store designed with support for the modern data center to make distributed systems and configuration easy. icon: https://raw.githubusercontent.com/hashicorp/consul/bce3809dfca37b883828c3715b84143dd71c0f85/website/source/assets/images/favicons/android-chrome-512x512.png sources: diff --git a/stable/consul/README.md b/stable/consul/README.md index f357fabd2a..07187a15be 100644 --- a/stable/consul/README.md +++ b/stable/consul/README.md @@ -28,7 +28,7 @@ The following tables lists the configurable parameters of the consul chart and t | ----------------------- | ---------------------------------- | ---------------------------------------------------------- | | `Name` | Consul statefulset name | `consul` | | `Image` | Container image name | `consul` | -| `ImageTag` | Container image tag | `v0.7.5` | +| `ImageTag` | Container image tag | `1.0.0` | | `ImagePullPolicy` | Container pull policy | `Always` | | `Replicas` | k8s statefulset replicas | `3` | | `Component` | k8s selector key | `consul` | @@ -46,11 +46,13 @@ The following tables lists the configurable parameters of the consul chart and t | `SerfwanUdpPort` | Container serf wan UDP listening port | `8302` | | `ServerPort` | Container server listening port | `8300` | | `ConsulDnsPort` | Container dns listening port | `8600` | +| `antiAffinity` | Consul pod anti-affinity setting | `hard` | +| `maxUnavailable` | Pod disruption Budget maxUnavailable | `1` | | `ui.enabled` | Enable Consul Web UI | `false` | | `uiService.enabled` | Create dedicated Consul Web UI svc | `false` | | `uiService.type` | Dedicate Consul Web UI svc type | `NodePort` | -| `test.image` | Test container image requires kubectl + bash (used for helm test) | `lachlanevenson/k8s-kubectl` | -| `test.imageTag` | Test container image tag (used for helm test) | `v1.4.8-bash` | +| `test.image` | Test container image requires kubectl + bash (used for helm test) | `lachlanevenson/k8s-kubectl` | +| `test.imageTag` | Test container image tag (used for helm test) | `v1.4.8-bash` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. diff --git a/stable/consul/templates/consul.yaml b/stable/consul/templates/consul.yaml index 380d090c36..6bd2e889be 100644 --- a/stable/consul/templates/consul.yaml +++ b/stable/consul/templates/consul.yaml @@ -25,6 +25,18 @@ spec: type: "{{ .Values.uiService.type }}" {{- end }} --- +{{- if .Values.maxUnavailable }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: "{{ template "fullname" . }}-pdb" +spec: + maxUnavailable: {{ .Values.maxUnavailable }} + selector: + matchLabels: + component: "{{ .Release.Name }}-{{ .Values.Component }}" +{{- end }} +--- apiVersion: v1 kind: Service metadata: @@ -77,6 +89,8 @@ metadata: spec: serviceName: "{{ template "fullname" . }}" replicas: {{ default 3 .Values.Replicas }} + updateStrategy: + type: RollingUpdate template: metadata: name: "{{ template "fullname" . }}" @@ -88,6 +102,31 @@ spec: spec: securityContext: fsGroup: 1000 + {{- if eq .Values.antiAffinity "hard" }} + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: component + operator: In + values: + - "{{ .Release.Name }}-{{ .Values.Component }}" + topologyKey: kubernetes.io/hostname + {{- else if eq .Values.antiAffinity "soft" }} + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 1 + podAffinityTerm: + topologyKey: kubernetes.io/hostname + labelSelector: + matchExpressions: + - key: component + operator: In + values: + - "{{ .Release.Name }}-{{ .Values.Component }}" + {{- end }} containers: - name: "{{ template "fullname" . }}" image: "{{ .Values.Image }}:{{ .Values.ImageTag }}" diff --git a/stable/consul/values.yaml b/stable/consul/values.yaml index de27a7a3bd..7bbd8ead79 100644 --- a/stable/consul/values.yaml +++ b/stable/consul/values.yaml @@ -16,7 +16,7 @@ ConsulDnsPort: 8600 Component: "consul" Replicas: 3 Image: "consul" -ImageTag: "0.8.3" +ImageTag: "1.0.0" ImagePullPolicy: "Always" Resources: {} # requests: @@ -43,6 +43,21 @@ EncryptGossip: true ## StorageClass name for use with Persistent Volume Claim (PVC) using beta notations # StorageClass: +## Setting maxUnavailable will create a pod disruption budget that will prevent +## voluntarty cluster administration from taking down too many consul pods. If +## you set maxUnavailable, you should set it to ceil((n/2) - 1), where +## n = Replicas. For example, if you have 5 or 6 Replicas, you'll want to set +## maxUnavailable = 2. If you are using the default of 3 Replicas, you'll want +## to set maxUnavailable to 1. +maxUnavailable: 1 + +## Anti-Affinity setting. The default "hard" will use pod anti-affinity that is +## requiredDuringSchedulingIgnoredDuringExecution to ensure 2 services don't +## end up on the same node. Setting this to "soft" will use +## preferredDuringSchedulingIgnoredDuringExecution. If set to anything else, +## no anti-affinity rules will be configured. +antiAffinity: "hard" + ## Enable Consul Web UI ## ui: