Skip to content

Commit

Permalink
Add feature_gates profile option
Browse files Browse the repository at this point in the history
It is possible now to enable Kubernetes feature gates[1] using minikube
--feature-gates option[2]. We will use this to enable
StatefulSetAutoDeletePVC feature gate.

Example config:

    profiles:
      - name: featured
        feature_gates:
          - StatefulSetAutoDeletePVC=true

[1] https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/
[2] https://minikube.sigs.k8s.io/docs/handbook/config/#enabling-feature-gates

Signed-off-by: Nir Soffer <[email protected]>
  • Loading branch information
nirs committed Nov 13, 2023
1 parent 7f1dae6 commit b2fe797
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,10 @@ $ drenv delete envs/example.yaml
- `extra_config`: List of extra config key=value. Each item adds
`--extra-config` minikube option. See `minikube start --help` to
see the possible keys and values.
- `feature_gates`: List of Kubernetes feature gates key=value. Each
item adds `--feature-gates` minikube option. See
[Feature Gates](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/)
for possible keys and values.
- `containerd`: Optional containerd configuration object. See
`containerd config default` for available options.
- `workers`: Optional list of workers to run when starting a
Expand Down
1 change: 1 addition & 0 deletions test/drenv/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def start_minikube_cluster(profile, verbose=False):
addons=profile["addons"],
service_cluster_ip_range=profile["service_cluster_ip_range"],
extra_config=profile["extra_config"],
feature_gates=profile["feature_gates"],
alsologtostderr=verbose,
)

Expand Down
1 change: 1 addition & 0 deletions test/drenv/envfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def _validate_profile(profile, addons_root):
profile.setdefault("ser", [])
profile.setdefault("service_cluster_ip_range", None)
profile.setdefault("extra_config", [])
profile.setdefault("feature_gates", [])
profile.setdefault("containerd", None)
profile.setdefault("workers", [])

Expand Down
5 changes: 5 additions & 0 deletions test/drenv/minikube.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def start(
addons=(),
service_cluster_ip_range=None,
extra_config=None,
feature_gates=None,
alsologtostderr=False,
):
args = []
Expand Down Expand Up @@ -72,6 +73,10 @@ def start(
for pair in extra_config:
args.extend(("--extra-config", pair))

if feature_gates:
for pair in feature_gates:
args.extend(("--feature-gates", pair))

if alsologtostderr:
args.append("--alsologtostderr")

Expand Down

0 comments on commit b2fe797

Please sign in to comment.