Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

salt: Allow to provide featureGates for apiserver in bootstrap config #3318

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
### Features Added
- [#3180](https://github.com/scality/metalk8s/issues/3180) - All alerts from
Alertmanager are now stored in Loki database for persistence
(PR[#3191](https://github.com/scality/metalk8s/pull/))
(PR[#3191](https://github.com/scality/metalk8s/pull/3191))
alexandre-allard marked this conversation as resolved.
Show resolved Hide resolved

- [#3294](https://github.com/scality/metalk8s/issues/3294) - Allow to manage
`kube-apiserver` feature gates from Bootstrap Configuration file
(PR[#3318](https://github.com/scality/metalk8s/pull/3318))

### Enhancements
- Bump Kubernetes version to 1.20.6
Expand Down
1 change: 1 addition & 0 deletions salt/_pillar/metalk8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def ext_pillar(minion_id, pillar, bootstrap_config): # pylint: disable=unused-a
"networks": _load_networks(config),
"metalk8s": metal_data,
"proxies": config.get("proxies", {}),
"kubernetes": config.get("kubernetes", {}),
}

if not isinstance(metal_data["archives"], list):
Expand Down
8 changes: 8 additions & 0 deletions salt/metalk8s/kubernetes/apiserver/installed.sls
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ include:
{%- endif %}
{%- set etcd_servers = etcd_servers | unique %}

{%- set feature_gates = [] %}
{%- for feature, value in pillar.kubernetes.get("apiServer", {}).get("featureGates", {}).items() %}
{%- do feature_gates.append(feature ~ "=" ~ value) %}
TeddyAndrieux marked this conversation as resolved.
Show resolved Hide resolved
{%- endfor %}

Create kube-apiserver Pod manifest:
metalk8s.static_pod_managed:
- name: /etc/kubernetes/manifests/kube-apiserver.yaml
Expand Down Expand Up @@ -96,6 +101,9 @@ Create kube-apiserver Pod manifest:
- --oidc-groups-claim=groups
- '"--oidc-groups-prefix=oidc:"'
- --v={{ 2 if metalk8s.debug else 0 }}
{% if feature_gates %}
- --feature-gates={{ feature_gates | join(",") }}
{%- endif %}
requested_cpu: 250m
volumes:
- path: {{ encryption_k8s_path }}
Expand Down
1 change: 1 addition & 0 deletions salt/tests/unit/formulas/data/base_pillar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,4 @@ certificates:
watched: true
workload-plane-ingress:
watched: true
kubernetes: {}