Skip to content

Commit

Permalink
Added extraConfig helm field, so configuration can be better describe… (
Browse files Browse the repository at this point in the history
#25)

* Added extraConfig helm field, so configuration can be better described declaratively

* Switched to single quotes for the exclude namespaces configmap field, since these namespaces can be regex, which results in wrong escaping with double quotes

* removed blank between exclude namespace items

* adjusted README

---------

Co-authored-by: gmi <[email protected]>
Co-authored-by: Johannes Thiem <[email protected]>
  • Loading branch information
3 people authored May 7, 2024
1 parent b9c23ca commit 4628362
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ name: py-kube-downscaler
description: A Helm chart for deploying py-kube-downscaler

type: application
version: 0.1.1
version: 0.2.0
appVersion: "24.4.0"
3 changes: 2 additions & 1 deletion chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ This repository offers a Helm chart for the `py-kube-downscaler`.
| image.tag | string | `"23.2.0@sha256:4129e7e7551eb451ee2b43680ef818f3057304ad50888f79ec9722afab6c29ff"` | Tag of the image to use |
| arguments | list | `[--interval=60,--include-resources=deployments,statefulsets,horizontalpodautoscalers,scaledobjects]` | Arguments to pass to the kube-downscaler binary |
| excludedNamespaces | list | `["namespace-a", "namespace-b"]` | Namespaces to exclude from downscaling |
| extraConfig | string | `"DOWNSCALE_PERIOD: 'Mon-Sun 19:00-20:00 Europe/Berlin'"` | Additional configuration in ConfigMap format |

# Deploy py-kube-downscaler using Helm chart

This directory contains tutorial to deploy py-kube-downscaler.
This directory contains a tutorial to deploy py-kube-downscaler.

## Configuring your Deployment to downscale

Expand Down
5 changes: 4 additions & 1 deletion chart/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ metadata:
name: {{ include "py-kube-downscaler.name" . }}
data:
# downscale for non-work hours
EXCLUDE_NAMESPACES: "{{- join ", " .Values.excludedNamespaces }}"
EXCLUDE_NAMESPACES: '{{- join "," .Values.excludedNamespaces }}'
{{- if .Values.extraConfig }}
{{- tpl .Values.extraConfig . | nindent 2 }}
{{- end }}
7 changes: 7 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,10 @@ configMapName: py-kube-downscaler
excludedNamespaces:
- py-kube-downscaler
- kube-system

# Additional config in the configmap.
# Add configmap lines via the multiline Operator |
# e.g.:
# extraConfig: |
# DOWNSCALE_PERIOD: "Mon-Sun 19:00-20:00 Europe/Berlin"
extraConfig: ""

0 comments on commit 4628362

Please sign in to comment.