From e20981b9ca279d1dbc6692f2b8046e2bb01a4e43 Mon Sep 17 00:00:00 2001 From: Jonathan Mayer Date: Thu, 24 Oct 2024 15:50:12 +0200 Subject: [PATCH 01/22] fix: invalid email in pre commit workflow (#66) --- .github/workflows/pre_commit.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre_commit.yaml b/.github/workflows/pre_commit.yaml index ad7cfbd..8859a85 100644 --- a/.github/workflows/pre_commit.yaml +++ b/.github/workflows/pre_commit.yaml @@ -30,8 +30,8 @@ jobs: SKIP: "no-commit-to-branch" # if not skipped, will always fail on main - name: Push changes run: | - git config --global user.name "github-actions" - git config --global user.email "github-actions@github.com" + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" git add . if git diff-index --quiet HEAD; then echo "No changes were made" From 0309fa8f379589c53deb9978b7b3dd90ee4535a1 Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 25 Oct 2024 11:45:35 +0200 Subject: [PATCH 02/22] feat: added installation guide --- .../getting-started/0 - Installation.md | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/website/content/guides/getting-started/0 - Installation.md b/website/content/guides/getting-started/0 - Installation.md index fff0c8d..8e7d54f 100644 --- a/website/content/guides/getting-started/0 - Installation.md +++ b/website/content/guides/getting-started/0 - Installation.md @@ -3,4 +3,30 @@ title: Installation id: installation --- -# Installation +We provide a Helm Chart for an easy installation of the GoKubeDownscaler. + +## Prerequisits +In order to get started installing the GoKubeDownscaler using our Helm Chart you need: +- Helm installed on a system +- have access to a Kubernetes cluster in some kind of way. + +You can find out how to install Helm [here](https://helm.sh/docs/intro/). + +Also make sure your context is set to the right cluster and namespace where you want to deploy the GoKubeDownscaler. + +## Install the chart + +In order to install the chart you only need to add our Helm Chart repository by running: + +```bash +helm repo add caas-team https://caas-team.github.io/helm-charts/ +``` + +Followed by the actual install command: +```bash +helm install go-kube-downscaler caas-team/go-kube-downscaler +``` + +Now the GoKubeDownscaler should be properly installed. + +You can find out how to customize your installation of the GoKubeDownscaler [here](http://localhost:3000/GoKubeDownscaler/docs/helm-chart/Values). From fab90f17a9baf2bb5751cbaff6cc263c8a1a8978 Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 25 Oct 2024 11:45:57 +0200 Subject: [PATCH 03/22] feat: added prometheuses to values.yaml --- deployments/chart/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/deployments/chart/values.yaml b/deployments/chart/values.yaml index 0ecf8e8..11f40d5 100644 --- a/deployments/chart/values.yaml +++ b/deployments/chart/values.yaml @@ -18,6 +18,7 @@ includedResources: # - scaledobjects # - stacks # - poddisruptionbudgets +# - prometheuses fullnameOverride: "" nameOverride: "" From e5bdc2c0868c9e9877058b45a12a45f8aeb14cf2 Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 25 Oct 2024 11:46:47 +0200 Subject: [PATCH 04/22] feat: added helm chart sidebar to docs --- website/content/docs/index.mdx | 5 ----- website/sidebars.ts | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) delete mode 100644 website/content/docs/index.mdx diff --git a/website/content/docs/index.mdx b/website/content/docs/index.mdx deleted file mode 100644 index b3d30c9..0000000 --- a/website/content/docs/index.mdx +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Documentation ---- - -# Documentation diff --git a/website/sidebars.ts b/website/sidebars.ts index 26162ac..76f09fc 100644 --- a/website/sidebars.ts +++ b/website/sidebars.ts @@ -3,8 +3,20 @@ import type { SidebarsConfig } from "@docusaurus/plugin-content-docs"; const sidebars: SidebarsConfig = { DocsSidebar: [ { - type: "autogenerated", - dirName: "docs", + type: "category", + label: "Helm Chart", + link: { + type: "generated-index", + title: "Helm Chart", + description: "Documentation about contents of the Helm chart.", + slug: "/docs/helm-chart", + }, + items: [ + { + type: "autogenerated", + dirName: "docs/helm-chart", + }, + ], }, ], GuidesSidebar: [ From 49863cdb07879e062a26883d8ad5418831c883cc Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 25 Oct 2024 14:25:11 +0200 Subject: [PATCH 05/22] chore: add pre-commit whinery --- website/content/guides/getting-started/0 - Installation.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/content/guides/getting-started/0 - Installation.md b/website/content/guides/getting-started/0 - Installation.md index 8e7d54f..ca6a50a 100644 --- a/website/content/guides/getting-started/0 - Installation.md +++ b/website/content/guides/getting-started/0 - Installation.md @@ -6,7 +6,9 @@ id: installation We provide a Helm Chart for an easy installation of the GoKubeDownscaler. ## Prerequisits + In order to get started installing the GoKubeDownscaler using our Helm Chart you need: + - Helm installed on a system - have access to a Kubernetes cluster in some kind of way. @@ -23,6 +25,7 @@ helm repo add caas-team https://caas-team.github.io/helm-charts/ ``` Followed by the actual install command: + ```bash helm install go-kube-downscaler caas-team/go-kube-downscaler ``` From 82a39a8fd50fcdfdea001b2ee30078e60a32f2fa Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 25 Oct 2024 15:13:06 +0200 Subject: [PATCH 06/22] feat: add skeleton markdown files --- .../content/docs/helm-chart/0 - Components.md | 28 +++++++++++++++++++ .../helm-chart/Values/0 - replicaCount.md | 8 ++++++ .../docs/helm-chart/Values/1 - image.md | 8 ++++++ .../helm-chart/Values/10 - securityContext.md | 8 ++++++ .../docs/helm-chart/Values/11 - resources.md | 8 ++++++ .../helm-chart/Values/12 - nodeSelector.md | 8 ++++++ .../helm-chart/Values/13 - tolerations.md | 8 ++++++ .../docs/helm-chart/Values/14 - affinity.md | 8 ++++++ .../helm-chart/Values/15 - configMapName.md | 8 ++++++ .../Values/16 - excludedNamespaces.md | 8 ++++++ .../helm-chart/Values/17 - extraConfig.md | 8 ++++++ .../docs/helm-chart/Values/2 - arguments.md | 8 ++++++ .../Values/3 - includedResources.md | 8 ++++++ .../helm-chart/Values/4 - fullnameOverride.md | 8 ++++++ .../helm-chart/Values/5 - nameOverride.md | 8 ++++++ .../Values/6 - constrainedDownscaler.md | 8 ++++++ .../Values/7 - constrainedNamespaces.md | 8 ++++++ .../helm-chart/Values/8 - serviceAccount.md | 8 ++++++ .../Values/9 - podSecurityContext.md | 8 ++++++ 19 files changed, 172 insertions(+) create mode 100644 website/content/docs/helm-chart/0 - Components.md create mode 100644 website/content/docs/helm-chart/Values/0 - replicaCount.md create mode 100644 website/content/docs/helm-chart/Values/1 - image.md create mode 100644 website/content/docs/helm-chart/Values/10 - securityContext.md create mode 100644 website/content/docs/helm-chart/Values/11 - resources.md create mode 100644 website/content/docs/helm-chart/Values/12 - nodeSelector.md create mode 100644 website/content/docs/helm-chart/Values/13 - tolerations.md create mode 100644 website/content/docs/helm-chart/Values/14 - affinity.md create mode 100644 website/content/docs/helm-chart/Values/15 - configMapName.md create mode 100644 website/content/docs/helm-chart/Values/16 - excludedNamespaces.md create mode 100644 website/content/docs/helm-chart/Values/17 - extraConfig.md create mode 100644 website/content/docs/helm-chart/Values/2 - arguments.md create mode 100644 website/content/docs/helm-chart/Values/3 - includedResources.md create mode 100644 website/content/docs/helm-chart/Values/4 - fullnameOverride.md create mode 100644 website/content/docs/helm-chart/Values/5 - nameOverride.md create mode 100644 website/content/docs/helm-chart/Values/6 - constrainedDownscaler.md create mode 100644 website/content/docs/helm-chart/Values/7 - constrainedNamespaces.md create mode 100644 website/content/docs/helm-chart/Values/8 - serviceAccount.md create mode 100644 website/content/docs/helm-chart/Values/9 - podSecurityContext.md diff --git a/website/content/docs/helm-chart/0 - Components.md b/website/content/docs/helm-chart/0 - Components.md new file mode 100644 index 0000000..f6c1570 --- /dev/null +++ b/website/content/docs/helm-chart/0 - Components.md @@ -0,0 +1,28 @@ +--- +title: Components +id: components +--- + +# Components + +The GoKubeDownscaler Helm Chart can create the following Kubernetes Objects: + +## Deployment + +The [deployment.yaml](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/deployment.yaml) file creates the main Deployment of the GoKubeDownscaler with a reference to the provided ServiceAccount and ConfigMap. + +## Serviceaccount + +The [serviceaccount.yaml](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/serviceaccount.yaml) file creates a ServiceAccount that will be used by the go-kube-downscaler to interact with Kubernetes. + +## Configmap + +The [configmap.yaml](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/configmap.yaml) file creates a new ConfigMap with the provided name. It is used to store environment variables like `EXCLUDE_NAMESPACES`. + +## Clusterrole + +The [clusterrole.yaml](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/clusterrole.yaml) file creates a ClusterRole and a ClusterRoleBinding for the desired cluster if [constrainedDownscaler](http://localhost:3000/GoKubeDownscaler/docs/helm-chart/Values) is set to false. These allow the actions the GoKubeDownscaler needs to scale down workloads in a clusterwide context. + +## Role + +The [role.yaml](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/role.yaml) file creates a Role and a RoleBinding for every namespace listed in [constrainedNamespaces](http://localhost:3000/GoKubeDownscaler/docs/helm-chart/Values) if [constrainedDownscaler](http://localhost:3000/GoKubeDownscaler/docs/helm-chart/Values) is set to true. diff --git a/website/content/docs/helm-chart/Values/0 - replicaCount.md b/website/content/docs/helm-chart/Values/0 - replicaCount.md new file mode 100644 index 0000000..b01e821 --- /dev/null +++ b/website/content/docs/helm-chart/Values/0 - replicaCount.md @@ -0,0 +1,8 @@ +--- +title: replicaCount +id: replicaCount +--- + +# replicaCount + +Adjusts the number of replicas that the go-kube-downscaler deployment will have. diff --git a/website/content/docs/helm-chart/Values/1 - image.md b/website/content/docs/helm-chart/Values/1 - image.md new file mode 100644 index 0000000..784033e --- /dev/null +++ b/website/content/docs/helm-chart/Values/1 - image.md @@ -0,0 +1,8 @@ +--- +title: image +id: image +--- + +# image + +Contains the repository URL and the image tag for the image you want to use. diff --git a/website/content/docs/helm-chart/Values/10 - securityContext.md b/website/content/docs/helm-chart/Values/10 - securityContext.md new file mode 100644 index 0000000..338263c --- /dev/null +++ b/website/content/docs/helm-chart/Values/10 - securityContext.md @@ -0,0 +1,8 @@ +--- +title: securityContext +id: securityContext +--- + +# securityContext + +Defines the SecurityContext on container level. (More info [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)) diff --git a/website/content/docs/helm-chart/Values/11 - resources.md b/website/content/docs/helm-chart/Values/11 - resources.md new file mode 100644 index 0000000..fe20299 --- /dev/null +++ b/website/content/docs/helm-chart/Values/11 - resources.md @@ -0,0 +1,8 @@ +--- +title: resources +id: resources +--- + +# resources + +Defines the CPU and memory limits and requests. diff --git a/website/content/docs/helm-chart/Values/12 - nodeSelector.md b/website/content/docs/helm-chart/Values/12 - nodeSelector.md new file mode 100644 index 0000000..2630a8b --- /dev/null +++ b/website/content/docs/helm-chart/Values/12 - nodeSelector.md @@ -0,0 +1,8 @@ +--- +title: nodeSelector +id: nodeSelector +--- + +# nodeSelector + +Defines labels of nodes that you want the deployment to schedule them on. diff --git a/website/content/docs/helm-chart/Values/13 - tolerations.md b/website/content/docs/helm-chart/Values/13 - tolerations.md new file mode 100644 index 0000000..ba0b547 --- /dev/null +++ b/website/content/docs/helm-chart/Values/13 - tolerations.md @@ -0,0 +1,8 @@ +--- +title: tolerations +id: tolerations +--- + +# tolerations + +Adds tolerations to the pods of the deployment to be able to be scheduled on nodes with matching taints. (More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)) diff --git a/website/content/docs/helm-chart/Values/14 - affinity.md b/website/content/docs/helm-chart/Values/14 - affinity.md new file mode 100644 index 0000000..6e55a6f --- /dev/null +++ b/website/content/docs/helm-chart/Values/14 - affinity.md @@ -0,0 +1,8 @@ +--- +title: affinity +id: affinity +--- + +# affinity + +Defines rules for node affinity and pod affinity/anti-affinity. (More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) diff --git a/website/content/docs/helm-chart/Values/15 - configMapName.md b/website/content/docs/helm-chart/Values/15 - configMapName.md new file mode 100644 index 0000000..674e266 --- /dev/null +++ b/website/content/docs/helm-chart/Values/15 - configMapName.md @@ -0,0 +1,8 @@ +--- +title: configMapName +id: configMapName +--- + +# configMapName + +The name of the configmap for the go-kube-downscaler. diff --git a/website/content/docs/helm-chart/Values/16 - excludedNamespaces.md b/website/content/docs/helm-chart/Values/16 - excludedNamespaces.md new file mode 100644 index 0000000..1e8386e --- /dev/null +++ b/website/content/docs/helm-chart/Values/16 - excludedNamespaces.md @@ -0,0 +1,8 @@ +--- +title: excludedNamespaces +id: excludedNamespaces +--- + +# excludedNamespaces + +A list of namespaces that are supposed to be excluded from the downscaling process of the go-kube-downscaler. diff --git a/website/content/docs/helm-chart/Values/17 - extraConfig.md b/website/content/docs/helm-chart/Values/17 - extraConfig.md new file mode 100644 index 0000000..ed43e8f --- /dev/null +++ b/website/content/docs/helm-chart/Values/17 - extraConfig.md @@ -0,0 +1,8 @@ +--- +title: extraConfig +id: extraConfig +--- + +# extraConfig + +Adds additional specified environment variables to the ConfigMap. diff --git a/website/content/docs/helm-chart/Values/2 - arguments.md b/website/content/docs/helm-chart/Values/2 - arguments.md new file mode 100644 index 0000000..53f0959 --- /dev/null +++ b/website/content/docs/helm-chart/Values/2 - arguments.md @@ -0,0 +1,8 @@ +--- +title: arguments +id: arguments +--- + +# arguments + +Defines command line arguments for the container. diff --git a/website/content/docs/helm-chart/Values/3 - includedResources.md b/website/content/docs/helm-chart/Values/3 - includedResources.md new file mode 100644 index 0000000..bbfc16f --- /dev/null +++ b/website/content/docs/helm-chart/Values/3 - includedResources.md @@ -0,0 +1,8 @@ +--- +title: includedResources +id: includedResources +--- + +# includedResources + +Defines all the resources that the go-kube-downscaler is supposed to be able to handle. diff --git a/website/content/docs/helm-chart/Values/4 - fullnameOverride.md b/website/content/docs/helm-chart/Values/4 - fullnameOverride.md new file mode 100644 index 0000000..267c920 --- /dev/null +++ b/website/content/docs/helm-chart/Values/4 - fullnameOverride.md @@ -0,0 +1,8 @@ +--- +title: fullnameOverride +id: fullnameOverride +--- + +# fullnameOverride + +Overrides the full names of the created Kubernetes resources with the provided name if set. diff --git a/website/content/docs/helm-chart/Values/5 - nameOverride.md b/website/content/docs/helm-chart/Values/5 - nameOverride.md new file mode 100644 index 0000000..26a487b --- /dev/null +++ b/website/content/docs/helm-chart/Values/5 - nameOverride.md @@ -0,0 +1,8 @@ +--- +title: nameOverride +id: nameOverride +--- + +# nameOverride + +Overrides the chart name for the created Kubernetes resources. diff --git a/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.md b/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.md new file mode 100644 index 0000000..2a45135 --- /dev/null +++ b/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.md @@ -0,0 +1,8 @@ +--- +title: constrainedDownscaler +id: constrainedDownscaler +--- + +# constrainedDownscaler + +Sets the go-kube-downscaler to a constrained state if true, meaning that it does not run clusterwide but restricted to a list of namespaces. These namespaces are listed in [constrainedNamespaces](#constrainedNamespaces). diff --git a/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.md b/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.md new file mode 100644 index 0000000..71d45de --- /dev/null +++ b/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.md @@ -0,0 +1,8 @@ +--- +title: constrainedNamespaces +id: constrainedNamespaces +--- + +# constrainedNamespaces + +A list of namespaces the go-kube-downscaler is going to operate on when constrained. diff --git a/website/content/docs/helm-chart/Values/8 - serviceAccount.md b/website/content/docs/helm-chart/Values/8 - serviceAccount.md new file mode 100644 index 0000000..39da1e7 --- /dev/null +++ b/website/content/docs/helm-chart/Values/8 - serviceAccount.md @@ -0,0 +1,8 @@ +--- +title: serviceAccount +id: serviceAccount +--- + +# serviceAccount + +Specifies whether a new ServiceAccount is supposed to be created and if not, what the name of the ServiceAccount to use is. diff --git a/website/content/docs/helm-chart/Values/9 - podSecurityContext.md b/website/content/docs/helm-chart/Values/9 - podSecurityContext.md new file mode 100644 index 0000000..337201b --- /dev/null +++ b/website/content/docs/helm-chart/Values/9 - podSecurityContext.md @@ -0,0 +1,8 @@ +--- +title: podSecurityContext +id: podSecurityContext +--- + +# podSecurityContext + +Defines the SecurityContext on pod level. (More info [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)) From 6f43f4a796ced89a0a4acc9451d6a8367835a74e Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 28 Oct 2024 08:55:41 +0100 Subject: [PATCH 07/22] refactored configMap parameters --- deployments/chart/templates/configmap.yaml | 6 +++--- deployments/chart/values.yaml | 15 +++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/deployments/chart/templates/configmap.yaml b/deployments/chart/templates/configmap.yaml index 14e6034..8232e9e 100644 --- a/deployments/chart/templates/configmap.yaml +++ b/deployments/chart/templates/configmap.yaml @@ -1,10 +1,10 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Values.configMapName }} + name: {{ .Values.configMap.name }} data: # downscale for non-work hours EXCLUDE_NAMESPACES: '{{- join "," .Values.excludedNamespaces }}' - {{- if .Values.extraConfig }} - {{- tpl .Values.extraConfig . | nindent 2 }} + {{- if .Values.configMap.extraConfig }} + {{- tpl .Values.configMap.extraConfig . | nindent 2 }} {{- end }} diff --git a/deployments/chart/values.yaml b/deployments/chart/values.yaml index 11f40d5..5f2b5bf 100644 --- a/deployments/chart/values.yaml +++ b/deployments/chart/values.yaml @@ -61,15 +61,14 @@ tolerations: [] affinity: {} -configMapName: go-kube-downscaler - excludedNamespaces: - 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: "" +configMap: + name: go-kube-downscaler + # extraConfig adds lines to the configmap + # e.g.: + # extraConfig: | + # DOWNSCALE_PERIOD: "Mon-Sun 19:00-20:00 Europe/Berlin" + extraConfig: "" From ea0389724fcdc5d8675bc6ba85bc01f730bcbe34 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 28 Oct 2024 09:11:29 +0100 Subject: [PATCH 08/22] refactor site structure --- .../docs/helm-chart/Values/15 - configMapName.md | 8 -------- ...xcludedNamespaces.md => 15 - excludedNamespaces.md} | 0 .../content/docs/helm-chart/Values/16 - configMap.md | 10 ++++++++++ .../content/docs/helm-chart/Values/17 - extraConfig.md | 8 -------- 4 files changed, 10 insertions(+), 16 deletions(-) delete mode 100644 website/content/docs/helm-chart/Values/15 - configMapName.md rename website/content/docs/helm-chart/Values/{16 - excludedNamespaces.md => 15 - excludedNamespaces.md} (100%) create mode 100644 website/content/docs/helm-chart/Values/16 - configMap.md delete mode 100644 website/content/docs/helm-chart/Values/17 - extraConfig.md diff --git a/website/content/docs/helm-chart/Values/15 - configMapName.md b/website/content/docs/helm-chart/Values/15 - configMapName.md deleted file mode 100644 index 674e266..0000000 --- a/website/content/docs/helm-chart/Values/15 - configMapName.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: configMapName -id: configMapName ---- - -# configMapName - -The name of the configmap for the go-kube-downscaler. diff --git a/website/content/docs/helm-chart/Values/16 - excludedNamespaces.md b/website/content/docs/helm-chart/Values/15 - excludedNamespaces.md similarity index 100% rename from website/content/docs/helm-chart/Values/16 - excludedNamespaces.md rename to website/content/docs/helm-chart/Values/15 - excludedNamespaces.md diff --git a/website/content/docs/helm-chart/Values/16 - configMap.md b/website/content/docs/helm-chart/Values/16 - configMap.md new file mode 100644 index 0000000..93450e5 --- /dev/null +++ b/website/content/docs/helm-chart/Values/16 - configMap.md @@ -0,0 +1,10 @@ +--- +title: configMap +id: configMap +--- + +# configMap + +The name of the configmap for the go-kube-downscaler. + +extraConfig adds additional specified environment variables to the ConfigMap. diff --git a/website/content/docs/helm-chart/Values/17 - extraConfig.md b/website/content/docs/helm-chart/Values/17 - extraConfig.md deleted file mode 100644 index ed43e8f..0000000 --- a/website/content/docs/helm-chart/Values/17 - extraConfig.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: extraConfig -id: extraConfig ---- - -# extraConfig - -Adds additional specified environment variables to the ConfigMap. From 3d2400759473994d67f6938b1a9ec084f95bc874 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 28 Oct 2024 10:19:41 +0100 Subject: [PATCH 09/22] changed comment --- deployments/chart/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/chart/values.yaml b/deployments/chart/values.yaml index 5f2b5bf..3f17e35 100644 --- a/deployments/chart/values.yaml +++ b/deployments/chart/values.yaml @@ -2,7 +2,7 @@ replicaCount: 1 image: repository: ghcr.io/caas-team/gokubedownscaler - tag: "" # Dynamically set from CI + tag: "" # Defaults to appVersion arguments: # - --interval=60 From f1b3ce785ce70913a0cb509d3fbbd496d5a50b45 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 28 Oct 2024 15:36:09 +0100 Subject: [PATCH 10/22] add default values --- .../helm-chart/Values/0 - replicaCount.md | 13 +- .../docs/helm-chart/Values/1 - image.md | 19 ++- .../helm-chart/Values/10 - securityContext.md | 12 ++ .../docs/helm-chart/Values/11 - resources.md | 12 ++ .../helm-chart/Values/12 - nodeSelector.md | 6 + .../helm-chart/Values/13 - tolerations.md | 6 + .../docs/helm-chart/Values/14 - affinity.md | 6 + .../Values/15 - excludedNamespaces.md | 8 ++ .../docs/helm-chart/Values/16 - configMap.md | 8 ++ .../docs/helm-chart/Values/2 - arguments.md | 128 +++++++++++++++++- .../Values/3 - includedResources.md | 7 + .../helm-chart/Values/4 - fullnameOverride.md | 6 + .../helm-chart/Values/5 - nameOverride.md | 6 + .../Values/6 - constrainedDownscaler.md | 6 + .../Values/7 - constrainedNamespaces.md | 6 + .../helm-chart/Values/8 - serviceAccount.md | 8 ++ .../Values/9 - podSecurityContext.md | 11 ++ 17 files changed, 265 insertions(+), 3 deletions(-) diff --git a/website/content/docs/helm-chart/Values/0 - replicaCount.md b/website/content/docs/helm-chart/Values/0 - replicaCount.md index b01e821..e754ab5 100644 --- a/website/content/docs/helm-chart/Values/0 - replicaCount.md +++ b/website/content/docs/helm-chart/Values/0 - replicaCount.md @@ -5,4 +5,15 @@ id: replicaCount # replicaCount -Adjusts the number of replicas that the go-kube-downscaler deployment will have. +`replicaCount` adjusts the number of replicas that the GoKubeDownscaler deployment will have. + +> ℹ️ **The default value of `replicaCount` is:** +> +> ```yaml +> replicaCount: 1 +> ``` + +Changing this to a different integer value will result in the deployment of the provided number of pods. + +> ⚠️ **Warning**\ +> This value should not be changed because multiple instances of the GoKubeDownscaler would be fighting about downscaling the targeted resources. diff --git a/website/content/docs/helm-chart/Values/1 - image.md b/website/content/docs/helm-chart/Values/1 - image.md index 784033e..e82d6ee 100644 --- a/website/content/docs/helm-chart/Values/1 - image.md +++ b/website/content/docs/helm-chart/Values/1 - image.md @@ -5,4 +5,21 @@ id: image # image -Contains the repository URL and the image tag for the image you want to use. +`image` contains the two fields `repository` and `tag`: + +- `repository` is the repository URL where the image versions of the GoKubeDownscaler are located. +- `tag` is the version tag of the image. + +> ℹ️ **The default values for `image` are:** +> +> ```yaml +> image: +> repository: ghcr.io/caas-team/gokubedownscaler +> tag: "" +> ``` + +Changing the value of `repository` will result in the images being pulled from another location. It is advised to leave this as is unless you want or need to pull the images from a private registry of your choice. + +Changing the value of `tag` will deploy a different version of the GoKubeDownscaler. If left empty like it is by default the GoKubeDownscaler will use the [appVersion](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/Chart.yaml#L10) of the currently used Helm Chart. + +More details to versions of the GoKubeDownscaler can be found [here](https://github.com/caas-team/GoKubeDownscaler/releases). diff --git a/website/content/docs/helm-chart/Values/10 - securityContext.md b/website/content/docs/helm-chart/Values/10 - securityContext.md index 338263c..fc24832 100644 --- a/website/content/docs/helm-chart/Values/10 - securityContext.md +++ b/website/content/docs/helm-chart/Values/10 - securityContext.md @@ -6,3 +6,15 @@ id: securityContext # securityContext Defines the SecurityContext on container level. (More info [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)) + +> ℹ️ **The default values for `securityContext` are:** +> +> ```yaml +> securityContext: +> readOnlyRootFilesystem: true +> allowPrivilegeEscalation: false +> privileged: false +> capabilities: +> drop: +> - ALL +> ``` diff --git a/website/content/docs/helm-chart/Values/11 - resources.md b/website/content/docs/helm-chart/Values/11 - resources.md index fe20299..180cf3c 100644 --- a/website/content/docs/helm-chart/Values/11 - resources.md +++ b/website/content/docs/helm-chart/Values/11 - resources.md @@ -6,3 +6,15 @@ id: resources # resources Defines the CPU and memory limits and requests. + +> ℹ️ **The default values for `resources` are:** +> +> ```yaml +> resources: +> limits: +> cpu: 500m +> memory: 900Mi +> requests: +> cpu: 200m +> memory: 300Mi +> ``` diff --git a/website/content/docs/helm-chart/Values/12 - nodeSelector.md b/website/content/docs/helm-chart/Values/12 - nodeSelector.md index 2630a8b..a396b8e 100644 --- a/website/content/docs/helm-chart/Values/12 - nodeSelector.md +++ b/website/content/docs/helm-chart/Values/12 - nodeSelector.md @@ -6,3 +6,9 @@ id: nodeSelector # nodeSelector Defines labels of nodes that you want the deployment to schedule them on. + +> ℹ️ **The default value for `nodeSelector` is:** +> +> ```yaml +> nodeSelector: {} +> ``` diff --git a/website/content/docs/helm-chart/Values/13 - tolerations.md b/website/content/docs/helm-chart/Values/13 - tolerations.md index ba0b547..a7b7eda 100644 --- a/website/content/docs/helm-chart/Values/13 - tolerations.md +++ b/website/content/docs/helm-chart/Values/13 - tolerations.md @@ -6,3 +6,9 @@ id: tolerations # tolerations Adds tolerations to the pods of the deployment to be able to be scheduled on nodes with matching taints. (More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)) + +> ℹ️ **The default value for `tolerations` is:** +> +> ```yaml +> tolerations: [] +> ``` diff --git a/website/content/docs/helm-chart/Values/14 - affinity.md b/website/content/docs/helm-chart/Values/14 - affinity.md index 6e55a6f..c8883cc 100644 --- a/website/content/docs/helm-chart/Values/14 - affinity.md +++ b/website/content/docs/helm-chart/Values/14 - affinity.md @@ -6,3 +6,9 @@ id: affinity # affinity Defines rules for node affinity and pod affinity/anti-affinity. (More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) + +> ℹ️ **The default value for `affinity` is:** +> +> ```yaml +> affinity: {} +> ``` diff --git a/website/content/docs/helm-chart/Values/15 - excludedNamespaces.md b/website/content/docs/helm-chart/Values/15 - excludedNamespaces.md index 1e8386e..68bb1d1 100644 --- a/website/content/docs/helm-chart/Values/15 - excludedNamespaces.md +++ b/website/content/docs/helm-chart/Values/15 - excludedNamespaces.md @@ -6,3 +6,11 @@ id: excludedNamespaces # excludedNamespaces A list of namespaces that are supposed to be excluded from the downscaling process of the go-kube-downscaler. + +> ℹ️ **The default value for `excludedNamespaces` is:** +> +> ```yaml +> excludedNamespaces: +> - kube-downscaler +> - kube-system +> ``` diff --git a/website/content/docs/helm-chart/Values/16 - configMap.md b/website/content/docs/helm-chart/Values/16 - configMap.md index 93450e5..5caabf3 100644 --- a/website/content/docs/helm-chart/Values/16 - configMap.md +++ b/website/content/docs/helm-chart/Values/16 - configMap.md @@ -8,3 +8,11 @@ id: configMap The name of the configmap for the go-kube-downscaler. extraConfig adds additional specified environment variables to the ConfigMap. + +> ℹ️ **The default values for `configMap` are:** +> +> ```yaml +> configMap: +> name: go-kube-downscaler +> extraConfig: "" +> ``` diff --git a/website/content/docs/helm-chart/Values/2 - arguments.md b/website/content/docs/helm-chart/Values/2 - arguments.md index 53f0959..113ddb0 100644 --- a/website/content/docs/helm-chart/Values/2 - arguments.md +++ b/website/content/docs/helm-chart/Values/2 - arguments.md @@ -5,4 +5,130 @@ id: arguments # arguments -Defines command line arguments for the container. +`arguments` set [layer values](#values) and runtime configuration at the start of the program. See the [layers concept](#layers) for more details on which of the layers [values](#values) will be used. + +> ℹ️ **The default value for `arguments` is:** +> +> ```yaml +> arguments: +> ``` + +By default the `arguments` value is empty. Setting arguments can change how the GoKubeDownscaler behaves. + +Possible values are: + +## Layer Values: + +- ### --upscale-period + sets the [upscale-period](#upscale-period) value on the [cli layer](#cli-layer) + ```yaml + arguments: + - --upscale-period= + ``` +- ### --default-uptime + sets the [uptime](#uptime) value on the [cli layer](#cli-layer) + ```yaml + arguments: + - --default-uptime= + ``` +- ### --downscale-period + sets the [downscale-period](#downscale-period) value on the [cli layer](#cli-layer) + ```yaml + arguments: + - --downscale-period= + ``` +- ### --default-downtime + sets the [downtime](#downtime) value on the [cli layer](#cli-layer) + ```yaml + arguments: + - --default-downtime= + ``` +- ### --downtime-replicas + sets the [downscale replicas](#downscale-replicas) value on the [cli layer](#cli-layer) + ```yaml + arguments: + - --downtime-replicas= + ``` +- ### --explicit-include + sets the [exclude value](#exclude) on the [cli layer](#cli-layer) to true, which excludes every workload unless the exclude value on the [workload](#workload-layer) or [namespace](#namespace-layer) layer is set to false. See the [layers concept](#layers) for more details. + ```yaml + arguments: + - --explicit-include= + ``` + +## Runtime Configuration: + +- ### --dry-run + `--dry-run` takes a boolean value that defaults to `false`.\ + If you set: + ```yaml + arguments: + - --dry-run=true + ``` + the GoKubeDownscaler will be set into dry run mode, which makes it only print the actions it would have performed instead of actually scaling resources. +- ### --debug + `--debug` takes a boolean value that defaults to `false`.\ + makes the downscaler print more/debug information on what it currently does and what happens to the workloads. + ```yaml + arguments: + - --debug=true + ``` +- ### --once + `--once` takes a boolean value that defaults to `false`.\ + makes the downscaler exit after one scan + ```yaml + arguments: + - --once=true + ``` +- ### --interval + `--interval` takes a [duration](#duration) value that defaults to `30s`.\ + sets the wait time between scans + ```yaml + arguments: + - --interval= + ``` +- ### --namespace + `--namespace` takes a comma separated list of namespaces that defaults to all namespaces + makes the downscaler get workloads only from the specified namespaces + ```yaml + arguments: + - --namespace= + ``` +- ### --include-resources + `--include-resources` takes a comma separated list of (case-insensitive) [scalable resources](#scalable-resources) that defaults to deployments. + enables scaling of workloads with the specified resource type + ```yaml + arguments: + - --include-resources= + ``` +- ### --exclude-namespaces + `--exclude-namespaces` takes a comma separated list of regex patterns matching namespaces (`some-ns,other-ns,kube-.*` or `some-ns, other-ns, kube-.*`) that defaults to kube-system, kube-downscaler + excludes the matching namespaces from being scaled + ```yaml + arguments: + - --exclude-namespaces= + ``` +- ### --exclude-deployments + `--exclude-deployments` takes a comma separated list of regex patterns matching workload names (`some-workload,other-workload,.*kube-downscaler` or `some-workload, other-workload, .*kube-downscaler`) + excludes the matching workloads from being scaled + default: none + ```yaml + arguments: + - --exclude-deployments= + ``` +- ### --matching-labels + comma separated list of regex patterns matching labels with their value (`some-label=val,other-label=value,another-label=.*` or `some-label=val, other-label=value, another-label=.*`) + makes the downscaler only include workloads which have any label that matches any of the specified labels and values + default: none + ```yaml + arguments: + - --matching-labels= + ``` +- ### --time-annotation + string key of an annotation on the workload containing a [RFC3339 Timestamp](https://datatracker.ietf.org/doc/html/rfc3339) + when set grace-period will use the timestamp in the annotation instead of the creation time of the workload + default: none (uses the workloads creation time) + ```yaml + arguments: + - --time-annotation= + ``` diff --git a/website/content/docs/helm-chart/Values/3 - includedResources.md b/website/content/docs/helm-chart/Values/3 - includedResources.md index bbfc16f..238b767 100644 --- a/website/content/docs/helm-chart/Values/3 - includedResources.md +++ b/website/content/docs/helm-chart/Values/3 - includedResources.md @@ -6,3 +6,10 @@ id: includedResources # includedResources Defines all the resources that the go-kube-downscaler is supposed to be able to handle. + +> ℹ️ **The default value for `includedResources` is:** +> +> ```yaml +> includedResources: +> - deployments +> ``` diff --git a/website/content/docs/helm-chart/Values/4 - fullnameOverride.md b/website/content/docs/helm-chart/Values/4 - fullnameOverride.md index 267c920..f8f85ec 100644 --- a/website/content/docs/helm-chart/Values/4 - fullnameOverride.md +++ b/website/content/docs/helm-chart/Values/4 - fullnameOverride.md @@ -6,3 +6,9 @@ id: fullnameOverride # fullnameOverride Overrides the full names of the created Kubernetes resources with the provided name if set. + +> ℹ️ **The default value for `fullnameOverride` is:** +> +> ```yaml +> fullnameOverride: "" +> ``` diff --git a/website/content/docs/helm-chart/Values/5 - nameOverride.md b/website/content/docs/helm-chart/Values/5 - nameOverride.md index 26a487b..55ac274 100644 --- a/website/content/docs/helm-chart/Values/5 - nameOverride.md +++ b/website/content/docs/helm-chart/Values/5 - nameOverride.md @@ -6,3 +6,9 @@ id: nameOverride # nameOverride Overrides the chart name for the created Kubernetes resources. + +> ℹ️ **The default value for `nameOverride` is:** +> +> ```yaml +> nameOverride: "" +> ``` diff --git a/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.md b/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.md index 2a45135..e77c03b 100644 --- a/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.md +++ b/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.md @@ -6,3 +6,9 @@ id: constrainedDownscaler # constrainedDownscaler Sets the go-kube-downscaler to a constrained state if true, meaning that it does not run clusterwide but restricted to a list of namespaces. These namespaces are listed in [constrainedNamespaces](#constrainedNamespaces). + +> ℹ️ **The default value for `constrainedDownscaler` is:** +> +> ```yaml +> constrainedDownscaler: false +> ``` diff --git a/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.md b/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.md index 71d45de..91f79b0 100644 --- a/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.md +++ b/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.md @@ -6,3 +6,9 @@ id: constrainedNamespaces # constrainedNamespaces A list of namespaces the go-kube-downscaler is going to operate on when constrained. + +> ℹ️ **The default value for `constrainedNamespaces` is:** +> +> ```yaml +> constrainedNamespaces: [] +> ``` diff --git a/website/content/docs/helm-chart/Values/8 - serviceAccount.md b/website/content/docs/helm-chart/Values/8 - serviceAccount.md index 39da1e7..5599208 100644 --- a/website/content/docs/helm-chart/Values/8 - serviceAccount.md +++ b/website/content/docs/helm-chart/Values/8 - serviceAccount.md @@ -6,3 +6,11 @@ id: serviceAccount # serviceAccount Specifies whether a new ServiceAccount is supposed to be created and if not, what the name of the ServiceAccount to use is. + +> ℹ️ **The default values for `serviceAccount` are:** +> +> ```yaml +> serviceAccount: +> create: true +> name: "" +> ``` diff --git a/website/content/docs/helm-chart/Values/9 - podSecurityContext.md b/website/content/docs/helm-chart/Values/9 - podSecurityContext.md index 337201b..882405e 100644 --- a/website/content/docs/helm-chart/Values/9 - podSecurityContext.md +++ b/website/content/docs/helm-chart/Values/9 - podSecurityContext.md @@ -6,3 +6,14 @@ id: podSecurityContext # podSecurityContext Defines the SecurityContext on pod level. (More info [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)) + +> ℹ️ **The default values for `podSecurityContext` are:** +> +> ```yaml +> podSecurityContext: +> runAsGroup: 1000 +> runAsNonRoot: true +> runAsUser: 1000 +> fsGroup: 1000 +> supplementalGroups: [1000] +> ``` From c545c880d7ae9dd62429ef15c41b6d038b438e13 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 28 Oct 2024 16:06:32 +0100 Subject: [PATCH 11/22] add included resources skeleton --- .../Values/3 - includedResources.md | 43 ++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/website/content/docs/helm-chart/Values/3 - includedResources.md b/website/content/docs/helm-chart/Values/3 - includedResources.md index 238b767..adb06bb 100644 --- a/website/content/docs/helm-chart/Values/3 - includedResources.md +++ b/website/content/docs/helm-chart/Values/3 - includedResources.md @@ -5,7 +5,7 @@ id: includedResources # includedResources -Defines all the resources that the go-kube-downscaler is supposed to be able to handle. +`includedResources` defines all the resource types that the go-kube-downscaler is supposed to be able to handle. > ℹ️ **The default value for `includedResources` is:** > @@ -13,3 +13,44 @@ Defines all the resources that the go-kube-downscaler is supposed to be able to > includedResources: > - deployments > ``` + +Supported resources are: + +## Deployments + +## Statefulsets + +## Daemonsets + +## Rollouts + +## HorizontalPodAutoscalers + +## Jobs + +## Cronjobs + +## ScaledObjects + +## Stacks + +## PodDisruptionBudgets + +## Prometheuses + +```yaml +includedResources: + - deployments + - statefulsets + - daemonsets + - rollouts + - horizontalpodautoscalers + - jobs + - cronjobs + - scaledobjects + - stacks + - poddisruptionbudgets + - prometheuses +``` + +You can also find these as comments in the [values.yaml](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/values.yaml#L10-L21). From be52ad8afbc3cc7a0ac0258491bde48c8520d257 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 29 Oct 2024 10:51:36 +0100 Subject: [PATCH 12/22] change filetype to mdx --- .../docs/helm-chart/{0 - Components.md => 0 - Components.mdx} | 0 .../Values/{0 - replicaCount.md => 0 - replicaCount.mdx} | 0 .../docs/helm-chart/Values/{1 - image.md => 1 - image.mdx} | 0 .../{10 - securityContext.md => 10 - securityContext.mdx} | 0 .../helm-chart/Values/{11 - resources.md => 11 - resources.mdx} | 0 .../Values/{12 - nodeSelector.md => 12 - nodeSelector.mdx} | 0 .../Values/{13 - tolerations.md => 13 - tolerations.mdx} | 0 .../helm-chart/Values/{14 - affinity.md => 14 - affinity.mdx} | 0 .../{15 - excludedNamespaces.md => 15 - excludedNamespaces.mdx} | 0 .../helm-chart/Values/{16 - configMap.md => 16 - configMap.mdx} | 0 .../helm-chart/Values/{2 - arguments.md => 2 - arguments.mdx} | 2 +- .../{3 - includedResources.md => 3 - includedResources.mdx} | 0 .../{4 - fullnameOverride.md => 4 - fullnameOverride.mdx} | 0 .../Values/{5 - nameOverride.md => 5 - nameOverride.mdx} | 0 ...- constrainedDownscaler.md => 6 - constrainedDownscaler.mdx} | 0 ...- constrainedNamespaces.md => 7 - constrainedNamespaces.mdx} | 0 .../Values/{8 - serviceAccount.md => 8 - serviceAccount.mdx} | 0 .../{9 - podSecurityContext.md => 9 - podSecurityContext.mdx} | 0 .../{0 - Installation.md => 0 - Installation.mdx} | 0 ...sic Night Time Saving.md => 1 - Basic Night Time Saving.mdx} | 0 20 files changed, 1 insertion(+), 1 deletion(-) rename website/content/docs/helm-chart/{0 - Components.md => 0 - Components.mdx} (100%) rename website/content/docs/helm-chart/Values/{0 - replicaCount.md => 0 - replicaCount.mdx} (100%) rename website/content/docs/helm-chart/Values/{1 - image.md => 1 - image.mdx} (100%) rename website/content/docs/helm-chart/Values/{10 - securityContext.md => 10 - securityContext.mdx} (100%) rename website/content/docs/helm-chart/Values/{11 - resources.md => 11 - resources.mdx} (100%) rename website/content/docs/helm-chart/Values/{12 - nodeSelector.md => 12 - nodeSelector.mdx} (100%) rename website/content/docs/helm-chart/Values/{13 - tolerations.md => 13 - tolerations.mdx} (100%) rename website/content/docs/helm-chart/Values/{14 - affinity.md => 14 - affinity.mdx} (100%) rename website/content/docs/helm-chart/Values/{15 - excludedNamespaces.md => 15 - excludedNamespaces.mdx} (100%) rename website/content/docs/helm-chart/Values/{16 - configMap.md => 16 - configMap.mdx} (100%) rename website/content/docs/helm-chart/Values/{2 - arguments.md => 2 - arguments.mdx} (96%) rename website/content/docs/helm-chart/Values/{3 - includedResources.md => 3 - includedResources.mdx} (100%) rename website/content/docs/helm-chart/Values/{4 - fullnameOverride.md => 4 - fullnameOverride.mdx} (100%) rename website/content/docs/helm-chart/Values/{5 - nameOverride.md => 5 - nameOverride.mdx} (100%) rename website/content/docs/helm-chart/Values/{6 - constrainedDownscaler.md => 6 - constrainedDownscaler.mdx} (100%) rename website/content/docs/helm-chart/Values/{7 - constrainedNamespaces.md => 7 - constrainedNamespaces.mdx} (100%) rename website/content/docs/helm-chart/Values/{8 - serviceAccount.md => 8 - serviceAccount.mdx} (100%) rename website/content/docs/helm-chart/Values/{9 - podSecurityContext.md => 9 - podSecurityContext.mdx} (100%) rename website/content/guides/getting-started/{0 - Installation.md => 0 - Installation.mdx} (100%) rename website/content/guides/getting-started/{1 - Basic Night Time Saving.md => 1 - Basic Night Time Saving.mdx} (100%) diff --git a/website/content/docs/helm-chart/0 - Components.md b/website/content/docs/helm-chart/0 - Components.mdx similarity index 100% rename from website/content/docs/helm-chart/0 - Components.md rename to website/content/docs/helm-chart/0 - Components.mdx diff --git a/website/content/docs/helm-chart/Values/0 - replicaCount.md b/website/content/docs/helm-chart/Values/0 - replicaCount.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/0 - replicaCount.md rename to website/content/docs/helm-chart/Values/0 - replicaCount.mdx diff --git a/website/content/docs/helm-chart/Values/1 - image.md b/website/content/docs/helm-chart/Values/1 - image.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/1 - image.md rename to website/content/docs/helm-chart/Values/1 - image.mdx diff --git a/website/content/docs/helm-chart/Values/10 - securityContext.md b/website/content/docs/helm-chart/Values/10 - securityContext.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/10 - securityContext.md rename to website/content/docs/helm-chart/Values/10 - securityContext.mdx diff --git a/website/content/docs/helm-chart/Values/11 - resources.md b/website/content/docs/helm-chart/Values/11 - resources.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/11 - resources.md rename to website/content/docs/helm-chart/Values/11 - resources.mdx diff --git a/website/content/docs/helm-chart/Values/12 - nodeSelector.md b/website/content/docs/helm-chart/Values/12 - nodeSelector.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/12 - nodeSelector.md rename to website/content/docs/helm-chart/Values/12 - nodeSelector.mdx diff --git a/website/content/docs/helm-chart/Values/13 - tolerations.md b/website/content/docs/helm-chart/Values/13 - tolerations.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/13 - tolerations.md rename to website/content/docs/helm-chart/Values/13 - tolerations.mdx diff --git a/website/content/docs/helm-chart/Values/14 - affinity.md b/website/content/docs/helm-chart/Values/14 - affinity.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/14 - affinity.md rename to website/content/docs/helm-chart/Values/14 - affinity.mdx diff --git a/website/content/docs/helm-chart/Values/15 - excludedNamespaces.md b/website/content/docs/helm-chart/Values/15 - excludedNamespaces.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/15 - excludedNamespaces.md rename to website/content/docs/helm-chart/Values/15 - excludedNamespaces.mdx diff --git a/website/content/docs/helm-chart/Values/16 - configMap.md b/website/content/docs/helm-chart/Values/16 - configMap.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/16 - configMap.md rename to website/content/docs/helm-chart/Values/16 - configMap.mdx diff --git a/website/content/docs/helm-chart/Values/2 - arguments.md b/website/content/docs/helm-chart/Values/2 - arguments.mdx similarity index 96% rename from website/content/docs/helm-chart/Values/2 - arguments.md rename to website/content/docs/helm-chart/Values/2 - arguments.mdx index 113ddb0..39c2909 100644 --- a/website/content/docs/helm-chart/Values/2 - arguments.md +++ b/website/content/docs/helm-chart/Values/2 - arguments.mdx @@ -75,7 +75,7 @@ Possible values are: ``` - ### --once `--once` takes a boolean value that defaults to `false`.\ - makes the downscaler exit after one scan + makes the downscaler exit after one scan {/* In the future we should explain what a scan is in the #concepts section and link it here */} ```yaml arguments: - --once=true diff --git a/website/content/docs/helm-chart/Values/3 - includedResources.md b/website/content/docs/helm-chart/Values/3 - includedResources.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/3 - includedResources.md rename to website/content/docs/helm-chart/Values/3 - includedResources.mdx diff --git a/website/content/docs/helm-chart/Values/4 - fullnameOverride.md b/website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/4 - fullnameOverride.md rename to website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx diff --git a/website/content/docs/helm-chart/Values/5 - nameOverride.md b/website/content/docs/helm-chart/Values/5 - nameOverride.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/5 - nameOverride.md rename to website/content/docs/helm-chart/Values/5 - nameOverride.mdx diff --git a/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.md b/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/6 - constrainedDownscaler.md rename to website/content/docs/helm-chart/Values/6 - constrainedDownscaler.mdx diff --git a/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.md b/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/7 - constrainedNamespaces.md rename to website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx diff --git a/website/content/docs/helm-chart/Values/8 - serviceAccount.md b/website/content/docs/helm-chart/Values/8 - serviceAccount.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/8 - serviceAccount.md rename to website/content/docs/helm-chart/Values/8 - serviceAccount.mdx diff --git a/website/content/docs/helm-chart/Values/9 - podSecurityContext.md b/website/content/docs/helm-chart/Values/9 - podSecurityContext.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/9 - podSecurityContext.md rename to website/content/docs/helm-chart/Values/9 - podSecurityContext.mdx diff --git a/website/content/guides/getting-started/0 - Installation.md b/website/content/guides/getting-started/0 - Installation.mdx similarity index 100% rename from website/content/guides/getting-started/0 - Installation.md rename to website/content/guides/getting-started/0 - Installation.mdx diff --git a/website/content/guides/getting-started/1 - Basic Night Time Saving.md b/website/content/guides/getting-started/1 - Basic Night Time Saving.mdx similarity index 100% rename from website/content/guides/getting-started/1 - Basic Night Time Saving.md rename to website/content/guides/getting-started/1 - Basic Night Time Saving.mdx From b421186a01224be1b27d99c32a97cb179e66e07e Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 29 Oct 2024 13:53:23 +0100 Subject: [PATCH 13/22] change layout --- website/content/_global_md_links.mdx | 18 +++++++++++++ .../helm-chart/Values/0 - replicaCount.mdx | 17 +++++++------ .../docs/helm-chart/Values/1 - image.mdx | 17 +++++++------ .../Values/10 - securityContext.mdx | 25 +++++++++++-------- .../docs/helm-chart/Values/11 - resources.mdx | 25 +++++++++++-------- .../helm-chart/Values/12 - nodeSelector.mdx | 13 ++++++---- .../helm-chart/Values/13 - tolerations.mdx | 13 ++++++---- .../docs/helm-chart/Values/14 - affinity.mdx | 13 ++++++---- .../Values/15 - excludedNamespaces.mdx | 17 +++++++------ .../docs/helm-chart/Values/16 - configMap.mdx | 17 +++++++------ .../docs/helm-chart/Values/2 - arguments.mdx | 13 ++++++---- .../Values/3 - includedResources.mdx | 15 ++++++----- .../Values/4 - fullnameOverride.mdx | 13 ++++++---- .../helm-chart/Values/5 - nameOverride.mdx | 13 ++++++---- .../Values/6 - constrainedDownscaler.mdx | 13 ++++++---- .../Values/7 - constrainedNamespaces.mdx | 13 ++++++---- .../helm-chart/Values/8 - serviceAccount.mdx | 17 +++++++------ .../Values/9 - podSecurityContext.mdx | 23 +++++++++-------- .../getting-started/0 - Installation.mdx | 2 +- .../1 - Basic Night Time Saving.mdx | 2 +- website/docusaurus.config.ts | 8 ++++++ 21 files changed, 192 insertions(+), 115 deletions(-) create mode 100644 website/content/_global_md_links.mdx diff --git a/website/content/_global_md_links.mdx b/website/content/_global_md_links.mdx new file mode 100644 index 0000000..4d13216 --- /dev/null +++ b/website/content/_global_md_links.mdx @@ -0,0 +1,18 @@ +{/* Repo links */} +[contribution-manifest]: https://github.com/caas-team/GoKubeDownscaler/blob/main/CONTRIBUTING.md "Contribution Manifest" + +{/* Guides links */} +[guides-developing]: /GoKubeDownscaler/guides/developing "Developing Guide" + +{/* Documentation links */} +[docs-helm-permissions]: /GoKubeDownscaler/TODO "Helm Chart permission Documentation" + +{/* External links */} +[docusaurus]: https://docusaurus.io "Docusaurus" +[brew]: https://brew.sh "Brew" +[pre-commit]: https://pre-commit.com "Pre-Commit" +[pre-commit-install]: https://pre-commit.com/#install "Pre-Commit Installation" +[golangci-lint-install]: https://golangci-lint.run/welcome/install/#local-installation "GolangCi-Lint Installation" +[gofumpt-install]: https://github.com/mvdan/gofumpt "GoFumpt Installation" +[go-install]: https://go.dev/doc/install "Go Installation" +[git-install]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git "Git Installation" diff --git a/website/content/docs/helm-chart/Values/0 - replicaCount.mdx b/website/content/docs/helm-chart/Values/0 - replicaCount.mdx index e754ab5..8d8d34b 100644 --- a/website/content/docs/helm-chart/Values/0 - replicaCount.mdx +++ b/website/content/docs/helm-chart/Values/0 - replicaCount.mdx @@ -7,13 +7,16 @@ id: replicaCount `replicaCount` adjusts the number of replicas that the GoKubeDownscaler deployment will have. -> ℹ️ **The default value of `replicaCount` is:** -> -> ```yaml -> replicaCount: 1 -> ``` +:::info +The default value of `replicaCount` is: + +```yaml +replicaCount: 1 +``` +::: Changing this to a different integer value will result in the deployment of the provided number of pods. -> ⚠️ **Warning**\ -> This value should not be changed because multiple instances of the GoKubeDownscaler would be fighting about downscaling the targeted resources. +:::warning +This value should not be changed because multiple instances of the GoKubeDownscaler would be fighting about downscaling the targeted resources. +::: diff --git a/website/content/docs/helm-chart/Values/1 - image.mdx b/website/content/docs/helm-chart/Values/1 - image.mdx index e82d6ee..41c174d 100644 --- a/website/content/docs/helm-chart/Values/1 - image.mdx +++ b/website/content/docs/helm-chart/Values/1 - image.mdx @@ -10,13 +10,16 @@ id: image - `repository` is the repository URL where the image versions of the GoKubeDownscaler are located. - `tag` is the version tag of the image. -> ℹ️ **The default values for `image` are:** -> -> ```yaml -> image: -> repository: ghcr.io/caas-team/gokubedownscaler -> tag: "" -> ``` +:::info +The default values for `image` are: + +```yaml +image: + repository: ghcr.io/caas-team/gokubedownscaler + tag: "" +``` + +::: Changing the value of `repository` will result in the images being pulled from another location. It is advised to leave this as is unless you want or need to pull the images from a private registry of your choice. diff --git a/website/content/docs/helm-chart/Values/10 - securityContext.mdx b/website/content/docs/helm-chart/Values/10 - securityContext.mdx index fc24832..2f73ad7 100644 --- a/website/content/docs/helm-chart/Values/10 - securityContext.mdx +++ b/website/content/docs/helm-chart/Values/10 - securityContext.mdx @@ -7,14 +7,17 @@ id: securityContext Defines the SecurityContext on container level. (More info [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)) -> ℹ️ **The default values for `securityContext` are:** -> -> ```yaml -> securityContext: -> readOnlyRootFilesystem: true -> allowPrivilegeEscalation: false -> privileged: false -> capabilities: -> drop: -> - ALL -> ``` +:::info +The default values for `securityContext` are: + +```yaml +securityContext: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + privileged: false + capabilities: + drop: + - ALL +``` + +::: diff --git a/website/content/docs/helm-chart/Values/11 - resources.mdx b/website/content/docs/helm-chart/Values/11 - resources.mdx index 180cf3c..55c70a8 100644 --- a/website/content/docs/helm-chart/Values/11 - resources.mdx +++ b/website/content/docs/helm-chart/Values/11 - resources.mdx @@ -7,14 +7,17 @@ id: resources Defines the CPU and memory limits and requests. -> ℹ️ **The default values for `resources` are:** -> -> ```yaml -> resources: -> limits: -> cpu: 500m -> memory: 900Mi -> requests: -> cpu: 200m -> memory: 300Mi -> ``` +:::info +The default values for `resources` are: + +```yaml +resources: + limits: + cpu: 500m + memory: 900Mi + requests: + cpu: 200m + memory: 300Mi +``` + +::: diff --git a/website/content/docs/helm-chart/Values/12 - nodeSelector.mdx b/website/content/docs/helm-chart/Values/12 - nodeSelector.mdx index a396b8e..0d27f34 100644 --- a/website/content/docs/helm-chart/Values/12 - nodeSelector.mdx +++ b/website/content/docs/helm-chart/Values/12 - nodeSelector.mdx @@ -7,8 +7,11 @@ id: nodeSelector Defines labels of nodes that you want the deployment to schedule them on. -> ℹ️ **The default value for `nodeSelector` is:** -> -> ```yaml -> nodeSelector: {} -> ``` +:::info +The default value for `nodeSelector` is: + +```yaml +nodeSelector: {} +``` + +::: diff --git a/website/content/docs/helm-chart/Values/13 - tolerations.mdx b/website/content/docs/helm-chart/Values/13 - tolerations.mdx index a7b7eda..b826f2d 100644 --- a/website/content/docs/helm-chart/Values/13 - tolerations.mdx +++ b/website/content/docs/helm-chart/Values/13 - tolerations.mdx @@ -7,8 +7,11 @@ id: tolerations Adds tolerations to the pods of the deployment to be able to be scheduled on nodes with matching taints. (More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)) -> ℹ️ **The default value for `tolerations` is:** -> -> ```yaml -> tolerations: [] -> ``` +:::info +The default value for `tolerations` is: + +```yaml +tolerations: [] +``` + +::: diff --git a/website/content/docs/helm-chart/Values/14 - affinity.mdx b/website/content/docs/helm-chart/Values/14 - affinity.mdx index c8883cc..beb7817 100644 --- a/website/content/docs/helm-chart/Values/14 - affinity.mdx +++ b/website/content/docs/helm-chart/Values/14 - affinity.mdx @@ -7,8 +7,11 @@ id: affinity Defines rules for node affinity and pod affinity/anti-affinity. (More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) -> ℹ️ **The default value for `affinity` is:** -> -> ```yaml -> affinity: {} -> ``` +:::info +The default value for `affinity` is: + +```yaml +affinity: {} +``` + +::: diff --git a/website/content/docs/helm-chart/Values/15 - excludedNamespaces.mdx b/website/content/docs/helm-chart/Values/15 - excludedNamespaces.mdx index 68bb1d1..557bb87 100644 --- a/website/content/docs/helm-chart/Values/15 - excludedNamespaces.mdx +++ b/website/content/docs/helm-chart/Values/15 - excludedNamespaces.mdx @@ -7,10 +7,13 @@ id: excludedNamespaces A list of namespaces that are supposed to be excluded from the downscaling process of the go-kube-downscaler. -> ℹ️ **The default value for `excludedNamespaces` is:** -> -> ```yaml -> excludedNamespaces: -> - kube-downscaler -> - kube-system -> ``` +:::info +The default value for `excludedNamespaces` is: + +```yaml +excludedNamespaces: + - kube-downscaler + - kube-system +``` + +::: diff --git a/website/content/docs/helm-chart/Values/16 - configMap.mdx b/website/content/docs/helm-chart/Values/16 - configMap.mdx index 5caabf3..a90c231 100644 --- a/website/content/docs/helm-chart/Values/16 - configMap.mdx +++ b/website/content/docs/helm-chart/Values/16 - configMap.mdx @@ -9,10 +9,13 @@ The name of the configmap for the go-kube-downscaler. extraConfig adds additional specified environment variables to the ConfigMap. -> ℹ️ **The default values for `configMap` are:** -> -> ```yaml -> configMap: -> name: go-kube-downscaler -> extraConfig: "" -> ``` +:::info +The default values for `configMap` are: + +```yaml +configMap: + name: go-kube-downscaler + extraConfig: "" +``` + +::: diff --git a/website/content/docs/helm-chart/Values/2 - arguments.mdx b/website/content/docs/helm-chart/Values/2 - arguments.mdx index 39c2909..c124346 100644 --- a/website/content/docs/helm-chart/Values/2 - arguments.mdx +++ b/website/content/docs/helm-chart/Values/2 - arguments.mdx @@ -7,11 +7,14 @@ id: arguments `arguments` set [layer values](#values) and runtime configuration at the start of the program. See the [layers concept](#layers) for more details on which of the layers [values](#values) will be used. -> ℹ️ **The default value for `arguments` is:** -> -> ```yaml -> arguments: -> ``` +:::info +The default value for `arguments` is: + +```yaml +arguments: +``` + +::: By default the `arguments` value is empty. Setting arguments can change how the GoKubeDownscaler behaves. diff --git a/website/content/docs/helm-chart/Values/3 - includedResources.mdx b/website/content/docs/helm-chart/Values/3 - includedResources.mdx index adb06bb..a23beff 100644 --- a/website/content/docs/helm-chart/Values/3 - includedResources.mdx +++ b/website/content/docs/helm-chart/Values/3 - includedResources.mdx @@ -7,12 +7,15 @@ id: includedResources `includedResources` defines all the resource types that the go-kube-downscaler is supposed to be able to handle. -> ℹ️ **The default value for `includedResources` is:** -> -> ```yaml -> includedResources: -> - deployments -> ``` +:::info +The default value for `includedResources` is: + +```yaml +includedResources: + - deployments +``` + +::: Supported resources are: diff --git a/website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx b/website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx index f8f85ec..ea29d30 100644 --- a/website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx +++ b/website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx @@ -7,8 +7,11 @@ id: fullnameOverride Overrides the full names of the created Kubernetes resources with the provided name if set. -> ℹ️ **The default value for `fullnameOverride` is:** -> -> ```yaml -> fullnameOverride: "" -> ``` +:::info +The default value for `fullnameOverride` is: + +```yaml +fullnameOverride: "" +``` + +::: diff --git a/website/content/docs/helm-chart/Values/5 - nameOverride.mdx b/website/content/docs/helm-chart/Values/5 - nameOverride.mdx index 55ac274..ecf10c4 100644 --- a/website/content/docs/helm-chart/Values/5 - nameOverride.mdx +++ b/website/content/docs/helm-chart/Values/5 - nameOverride.mdx @@ -7,8 +7,11 @@ id: nameOverride Overrides the chart name for the created Kubernetes resources. -> ℹ️ **The default value for `nameOverride` is:** -> -> ```yaml -> nameOverride: "" -> ``` +:::info +The default value for `nameOverride` is: + +```yaml +nameOverride: "" +``` + +::: diff --git a/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.mdx b/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.mdx index e77c03b..da11d8a 100644 --- a/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.mdx +++ b/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.mdx @@ -7,8 +7,11 @@ id: constrainedDownscaler Sets the go-kube-downscaler to a constrained state if true, meaning that it does not run clusterwide but restricted to a list of namespaces. These namespaces are listed in [constrainedNamespaces](#constrainedNamespaces). -> ℹ️ **The default value for `constrainedDownscaler` is:** -> -> ```yaml -> constrainedDownscaler: false -> ``` +:::info +The default value for `constrainedDownscaler` is: + +```yaml +constrainedDownscaler: false +``` + +::: diff --git a/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx b/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx index 91f79b0..ed0d42c 100644 --- a/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx +++ b/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx @@ -7,8 +7,11 @@ id: constrainedNamespaces A list of namespaces the go-kube-downscaler is going to operate on when constrained. -> ℹ️ **The default value for `constrainedNamespaces` is:** -> -> ```yaml -> constrainedNamespaces: [] -> ``` +:::info +The default value for `constrainedNamespaces` is: + +```yaml +constrainedNamespaces: [] +``` + +::: diff --git a/website/content/docs/helm-chart/Values/8 - serviceAccount.mdx b/website/content/docs/helm-chart/Values/8 - serviceAccount.mdx index 5599208..26bcc42 100644 --- a/website/content/docs/helm-chart/Values/8 - serviceAccount.mdx +++ b/website/content/docs/helm-chart/Values/8 - serviceAccount.mdx @@ -7,10 +7,13 @@ id: serviceAccount Specifies whether a new ServiceAccount is supposed to be created and if not, what the name of the ServiceAccount to use is. -> ℹ️ **The default values for `serviceAccount` are:** -> -> ```yaml -> serviceAccount: -> create: true -> name: "" -> ``` +:::info +The default values for `serviceAccount` are: + +```yaml +serviceAccount: + create: true + name: "" +``` + +::: diff --git a/website/content/docs/helm-chart/Values/9 - podSecurityContext.mdx b/website/content/docs/helm-chart/Values/9 - podSecurityContext.mdx index 882405e..8ac262a 100644 --- a/website/content/docs/helm-chart/Values/9 - podSecurityContext.mdx +++ b/website/content/docs/helm-chart/Values/9 - podSecurityContext.mdx @@ -7,13 +7,16 @@ id: podSecurityContext Defines the SecurityContext on pod level. (More info [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)) -> ℹ️ **The default values for `podSecurityContext` are:** -> -> ```yaml -> podSecurityContext: -> runAsGroup: 1000 -> runAsNonRoot: true -> runAsUser: 1000 -> fsGroup: 1000 -> supplementalGroups: [1000] -> ``` +:::info +The default values for `podSecurityContext` are: + +```yaml +podSecurityContext: + runAsGroup: 1000 + runAsNonRoot: true + runAsUser: 1000 + fsGroup: 1000 + supplementalGroups: [1000] +``` + +::: diff --git a/website/content/guides/getting-started/0 - Installation.mdx b/website/content/guides/getting-started/0 - Installation.mdx index ca6a50a..6b810b8 100644 --- a/website/content/guides/getting-started/0 - Installation.mdx +++ b/website/content/guides/getting-started/0 - Installation.mdx @@ -5,7 +5,7 @@ id: installation We provide a Helm Chart for an easy installation of the GoKubeDownscaler. -## Prerequisits +## Prerequisites In order to get started installing the GoKubeDownscaler using our Helm Chart you need: diff --git a/website/content/guides/getting-started/1 - Basic Night Time Saving.mdx b/website/content/guides/getting-started/1 - Basic Night Time Saving.mdx index 76840d8..ce2478e 100644 --- a/website/content/guides/getting-started/1 - Basic Night Time Saving.mdx +++ b/website/content/guides/getting-started/1 - Basic Night Time Saving.mdx @@ -5,4 +5,4 @@ id: basic-night-time-saving # Basic Night Time Saving -One of the easiest ways and most common usecases for the Downscaler is using it for Night Time Saving. +One of the easiest ways and most common use cases for the Downscaler is using it for Night Time Saving. diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index 8e6dae4..4a07e70 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -133,6 +133,14 @@ const config: Config = { }, } satisfies Preset.ThemeConfig, plugins: [svgoConfigPlugin, tailwindPlugin], + markdown: { + preprocessor: ({ fileContent }) => { + // this injects the global md links into every md file + const fs = require("node:fs"); + const links = fs.readFileSync("./content/_global_md_links.mdx"); + return fileContent + "\n" + links; + }, + }, }; export default config; From 82b599b6d5816a8c944e7eb2585d3ff8cea6861c Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 29 Oct 2024 16:11:27 +0100 Subject: [PATCH 14/22] added content --- website/content/_global_md_links.mdx | 31 +- .../docs/helm-chart/0 - Components.mdx | 10 +- .../docs/helm-chart/1 - Permissions.mdx | 276 ++++++++++++++++++ .../helm-chart/Values/0 - replicaCount.mdx | 3 +- .../docs/helm-chart/Values/1 - image.mdx | 4 +- .../docs/helm-chart/Values/16 - configMap.mdx | 5 +- .../Values/3 - includedResources.mdx | 38 ++- .../getting-started/0 - Installation.mdx | 8 +- 8 files changed, 342 insertions(+), 33 deletions(-) create mode 100644 website/content/docs/helm-chart/1 - Permissions.mdx diff --git a/website/content/_global_md_links.mdx b/website/content/_global_md_links.mdx index 4d13216..32aae12 100644 --- a/website/content/_global_md_links.mdx +++ b/website/content/_global_md_links.mdx @@ -1,11 +1,39 @@ {/* Repo links */} [contribution-manifest]: https://github.com/caas-team/GoKubeDownscaler/blob/main/CONTRIBUTING.md "Contribution Manifest" +[deployment-yaml]: https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/deployment.yaml "Deployment" +[serviceaccount-yaml]: https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/serviceaccount.yaml "Service Account" +[configmap-yaml]: https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/configmap.yaml "ConfigMap" +[clusterrole-yaml]: https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/clusterrole.yaml "Clusterrole" +[role-yaml]: https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/role.yaml "Role" +[github-releases]: https://github.com/caas-team/GoKubeDownscaler/releases "Github Releases" +[chart-appversion]: https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/Chart.yaml#L10 "appVersion" {/* Guides links */} [guides-developing]: /GoKubeDownscaler/guides/developing "Developing Guide" {/* Documentation links */} -[docs-helm-permissions]: /GoKubeDownscaler/TODO "Helm Chart permission Documentation" +[docs-helm-chart]: /GoKubeDownscaler/docs/helm-chart "Helm Chart Docs" +[docs-helm-components]: /GoKubeDownscaler/docs/helm-chart/components "Helm Components" +[docs-helm-permissions]: /GoKubeDownscaler/docs/helm-chart/permissions "Permissions" + +{/* Helm Value links */} +[replicaCount]: /GoKubeDownscaler/docs/helm-chart/Values/replicaCount +[image]: /GoKubeDownscaler/docs/helm-chart/Values/image +[arguments]: /GoKubeDownscaler/docs/helm-chart/Values/arguments +[includedResources]: /GoKubeDownscaler/docs/helm-chart/Values/includedResources +[fullnameOverride]: /GoKubeDownscaler/docs/helm-chart/Values/fullnameOverride +[nameOverride]: /GoKubeDownscaler/docs/helm-chart/Values/nameOverride +[constrainedDownscaler]: /GoKubeDownscaler/docs/helm-chart/Values/constrainedDownscaler +[constrainedNamespaces]: /GoKubeDownscaler/docs/helm-chart/Values/constrainedNamespaces +[serviceAccount]: /GoKubeDownscaler/docs/helm-chart/Values/serviceAccount +[podSecurityContext]: /GoKubeDownscaler/docs/helm-chart/Values/podSecurityContext +[securityContext]: /GoKubeDownscaler/docs/helm-chart/Values/securityContext +[resources]: /GoKubeDownscaler/docs/helm-chart/Values/resources +[nodeSelector]: /GoKubeDownscaler/docs/helm-chart/Values/nodeSelector +[tolerations]: /GoKubeDownscaler/docs/helm-chart/Values/tolerations +[affinity]: /GoKubeDownscaler/docs/helm-chart/Values/affinity +[excludedNamespaces]: /GoKubeDownscaler/docs/helm-chart/Values/excludedNamespaces +[configMap]: /GoKubeDownscaler/docs/helm-chart/Values/configMap {/* External links */} [docusaurus]: https://docusaurus.io "Docusaurus" @@ -16,3 +44,4 @@ [gofumpt-install]: https://github.com/mvdan/gofumpt "GoFumpt Installation" [go-install]: https://go.dev/doc/install "Go Installation" [git-install]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git "Git Installation" +[helm-intro]: https://helm.sh/docs/intro/ "Helm Intro" diff --git a/website/content/docs/helm-chart/0 - Components.mdx b/website/content/docs/helm-chart/0 - Components.mdx index f6c1570..e6ee409 100644 --- a/website/content/docs/helm-chart/0 - Components.mdx +++ b/website/content/docs/helm-chart/0 - Components.mdx @@ -9,20 +9,20 @@ The GoKubeDownscaler Helm Chart can create the following Kubernetes Objects: ## Deployment -The [deployment.yaml](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/deployment.yaml) file creates the main Deployment of the GoKubeDownscaler with a reference to the provided ServiceAccount and ConfigMap. +The [deployment.yaml][deployment-yaml] file creates the main Deployment of the GoKubeDownscaler with a reference to the provided ServiceAccount and ConfigMap. ## Serviceaccount -The [serviceaccount.yaml](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/serviceaccount.yaml) file creates a ServiceAccount that will be used by the go-kube-downscaler to interact with Kubernetes. +The [serviceaccount.yaml][serviceaccount-yaml] file creates a ServiceAccount that will be used by the go-kube-downscaler to interact with Kubernetes. ## Configmap -The [configmap.yaml](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/configmap.yaml) file creates a new ConfigMap with the provided name. It is used to store environment variables like `EXCLUDE_NAMESPACES`. +The [configmap.yaml][configmap-yaml] file creates a new ConfigMap with the provided name. It is used to store environment variables like `EXCLUDE_NAMESPACES`. ## Clusterrole -The [clusterrole.yaml](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/clusterrole.yaml) file creates a ClusterRole and a ClusterRoleBinding for the desired cluster if [constrainedDownscaler](http://localhost:3000/GoKubeDownscaler/docs/helm-chart/Values) is set to false. These allow the actions the GoKubeDownscaler needs to scale down workloads in a clusterwide context. +The [clusterrole.yaml][clusterrole-yaml] file creates a ClusterRole and a ClusterRoleBinding for the desired cluster if [constrainedDownscaler][constrainedDownscaler] is set to false. These allow the actions the GoKubeDownscaler needs to scale down workloads in a clusterwide context. ## Role -The [role.yaml](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/role.yaml) file creates a Role and a RoleBinding for every namespace listed in [constrainedNamespaces](http://localhost:3000/GoKubeDownscaler/docs/helm-chart/Values) if [constrainedDownscaler](http://localhost:3000/GoKubeDownscaler/docs/helm-chart/Values) is set to true. +The [role.yaml][role-yaml] file creates a Role and a RoleBinding for every namespace listed in [constrainedNamespaces][constrainedNamespaces] if [constrainedDownscaler][constrainedDownscaler] is set to true. diff --git a/website/content/docs/helm-chart/1 - Permissions.mdx b/website/content/docs/helm-chart/1 - Permissions.mdx new file mode 100644 index 0000000..a52b7ce --- /dev/null +++ b/website/content/docs/helm-chart/1 - Permissions.mdx @@ -0,0 +1,276 @@ +--- +title: Permissions +id: permissions +--- + +# Permissions + +The GoKubeDownscaler needs certain permissions to scale workloads. + +If [constrainedDownscaler][constrainedDownscaler] is set to true the Helm Chart will create roles for each namespace defined in [constrainedNamespaces][constrainedNamespaces]. + +Otherwise it will always create a cluster role. + +::::info + +## Default Permissions + +By default the GoKubeDownscaler will always have the following permissions if it is installed via our Helm Chart: + +```yaml +- apiGroups: + - "" + resources: + - pods + - namespaces + verbs: + - get + - watch + - list +- apiGroups: + - "" + resources: + - events + verbs: + - get + - create + - watch + - list + - update + - patch +``` + +These are necessary for the GoKubeDownscaler to work properly. + +:::note +If you are using a clusterwide installation of the GoKubeDownscaler it will also have: +::: + +```yaml +- apiGroups: + - constraints.gatekeeper.sh + resources: + - kubedownscalerjobsconstraint + verbs: + - get + - create + - watch + - list + - update + - patch + - delete +- apiGroups: + - kyverno.io + resources: + - policies + resourceNames: + - kube-downscaler-jobs-policy + verbs: + - get + - create + - watch + - list + - update + - patch + - delete +- apiGroups: + - kyverno.io + resources: + - policies + verbs: + - get + - create + - watch + - list +- apiGroups: + - templates.gatekeeper.sh + resources: + - constrainttemplate + verbs: + - create + - get + - list + - watch +- apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions + verbs: + - create + - get + - list + - watch +``` + +TODO Explain why these are added. + +:::: + +Otherwise the GoKubeDownscaler assigns permissions depending on the resources defined in [includedResources][includedResources]. + +This will add the following permissions: + +## Deployments + +```yaml +- apiGroups: + - apps + resources: + - deployments + verbs: + - get + - watch + - list + - update + - patch +``` + +## Statefulsets + +```yaml +- apiGroups: + - apps + resources: + - statefulsets + verbs: + - get + - watch + - list + - update + - patch +``` + +## Daemonsets + +```yaml +- apiGroups: + - apps + resources: + - daemonsets + verbs: + - get + - watch + - list + - update + - patch +``` + +## Rollouts + +```yaml +- apiGroups: + - argoproj.io + resources: + - rollouts + verbs: + - get + - watch + - list + - update + - patch +``` + +## HorizontalPodAutoscalers + +```yaml +- apiGroups: + - autoscaling + resources: + - horizontalpodautoscalers + verbs: + - get + - watch + - list + - update + - patch +``` + +## Jobs + +```yaml +- apiGroups: + - batch + resources: + - jobs + verbs: + - get + - watch + - list + - update + - patch +``` + +## Cronjobs + +```yaml +- apiGroups: + - batch + resources: + - cronjobs + verbs: + - get + - watch + - list + - update + - patch +``` + +## Scaledobjects + +```yaml +- apiGroups: + - keda.sh + resources: + - scaledobjects + verbs: + - get + - watch + - list + - update + - patch +``` + +## Stacks + +```yaml +- apiGroups: + - zalando.org + resources: + - stacks + verbs: + - get + - watch + - list + - update + - patch +``` + +## Prometheuses + +```yaml +- apiGroups: + - monitoring.coreos.com + resources: + - prometheuses + verbs: + - get + - watch + - list + - update + - patch +``` + +## PodDisruptionBudgets + +```yaml +- apiGroups: + - policy + resources: + - poddisruptionbudgets + verbs: + - get + - watch + - list + - update + - patch +``` diff --git a/website/content/docs/helm-chart/Values/0 - replicaCount.mdx b/website/content/docs/helm-chart/Values/0 - replicaCount.mdx index 8d8d34b..e6bd41f 100644 --- a/website/content/docs/helm-chart/Values/0 - replicaCount.mdx +++ b/website/content/docs/helm-chart/Values/0 - replicaCount.mdx @@ -13,10 +13,11 @@ The default value of `replicaCount` is: ```yaml replicaCount: 1 ``` + ::: Changing this to a different integer value will result in the deployment of the provided number of pods. :::warning -This value should not be changed because multiple instances of the GoKubeDownscaler would be fighting about downscaling the targeted resources. +This value should not be changed because multiple instances of the GoKubeDownscaler could lead to errors if they try to scale the same resources simultaneously. ::: diff --git a/website/content/docs/helm-chart/Values/1 - image.mdx b/website/content/docs/helm-chart/Values/1 - image.mdx index 41c174d..f3f3cc8 100644 --- a/website/content/docs/helm-chart/Values/1 - image.mdx +++ b/website/content/docs/helm-chart/Values/1 - image.mdx @@ -23,6 +23,6 @@ image: Changing the value of `repository` will result in the images being pulled from another location. It is advised to leave this as is unless you want or need to pull the images from a private registry of your choice. -Changing the value of `tag` will deploy a different version of the GoKubeDownscaler. If left empty like it is by default the GoKubeDownscaler will use the [appVersion](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/Chart.yaml#L10) of the currently used Helm Chart. +Changing the value of `tag` will deploy a different version of the GoKubeDownscaler. If left empty like it is by default the GoKubeDownscaler will use the [appVersion][chart-appversion] of the currently used Helm Chart. -More details to versions of the GoKubeDownscaler can be found [here](https://github.com/caas-team/GoKubeDownscaler/releases). +More details to versions of the GoKubeDownscaler can be found [here][github-releases]. diff --git a/website/content/docs/helm-chart/Values/16 - configMap.mdx b/website/content/docs/helm-chart/Values/16 - configMap.mdx index a90c231..14a5a75 100644 --- a/website/content/docs/helm-chart/Values/16 - configMap.mdx +++ b/website/content/docs/helm-chart/Values/16 - configMap.mdx @@ -5,9 +5,10 @@ id: configMap # configMap -The name of the configmap for the go-kube-downscaler. +`configMap` contains the two fields `name` and `extraConfig`: -extraConfig adds additional specified environment variables to the ConfigMap. +- `name` is the name of the configmap for the GoKubeDownscaler. +- `extraConfig` adds additional specified environment variables to the ConfigMap. :::info The default values for `configMap` are: diff --git a/website/content/docs/helm-chart/Values/3 - includedResources.mdx b/website/content/docs/helm-chart/Values/3 - includedResources.mdx index a23beff..30c3644 100644 --- a/website/content/docs/helm-chart/Values/3 - includedResources.mdx +++ b/website/content/docs/helm-chart/Values/3 - includedResources.mdx @@ -5,7 +5,7 @@ id: includedResources # includedResources -`includedResources` defines all the resource types that the go-kube-downscaler is supposed to be able to handle. +`includedResources` defines all the resource types that the GoKubeDownscaler is supposed to be able to handle. :::info The default value for `includedResources` is: @@ -17,29 +17,25 @@ includedResources: ::: -Supported resources are: - -## Deployments - -## Statefulsets - -## Daemonsets - -## Rollouts - -## HorizontalPodAutoscalers +If you add a resource to this list the Helm Chart will create a set of [permissions][docs-helm-permissions] and assign them to the role for the GoKubeDownscaler. -## Jobs - -## Cronjobs - -## ScaledObjects +Supported resources are: -## Stacks +- Deployments +- Statefulsets +- Daemonsets +- Rollouts +- HorizontalPodAutoscalers +- Jobs +- Cronjobs +- ScaledObjects +- Stacks +- PodDisruptionBudgets +- Prometheuses -## PodDisruptionBudgets +:::tip -## Prometheuses +An example for including resources can look like this: ```yaml includedResources: @@ -57,3 +53,5 @@ includedResources: ``` You can also find these as comments in the [values.yaml](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/values.yaml#L10-L21). + +::: diff --git a/website/content/guides/getting-started/0 - Installation.mdx b/website/content/guides/getting-started/0 - Installation.mdx index 6b810b8..a9ef256 100644 --- a/website/content/guides/getting-started/0 - Installation.mdx +++ b/website/content/guides/getting-started/0 - Installation.mdx @@ -3,6 +3,8 @@ title: Installation id: installation --- +# Installation + We provide a Helm Chart for an easy installation of the GoKubeDownscaler. ## Prerequisites @@ -12,7 +14,7 @@ In order to get started installing the GoKubeDownscaler using our Helm Chart you - Helm installed on a system - have access to a Kubernetes cluster in some kind of way. -You can find out how to install Helm [here](https://helm.sh/docs/intro/). +You can find out how to install Helm [here][helm-intro]. Also make sure your context is set to the right cluster and namespace where you want to deploy the GoKubeDownscaler. @@ -32,4 +34,6 @@ helm install go-kube-downscaler caas-team/go-kube-downscaler Now the GoKubeDownscaler should be properly installed. -You can find out how to customize your installation of the GoKubeDownscaler [here](http://localhost:3000/GoKubeDownscaler/docs/helm-chart/Values). +:::tip +You can find out how to customize your installation of the GoKubeDownscaler [here][docs-helm-chart]. +::: From 75e148045eb37d9e2e02751d76af11da6cea73e2 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 29 Oct 2024 16:14:47 +0100 Subject: [PATCH 15/22] made todo a comment --- website/content/docs/helm-chart/1 - Permissions.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/helm-chart/1 - Permissions.mdx b/website/content/docs/helm-chart/1 - Permissions.mdx index a52b7ce..9956219 100644 --- a/website/content/docs/helm-chart/1 - Permissions.mdx +++ b/website/content/docs/helm-chart/1 - Permissions.mdx @@ -102,7 +102,7 @@ If you are using a clusterwide installation of the GoKubeDownscaler it will also - watch ``` -TODO Explain why these are added. +{/* TODO Explain why these are added. */} :::: From 2912755840133692b547a69aa76643e2d7191a55 Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 30 Oct 2024 15:35:16 +0100 Subject: [PATCH 16/22] changed index structure --- website/content/_global_md_links.mdx | 1 + .../docs/helm-chart/0 - Components.mdx | 2 +- .../docs/helm-chart/1 - Permissions.mdx | 187 ++---------------- .../docs/helm-chart/Values/16 - configMap.mdx | 2 +- .../Values/3 - includedResources.mdx | 4 +- .../Values/4 - fullnameOverride.mdx | 4 +- .../Values/6 - constrainedDownscaler.mdx | 12 +- .../Values/7 - constrainedNamespaces.mdx | 3 +- .../helm-chart/Values/8 - serviceAccount.mdx | 5 +- .../content/docs/helm-chart/Values/index.mdx | 12 ++ website/content/docs/helm-chart/index.mdx | 14 ++ .../getting-started/0 - Installation.mdx | 2 +- .../index.mdx} | 2 +- website/sidebars.ts | 30 +-- 14 files changed, 73 insertions(+), 207 deletions(-) create mode 100644 website/content/docs/helm-chart/Values/index.mdx create mode 100644 website/content/docs/helm-chart/index.mdx rename website/content/guides/{Getting Started.mdx => getting-started/index.mdx} (72%) diff --git a/website/content/_global_md_links.mdx b/website/content/_global_md_links.mdx index 32aae12..e9f33aa 100644 --- a/website/content/_global_md_links.mdx +++ b/website/content/_global_md_links.mdx @@ -13,6 +13,7 @@ {/* Documentation links */} [docs-helm-chart]: /GoKubeDownscaler/docs/helm-chart "Helm Chart Docs" +[docs-helm-values]: /GoKubeDownscaler/docs/helm-chart/Values "Helm Chart Values" [docs-helm-components]: /GoKubeDownscaler/docs/helm-chart/components "Helm Components" [docs-helm-permissions]: /GoKubeDownscaler/docs/helm-chart/permissions "Permissions" diff --git a/website/content/docs/helm-chart/0 - Components.mdx b/website/content/docs/helm-chart/0 - Components.mdx index e6ee409..069d8d0 100644 --- a/website/content/docs/helm-chart/0 - Components.mdx +++ b/website/content/docs/helm-chart/0 - Components.mdx @@ -5,7 +5,7 @@ id: components # Components -The GoKubeDownscaler Helm Chart can create the following Kubernetes Objects: +The following Kubernetes Objects can be created with our Helm Chart: ## Deployment diff --git a/website/content/docs/helm-chart/1 - Permissions.mdx b/website/content/docs/helm-chart/1 - Permissions.mdx index 9956219..466f57b 100644 --- a/website/content/docs/helm-chart/1 - Permissions.mdx +++ b/website/content/docs/helm-chart/1 - Permissions.mdx @@ -9,9 +9,7 @@ The GoKubeDownscaler needs certain permissions to scale workloads. If [constrainedDownscaler][constrainedDownscaler] is set to true the Helm Chart will create roles for each namespace defined in [constrainedNamespaces][constrainedNamespaces]. -Otherwise it will always create a cluster role. - -::::info +Otherwise it will always create a cluster role with the needed permissions. ## Default Permissions @@ -42,6 +40,8 @@ By default the GoKubeDownscaler will always have the following permissions if it These are necessary for the GoKubeDownscaler to work properly. +## Admission Controller Permissions + :::note If you are using a clusterwide installation of the GoKubeDownscaler it will also have: ::: @@ -104,173 +104,20 @@ If you are using a clusterwide installation of the GoKubeDownscaler it will also {/* TODO Explain why these are added. */} -:::: - -Otherwise the GoKubeDownscaler assigns permissions depending on the resources defined in [includedResources][includedResources]. - -This will add the following permissions: - -## Deployments - -```yaml -- apiGroups: - - apps - resources: - - deployments - verbs: - - get - - watch - - list - - update - - patch -``` - -## Statefulsets +## Workload Permissions -```yaml -- apiGroups: - - apps - resources: - - statefulsets - verbs: - - get - - watch - - list - - update - - patch -``` +The Helm Chart assigns get, watch, list, update and patch permissions for the workloads defined in [includedResources][includedResources]. -## Daemonsets +These resources can be: -```yaml -- apiGroups: - - apps - resources: - - daemonsets - verbs: - - get - - watch - - list - - update - - patch -``` - -## Rollouts - -```yaml -- apiGroups: - - argoproj.io - resources: - - rollouts - verbs: - - get - - watch - - list - - update - - patch -``` - -## HorizontalPodAutoscalers - -```yaml -- apiGroups: - - autoscaling - resources: - - horizontalpodautoscalers - verbs: - - get - - watch - - list - - update - - patch -``` - -## Jobs - -```yaml -- apiGroups: - - batch - resources: - - jobs - verbs: - - get - - watch - - list - - update - - patch -``` - -## Cronjobs - -```yaml -- apiGroups: - - batch - resources: - - cronjobs - verbs: - - get - - watch - - list - - update - - patch -``` - -## Scaledobjects - -```yaml -- apiGroups: - - keda.sh - resources: - - scaledobjects - verbs: - - get - - watch - - list - - update - - patch -``` - -## Stacks - -```yaml -- apiGroups: - - zalando.org - resources: - - stacks - verbs: - - get - - watch - - list - - update - - patch -``` - -## Prometheuses - -```yaml -- apiGroups: - - monitoring.coreos.com - resources: - - prometheuses - verbs: - - get - - watch - - list - - update - - patch -``` - -## PodDisruptionBudgets - -```yaml -- apiGroups: - - policy - resources: - - poddisruptionbudgets - verbs: - - get - - watch - - list - - update - - patch -``` +- Deployments +- Statefulsets +- Daemonsets +- Rollouts +- HorizontalPodAutoscalers +- Jobs +- Cronjobs +- ScaledObjects +- Stacks +- PodDisruptionBudgets +- Prometheuses diff --git a/website/content/docs/helm-chart/Values/16 - configMap.mdx b/website/content/docs/helm-chart/Values/16 - configMap.mdx index 14a5a75..6a9d7bd 100644 --- a/website/content/docs/helm-chart/Values/16 - configMap.mdx +++ b/website/content/docs/helm-chart/Values/16 - configMap.mdx @@ -7,7 +7,7 @@ id: configMap `configMap` contains the two fields `name` and `extraConfig`: -- `name` is the name of the configmap for the GoKubeDownscaler. +- `name` defines the name of the configmap for the GoKubeDownscaler. - `extraConfig` adds additional specified environment variables to the ConfigMap. :::info diff --git a/website/content/docs/helm-chart/Values/3 - includedResources.mdx b/website/content/docs/helm-chart/Values/3 - includedResources.mdx index 30c3644..4ba0182 100644 --- a/website/content/docs/helm-chart/Values/3 - includedResources.mdx +++ b/website/content/docs/helm-chart/Values/3 - includedResources.mdx @@ -17,7 +17,7 @@ includedResources: ::: -If you add a resource to this list the Helm Chart will create a set of [permissions][docs-helm-permissions] and assign them to the role for the GoKubeDownscaler. +For every resource in this list the Helm Chart will create a set of [permissions][docs-helm-permissions] and assign them to the role for the GoKubeDownscaler. Supported resources are: @@ -52,6 +52,4 @@ includedResources: - prometheuses ``` -You can also find these as comments in the [values.yaml](https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/values.yaml#L10-L21). - ::: diff --git a/website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx b/website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx index ea29d30..0a887d4 100644 --- a/website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx +++ b/website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx @@ -5,7 +5,7 @@ id: fullnameOverride # fullnameOverride -Overrides the full names of the created Kubernetes resources with the provided name if set. +`fullnameOverride` overrides the full names of the created Kubernetes resources with the provided name if set. :::info The default value for `fullnameOverride` is: @@ -15,3 +15,5 @@ fullnameOverride: "" ``` ::: + +If a value for `fullnameOverride` is set the Helm Chart diff --git a/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.mdx b/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.mdx index da11d8a..1d19893 100644 --- a/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.mdx +++ b/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.mdx @@ -5,7 +5,7 @@ id: constrainedDownscaler # constrainedDownscaler -Sets the go-kube-downscaler to a constrained state if true, meaning that it does not run clusterwide but restricted to a list of namespaces. These namespaces are listed in [constrainedNamespaces](#constrainedNamespaces). +`constrainedDownscaler` sets the GoKubeDownscaler to a constrained state if true, meaning that it does not run clusterwide but restricted to a list of namespaces. :::info The default value for `constrainedDownscaler` is: @@ -15,3 +15,13 @@ constrainedDownscaler: false ``` ::: + +The namespaces the GoKubeDownscaler is constrained to are listed in [constrainedNamespaces][constrainedNamespaces]. + +:::warning +[constrainedNamespaces][constrainedNamespaces] cannot be empty if `constrainedDownscaler` is set to true! +::: + +It will also create roles in each of these namespaces instead of a clusterrole for the needed [permissions][docs-helm-permissions]. + +This feature is very useful if you don't have the necessary rights to make a clusterwide installation. diff --git a/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx b/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx index ed0d42c..5835d38 100644 --- a/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx +++ b/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx @@ -5,7 +5,8 @@ id: constrainedNamespaces # constrainedNamespaces -A list of namespaces the go-kube-downscaler is going to operate on when constrained. +`constrainedNamespaces` is a list of namespaces the GoKubeDownscaler is going to operate on when constrained.\ +You can constrain the GoKubeDownscaler with the [constrainedDownscaler][constrainedDownscaler] parameter. :::info The default value for `constrainedNamespaces` is: diff --git a/website/content/docs/helm-chart/Values/8 - serviceAccount.mdx b/website/content/docs/helm-chart/Values/8 - serviceAccount.mdx index 26bcc42..4afa626 100644 --- a/website/content/docs/helm-chart/Values/8 - serviceAccount.mdx +++ b/website/content/docs/helm-chart/Values/8 - serviceAccount.mdx @@ -5,7 +5,10 @@ id: serviceAccount # serviceAccount -Specifies whether a new ServiceAccount is supposed to be created and if not, what the name of the ServiceAccount to use is. +`serviceAccount` contains the two fields `create` and `name`: + +- `create` is a boolean value indicating if a new ServiceAccount is supposed to be created. +- `name` is the name of the ServiceAccount the GoKubeDownscaler is supposed to use. :::info The default values for `serviceAccount` are: diff --git a/website/content/docs/helm-chart/Values/index.mdx b/website/content/docs/helm-chart/Values/index.mdx new file mode 100644 index 0000000..5d833ff --- /dev/null +++ b/website/content/docs/helm-chart/Values/index.mdx @@ -0,0 +1,12 @@ +--- +title: Values +id: values +--- + +# Values + +import DocCardList from "@theme/DocCardList"; + +These are the values for the Helm Chart defined in the values.yaml file. + + diff --git a/website/content/docs/helm-chart/index.mdx b/website/content/docs/helm-chart/index.mdx new file mode 100644 index 0000000..e3fccad --- /dev/null +++ b/website/content/docs/helm-chart/index.mdx @@ -0,0 +1,14 @@ +--- +title: Helm Chart +id: helm-chart +--- + +import DocCardList from "@theme/DocCardList"; + +# Helm Chart + +In order to make the installation of the GoKubeDownscaler as easy as possible we provide a fully customizable Helm Chart. + +On the following pages you find out everything you need about it. + + diff --git a/website/content/guides/getting-started/0 - Installation.mdx b/website/content/guides/getting-started/0 - Installation.mdx index a9ef256..dd35823 100644 --- a/website/content/guides/getting-started/0 - Installation.mdx +++ b/website/content/guides/getting-started/0 - Installation.mdx @@ -35,5 +35,5 @@ helm install go-kube-downscaler caas-team/go-kube-downscaler Now the GoKubeDownscaler should be properly installed. :::tip -You can find out how to customize your installation of the GoKubeDownscaler [here][docs-helm-chart]. +You can find out how to customize your installation of the GoKubeDownscaler [here][docs-helm-values]. ::: diff --git a/website/content/guides/Getting Started.mdx b/website/content/guides/getting-started/index.mdx similarity index 72% rename from website/content/guides/Getting Started.mdx rename to website/content/guides/getting-started/index.mdx index d9b93a3..1a605f8 100644 --- a/website/content/guides/Getting Started.mdx +++ b/website/content/guides/getting-started/index.mdx @@ -9,6 +9,6 @@ import DocCardList from "@theme/DocCardList"; # Basic configuration -These are some basic example configurations and usecases: +These are some basic example configurations and use cases: diff --git a/website/sidebars.ts b/website/sidebars.ts index 76f09fc..1cdf5b9 100644 --- a/website/sidebars.ts +++ b/website/sidebars.ts @@ -3,36 +3,14 @@ import type { SidebarsConfig } from "@docusaurus/plugin-content-docs"; const sidebars: SidebarsConfig = { DocsSidebar: [ { - type: "category", - label: "Helm Chart", - link: { - type: "generated-index", - title: "Helm Chart", - description: "Documentation about contents of the Helm chart.", - slug: "/docs/helm-chart", - }, - items: [ - { - type: "autogenerated", - dirName: "docs/helm-chart", - }, - ], + type: "autogenerated", + dirName: "docs", }, ], GuidesSidebar: [ { - type: "category", - label: "Getting Started", - link: { - type: "doc", - id: "guides/getting-started", - }, - items: [ - { - type: "autogenerated", - dirName: "guides/getting-started", - }, - ], + type: "autogenerated", + dirName: "guides", }, ], }; From 9765e72f1a3ee30849150b4b1a99649eec55718c Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 4 Nov 2024 12:49:16 +0100 Subject: [PATCH 17/22] add contents --- website/content/_global_md_links.mdx | 2 + .../helm-chart/Values/0 - replicaCount.mdx | 2 +- .../Values/10 - securityContext.mdx | 6 +- .../docs/helm-chart/Values/11 - resources.mdx | 8 +- .../helm-chart/Values/12 - nodeSelector.mdx | 18 ++- .../helm-chart/Values/13 - tolerations.mdx | 16 ++- .../docs/helm-chart/Values/14 - affinity.mdx | 4 +- .../Values/15 - excludedNamespaces.mdx | 15 ++- .../docs/helm-chart/Values/16 - configMap.mdx | 19 +++ .../docs/helm-chart/Values/2 - arguments.mdx | 127 ++---------------- .../Values/4 - fullnameOverride.mdx | 12 +- .../helm-chart/Values/5 - nameOverride.mdx | 20 ++- .../Values/7 - constrainedNamespaces.mdx | 13 +- .../helm-chart/Values/8 - serviceAccount.mdx | 11 ++ .../Values/9 - podSecurityContext.mdx | 6 +- 15 files changed, 150 insertions(+), 129 deletions(-) diff --git a/website/content/_global_md_links.mdx b/website/content/_global_md_links.mdx index e9f33aa..3454c19 100644 --- a/website/content/_global_md_links.mdx +++ b/website/content/_global_md_links.mdx @@ -16,6 +16,8 @@ [docs-helm-values]: /GoKubeDownscaler/docs/helm-chart/Values "Helm Chart Values" [docs-helm-components]: /GoKubeDownscaler/docs/helm-chart/components "Helm Components" [docs-helm-permissions]: /GoKubeDownscaler/docs/helm-chart/permissions "Permissions" +{/* TODO */} +[docs-arguments]: /GoKubeDownscaler/docs/ "arguments" {/* Helm Value links */} [replicaCount]: /GoKubeDownscaler/docs/helm-chart/Values/replicaCount diff --git a/website/content/docs/helm-chart/Values/0 - replicaCount.mdx b/website/content/docs/helm-chart/Values/0 - replicaCount.mdx index e6bd41f..cefe6a4 100644 --- a/website/content/docs/helm-chart/Values/0 - replicaCount.mdx +++ b/website/content/docs/helm-chart/Values/0 - replicaCount.mdx @@ -19,5 +19,5 @@ replicaCount: 1 Changing this to a different integer value will result in the deployment of the provided number of pods. :::warning -This value should not be changed because multiple instances of the GoKubeDownscaler could lead to errors if they try to scale the same resources simultaneously. +This value should not be changed because multiple instances of the GoKubeDownscaler could lead to errors if they try to scale the same workloads simultaneously. ::: diff --git a/website/content/docs/helm-chart/Values/10 - securityContext.mdx b/website/content/docs/helm-chart/Values/10 - securityContext.mdx index 2f73ad7..acd52ae 100644 --- a/website/content/docs/helm-chart/Values/10 - securityContext.mdx +++ b/website/content/docs/helm-chart/Values/10 - securityContext.mdx @@ -5,7 +5,7 @@ id: securityContext # securityContext -Defines the SecurityContext on container level. (More info [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)) +`securityContext` defines the SecurityContext on container level. :::info The default values for `securityContext` are: @@ -21,3 +21,7 @@ securityContext: ``` ::: + +In this field you can customize privilege and access control settings for the GoKubeDownscaler container. + +More info on all the possible configurations can be found [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). diff --git a/website/content/docs/helm-chart/Values/11 - resources.mdx b/website/content/docs/helm-chart/Values/11 - resources.mdx index 55c70a8..649e02b 100644 --- a/website/content/docs/helm-chart/Values/11 - resources.mdx +++ b/website/content/docs/helm-chart/Values/11 - resources.mdx @@ -5,7 +5,7 @@ id: resources # resources -Defines the CPU and memory limits and requests. +`resources` defines the CPU and memory limits and requests. :::info The default values for `resources` are: @@ -21,3 +21,9 @@ resources: ``` ::: + +Here you can adjust the minimum and maximum amounts of cpu and memory the GoKubeDownscaler Pod is allowed to use. + +The requests being the minimum and the limits being the maximum. + +You can read more about this [here](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). diff --git a/website/content/docs/helm-chart/Values/12 - nodeSelector.mdx b/website/content/docs/helm-chart/Values/12 - nodeSelector.mdx index 0d27f34..2d8d238 100644 --- a/website/content/docs/helm-chart/Values/12 - nodeSelector.mdx +++ b/website/content/docs/helm-chart/Values/12 - nodeSelector.mdx @@ -5,7 +5,7 @@ id: nodeSelector # nodeSelector -Defines labels of nodes that you want the deployment to schedule them on. +`nodeSelector` defines labels of nodes that you want the deployment to be scheduled on. :::info The default value for `nodeSelector` is: @@ -15,3 +15,19 @@ nodeSelector: {} ``` ::: + +If you want the GoKubeDownscaler to be scheduled on a specific type of node you can specify the determining labels of the node here. + +:::tip For example: + +If you set: + +```yaml +nodeSelector: + disktype: ssd + env: production +``` + +the GoKubeDownscaler will only be scheduled on a Node that also has the labels `disktype: ssd` and `env: production`. + +::: diff --git a/website/content/docs/helm-chart/Values/13 - tolerations.mdx b/website/content/docs/helm-chart/Values/13 - tolerations.mdx index b826f2d..3a8e751 100644 --- a/website/content/docs/helm-chart/Values/13 - tolerations.mdx +++ b/website/content/docs/helm-chart/Values/13 - tolerations.mdx @@ -5,7 +5,7 @@ id: tolerations # tolerations -Adds tolerations to the pods of the deployment to be able to be scheduled on nodes with matching taints. (More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)) +`tolerations` adds tolerations to the pod of the deployment to be able to be scheduled on nodes with matching taints. :::info The default value for `tolerations` is: @@ -15,3 +15,17 @@ tolerations: [] ``` ::: + +This field allows the GoKubeDownscaler pod to be scheduled on Nodes with certain taints. + +If you want to allow the GoKubeDownscaler pod to schedule on a Node with a taint `key1=value1:NoSchedule` you can set: + +```yaml +tolerations: + - key: "key1" + operator: "Equal" + value: "value1" + effect: "NoSchedule" +``` + +You can find more info about taints and tolerations [here](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/). diff --git a/website/content/docs/helm-chart/Values/14 - affinity.mdx b/website/content/docs/helm-chart/Values/14 - affinity.mdx index beb7817..54b98c9 100644 --- a/website/content/docs/helm-chart/Values/14 - affinity.mdx +++ b/website/content/docs/helm-chart/Values/14 - affinity.mdx @@ -5,7 +5,7 @@ id: affinity # affinity -Defines rules for node affinity and pod affinity/anti-affinity. (More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) +`affinity` defines rules for node affinity and pod affinity/anti-affinity. :::info The default value for `affinity` is: @@ -15,3 +15,5 @@ affinity: {} ``` ::: + +(More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) diff --git a/website/content/docs/helm-chart/Values/15 - excludedNamespaces.mdx b/website/content/docs/helm-chart/Values/15 - excludedNamespaces.mdx index 557bb87..0d67ff6 100644 --- a/website/content/docs/helm-chart/Values/15 - excludedNamespaces.mdx +++ b/website/content/docs/helm-chart/Values/15 - excludedNamespaces.mdx @@ -5,7 +5,7 @@ id: excludedNamespaces # excludedNamespaces -A list of namespaces that are supposed to be excluded from the downscaling process of the go-kube-downscaler. +`excludedNamespaces` is a list of namespaces that are supposed to be excluded from the downscaling process of the GoKubeDownscaler. :::info The default value for `excludedNamespaces` is: @@ -17,3 +17,16 @@ excludedNamespaces: ``` ::: + +All workloads in any namespace listed in this field will not be scaled even if there is a fitting annotation present. + +So adding a namespace like this: + +```yaml +excludedNamespaces: + - kube-downscaler + - kube-system + - namespace1 +``` + +will result in all workloads in the namespaces kube-downscaler, kube-system and namespace1 not being scaled down under any circumstance. diff --git a/website/content/docs/helm-chart/Values/16 - configMap.mdx b/website/content/docs/helm-chart/Values/16 - configMap.mdx index 6a9d7bd..54f3566 100644 --- a/website/content/docs/helm-chart/Values/16 - configMap.mdx +++ b/website/content/docs/helm-chart/Values/16 - configMap.mdx @@ -20,3 +20,22 @@ configMap: ``` ::: + +By default the `extraConfig` field is empty. Adding a line will change how the GoKubeDownscaler behaves. + +:::tip For example: + +```yaml +configMap: + name: go-kube-downscaler + extraConfig: | + EXCLUDE_DEPLOYMENTS: deployment1, deployment2 +``` + +This will add the `EXCLUDE_DEPLOYMENTS` environment variable to the configMap. + +The given configuration will exclude the deployments with the name deployment1 and deployment2 from the scaling process of the GoKubeDownscaler even if they have a fitting annotation and are in a not excluded namespace. + +::: + +You can find a list of all possible environment variables [here][docs-environment-variables]. diff --git a/website/content/docs/helm-chart/Values/2 - arguments.mdx b/website/content/docs/helm-chart/Values/2 - arguments.mdx index c124346..6d5e330 100644 --- a/website/content/docs/helm-chart/Values/2 - arguments.mdx +++ b/website/content/docs/helm-chart/Values/2 - arguments.mdx @@ -5,7 +5,7 @@ id: arguments # arguments -`arguments` set [layer values](#values) and runtime configuration at the start of the program. See the [layers concept](#layers) for more details on which of the layers [values](#values) will be used. +`arguments` set [layer values](#values) and runtime configuration at the start of the program. :::info The default value for `arguments` is: @@ -16,122 +16,17 @@ arguments: ::: -By default the `arguments` value is empty. Setting arguments can change how the GoKubeDownscaler behaves. +By default the `arguments` field is empty. Adding an argument will change how the GoKubeDownscaler behaves. -Possible values are: +:::tip For example: -## Layer Values: - -- ### --upscale-period - sets the [upscale-period](#upscale-period) value on the [cli layer](#cli-layer) - ```yaml - arguments: - - --upscale-period= - ``` -- ### --default-uptime - sets the [uptime](#uptime) value on the [cli layer](#cli-layer) - ```yaml - arguments: - - --default-uptime= - ``` -- ### --downscale-period - sets the [downscale-period](#downscale-period) value on the [cli layer](#cli-layer) - ```yaml - arguments: - - --downscale-period= - ``` -- ### --default-downtime - sets the [downtime](#downtime) value on the [cli layer](#cli-layer) - ```yaml - arguments: - - --default-downtime= - ``` -- ### --downtime-replicas - sets the [downscale replicas](#downscale-replicas) value on the [cli layer](#cli-layer) - ```yaml - arguments: - - --downtime-replicas= - ``` -- ### --explicit-include - sets the [exclude value](#exclude) on the [cli layer](#cli-layer) to true, which excludes every workload unless the exclude value on the [workload](#workload-layer) or [namespace](#namespace-layer) layer is set to false. See the [layers concept](#layers) for more details. - ```yaml - arguments: - - --explicit-include= - ``` +```yaml +arguments: + - --interval=10 + - --dry-run=true +``` -## Runtime Configuration: +This configuration will set the GoKubeDownscaler to dry run mode, which makes it only print the actions it would have performed instead of actually scaling resources and sets the wait time between workload scans to 10 seconds. +::: -- ### --dry-run - `--dry-run` takes a boolean value that defaults to `false`.\ - If you set: - ```yaml - arguments: - - --dry-run=true - ``` - the GoKubeDownscaler will be set into dry run mode, which makes it only print the actions it would have performed instead of actually scaling resources. -- ### --debug - `--debug` takes a boolean value that defaults to `false`.\ - makes the downscaler print more/debug information on what it currently does and what happens to the workloads. - ```yaml - arguments: - - --debug=true - ``` -- ### --once - `--once` takes a boolean value that defaults to `false`.\ - makes the downscaler exit after one scan {/* In the future we should explain what a scan is in the #concepts section and link it here */} - ```yaml - arguments: - - --once=true - ``` -- ### --interval - `--interval` takes a [duration](#duration) value that defaults to `30s`.\ - sets the wait time between scans - ```yaml - arguments: - - --interval= - ``` -- ### --namespace - `--namespace` takes a comma separated list of namespaces that defaults to all namespaces - makes the downscaler get workloads only from the specified namespaces - ```yaml - arguments: - - --namespace= - ``` -- ### --include-resources - `--include-resources` takes a comma separated list of (case-insensitive) [scalable resources](#scalable-resources) that defaults to deployments. - enables scaling of workloads with the specified resource type - ```yaml - arguments: - - --include-resources= - ``` -- ### --exclude-namespaces - `--exclude-namespaces` takes a comma separated list of regex patterns matching namespaces (`some-ns,other-ns,kube-.*` or `some-ns, other-ns, kube-.*`) that defaults to kube-system, kube-downscaler - excludes the matching namespaces from being scaled - ```yaml - arguments: - - --exclude-namespaces= - ``` -- ### --exclude-deployments - `--exclude-deployments` takes a comma separated list of regex patterns matching workload names (`some-workload,other-workload,.*kube-downscaler` or `some-workload, other-workload, .*kube-downscaler`) - excludes the matching workloads from being scaled - default: none - ```yaml - arguments: - - --exclude-deployments= - ``` -- ### --matching-labels - comma separated list of regex patterns matching labels with their value (`some-label=val,other-label=value,another-label=.*` or `some-label=val, other-label=value, another-label=.*`) - makes the downscaler only include workloads which have any label that matches any of the specified labels and values - default: none - ```yaml - arguments: - - --matching-labels= - ``` -- ### --time-annotation - string key of an annotation on the workload containing a [RFC3339 Timestamp](https://datatracker.ietf.org/doc/html/rfc3339) - when set grace-period will use the timestamp in the annotation instead of the creation time of the workload - default: none (uses the workloads creation time) - ```yaml - arguments: - - --time-annotation= - ``` +You can find a list of all possible arguments [here][docs-arguments]. diff --git a/website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx b/website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx index 0a887d4..32b20e2 100644 --- a/website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx +++ b/website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx @@ -5,7 +5,7 @@ id: fullnameOverride # fullnameOverride -`fullnameOverride` overrides the full names of the created Kubernetes resources with the provided name if set. +`fullnameOverride` overrides the names of the created Kubernetes objects with the provided name. :::info The default value for `fullnameOverride` is: @@ -16,4 +16,12 @@ fullnameOverride: "" ::: -If a value for `fullnameOverride` is set the Helm Chart +If a value for `fullnameOverride` is set the Helm Chart will change the names of the following kubernetes objects to the one provided: + +- Deployment +- ClusterRole +- ClusterRoleBinding +- Role +- RoleBinding + +Keep in mind however that the override is being cut off after 63 characters and will trim trailing hyphens. diff --git a/website/content/docs/helm-chart/Values/5 - nameOverride.mdx b/website/content/docs/helm-chart/Values/5 - nameOverride.mdx index ecf10c4..de3a8c9 100644 --- a/website/content/docs/helm-chart/Values/5 - nameOverride.mdx +++ b/website/content/docs/helm-chart/Values/5 - nameOverride.mdx @@ -5,7 +5,7 @@ id: nameOverride # nameOverride -Overrides the chart name for the created Kubernetes resources. +`nameOverride` overrides the chart name for the created Kubernetes objects. :::info The default value for `nameOverride` is: @@ -15,3 +15,21 @@ nameOverride: "" ``` ::: + +If a value for `nameOverride` is set the Helm Chart will adjust the names of the following kubernetes objects: + +- Deployment +- ClusterRole +- ClusterRoleBinding +- Role +- RoleBinding + +So if you for example install the Helm Chart with the release name `my-release` and set: + +```yaml +nameOverride: my-custom-name +``` + +the names of the mentioned kubernetes objects will be changed to `my-release-my-custom-name`. + +Keep in mind however that the override is being cut off after 63 characters and will trim trailing hyphens. diff --git a/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx b/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx index 5835d38..05b6908 100644 --- a/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx +++ b/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx @@ -5,8 +5,7 @@ id: constrainedNamespaces # constrainedNamespaces -`constrainedNamespaces` is a list of namespaces the GoKubeDownscaler is going to operate on when constrained.\ -You can constrain the GoKubeDownscaler with the [constrainedDownscaler][constrainedDownscaler] parameter. +`constrainedNamespaces` is a comma separated list of namespaces the GoKubeDownscaler is going to operate on when constrained. :::info The default value for `constrainedNamespaces` is: @@ -16,3 +15,13 @@ constrainedNamespaces: [] ``` ::: + +The [constrainedDownscaler][constrainedDownscaler] parameter has to be set to true for this field to be effective. + +If you want to constrain the GoKubeDownscaler to a set of namespaces you can configure it like this: + +```yaml +constrainedNamespaces: [namespace1, namespace2, namespace3] +``` + +This ensures that theGoKubeDownscaler only has access to actions on the namespaces namespace1, namespace2 and namespace3. diff --git a/website/content/docs/helm-chart/Values/8 - serviceAccount.mdx b/website/content/docs/helm-chart/Values/8 - serviceAccount.mdx index 4afa626..fb84c81 100644 --- a/website/content/docs/helm-chart/Values/8 - serviceAccount.mdx +++ b/website/content/docs/helm-chart/Values/8 - serviceAccount.mdx @@ -20,3 +20,14 @@ serviceAccount: ``` ::: + +By default the Helm Chart will always create a service account for the GoKubeDownscaler with the name\ +`[release-name]-go-kube-downscaler`. + +This name can be overridden by the serviceAccount.name field. + +If you don't want to create a new service account you can set the serviceAccount.create field to false. + +The Helm Chart will then by default try to assign the default service account to the GoKubeDownscaler. + +This can again be changed by providing a name in the serviceAccount.name field. diff --git a/website/content/docs/helm-chart/Values/9 - podSecurityContext.mdx b/website/content/docs/helm-chart/Values/9 - podSecurityContext.mdx index 8ac262a..f884011 100644 --- a/website/content/docs/helm-chart/Values/9 - podSecurityContext.mdx +++ b/website/content/docs/helm-chart/Values/9 - podSecurityContext.mdx @@ -5,7 +5,7 @@ id: podSecurityContext # podSecurityContext -Defines the SecurityContext on pod level. (More info [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)) +`podSecurityContext` defines the SecurityContext on pod level. :::info The default values for `podSecurityContext` are: @@ -20,3 +20,7 @@ podSecurityContext: ``` ::: + +In this field you can customize privilege and access control settings for the GoKubeDownscaler Pod. + +More info on all the possible configurations can be found [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). From 7d3bb557dc07e2733639359328e9fd4e790ef765 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 5 Nov 2024 10:21:22 +0100 Subject: [PATCH 18/22] restructure directories --- website/content/_global_md_links.mdx | 3 +++ .../docs/{helm-chart => 0 - helm-chart}/0 - Components.mdx | 0 .../docs/{helm-chart => 0 - helm-chart}/1 - Permissions.mdx | 0 .../Values => 0 - helm-chart/3 - values}/0 - replicaCount.mdx | 2 +- .../Values => 0 - helm-chart/3 - values}/1 - image.mdx | 2 +- .../3 - values}/10 - securityContext.mdx | 2 +- .../Values => 0 - helm-chart/3 - values}/11 - resources.mdx | 0 .../Values => 0 - helm-chart/3 - values}/12 - nodeSelector.mdx | 0 .../Values => 0 - helm-chart/3 - values}/13 - tolerations.mdx | 0 .../Values => 0 - helm-chart/3 - values}/14 - affinity.mdx | 2 +- .../3 - values}/15 - excludedNamespaces.mdx | 0 .../Values => 0 - helm-chart/3 - values}/16 - configMap.mdx | 0 .../Values => 0 - helm-chart/3 - values}/2 - arguments.mdx | 0 .../3 - values}/3 - includedResources.mdx | 0 .../3 - values}/4 - fullnameOverride.mdx | 0 .../Values => 0 - helm-chart/3 - values}/5 - nameOverride.mdx | 0 .../3 - values}/6 - constrainedDownscaler.mdx | 0 .../3 - values}/7 - constrainedNamespaces.mdx | 0 .../3 - values}/8 - serviceAccount.mdx | 0 .../3 - values}/9 - podSecurityContext.mdx | 0 .../{helm-chart/Values => 0 - helm-chart/3 - values}/index.mdx | 0 website/content/docs/{helm-chart => 0 - helm-chart}/index.mdx | 0 22 files changed, 7 insertions(+), 4 deletions(-) rename website/content/docs/{helm-chart => 0 - helm-chart}/0 - Components.mdx (100%) rename website/content/docs/{helm-chart => 0 - helm-chart}/1 - Permissions.mdx (100%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/0 - replicaCount.mdx (69%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/1 - image.mdx (89%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/10 - securityContext.mdx (76%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/11 - resources.mdx (100%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/12 - nodeSelector.mdx (100%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/13 - tolerations.mdx (100%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/14 - affinity.mdx (68%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/15 - excludedNamespaces.mdx (100%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/16 - configMap.mdx (100%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/2 - arguments.mdx (100%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/3 - includedResources.mdx (100%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/4 - fullnameOverride.mdx (100%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/5 - nameOverride.mdx (100%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/6 - constrainedDownscaler.mdx (100%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/7 - constrainedNamespaces.mdx (100%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/8 - serviceAccount.mdx (100%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/9 - podSecurityContext.mdx (100%) rename website/content/docs/{helm-chart/Values => 0 - helm-chart/3 - values}/index.mdx (100%) rename website/content/docs/{helm-chart => 0 - helm-chart}/index.mdx (100%) diff --git a/website/content/_global_md_links.mdx b/website/content/_global_md_links.mdx index 3454c19..bcb6eab 100644 --- a/website/content/_global_md_links.mdx +++ b/website/content/_global_md_links.mdx @@ -48,3 +48,6 @@ [go-install]: https://go.dev/doc/install "Go Installation" [git-install]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git "Git Installation" [helm-intro]: https://helm.sh/docs/intro/ "Helm Intro" + +{/* K8s Pages */} +[kubernetes-security-context]: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ "Security context" diff --git a/website/content/docs/helm-chart/0 - Components.mdx b/website/content/docs/0 - helm-chart/0 - Components.mdx similarity index 100% rename from website/content/docs/helm-chart/0 - Components.mdx rename to website/content/docs/0 - helm-chart/0 - Components.mdx diff --git a/website/content/docs/helm-chart/1 - Permissions.mdx b/website/content/docs/0 - helm-chart/1 - Permissions.mdx similarity index 100% rename from website/content/docs/helm-chart/1 - Permissions.mdx rename to website/content/docs/0 - helm-chart/1 - Permissions.mdx diff --git a/website/content/docs/helm-chart/Values/0 - replicaCount.mdx b/website/content/docs/0 - helm-chart/3 - values/0 - replicaCount.mdx similarity index 69% rename from website/content/docs/helm-chart/Values/0 - replicaCount.mdx rename to website/content/docs/0 - helm-chart/3 - values/0 - replicaCount.mdx index cefe6a4..0cd29f2 100644 --- a/website/content/docs/helm-chart/Values/0 - replicaCount.mdx +++ b/website/content/docs/0 - helm-chart/3 - values/0 - replicaCount.mdx @@ -19,5 +19,5 @@ replicaCount: 1 Changing this to a different integer value will result in the deployment of the provided number of pods. :::warning -This value should not be changed because multiple instances of the GoKubeDownscaler could lead to errors if they try to scale the same workloads simultaneously. +This value should not be changed because running multiple instances of the GoKubeDownscaler on the same workloads is currently not supported. ::: diff --git a/website/content/docs/helm-chart/Values/1 - image.mdx b/website/content/docs/0 - helm-chart/3 - values/1 - image.mdx similarity index 89% rename from website/content/docs/helm-chart/Values/1 - image.mdx rename to website/content/docs/0 - helm-chart/3 - values/1 - image.mdx index f3f3cc8..e3cce77 100644 --- a/website/content/docs/helm-chart/Values/1 - image.mdx +++ b/website/content/docs/0 - helm-chart/3 - values/1 - image.mdx @@ -25,4 +25,4 @@ Changing the value of `repository` will result in the images being pulled from a Changing the value of `tag` will deploy a different version of the GoKubeDownscaler. If left empty like it is by default the GoKubeDownscaler will use the [appVersion][chart-appversion] of the currently used Helm Chart. -More details to versions of the GoKubeDownscaler can be found [here][github-releases]. +You can find all versions of the GoKubeDownscaler [on the github releases page][github-releases]. diff --git a/website/content/docs/helm-chart/Values/10 - securityContext.mdx b/website/content/docs/0 - helm-chart/3 - values/10 - securityContext.mdx similarity index 76% rename from website/content/docs/helm-chart/Values/10 - securityContext.mdx rename to website/content/docs/0 - helm-chart/3 - values/10 - securityContext.mdx index acd52ae..cfdfd44 100644 --- a/website/content/docs/helm-chart/Values/10 - securityContext.mdx +++ b/website/content/docs/0 - helm-chart/3 - values/10 - securityContext.mdx @@ -24,4 +24,4 @@ securityContext: In this field you can customize privilege and access control settings for the GoKubeDownscaler container. -More info on all the possible configurations can be found [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). +You can find more information on security context in [the official kubernetes documentation][kubernetes-security-context]. diff --git a/website/content/docs/helm-chart/Values/11 - resources.mdx b/website/content/docs/0 - helm-chart/3 - values/11 - resources.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/11 - resources.mdx rename to website/content/docs/0 - helm-chart/3 - values/11 - resources.mdx diff --git a/website/content/docs/helm-chart/Values/12 - nodeSelector.mdx b/website/content/docs/0 - helm-chart/3 - values/12 - nodeSelector.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/12 - nodeSelector.mdx rename to website/content/docs/0 - helm-chart/3 - values/12 - nodeSelector.mdx diff --git a/website/content/docs/helm-chart/Values/13 - tolerations.mdx b/website/content/docs/0 - helm-chart/3 - values/13 - tolerations.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/13 - tolerations.mdx rename to website/content/docs/0 - helm-chart/3 - values/13 - tolerations.mdx diff --git a/website/content/docs/helm-chart/Values/14 - affinity.mdx b/website/content/docs/0 - helm-chart/3 - values/14 - affinity.mdx similarity index 68% rename from website/content/docs/helm-chart/Values/14 - affinity.mdx rename to website/content/docs/0 - helm-chart/3 - values/14 - affinity.mdx index 54b98c9..063febc 100644 --- a/website/content/docs/helm-chart/Values/14 - affinity.mdx +++ b/website/content/docs/0 - helm-chart/3 - values/14 - affinity.mdx @@ -16,4 +16,4 @@ affinity: {} ::: -(More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) +More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/) diff --git a/website/content/docs/helm-chart/Values/15 - excludedNamespaces.mdx b/website/content/docs/0 - helm-chart/3 - values/15 - excludedNamespaces.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/15 - excludedNamespaces.mdx rename to website/content/docs/0 - helm-chart/3 - values/15 - excludedNamespaces.mdx diff --git a/website/content/docs/helm-chart/Values/16 - configMap.mdx b/website/content/docs/0 - helm-chart/3 - values/16 - configMap.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/16 - configMap.mdx rename to website/content/docs/0 - helm-chart/3 - values/16 - configMap.mdx diff --git a/website/content/docs/helm-chart/Values/2 - arguments.mdx b/website/content/docs/0 - helm-chart/3 - values/2 - arguments.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/2 - arguments.mdx rename to website/content/docs/0 - helm-chart/3 - values/2 - arguments.mdx diff --git a/website/content/docs/helm-chart/Values/3 - includedResources.mdx b/website/content/docs/0 - helm-chart/3 - values/3 - includedResources.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/3 - includedResources.mdx rename to website/content/docs/0 - helm-chart/3 - values/3 - includedResources.mdx diff --git a/website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx b/website/content/docs/0 - helm-chart/3 - values/4 - fullnameOverride.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx rename to website/content/docs/0 - helm-chart/3 - values/4 - fullnameOverride.mdx diff --git a/website/content/docs/helm-chart/Values/5 - nameOverride.mdx b/website/content/docs/0 - helm-chart/3 - values/5 - nameOverride.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/5 - nameOverride.mdx rename to website/content/docs/0 - helm-chart/3 - values/5 - nameOverride.mdx diff --git a/website/content/docs/helm-chart/Values/6 - constrainedDownscaler.mdx b/website/content/docs/0 - helm-chart/3 - values/6 - constrainedDownscaler.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/6 - constrainedDownscaler.mdx rename to website/content/docs/0 - helm-chart/3 - values/6 - constrainedDownscaler.mdx diff --git a/website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx b/website/content/docs/0 - helm-chart/3 - values/7 - constrainedNamespaces.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/7 - constrainedNamespaces.mdx rename to website/content/docs/0 - helm-chart/3 - values/7 - constrainedNamespaces.mdx diff --git a/website/content/docs/helm-chart/Values/8 - serviceAccount.mdx b/website/content/docs/0 - helm-chart/3 - values/8 - serviceAccount.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/8 - serviceAccount.mdx rename to website/content/docs/0 - helm-chart/3 - values/8 - serviceAccount.mdx diff --git a/website/content/docs/helm-chart/Values/9 - podSecurityContext.mdx b/website/content/docs/0 - helm-chart/3 - values/9 - podSecurityContext.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/9 - podSecurityContext.mdx rename to website/content/docs/0 - helm-chart/3 - values/9 - podSecurityContext.mdx diff --git a/website/content/docs/helm-chart/Values/index.mdx b/website/content/docs/0 - helm-chart/3 - values/index.mdx similarity index 100% rename from website/content/docs/helm-chart/Values/index.mdx rename to website/content/docs/0 - helm-chart/3 - values/index.mdx diff --git a/website/content/docs/helm-chart/index.mdx b/website/content/docs/0 - helm-chart/index.mdx similarity index 100% rename from website/content/docs/helm-chart/index.mdx rename to website/content/docs/0 - helm-chart/index.mdx From 2f7acf6aa829d8831f84bc4d1c870f949bf65e72 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 5 Nov 2024 11:31:14 +0100 Subject: [PATCH 19/22] still not done but fixes the md ref --- website/content/_global_md_links.mdx | 43 +++++++++++-------- .../0 - replicaCount.mdx | 2 +- .../{3 - values => 2 - values}/1 - image.mdx | 2 +- .../10 - securityContext.mdx | 4 +- .../11 - resources.mdx | 4 +- .../12 - nodeSelector.mdx | 2 +- .../2 - values/13 - tolerations.mdx | 31 +++++++++++++ .../2 - values/14 - affinity.mdx | 21 +++++++++ .../15 - excludedNamespaces.mdx | 2 +- .../16 - configMap.mdx | 8 ++-- .../2 - arguments.mdx | 5 ++- .../3 - includedResources.mdx | 2 +- .../4 - fullnameOverride.mdx | 3 +- .../5 - nameOverride.mdx | 5 ++- .../6 - constrainedDownscaler.mdx | 2 +- .../7 - constrainedNamespaces.mdx | 2 +- .../8 - serviceAccount.mdx | 4 +- .../9 - podSecurityContext.mdx | 4 +- .../{3 - values => 2 - values}/index.mdx | 0 .../3 - values/13 - tolerations.mdx | 31 ------------- .../3 - values/14 - affinity.mdx | 19 -------- .../getting-started/0 - Installation.mdx | 6 +-- 22 files changed, 106 insertions(+), 96 deletions(-) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/0 - replicaCount.mdx (79%) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/1 - image.mdx (92%) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/10 - securityContext.mdx (65%) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/11 - resources.mdx (66%) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/12 - nodeSelector.mdx (83%) create mode 100644 website/content/docs/0 - helm-chart/2 - values/13 - tolerations.mdx create mode 100644 website/content/docs/0 - helm-chart/2 - values/14 - affinity.mdx rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/15 - excludedNamespaces.mdx (80%) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/16 - configMap.mdx (67%) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/2 - arguments.mdx (72%) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/3 - includedResources.mdx (87%) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/4 - fullnameOverride.mdx (79%) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/5 - nameOverride.mdx (75%) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/6 - constrainedDownscaler.mdx (79%) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/7 - constrainedNamespaces.mdx (81%) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/8 - serviceAccount.mdx (79%) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/9 - podSecurityContext.mdx (64%) rename website/content/docs/0 - helm-chart/{3 - values => 2 - values}/index.mdx (100%) delete mode 100644 website/content/docs/0 - helm-chart/3 - values/13 - tolerations.mdx delete mode 100644 website/content/docs/0 - helm-chart/3 - values/14 - affinity.mdx diff --git a/website/content/_global_md_links.mdx b/website/content/_global_md_links.mdx index bcb6eab..7e2345a 100644 --- a/website/content/_global_md_links.mdx +++ b/website/content/_global_md_links.mdx @@ -17,26 +17,28 @@ [docs-helm-components]: /GoKubeDownscaler/docs/helm-chart/components "Helm Components" [docs-helm-permissions]: /GoKubeDownscaler/docs/helm-chart/permissions "Permissions" {/* TODO */} -[docs-arguments]: /GoKubeDownscaler/docs/ "arguments" +[docs-arguments]: /GoKubeDownscaler/docs/ "Arguments" +[docs-environment-variables]: /GoKubeDownscaler/docs/ "Environment Variables" +[docs-layer-values]: /GoKubeDownscaler/docs/ "Layer Values" {/* Helm Value links */} -[replicaCount]: /GoKubeDownscaler/docs/helm-chart/Values/replicaCount -[image]: /GoKubeDownscaler/docs/helm-chart/Values/image -[arguments]: /GoKubeDownscaler/docs/helm-chart/Values/arguments -[includedResources]: /GoKubeDownscaler/docs/helm-chart/Values/includedResources -[fullnameOverride]: /GoKubeDownscaler/docs/helm-chart/Values/fullnameOverride -[nameOverride]: /GoKubeDownscaler/docs/helm-chart/Values/nameOverride -[constrainedDownscaler]: /GoKubeDownscaler/docs/helm-chart/Values/constrainedDownscaler -[constrainedNamespaces]: /GoKubeDownscaler/docs/helm-chart/Values/constrainedNamespaces -[serviceAccount]: /GoKubeDownscaler/docs/helm-chart/Values/serviceAccount -[podSecurityContext]: /GoKubeDownscaler/docs/helm-chart/Values/podSecurityContext -[securityContext]: /GoKubeDownscaler/docs/helm-chart/Values/securityContext -[resources]: /GoKubeDownscaler/docs/helm-chart/Values/resources -[nodeSelector]: /GoKubeDownscaler/docs/helm-chart/Values/nodeSelector -[tolerations]: /GoKubeDownscaler/docs/helm-chart/Values/tolerations -[affinity]: /GoKubeDownscaler/docs/helm-chart/Values/affinity -[excludedNamespaces]: /GoKubeDownscaler/docs/helm-chart/Values/excludedNamespaces -[configMap]: /GoKubeDownscaler/docs/helm-chart/Values/configMap +[replicaCount]: /GoKubeDownscaler/docs/helm-chart/Values/replicaCount "replicaCount" +[image]: /GoKubeDownscaler/docs/helm-chart/Values/image "image" +[arguments]: /GoKubeDownscaler/docs/helm-chart/Values/arguments "arguments" +[includedResources]: /GoKubeDownscaler/docs/helm-chart/Values/includedResources "includedResources" +[fullnameOverride]: /GoKubeDownscaler/docs/helm-chart/Values/fullnameOverride "fullnameOverride" +[nameOverride]: /GoKubeDownscaler/docs/helm-chart/Values/nameOverride "nameOverride" +[constrainedDownscaler]: /GoKubeDownscaler/docs/helm-chart/Values/constrainedDownscaler "constrainedDownscaler" +[constrainedNamespaces]: /GoKubeDownscaler/docs/helm-chart/Values/constrainedNamespaces "constrainedNamespaces" +[serviceAccount]: /GoKubeDownscaler/docs/helm-chart/Values/serviceAccount "serviceAccount" +[podSecurityContext]: /GoKubeDownscaler/docs/helm-chart/Values/podSecurityContext "podSecurityContext" +[securityContext]: /GoKubeDownscaler/docs/helm-chart/Values/securityContext "securityContext" +[resources]: /GoKubeDownscaler/docs/helm-chart/Values/resources "resources" +[nodeSelector]: /GoKubeDownscaler/docs/helm-chart/Values/nodeSelector "nodeSelector" +[tolerations]: /GoKubeDownscaler/docs/helm-chart/Values/tolerations "tolerations" +[affinity]: /GoKubeDownscaler/docs/helm-chart/Values/affinity "affinity" +[excludedNamespaces]: /GoKubeDownscaler/docs/helm-chart/Values/excludedNamespaces "excludedNamespaces" +[configMap]: /GoKubeDownscaler/docs/helm-chart/Values/configMap "configMap" {/* External links */} [docusaurus]: https://docusaurus.io "Docusaurus" @@ -50,4 +52,7 @@ [helm-intro]: https://helm.sh/docs/intro/ "Helm Intro" {/* K8s Pages */} -[kubernetes-security-context]: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ "Security context" +[kubernetes-security-context]: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ "Kubernetes Security Context" +[kubernetes-resource-management]: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ "Kubernetes Resource Management" +[kubernetes-taints-and-tolerations]: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ "Kubernetes Taints and Tolerations" +[kubernetes-affinity]: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/ "Kubernetes Affinity" diff --git a/website/content/docs/0 - helm-chart/3 - values/0 - replicaCount.mdx b/website/content/docs/0 - helm-chart/2 - values/0 - replicaCount.mdx similarity index 79% rename from website/content/docs/0 - helm-chart/3 - values/0 - replicaCount.mdx rename to website/content/docs/0 - helm-chart/2 - values/0 - replicaCount.mdx index 0cd29f2..ac8e363 100644 --- a/website/content/docs/0 - helm-chart/3 - values/0 - replicaCount.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/0 - replicaCount.mdx @@ -5,7 +5,7 @@ id: replicaCount # replicaCount -`replicaCount` adjusts the number of replicas that the GoKubeDownscaler deployment will have. +The `replicaCount` value adjusts the number of replicas that the GoKubeDownscaler deployment will have. :::info The default value of `replicaCount` is: diff --git a/website/content/docs/0 - helm-chart/3 - values/1 - image.mdx b/website/content/docs/0 - helm-chart/2 - values/1 - image.mdx similarity index 92% rename from website/content/docs/0 - helm-chart/3 - values/1 - image.mdx rename to website/content/docs/0 - helm-chart/2 - values/1 - image.mdx index e3cce77..b01ea88 100644 --- a/website/content/docs/0 - helm-chart/3 - values/1 - image.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/1 - image.mdx @@ -5,7 +5,7 @@ id: image # image -`image` contains the two fields `repository` and `tag`: +The `image` value contains the two fields `repository` and `tag`: - `repository` is the repository URL where the image versions of the GoKubeDownscaler are located. - `tag` is the version tag of the image. diff --git a/website/content/docs/0 - helm-chart/3 - values/10 - securityContext.mdx b/website/content/docs/0 - helm-chart/2 - values/10 - securityContext.mdx similarity index 65% rename from website/content/docs/0 - helm-chart/3 - values/10 - securityContext.mdx rename to website/content/docs/0 - helm-chart/2 - values/10 - securityContext.mdx index cfdfd44..9f080e8 100644 --- a/website/content/docs/0 - helm-chart/3 - values/10 - securityContext.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/10 - securityContext.mdx @@ -5,7 +5,7 @@ id: securityContext # securityContext -`securityContext` defines the SecurityContext on container level. +The `securityContext` value defines the SecurityContext on container level. :::info The default values for `securityContext` are: @@ -24,4 +24,4 @@ securityContext: In this field you can customize privilege and access control settings for the GoKubeDownscaler container. -You can find more information on security context in [the official kubernetes documentation][kubernetes-security-context]. +For more information on possible configuration you can reference [the official Kubernetes documentation][kubernetes-security-context]. diff --git a/website/content/docs/0 - helm-chart/3 - values/11 - resources.mdx b/website/content/docs/0 - helm-chart/2 - values/11 - resources.mdx similarity index 66% rename from website/content/docs/0 - helm-chart/3 - values/11 - resources.mdx rename to website/content/docs/0 - helm-chart/2 - values/11 - resources.mdx index 649e02b..0c5264c 100644 --- a/website/content/docs/0 - helm-chart/3 - values/11 - resources.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/11 - resources.mdx @@ -5,7 +5,7 @@ id: resources # resources -`resources` defines the CPU and memory limits and requests. +The `resources` value defines the CPU and memory limits and requests. :::info The default values for `resources` are: @@ -26,4 +26,4 @@ Here you can adjust the minimum and maximum amounts of cpu and memory the GoKube The requests being the minimum and the limits being the maximum. -You can read more about this [here](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). +For more information on resource management you can reference [the official Kubernetes documentation][kubernetes-resource-management]. diff --git a/website/content/docs/0 - helm-chart/3 - values/12 - nodeSelector.mdx b/website/content/docs/0 - helm-chart/2 - values/12 - nodeSelector.mdx similarity index 83% rename from website/content/docs/0 - helm-chart/3 - values/12 - nodeSelector.mdx rename to website/content/docs/0 - helm-chart/2 - values/12 - nodeSelector.mdx index 2d8d238..643e828 100644 --- a/website/content/docs/0 - helm-chart/3 - values/12 - nodeSelector.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/12 - nodeSelector.mdx @@ -5,7 +5,7 @@ id: nodeSelector # nodeSelector -`nodeSelector` defines labels of nodes that you want the deployment to be scheduled on. +The `nodeSelector` value defines labels of nodes that you want the deployment to be scheduled on. :::info The default value for `nodeSelector` is: diff --git a/website/content/docs/0 - helm-chart/2 - values/13 - tolerations.mdx b/website/content/docs/0 - helm-chart/2 - values/13 - tolerations.mdx new file mode 100644 index 0000000..2685e3b --- /dev/null +++ b/website/content/docs/0 - helm-chart/2 - values/13 - tolerations.mdx @@ -0,0 +1,31 @@ +--- +title: tolerations +id: tolerations +--- + +# tolerations + +The `tolerations` value adds tolerations to the pods of the deployment to be able to be scheduled on nodes with matching taints. + +:::info +The default value for `tolerations` is: + +```yaml +tolerations: [] +``` + +::: + +This field allows the GoKubeDownscaler pods to be scheduled on Nodes with certain taints. + +If you want to allow the GoKubeDownscaler pods to schedule on a Node with a taint `key1=value1:NoSchedule` you can set: + +```yaml +tolerations: + - key: "key1" + operator: "Equal" + value: "value1" + effect: "NoSchedule" +``` + +For more information on taints and tolerations you can reference [the official Kubernetes documentation][kubernetes-taints-and-tolerations]. diff --git a/website/content/docs/0 - helm-chart/2 - values/14 - affinity.mdx b/website/content/docs/0 - helm-chart/2 - values/14 - affinity.mdx new file mode 100644 index 0000000..c1488cd --- /dev/null +++ b/website/content/docs/0 - helm-chart/2 - values/14 - affinity.mdx @@ -0,0 +1,21 @@ +--- +title: affinity +id: affinity +--- + +# affinity + +The `affinity` value defines rules for node affinity and pod affinity/anti-affinity. + +:::info +The default value for `affinity` is: + +```yaml +affinity: {} +``` + +::: + +By default the `affinity` field is empty. You can add affinity rules to this field for two . + +For more information on affinity you can reference [the official Kubernetes documentation][kubernetes-affinity]. diff --git a/website/content/docs/0 - helm-chart/3 - values/15 - excludedNamespaces.mdx b/website/content/docs/0 - helm-chart/2 - values/15 - excludedNamespaces.mdx similarity index 80% rename from website/content/docs/0 - helm-chart/3 - values/15 - excludedNamespaces.mdx rename to website/content/docs/0 - helm-chart/2 - values/15 - excludedNamespaces.mdx index 0d67ff6..adb1c6e 100644 --- a/website/content/docs/0 - helm-chart/3 - values/15 - excludedNamespaces.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/15 - excludedNamespaces.mdx @@ -5,7 +5,7 @@ id: excludedNamespaces # excludedNamespaces -`excludedNamespaces` is a list of namespaces that are supposed to be excluded from the downscaling process of the GoKubeDownscaler. +The `excludedNamespaces` value is a list of namespaces that are supposed to be excluded from the downscaling process of the GoKubeDownscaler. :::info The default value for `excludedNamespaces` is: diff --git a/website/content/docs/0 - helm-chart/3 - values/16 - configMap.mdx b/website/content/docs/0 - helm-chart/2 - values/16 - configMap.mdx similarity index 67% rename from website/content/docs/0 - helm-chart/3 - values/16 - configMap.mdx rename to website/content/docs/0 - helm-chart/2 - values/16 - configMap.mdx index 54f3566..33b909e 100644 --- a/website/content/docs/0 - helm-chart/3 - values/16 - configMap.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/16 - configMap.mdx @@ -5,7 +5,7 @@ id: configMap # configMap -`configMap` contains the two fields `name` and `extraConfig`: +The `configMap` value contains the two fields `name` and `extraConfig`: - `name` defines the name of the configmap for the GoKubeDownscaler. - `extraConfig` adds additional specified environment variables to the ConfigMap. @@ -21,7 +21,9 @@ configMap: ::: -By default the `extraConfig` field is empty. Adding a line will change how the GoKubeDownscaler behaves. +By default the `extraConfig` field is empty. Appending a line will add the corresponding environment variable to the configMap. + +This then changes how the GoKubeDownscaler behaves. :::tip For example: @@ -38,4 +40,4 @@ The given configuration will exclude the deployments with the name deployment1 a ::: -You can find a list of all possible environment variables [here][docs-environment-variables]. +You can find a list of all possible environment variables on [our documentation page][docs-environment-variables]. diff --git a/website/content/docs/0 - helm-chart/3 - values/2 - arguments.mdx b/website/content/docs/0 - helm-chart/2 - values/2 - arguments.mdx similarity index 72% rename from website/content/docs/0 - helm-chart/3 - values/2 - arguments.mdx rename to website/content/docs/0 - helm-chart/2 - values/2 - arguments.mdx index 6d5e330..85e4f4b 100644 --- a/website/content/docs/0 - helm-chart/3 - values/2 - arguments.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/2 - arguments.mdx @@ -5,7 +5,7 @@ id: arguments # arguments -`arguments` set [layer values](#values) and runtime configuration at the start of the program. +The `arguments` value sets [layer values][docs-layer-values] and runtime configuration at the startup of the container. :::info The default value for `arguments` is: @@ -27,6 +27,7 @@ arguments: ``` This configuration will set the GoKubeDownscaler to dry run mode, which makes it only print the actions it would have performed instead of actually scaling resources and sets the wait time between workload scans to 10 seconds. + ::: -You can find a list of all possible arguments [here][docs-arguments]. +You can find a list of all possible arguments on [our documentation page][docs-arguments]. diff --git a/website/content/docs/0 - helm-chart/3 - values/3 - includedResources.mdx b/website/content/docs/0 - helm-chart/2 - values/3 - includedResources.mdx similarity index 87% rename from website/content/docs/0 - helm-chart/3 - values/3 - includedResources.mdx rename to website/content/docs/0 - helm-chart/2 - values/3 - includedResources.mdx index 4ba0182..30e02c3 100644 --- a/website/content/docs/0 - helm-chart/3 - values/3 - includedResources.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/3 - includedResources.mdx @@ -5,7 +5,7 @@ id: includedResources # includedResources -`includedResources` defines all the resource types that the GoKubeDownscaler is supposed to be able to handle. +The `includedResources` value defines all the resource types that the GoKubeDownscaler is supposed to be able to handle. :::info The default value for `includedResources` is: diff --git a/website/content/docs/0 - helm-chart/3 - values/4 - fullnameOverride.mdx b/website/content/docs/0 - helm-chart/2 - values/4 - fullnameOverride.mdx similarity index 79% rename from website/content/docs/0 - helm-chart/3 - values/4 - fullnameOverride.mdx rename to website/content/docs/0 - helm-chart/2 - values/4 - fullnameOverride.mdx index 32b20e2..9362612 100644 --- a/website/content/docs/0 - helm-chart/3 - values/4 - fullnameOverride.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/4 - fullnameOverride.mdx @@ -5,7 +5,7 @@ id: fullnameOverride # fullnameOverride -`fullnameOverride` overrides the names of the created Kubernetes objects with the provided name. +The `fullnameOverride` value overrides the names of the created Kubernetes objects with the provided name. :::info The default value for `fullnameOverride` is: @@ -19,6 +19,7 @@ fullnameOverride: "" If a value for `fullnameOverride` is set the Helm Chart will change the names of the following kubernetes objects to the one provided: - Deployment +- ServiceAccount - ClusterRole - ClusterRoleBinding - Role diff --git a/website/content/docs/0 - helm-chart/3 - values/5 - nameOverride.mdx b/website/content/docs/0 - helm-chart/2 - values/5 - nameOverride.mdx similarity index 75% rename from website/content/docs/0 - helm-chart/3 - values/5 - nameOverride.mdx rename to website/content/docs/0 - helm-chart/2 - values/5 - nameOverride.mdx index de3a8c9..11eb4be 100644 --- a/website/content/docs/0 - helm-chart/3 - values/5 - nameOverride.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/5 - nameOverride.mdx @@ -5,7 +5,7 @@ id: nameOverride # nameOverride -`nameOverride` overrides the chart name for the created Kubernetes objects. +The `nameOverride` value overrides the chart name for the created Kubernetes objects. :::info The default value for `nameOverride` is: @@ -19,12 +19,13 @@ nameOverride: "" If a value for `nameOverride` is set the Helm Chart will adjust the names of the following kubernetes objects: - Deployment +- ServiceAccount - ClusterRole - ClusterRoleBinding - Role - RoleBinding -So if you for example install the Helm Chart with the release name `my-release` and set: +So if you for example install the Helm Chart with a release name `my-release` and set: ```yaml nameOverride: my-custom-name diff --git a/website/content/docs/0 - helm-chart/3 - values/6 - constrainedDownscaler.mdx b/website/content/docs/0 - helm-chart/2 - values/6 - constrainedDownscaler.mdx similarity index 79% rename from website/content/docs/0 - helm-chart/3 - values/6 - constrainedDownscaler.mdx rename to website/content/docs/0 - helm-chart/2 - values/6 - constrainedDownscaler.mdx index 1d19893..631546b 100644 --- a/website/content/docs/0 - helm-chart/3 - values/6 - constrainedDownscaler.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/6 - constrainedDownscaler.mdx @@ -5,7 +5,7 @@ id: constrainedDownscaler # constrainedDownscaler -`constrainedDownscaler` sets the GoKubeDownscaler to a constrained state if true, meaning that it does not run clusterwide but restricted to a list of namespaces. +The `constrainedDownscaler` value sets the GoKubeDownscaler to a constrained state if true, meaning that it does not run clusterwide but restricted to a list of namespaces. :::info The default value for `constrainedDownscaler` is: diff --git a/website/content/docs/0 - helm-chart/3 - values/7 - constrainedNamespaces.mdx b/website/content/docs/0 - helm-chart/2 - values/7 - constrainedNamespaces.mdx similarity index 81% rename from website/content/docs/0 - helm-chart/3 - values/7 - constrainedNamespaces.mdx rename to website/content/docs/0 - helm-chart/2 - values/7 - constrainedNamespaces.mdx index 05b6908..8c3f991 100644 --- a/website/content/docs/0 - helm-chart/3 - values/7 - constrainedNamespaces.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/7 - constrainedNamespaces.mdx @@ -5,7 +5,7 @@ id: constrainedNamespaces # constrainedNamespaces -`constrainedNamespaces` is a comma separated list of namespaces the GoKubeDownscaler is going to operate on when constrained. +The `constrainedNamespaces` value is a comma separated list of namespaces the GoKubeDownscaler is going to operate on when constrained. :::info The default value for `constrainedNamespaces` is: diff --git a/website/content/docs/0 - helm-chart/3 - values/8 - serviceAccount.mdx b/website/content/docs/0 - helm-chart/2 - values/8 - serviceAccount.mdx similarity index 79% rename from website/content/docs/0 - helm-chart/3 - values/8 - serviceAccount.mdx rename to website/content/docs/0 - helm-chart/2 - values/8 - serviceAccount.mdx index fb84c81..6c5fc02 100644 --- a/website/content/docs/0 - helm-chart/3 - values/8 - serviceAccount.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/8 - serviceAccount.mdx @@ -5,7 +5,7 @@ id: serviceAccount # serviceAccount -`serviceAccount` contains the two fields `create` and `name`: +The `serviceAccount` value contains the two fields `create` and `name`: - `create` is a boolean value indicating if a new ServiceAccount is supposed to be created. - `name` is the name of the ServiceAccount the GoKubeDownscaler is supposed to use. @@ -28,6 +28,6 @@ This name can be overridden by the serviceAccount.name field. If you don't want to create a new service account you can set the serviceAccount.create field to false. -The Helm Chart will then by default try to assign the default service account to the GoKubeDownscaler. +The Helm Chart will then by default try to assign the service account with the `default` name to the GoKubeDownscaler. This can again be changed by providing a name in the serviceAccount.name field. diff --git a/website/content/docs/0 - helm-chart/3 - values/9 - podSecurityContext.mdx b/website/content/docs/0 - helm-chart/2 - values/9 - podSecurityContext.mdx similarity index 64% rename from website/content/docs/0 - helm-chart/3 - values/9 - podSecurityContext.mdx rename to website/content/docs/0 - helm-chart/2 - values/9 - podSecurityContext.mdx index f884011..2971751 100644 --- a/website/content/docs/0 - helm-chart/3 - values/9 - podSecurityContext.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/9 - podSecurityContext.mdx @@ -5,7 +5,7 @@ id: podSecurityContext # podSecurityContext -`podSecurityContext` defines the SecurityContext on pod level. +The `podSecurityContext` value defines the SecurityContext on pod level. :::info The default values for `podSecurityContext` are: @@ -23,4 +23,4 @@ podSecurityContext: In this field you can customize privilege and access control settings for the GoKubeDownscaler Pod. -More info on all the possible configurations can be found [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). +For more information on possible configuration you can reference [the official Kubernetes documentation][kubernetes-security-context]. diff --git a/website/content/docs/0 - helm-chart/3 - values/index.mdx b/website/content/docs/0 - helm-chart/2 - values/index.mdx similarity index 100% rename from website/content/docs/0 - helm-chart/3 - values/index.mdx rename to website/content/docs/0 - helm-chart/2 - values/index.mdx diff --git a/website/content/docs/0 - helm-chart/3 - values/13 - tolerations.mdx b/website/content/docs/0 - helm-chart/3 - values/13 - tolerations.mdx deleted file mode 100644 index 3a8e751..0000000 --- a/website/content/docs/0 - helm-chart/3 - values/13 - tolerations.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: tolerations -id: tolerations ---- - -# tolerations - -`tolerations` adds tolerations to the pod of the deployment to be able to be scheduled on nodes with matching taints. - -:::info -The default value for `tolerations` is: - -```yaml -tolerations: [] -``` - -::: - -This field allows the GoKubeDownscaler pod to be scheduled on Nodes with certain taints. - -If you want to allow the GoKubeDownscaler pod to schedule on a Node with a taint `key1=value1:NoSchedule` you can set: - -```yaml -tolerations: - - key: "key1" - operator: "Equal" - value: "value1" - effect: "NoSchedule" -``` - -You can find more info about taints and tolerations [here](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/). diff --git a/website/content/docs/0 - helm-chart/3 - values/14 - affinity.mdx b/website/content/docs/0 - helm-chart/3 - values/14 - affinity.mdx deleted file mode 100644 index 063febc..0000000 --- a/website/content/docs/0 - helm-chart/3 - values/14 - affinity.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: affinity -id: affinity ---- - -# affinity - -`affinity` defines rules for node affinity and pod affinity/anti-affinity. - -:::info -The default value for `affinity` is: - -```yaml -affinity: {} -``` - -::: - -More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/) diff --git a/website/content/guides/getting-started/0 - Installation.mdx b/website/content/guides/getting-started/0 - Installation.mdx index dd35823..5b8bac7 100644 --- a/website/content/guides/getting-started/0 - Installation.mdx +++ b/website/content/guides/getting-started/0 - Installation.mdx @@ -11,11 +11,9 @@ We provide a Helm Chart for an easy installation of the GoKubeDownscaler. In order to get started installing the GoKubeDownscaler using our Helm Chart you need: -- Helm installed on a system +- [Helm installed][helm-intro] on a system - have access to a Kubernetes cluster in some kind of way. -You can find out how to install Helm [here][helm-intro]. - Also make sure your context is set to the right cluster and namespace where you want to deploy the GoKubeDownscaler. ## Install the chart @@ -35,5 +33,5 @@ helm install go-kube-downscaler caas-team/go-kube-downscaler Now the GoKubeDownscaler should be properly installed. :::tip -You can find out how to customize your installation of the GoKubeDownscaler [here][docs-helm-values]. +You can find out how to customize your installation of the GoKubeDownscaler [on our documentation page][docs-helm-values]. ::: From 4957b0dd17cc3e8015b942339024f7c76446a36d Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 5 Nov 2024 15:18:58 +0100 Subject: [PATCH 20/22] final touches --- website/content/_global_md_links.mdx | 2 +- .../2 - values/14 - affinity.mdx | 41 ++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/website/content/_global_md_links.mdx b/website/content/_global_md_links.mdx index 7e2345a..dc69fad 100644 --- a/website/content/_global_md_links.mdx +++ b/website/content/_global_md_links.mdx @@ -55,4 +55,4 @@ [kubernetes-security-context]: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ "Kubernetes Security Context" [kubernetes-resource-management]: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ "Kubernetes Resource Management" [kubernetes-taints-and-tolerations]: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ "Kubernetes Taints and Tolerations" -[kubernetes-affinity]: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/ "Kubernetes Affinity" +[kubernetes-affinity]: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity "Kubernetes Affinity" diff --git a/website/content/docs/0 - helm-chart/2 - values/14 - affinity.mdx b/website/content/docs/0 - helm-chart/2 - values/14 - affinity.mdx index c1488cd..ac3fbb9 100644 --- a/website/content/docs/0 - helm-chart/2 - values/14 - affinity.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/14 - affinity.mdx @@ -16,6 +16,45 @@ affinity: {} ::: -By default the `affinity` field is empty. You can add affinity rules to this field for two . +By default the `affinity` field is empty. + +You can add affinity rules to this field that give you a few more options for pod scheduling than [nodeSelector][nodeSelector]. + +## Node affinity + +You can use Node affinity to achieve something very similar to the [nodeSelector][nodeSelector]. + +```yaml +affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: topology.kubernetes.io/zone + operator: In + values: + - antarctica-east1 + - antarctica-west1 +``` + +With the configuration above the GoKubeDownscaler will only be scheduled on a Node where a label `topology.kubernetes.io/zone` exists and has either the value `antarctica-east1` or `antarctica-west1`. + +## Pod affinity + +Pod affinity on the other hand will compare the labels of all **pods** on a Node. + +```yaml +affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: security + operator: In + values: + - S1 +``` + +With this configuration the GoKubeDownscaler will prefer to deploy the pods on a Node where no other pod has the label `security=S1`. For more information on affinity you can reference [the official Kubernetes documentation][kubernetes-affinity]. From d0c3a4dba7ea052a7f20b344be5b462bf621770c Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 5 Nov 2024 15:28:12 +0100 Subject: [PATCH 21/22] adjustments --- website/content/_global_md_links.mdx | 1 + .../docs/0 - helm-chart/2 - values/14 - affinity.mdx | 6 +++--- website/content/docs/0 - helm-chart/2 - values/index.mdx | 2 +- website/content/docs/0 - helm-chart/index.mdx | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/website/content/_global_md_links.mdx b/website/content/_global_md_links.mdx index dc69fad..7a02a18 100644 --- a/website/content/_global_md_links.mdx +++ b/website/content/_global_md_links.mdx @@ -5,6 +5,7 @@ [configmap-yaml]: https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/configmap.yaml "ConfigMap" [clusterrole-yaml]: https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/clusterrole.yaml "Clusterrole" [role-yaml]: https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/templates/role.yaml "Role" +[values-yaml]: https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/values.yaml "Values File" [github-releases]: https://github.com/caas-team/GoKubeDownscaler/releases "Github Releases" [chart-appversion]: https://github.com/caas-team/GoKubeDownscaler/blob/main/deployments/chart/Chart.yaml#L10 "appVersion" diff --git a/website/content/docs/0 - helm-chart/2 - values/14 - affinity.mdx b/website/content/docs/0 - helm-chart/2 - values/14 - affinity.mdx index ac3fbb9..1fdff63 100644 --- a/website/content/docs/0 - helm-chart/2 - values/14 - affinity.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/14 - affinity.mdx @@ -49,12 +49,12 @@ affinity: preferredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - - key: security + - key: env operator: In values: - - S1 + - test ``` -With this configuration the GoKubeDownscaler will prefer to deploy the pods on a Node where no other pod has the label `security=S1`. +With this configuration the GoKubeDownscaler will only try to deploy the pods on a Node where no other pod has the label `env=test`. For more information on affinity you can reference [the official Kubernetes documentation][kubernetes-affinity]. diff --git a/website/content/docs/0 - helm-chart/2 - values/index.mdx b/website/content/docs/0 - helm-chart/2 - values/index.mdx index 5d833ff..1ebfdba 100644 --- a/website/content/docs/0 - helm-chart/2 - values/index.mdx +++ b/website/content/docs/0 - helm-chart/2 - values/index.mdx @@ -7,6 +7,6 @@ id: values import DocCardList from "@theme/DocCardList"; -These are the values for the Helm Chart defined in the values.yaml file. +Here you can find explanations for all the values defined in the [values.yaml][values-yaml] file for our Helm Chart. diff --git a/website/content/docs/0 - helm-chart/index.mdx b/website/content/docs/0 - helm-chart/index.mdx index e3fccad..0131f17 100644 --- a/website/content/docs/0 - helm-chart/index.mdx +++ b/website/content/docs/0 - helm-chart/index.mdx @@ -9,6 +9,6 @@ import DocCardList from "@theme/DocCardList"; In order to make the installation of the GoKubeDownscaler as easy as possible we provide a fully customizable Helm Chart. -On the following pages you find out everything you need about it. +On the following pages are the most important things you might want to know. From ffa5d89cff73c8e3948ddb3db562fac70c459576 Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 6 Nov 2024 09:43:34 +0100 Subject: [PATCH 22/22] adjust readme --- deployments/chart/README.md | 105 ++++-------------------------------- 1 file changed, 10 insertions(+), 95 deletions(-) diff --git a/deployments/chart/README.md b/deployments/chart/README.md index 12c95c8..f947b01 100644 --- a/deployments/chart/README.md +++ b/deployments/chart/README.md @@ -1,114 +1,29 @@ # Go Kubernetes Downscaler - Helm Chart -This repository provides a Helm chart for the `go-kube-downscaler`.\ -Here you can find a brief overview of the charts components and a quick installation guide. +This is the official Helm Chart for the `GoKubeDownscaler`. -- [Components](#components) - - [Deployment](#deployment) - - [Serviceaccount](#serviceaccount) - - [Configmap](#configmap) - - [Clusterrole](#clusterrole) - - [Role](#role) -- [Values](#values) - - [replicaCount](#replicaCount) - - [image](#image) - - [arguments](#arguments) - - [includedResources](#includedResources) - - [nameOverride](#nameOverride) - - [fullnameOverride](#fullnameOverride) - - [constrainedDownscaler](#constrainedDownscaler) - - [constrainedNamespaces](#constrainedNamespaces) - - [podSecurityContext](#podSecurityContext) - - [securityContext](#securityContext) -- [Installation](#installation) - - [Prerequisits](#prerequisits) - - [Install the Chart](#install-the-chart) -- [Configure scaling for specific Workloads](#configure-scaling-for-specific-workloads) - -## Components - -### Deployment - -The deployment.yaml file creates the main Deployment of the go-kube-downscaler with a reference to the provided ServiceAccount and ConfigMap. - -### Serviceaccount - -The serviceaccount.yaml file creates a ServiceAccount that will be used by the go-kube-downscaler to interact with Kubernetes. - -### Configmap - -The configmap.yaml file creates a new ConfigMap with the provided name. It is used to store environment variables like `EXCLUDE_NAMESPACES`. - -### Clusterrole - -If [constrainedDownscaler](#constrainedDownscaler) is set to false the clusterrole.yaml file creates a ClusterRole and a ClusterRoleBinding which allow the actions the go-kube-downscaler needs to scale down workloads in a clusterwide context. - -### Role - -If [constrainedDownscaler](#constrainedDownscaler) is set to true the role.yaml file creates a Role and a RoleBinding for every namespace listed in [constrainedNamespaces](#constrainedNamespaces) in order to allow the necessary actions to scale down workloads. - -## Values - -Here is a brief overview of all the values contained in this chart: - - - -| **Key** | **Description** | -| ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| replicaCount | Adjusts the number of replicas that the go-kube-downscaler deployment will have. | -| image | Contains the repository URL and the image tag for the image you want to use. | -| arguments | Defines command line arguments for the container. | -| includedResources | Defines all the resources that the go-kube-downscaler is supposed to be able to handle. | -| fullnameOverride | Overrides the full names of the created Kubernetes resources with the provided name if set. | -| nameOverride | Overrides the chart name for the created Kubernetes resources. | -| constrainedDownscaler | Sets the go-kube-downscaler to a constrained state if true, meaning that it does not run clusterwide but restricted to a list of namespaces. These namespaces are listed in [constrainedNamespaces](#constrainedNamespaces). | -| constrainedNamespaces | A list of namespaces the go-kube-downscaler is going to operate on when constrained. | -| serviceAccount | Specifies whether a new ServiceAccount is supposed to be created and if not, what the name of the ServiceAccount to use is. | -| podSecurityContext | Defines the SecurityContext on pod level. (More info [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)) | -| securityContext | Defines the SecurityContext on container level. (More info [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)) | -| resources | Defines the CPU and memory limits and requests. | -| nodeSelector | Defines labels of nodes that you want the deployment to schedule them on. | -| tolerations | Adds tolerations to the pods of the deployment to be able to be scheduled on nodes with matching taints. (More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)) | -| affinity | Defines rules for node affinity and pod affinity/anti-affinity. (More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) | -| configMapName | The name of the configmap for the go-kube-downscaler. | -| excludedNamespaces | A list of namespaces that are supposed to be excluded from the downscaling process of the go-kube-downscaler. | -| extraConfig | Adds additional specified environment variables to the ConfigMap. | - -The default values can be found [here](./values.yaml). +In order to installing the GoKubeDownscaler using our Helm Chart you only need to have Helm installed on a system and have access to a Kubernetes cluster in some kind of way. ## Installation -### Prerequisits - -In order to get started installing the go-kube-downscaler using our helm chart you only need to have helm installed on your system and have access to a Kubernetes cluster in some kind of way. - -You can find out how to install helm [here](https://helm.sh/docs/intro/install/). +The installation is quite simple. -Also make sure you are on the right cluster and namespace where you want to deploy the go-kube-downscaler. - -### Install the chart - -There are two ways to install this helm chart: - -You can either add our chart repository and deploy it by running: +First you have to add our chart repository by running: ```bash helm repo add caas-team https://caas-team.github.io/helm-charts/ - -helm install go-kube-downscaler caas-team/go-kube-downscaler ``` -**OR** +This will add all of our published Helm Charts to a local Helm repo named caas-team. -You can alternatively clone this repository, change the current directory to the GoKubeDownscaler repository and run: +After that you just need to run the following command: ```bash -helm install go-kube-downscaler ./deployments/chart +helm install go-kube-downscaler caas-team/go-kube-downscaler ``` -**Make sure to adjust the values.yaml as needed or use a custom values.yaml file.** +## Customizing your installation -## Configure scaling for specific Workloads +You can change a lot about your installation of the GoKubeDownscaler. -Now all that is left to do is annotate the workloads you want to scale. -You can find out how to do that [in the main readme](../../README.md#configuration). +You can find information on how to do that on our [documentation page](https://caas-team.github.io/GoKubeDownscaler/).