Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAM-25528: Unset pre-stop hook for bamboo-agent #719

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/charts/bamboo-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Kubernetes: `>=1.21.x-0`
| agent.securityToken.secretKey | string | `"security-token"` | |
| agent.securityToken.secretName | string | `nil` | The name of the K8s Secret that contains the security token. When specified the token will be automatically utilised on agent boot. An Example of creating a K8s secret for the secret below: 'kubectl create secret generic <secret-name> --from-literal=security-token=<security token>' https://kubernetes.io/docs/concepts/configuration/secret/#opaque-secrets |
| agent.server | string | `nil` | |
| agent.shutdown.command | string | `"/shutdown-wait.sh"` | By default pods will be stopped via a [preStop hook](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/), using a script supplied by the Docker image. If any other shutdown behaviour is needed it can be achieved by overriding this value. Note that the shutdown command needs to wait for the application shutdown completely before exiting; see [the default command](https://bitbucket.org/atlassian-docker/docker-bamboo-agent-base/src/master/shutdown-wait.sh) for details. |
| agent.shutdown.command | string | `nil` | Custom command for a [preStop hook](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/). Undefined by default which means no pre-stop hook is being executed when an agent container needs to be stopped and deleted |
| agent.shutdown.terminationGracePeriodSeconds | int | `30` | The termination grace period for pods during shutdown. This should be set to the internal grace period, plus a small buffer to allow the JVM to fully terminate. |
| agent.startupProbe.command | string | `"/probe-startup.sh"` | Command to use to check the startup status. This is provided by the agent image. |
| agent.startupProbe.failureThreshold | int | `120` | The number of consecutive failures of the Bamboo agent container startup probe before the pod fails readiness checks. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,12 @@ spec:
ports:
{{- include "agent.additionalPorts" . | nindent 12 }}
{{- end }}

{{- if .Values.agent.shutdown.command }}
lifecycle:
preStop:
exec:
command: ["sh", "-c", {{ .Values.agent.shutdown.command | quote }}]
{{- end }}
{{- include "agent.additionalContainers" . | nindent 8 }}
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
11 changes: 3 additions & 8 deletions src/main/charts/bamboo-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,10 @@ agent:
#
terminationGracePeriodSeconds: 30

# -- By default pods will be stopped via a [preStop hook](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/),
# using a script supplied by the Docker image. If any other
# shutdown behaviour is needed it can be achieved by overriding
# this value. Note that the shutdown command needs to wait for the
# application shutdown completely before exiting; see [the default
# command](https://bitbucket.org/atlassian-docker/docker-bamboo-agent-base/src/master/shutdown-wait.sh)
# for details.
# -- Custom command for a [preStop hook](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/).
# Undefined by default which means no pre-stop hook is being executed when an agent container needs to be stopped and deleted
#
command: "/shutdown-wait.sh"
command:

# Pod resource requests
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,5 @@ spec:
cpu: "1"
memory: 2G
volumeMounts:
lifecycle:
preStop:
exec:
command: ["sh", "-c", "/shutdown-wait.sh"]
priorityClassName: high
volumes:
Loading