diff --git a/install/kubernetes/github-actions-cache-server/Chart.yaml b/install/kubernetes/github-actions-cache-server/Chart.yaml index 3365c67..637ceee 100644 --- a/install/kubernetes/github-actions-cache-server/Chart.yaml +++ b/install/kubernetes/github-actions-cache-server/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.2.0 +version: 1.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/install/kubernetes/github-actions-cache-server/templates/deployment.yaml b/install/kubernetes/github-actions-cache-server/templates/deployment.yaml index bf977d9..97498e9 100644 --- a/install/kubernetes/github-actions-cache-server/templates/deployment.yaml +++ b/install/kubernetes/github-actions-cache-server/templates/deployment.yaml @@ -38,6 +38,9 @@ spec: {{- if .Values.topologySpreadConstraints }} topologySpreadConstraints: {{- toYaml .Values.topologySpreadConstraints | nindent 8 }} {{- end }} + {{- if .Values.terminationGracePeriodSeconds }} + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} + {{- end }} containers: - name: {{ .Chart.Name }} securityContext: @@ -54,6 +57,10 @@ spec: {{- toYaml .Values.readinessProbe | nindent 12 }} resources: {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.lifecycle }} + lifecycle: + {{- toYaml . | nindent 12 }} + {{- end }} {{- if or (eq $pvcEnabled "true") .Values.extraVolumeMounts }} volumeMounts: {{- if eq $pvcEnabled "true" }} diff --git a/install/kubernetes/github-actions-cache-server/templates/hpa.yaml b/install/kubernetes/github-actions-cache-server/templates/hpa.yaml index e51cc12..1fde30e 100644 --- a/install/kubernetes/github-actions-cache-server/templates/hpa.yaml +++ b/install/kubernetes/github-actions-cache-server/templates/hpa.yaml @@ -13,6 +13,10 @@ spec: name: {{ include "github-actions-cache-server.fullname" . }} minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} + {{- with .Values.autoscaling.behavior }} + behavior: + {{- toYaml . | nindent 4 }} + {{- end }} metrics: {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - type: Resource diff --git a/install/kubernetes/github-actions-cache-server/values.yaml b/install/kubernetes/github-actions-cache-server/values.yaml index 591d300..de121b7 100644 --- a/install/kubernetes/github-actions-cache-server/values.yaml +++ b/install/kubernetes/github-actions-cache-server/values.yaml @@ -217,6 +217,25 @@ autoscaling: maxReplicas: 10 targetCPUUtilizationPercentage: 70 targetMemoryUtilizationPercentage: 70 + # -- Scaling behavior for the HPA (`spec.behavior`), passed through verbatim. + # Empty by default, so Kubernetes applies its own defaults. + # Useful to damp scale-down flapping, e.g. + # `scaleDown: {stabilizationWindowSeconds: 900, policies: [{type: Pods, value: 1, periodSeconds: 300}]}`. + behavior: {} + +# -- Container lifecycle hooks (`lifecycle`), passed through verbatim. +# Empty by default. A `preStop` hook is the usual way to let in-flight requests +# finish: the container keeps serving while the Service endpoint removal +# propagates to ingress controllers, which is asynchronous. For example +# `preStop: {exec: {command: [/bin/sh, -c, sleep 30]}}` — pair it with a +# terminationGracePeriodSeconds larger than the sleep, or the kubelet will +# SIGKILL the container mid-hook. +lifecycle: {} + +# -- Grace period for pod termination (`terminationGracePeriodSeconds`). +# Empty by default, so Kubernetes applies its default of 30. +# Must exceed any `lifecycle.preStop` sleep above. +terminationGracePeriodSeconds: '' # -- Pod Disruption Budget configuration. # Disabled by default. When enabled, defaults to maxUnavailable: 1.