-
Notifications
You must be signed in to change notification settings - Fork 5
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
Dynamic update of Kubespray and K8s [#10] #11
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,6 +153,10 @@ class K8sInfra < Thor | |
if options['dry-run'] then | ||
puts "Dry-run successfully completed" | ||
else | ||
if @cluster_hash['k8s_infra']["release_type"]=="kubespray" then | ||
latest = ks.latest_kubespray_release | ||
ks.update_kubespray(latest) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updating kubespray itself every time might be a good idea even if using the latest stable K8s release from upstream. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That can be done. What about the addition of Multus and CNI plugins in the installation? Should that be part of default, or should it be kept as a separate e.g. "release" similar to how it is with dynamic Kubespray/K8s now? |
||
end | ||
cluster = ks.start_kubespray | ||
if cluster[:exit_code] == 0 then | ||
puts "KUBECONFIG path: #{full_kubeconfig_path}" | ||
|
@@ -233,8 +237,17 @@ class K8sInfra < Thor | |
puts "All required options not handled" | ||
end | ||
|
||
kubernetes_release = K8sUtils.kubernetes_release("#{options['release-type']}/#{options['arch']}") | ||
stable_k8s_release = K8sUtils.kubernetes_release('stable') | ||
unless options['release-type'] == "kubespray" | ||
kubernetes_release = K8sUtils.kubernetes_release("#{options['release-type']}/#{options['arch']}") | ||
stable_k8s_release = K8sUtils.kubernetes_release('stable') | ||
else | ||
ks = Kubespray.new(@cluster_hash) | ||
ks_version = ks.latest_kubespray_release | ||
k8s_version = ks.latest_supported_kubernetes(ks_version) | ||
kubernetes_release = k8s_version + "\n" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are the newlines necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is used to ensure the configuration file prints properly. I noticed lines were combined without it. I added it here as it is only a problem when |
||
stable_k8s_release = k8s_version + "\n" | ||
end | ||
|
||
config = ERB.new(cluster_config_template("#{options['arch']}", "#{options['provision-type']}", "#{kubernetes_release}", "#{stable_k8s_release}", "#{options['release-type']}"), nil, '-') | ||
if options['output'] then | ||
if File.exist?(options['output']) then | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent these lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the file it looks as follows - I think that's correct?