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

scheduler_extra_arguments not working on v1beta3 due to missing scheduler_merged_extra_arguments used in the template #669

Closed
catalinpan opened this issue Dec 28, 2023 · 2 comments
Labels

Comments

@catalinpan
Copy link

Describe the Bug

scheduler_extra_arguments for v1beta3 doesn't pick up the values as the template uses scheduler_merged_extra_arguments which is not specified anywhere other than in the template.

<%- if @scheduler_merged_extra_arguments -%>
extraArgs:
<%- @scheduler_merged_extra_arguments.each do |arg| -%>
<%= arg %>
<%- end -%>
<%- end -%>

Expected Behavior

scheduler_extra_arguments should populate the extraArgs values in /etc/kubernetes/config.yaml

It looks like in https://github.com/puppetlabs/puppetlabs-kubernetes/blob/02aa06d0dc451c8ddf23e4fc18f938dff767d685/manifests/config/kubeadm.pp

below part (or something similar) is missing

$scheduler_merged_extra_arguments = concat($scheduler_extra_arguments, $cloud_args)

Steps to Reproduce

In a kubernetes cluster > 1.21 add scheduler_extra_arguments. The scheduler extraArgs will not be populated.

For more details please check this part of the kubeadm manifest.

if $cloud_provider {
$cloud_args = $cloud_config ? {
undef => ["cloud-provider: ${cloud_provider}"],
default => ["cloud-provider: ${cloud_provider}", "cloud-config: ${cloud_config}"],
}
$apiserver_merged_extra_arguments = concat($apiserver_extra_arguments, $cloud_args)
$controllermanager_merged_extra_arguments = concat($controllermanager_extra_arguments, $cloud_args)
# could check against Kubernetes 1.10 here, but that uses alpha1 config which doesn't have these options
if $cloud_config {
# The cloud config must be mounted into the apiserver and controllermanager containers
$cloud_volume = {
'cloud' => {
hostPath => $cloud_config,
mountPath => $cloud_config,
},
}
if 'cloud' in $apiserver_extra_volumes or 'cloud' in $controllermanager_extra_volumes {
fail('Cannot use "cloud" as volume name')
}
$apiserver_merged_extra_volumes = merge($apiserver_extra_volumes, $cloud_volume)
$controllermanager_merged_extra_volumes = merge($controllermanager_extra_volumes, $cloud_volume)
} else {
$apiserver_merged_extra_volumes = $apiserver_extra_volumes
$controllermanager_merged_extra_volumes = $controllermanager_extra_volumes
}
} else {
$apiserver_merged_extra_arguments = $apiserver_extra_arguments
$controllermanager_merged_extra_arguments = $controllermanager_extra_arguments
$apiserver_merged_extra_volumes = $apiserver_extra_volumes
$controllermanager_merged_extra_volumes = $controllermanager_extra_volumes
}

Environment

  • Version 1.23.10
  • Platform Ubuntu 22.04

Additional Context

n/a

@catalinpan catalinpan added the bug label Dec 28, 2023
@deric
Copy link
Collaborator

deric commented Jan 15, 2024

This should have been fixed in #670, could you test the fix from the main branch?

@catalinpan
Copy link
Author

Thanks, it seems to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants