From 20b8dffaf2de9a03215beec7155fc196bc0cb819 Mon Sep 17 00:00:00 2001 From: Aaron Friel Date: Sun, 30 Dec 2018 13:19:48 -0800 Subject: [PATCH] [stable/graphite] Graphite statefulset (#10309) * [stable/graphite] Fix missing image tag in init container spec Graphite recently changed their initialization scripts in 1.1.5-x. The init container using `:latest` resulted in a failure to run the init script and a crash loop. Signed-off-by: Aaron Friel * [stable/graphite] Update to 1.1.5, use StatefulSet Update to 1.1.5 significantly improves performance/reliability and uses services on startup to configure the user accounts, obviating the need for an init container. The Deployment is replaced by a StatefulSet because Graphite is sensitive to the identity of the machines. Although this chart does not currently handle Graphite clusters, it is probably not a good thing that every Graphite pod should register as a new carbon agent and carbon aggregator. There doesn't appear to be any process to clean up "old" agents/aggregators or other container identity pieces. tl;dr: StatefulSet better models the behavior Graphite has than a deployment. Signed-off-by: Aaron Friel * [stable/graphite] Bump minor version number. Signed-off-by: Aaron Friel * [stable/graphite] Use apps/v1 api version in stateful set Signed-off-by: Aaron Friel --- stable/graphite/Chart.yaml | 4 ++-- stable/graphite/README.md | 2 +- .../{deployment.yaml => statefulset.yaml} | 14 ++++---------- stable/graphite/values.yaml | 2 +- 4 files changed, 8 insertions(+), 14 deletions(-) rename stable/graphite/templates/{deployment.yaml => statefulset.yaml} (88%) diff --git a/stable/graphite/Chart.yaml b/stable/graphite/Chart.yaml index 1accf3e733..ad9e4d4909 100644 --- a/stable/graphite/Chart.yaml +++ b/stable/graphite/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 -version: 0.1.4 -appVersion: "1.1.4-10" +version: 0.2.0 +appVersion: "1.1.5-3" description: Graphite metrics server name: graphite home: https://graphiteapp.org/ diff --git a/stable/graphite/README.md b/stable/graphite/README.md index d1b39ad5e4..4a12331bb6 100644 --- a/stable/graphite/README.md +++ b/stable/graphite/README.md @@ -37,7 +37,7 @@ The following table lists the configurable parameters of the Graphite chart and | Parameter | Description | Default | |--------------------------------|----------------------------------------------|----------------------------------------| | `image.repository` | Docker image repo | `graphiteapp/graphite-statsd` | -| `image.tag` | Docker image | `1.1.4-10` | +| `image.tag` | Docker image | `1.1.5-3` | | `image.pullPolicy` | Docker image pull policy | `IfNotPresent` | | `service.type` | Service type | `ClusterIP` | | `service.port` | Service port of Graphite UI | `8080` | diff --git a/stable/graphite/templates/deployment.yaml b/stable/graphite/templates/statefulset.yaml similarity index 88% rename from stable/graphite/templates/deployment.yaml rename to stable/graphite/templates/statefulset.yaml index 437f498486..57b861b68e 100644 --- a/stable/graphite/templates/deployment.yaml +++ b/stable/graphite/templates/statefulset.yaml @@ -1,5 +1,5 @@ apiVersion: apps/v1 -kind: Deployment +kind: StatefulSet metadata: name: {{ template "graphite.fullname" . }} labels: @@ -8,25 +8,19 @@ metadata: release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: - strategy: - type: Recreate + updateStrategy: + type: RollingUpdate selector: matchLabels: app: {{ template "graphite.name" . }} release: {{ .Release.Name }} + serviceName: {{ template "graphite.name" . }} template: metadata: labels: app: {{ template "graphite.name" . }} release: {{ .Release.Name }} spec: - initContainers: - - name: create-syncdb - image: {{ .Values.image.repository }} - command: [ "sh", "-c", "test -f /opt/graphite/storage/graphite.db || /usr/bin/expect /usr/local/bin/django_admin_init.exp"] - volumeMounts: - - name: {{ template "graphite.fullname" . }}-pvc - mountPath: /opt/graphite/storage/ containers: - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} name: {{ .Chart.Name }} diff --git a/stable/graphite/values.yaml b/stable/graphite/values.yaml index 4390854302..880eb84cd9 100644 --- a/stable/graphite/values.yaml +++ b/stable/graphite/values.yaml @@ -2,7 +2,7 @@ image: repository: graphiteapp/graphite-statsd - tag: 1.1.4-10 + tag: 1.1.5-3 pullPolicy: IfNotPresent service: