Skip to content

Commit

Permalink
salt,docs: Make terminated-pod-gc-threshold configurable
Browse files Browse the repository at this point in the history
Allow to manage the `terminated-pod-gc-threshold` argument from the
Bootstrap configuration, and default to 500 (note the current version of
controller manager default is 12500)
  • Loading branch information
TeddyAndrieux committed Nov 30, 2021
1 parent 02bc25e commit c6ea261
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
so that if it's possible each `Dex` pods will sit on a different infra node
(PR[#3614](https://github.com/scality/metalk8s/pull/3614))

- Allow to manage the number of terminated pods that can exists before the
terminated pod garbage collector starts deleting terminated pods from the
Bootstrap configuration, and default to `500`
(PR[#xx](https://github.com/scality/metalk8s/pull/xx))

### Removals

- Removed the PDF support for documentation, replaced it with the HTML output
Expand Down
8 changes: 8 additions & 0 deletions docs/installation/bootstrap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ Configuration
apiServer:
featureGates:
<feature_gate_name>: True
controllerManager:
config:
terminatedPodGCThreshold: 500
coreDNS:
replicas: 2
affinity:
Expand Down Expand Up @@ -210,6 +213,11 @@ defaults kubernetes configuration.
hard:
- topologyKey: kubernetes.io/hostname
From ``controllerManager`` section you can override the number of terminated
pods that can exist before the terminated pod garbage collector starts
deleting terminated pods. If it's set to 0, the terminated pod garbage
collector is disabled (default to ``500``)

.. _Feature Gates: https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/

.. _Bootstrap SSH Provisioning:
Expand Down
4 changes: 4 additions & 0 deletions salt/_pillar/metalk8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ def _load_kubernetes(config_data):
).setdefault("soft", [{"topologyKey": "kubernetes.io/hostname"}])
kubernetes_data["coreDNS"].setdefault("replicas", 2)

kubernetes_data.setdefault("controllerManager", {}).setdefault(
"config", {}
).setdefault("terminatedPodGCThreshold", 500)

return kubernetes_data


Expand Down
1 change: 1 addition & 0 deletions salt/metalk8s/kubernetes/controller-manager/installed.sls
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Create kube-controller-manager Pod manifest:
- --allocate-node-cidrs=true
- --cluster-cidr={{ networks.pod }}
- --node-cidr-mask-size=24
- --terminated-pod-gc-threshold={{ pillar.kubernetes.controllerManager.config.terminatedPodGCThreshold }}
- --v={{ 2 if metalk8s.debug else 0 }}
requested_cpu: 200m
ports:
Expand Down
3 changes: 3 additions & 0 deletions salt/tests/unit/formulas/data/base_pillar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ certificates:
workload-plane-ingress:
watched: true
kubernetes:
controllerManager:
config:
terminatedPodGCThreshold: 500
coreDNS:
replicas: 2
affinity:
Expand Down

0 comments on commit c6ea261

Please sign in to comment.