From 6c21f2374c4dfd03fb5f85b53733f22351dad8fa Mon Sep 17 00:00:00 2001 From: Colin Hoglund Date: Sat, 27 Jan 2018 08:26:31 -0500 Subject: [PATCH] enable adjusting agent replicas and ensure deployments are updated when shared secret changes (#3294) --- incubator/drone/Chart.yaml | 2 +- incubator/drone/README.md | 3 ++- incubator/drone/templates/deployment-agent.yaml | 4 +++- incubator/drone/templates/deployment-server.yaml | 2 ++ incubator/drone/values.yaml | 3 +++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/incubator/drone/Chart.yaml b/incubator/drone/Chart.yaml index 3c0287ad8e..72bfd545ef 100755 --- a/incubator/drone/Chart.yaml +++ b/incubator/drone/Chart.yaml @@ -1,7 +1,7 @@ name: drone home: https://drone.io/ icon: http://docs.drone.io/logo.svg -version: 0.2.1 +version: 0.3.0 appVersion: 0.8.2 description: Drone is a Continuous Delivery system built on container technology keywords: diff --git a/incubator/drone/README.md b/incubator/drone/README.md index 086c75d019..c1b668206f 100644 --- a/incubator/drone/README.md +++ b/incubator/drone/README.md @@ -54,6 +54,7 @@ The following tables lists the configurable parameters of the drone charts and t | `server.env` | Drone **server** environment variables | `(default values)` | | `server.resources` | Drone **server** pod resource requests & limits | `{}` | | `agent.env` | Drone **agent** environment variables | `(default values)` | +| `agent.replicas` | Drone **agent** replicas | `1` | | `agent.resources` | Drone **agent** pod resource requests & limits | `{}` | | `dind.driver` | **DinD** storage driver | `overlay2` | | `dind.resources` | **DinD** pod resource requests & limits | `{}` | @@ -62,4 +63,4 @@ The following tables lists the configurable parameters of the drone charts and t | `persistence.storageClass` | Storage class of backing PVC | `nil` | | `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | | `persistence.size` | Size of data volume | `1Gi` | -| `sharedSecret` | Drone server and agent shared secret | `(random value)` | +| `sharedSecret` | Drone server and agent shared secret (Note: The Default random value changes on every `helm upgrade` causing a rolling update of server and agents) | `(random value)` | diff --git a/incubator/drone/templates/deployment-agent.yaml b/incubator/drone/templates/deployment-agent.yaml index 1a7acaf980..de92f2004e 100644 --- a/incubator/drone/templates/deployment-agent.yaml +++ b/incubator/drone/templates/deployment-agent.yaml @@ -9,9 +9,11 @@ metadata: heritage: "{{ .Release.Service }}" component: agent spec: - replicas: 1 + replicas: {{ .Values.agent.replicas }} template: metadata: + annotations: + checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} labels: app: {{ template "drone.name" . }} release: "{{ .Release.Name }}" diff --git a/incubator/drone/templates/deployment-server.yaml b/incubator/drone/templates/deployment-server.yaml index 5bdbc504e3..8d83f3135e 100644 --- a/incubator/drone/templates/deployment-server.yaml +++ b/incubator/drone/templates/deployment-server.yaml @@ -13,6 +13,8 @@ spec: replicas: 1 template: metadata: + annotations: + checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} labels: app: {{ template "drone.name" . }} release: "{{ .Release.Name }}" diff --git a/incubator/drone/values.yaml b/incubator/drone/values.yaml index b8e0a42f99..35ad4a746e 100644 --- a/incubator/drone/values.yaml +++ b/incubator/drone/values.yaml @@ -105,6 +105,9 @@ agent: env: DRONE_DEBUG: "false" + ## Number of drone agent replicas + replicas: 1 + ## CPU and memory limits for drone agent ## resources: {}