Skip to content

Commit

Permalink
add contents
Browse files Browse the repository at this point in the history
  • Loading branch information
JTaeuber committed Nov 4, 2024
1 parent 2912755 commit 9765e72
Show file tree
Hide file tree
Showing 15 changed files with 150 additions and 129 deletions.
2 changes: 2 additions & 0 deletions website/content/_global_md_links.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
:::
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/).
8 changes: 7 additions & 1 deletion website/content/docs/helm-chart/Values/11 - resources.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/).
18 changes: 17 additions & 1 deletion website/content/docs/helm-chart/Values/12 - nodeSelector.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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`.

:::
16 changes: 15 additions & 1 deletion website/content/docs/helm-chart/Values/13 - tolerations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/).
4 changes: 3 additions & 1 deletion website/content/docs/helm-chart/Values/14 - affinity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -15,3 +15,5 @@ affinity: {}
```
:::
(More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/))
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
19 changes: 19 additions & 0 deletions website/content/docs/helm-chart/Values/16 - configMap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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].
127 changes: 11 additions & 116 deletions website/content/docs/helm-chart/Values/2 - arguments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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].
12 changes: 10 additions & 2 deletions website/content/docs/helm-chart/Values/4 - fullnameOverride.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
20 changes: 19 additions & 1 deletion website/content/docs/helm-chart/Values/5 - nameOverride.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Loading

0 comments on commit 9765e72

Please sign in to comment.