[stable/gocd] - GoCD agents should run postStart lifecycle hooks (#18768)

* [stable/gocd] - GoCD agents should run postStart lifecycle hooks

Signed-off-by: Erik Jutemar <erik.jutemar@pagero.com>

* [stable/gocd] - Update changelog with 1.19.2 GoCD agents postStart

Signed-off-by: Erik Jutemar <erik.jutemar@pagero.com>

* [stable/gocd] - Updated documentation for agent.postStart and agent.preStop

Signed-off-by: Erik Jutemar <erik.jutemar@pagero.com>
This commit is contained in:
Erik Jutemar
2019-11-12 02:28:06 -08:00
committed by Kubernetes Prow Robot
parent 087881c941
commit 8f4cb428f4
5 changed files with 19 additions and 3 deletions
+3
View File
@@ -1,3 +1,6 @@
### 1.19.2
* [cacab5e62](https://github.com/kubernetes/charts/commit/cacab5e62): GoCD agents postStart lifecycle hooks
### 1.19.1
* [00e10170c](https://github.com/kubernetes/charts/commit/00e10170c): Add support for specifying tolerations on both the GoCD server and agent pods
+1 -1
View File
@@ -1,7 +1,7 @@
apiVersion: v1
name: gocd
home: https://www.gocd.org/
version: 1.19.1
version: 1.19.2
appVersion: 19.10.0
description: GoCD is an open-source continuous delivery server to model and visualize complex workflows with ease.
icon: https://gocd.github.io/assets/images/go-icon-black-192x192.png
+1
View File
@@ -172,6 +172,7 @@ $ kubectl create secret generic gocd-server-ssh \
| `agent.annotations.pod ` | GoCD Agent Pod annotations. | `{}` |
| `agent.replicaCount` | GoCD Agent replicas Count. By default, no agents are provided. | `0` |
| `agent.preStop ` | Perform cleanup and backup before stopping the gocd server. Supported value is a list. | `nil` |
| `agent.postStart` | Commands to run after agent startup. | `nil` |
| `agent.terminationGracePeriodSeconds` | Optional duration in seconds the gocd agent pods need to terminate gracefully. | `nil` |
| `agent.deployStrategy` | GoCD Agent [deployment strategy](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy). | `{}` |
| `agent.image.repository` | GoCD agent image | `gocd/gocd-agent-alpine-3.6` |
@@ -144,12 +144,20 @@ spec:
readOnly: true
mountPath: /home/go/.ssh
{{- end }}
{{- if .Values.agent.preStop }}
{{- if or .Values.agent.preStop .Values.agent.postStart }}
lifecycle:
{{- if .Values.agent.preStop }}
preStop:
exec:
command:
{{ toYaml .Values.agent.preStop | indent 18 }}
{{- end }}
{{- if .Values.agent.postStart }}
postStart:
exec:
command:
{{ toYaml .Values.agent.postStart | indent 18 }}
{{- end }}
{{- end }}
securityContext:
privileged: {{ .Values.agent.privileged }}
+5 -1
View File
@@ -242,10 +242,14 @@ agent:
fsGroup: 0
# agent.replicaCount is the GoCD Agent replicas Count. Specify the number of GoCD agents to run
replicaCount: 0
# agent.preStop - array of commands to use in the agent pre-stop lifecycle hook
# agent.preStop - array of command and arguments to run in the agent pre-stop lifecycle hook
# preStop:
# - "/bin/bash"
# - "/disable_and_stop.sh"
# agent.postStart - array of command and arguments to run in agent post-start lifecycle hook
# postStart:
# - "/bin/bash"
# - "/agent_startup.sh"
# agent.deployStrategy is the strategy explained in detail at https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
# agent.terminationGracePeriodSeconds is the optional duration in seconds the gocd agent pods need to terminate gracefully.
# Note: SIGTERM is issued immediately after the pod deletion request is sent. If the pod doesn't terminate, k8s waits for terminationGracePeriodSeconds before issuing SIGKILL.