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

Check whether required params for embedded addons are present #1555

Closed
judge-red opened this issue Sep 30, 2021 · 6 comments · Fixed by #1618
Closed

Check whether required params for embedded addons are present #1555

judge-red opened this issue Sep 30, 2021 · 6 comments · Fixed by #1618
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/normal Not that urgent, but is important sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management.
Milestone

Comments

@judge-red
Copy link

What happened:

Here's a snippet from my KubeOneCluster manifest:

apiVersion: kubeone.io/v1beta1
kind: KubeOneCluster
addons:
    enable: true
    path: ./addons
    addons:
        - name: cluster-autoscaler
versions:

As you can see, I missed to configure the AUTOSCALER_VERSION param.

After applying this, I saw this funny issue:

  Warning  InspectFailed  3m53s (x558 over 124m)  kubelet            Failed to apply default image tag "k8s.gcr.io/autoscaling/cluster-autoscaler:${AUTOSCALER_VERSION}": couldn't parse image reference "k8s.gcr.io/autoscaling/cluster-autoscaler:${AUTOSCALER_VERSION}": invalid reference format

What is the expected behavior:

kubeone should probably fail before deploying addons, if required parameters are missing.

How to reproduce the issue:

See above - install e.g. the embedded cluster-autoscaler addon but don't specify any params.

Anything else we need to know?

Better examples wrt enabling the embedded addons would be nice.

Information about the environment:
KubeOne version (kubeone version): 1.3

@judge-red judge-red added kind/bug Categorizes issue or PR as related to a bug. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. labels Sep 30, 2021
@xmudrii xmudrii added the priority/normal Not that urgent, but is important label Sep 30, 2021
@xmudrii xmudrii added this to the KubeOne 1.4 milestone Sep 30, 2021
@xmudrii
Copy link
Member

xmudrii commented Sep 30, 2021

In this concrete case, we fixed this bug for the cluster-autoscaler addon yesterday with #1552. The version is now determined automatically based on the Kubernetes version, but it can also be overridden if needed (see the description of #1552 for more details). The fix will be included in the upcoming 1.3.1 patch release, but the release date is still TBD.

However, this might still be the issue for other addons, so I'm going to leave this issue open until we don't check and eventually fix other addons.

@judge-red
Copy link
Author

Thanks for the quick response @xmudrii! That's great news, looking forward to 1.3.1 :)

@judge-red
Copy link
Author

@xmudrii It's been a while and I also see other important fixes have been backported to 1.3. Do you think we could get a new release in the near future? :)

@xmudrii
Copy link
Member

xmudrii commented Nov 4, 2021

@judge-red We are waiting for #1607 which should be merged soon. I hope we will be able to cut 1.3.1 beginning of next week.

@kron4eg
Copy link
Member

kron4eg commented Nov 10, 2021

I don't even know how it can be possibly done in generic way. Go templates are absolutely happy to consume nils.

The best workaround I see is to define a "required" template function, that will ensure not-nilness of the given argument, and would fail the template render otherwise. Of course its usage should be explicit.

@kron4eg
Copy link
Member

kron4eg commented Nov 11, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/normal Not that urgent, but is important sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants