Skip to content

Commit

Permalink
salt: Make salt-master worker_threads and timeout configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
TeddyAndrieux committed Sep 15, 2023
1 parent 6759877 commit ef560b3
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
- Make `KubeJobNotCompleted` alert time configurable
(PR[4128](https://github.com/scality/metalk8s/pull/4128))

- Make salt master `worker_threads` and `timeout` configurable
(PR[4149](https://github.com/scality/metalk8s/pull/4149))

## Release 125.0.5

### Additions
Expand Down
10 changes: 10 additions & 0 deletions docs/installation/bootstrap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ Configuration
kubelet:
config:
maxPods: 110
salt:
master:
worker_threads: 12
timeout: 20
The ``networks`` field specifies a range of IP addresses written in CIDR
notation for it's various subfields.
Expand Down Expand Up @@ -241,6 +245,12 @@ defaults kubernetes configuration.
From ``kubelet`` section you can override the max number of pods that can
be scheduled on each nodes.

The ``salt`` field can be omitted if you do not have any specific salt settings
to configure.

From ``master`` section you can override the number of worker threads used
by salt master and the timeout for salt master to get an answer from minions

.. _Feature Gates: https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/
.. _specific OpenID for kube-apiserver: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#openid-connect-tokens

Expand Down
8 changes: 8 additions & 0 deletions salt/_pillar/metalk8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ def _load_addons(config_data):
return addons_data


def _load_salt(config_data):
"""Load Salt information from BootstrapConfiguration"""
salt_data = config_data.get("salt", {})

return salt_data


def ext_pillar(minion_id, pillar, bootstrap_config): # pylint: disable=unused-argument
config = _load_config(bootstrap_config)
if config.get("_errors"):
Expand All @@ -203,6 +210,7 @@ def ext_pillar(minion_id, pillar, bootstrap_config): # pylint: disable=unused-a
"proxies": config.get("proxies", {}),
"kubernetes": _load_kubernetes(config),
"addons": _load_addons(config),
"salt": _load_salt(config),
}

if not isinstance(metal_data["archives"], list):
Expand Down
2 changes: 2 additions & 0 deletions salt/metalk8s/salt/master/configured.sls
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Configure salt master:
kubeconfig: "{{ certificates.kubeconfig.files['salt-master'].path }}"
salt_api_ssl_crt: {{ certificates.server.files['salt-api'].path }}
saltenv: "{{ saltenv }}"
worker_threads: {{ salt.pillar.get("salt:master:worker_threads", default=12) }}
timeout: {{ salt.pillar.get("salt:master:timeout", default=20) }}
Configure salt master roots paths:
file.serialize:
Expand Down
4 changes: 2 additions & 2 deletions salt/metalk8s/salt/master/files/master-99-metalk8s.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ interface: {{ salt_ip }}

log_level: {{ 'debug' if debug else 'info' }}

timeout: 20
timeout: {{ timeout }}
sock_pool_size: 15
worker_threads: 10
worker_threads: {{ worker_threads}}

peer:
.*:
Expand Down
2 changes: 2 additions & 0 deletions salt/tests/unit/formulas/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,8 @@ metalk8s:
kubeconfig: /etc/salt/master-kubeconfig.conf
salt_api_ssl_crt: /etc/salt/pki/api/salt-api.crt
saltenv: metalk8s-2.7.1
worker_threads: 58
timeout: 42

salt-master-manifest.yaml.j2:
_cases:
Expand Down

0 comments on commit ef560b3

Please sign in to comment.