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

Support Kubernetes 1.22 and kubeadm v1beta3 configurations #531

Merged
merged 2 commits into from
Aug 23, 2021

Conversation

treydock
Copy link
Contributor

No description provided.

@treydock treydock requested a review from a team as a code owner August 10, 2021 17:10
@puppet-community-rangefinder
Copy link

kubernetes::config::kubeadm is a class

that may have no external impact to Forge modules.

kubernetes::config::worker is a class

that may have no external impact to Forge modules.

kubernetes is a class

Breaking changes to this file MAY impact these 5 modules (near match):

This module is declared in 0 of 578 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

@treydock
Copy link
Contributor Author

This is diff between v1beta2 and v1beta3. Changes based on API documentation: https://kubernetes.io/docs/reference/config-api/kubeadm-config.v1beta3/

diff -wur templates/v1beta2/config_kubeadm.yaml.erb templates/v1beta3/config_kubeadm.yaml.erb
--- templates/v1beta2/config_kubeadm.yaml.erb	2021-08-09 15:07:53.000000000 -0400
+++ templates/v1beta3/config_kubeadm.yaml.erb	2021-08-09 15:49:02.000000000 -0400
@@ -1,4 +1,4 @@
-apiVersion: kubeadm.k8s.io/v1beta2
+apiVersion: kubeadm.k8s.io/v1beta3
 bootstrapTokens:
 - groups:
   - system:bootstrappers:kubeadm:default-node-token
@@ -30,6 +30,12 @@
     <%- @kubelet_extra_arguments.each do |arg| -%>
     <%= arg %>
     <%- end -%>
+<% if @skip_phases -%>
+skipPhases:
+<% @skip_phases.split(',').each do |skip_phase| -%>
+- <%= skip_phase %>
+<% end -%>
+<% end -%>
 ---
 apiServer:
   timeoutForControlPlane: 4m0s
@@ -55,7 +61,7 @@
     pathType: <%= config['pathType'] %>
   <%- end -%>
 <%- end -%>
-apiVersion: kubeadm.k8s.io/v1beta2
+apiVersion: kubeadm.k8s.io/v1beta3
 certificatesDir: /etc/kubernetes/pki
 <%- if @kubernetes_cluster_name != "kubernetes"  -%>
 clusterName: <%= @kubernetes_cluster_name %>
@@ -85,8 +91,6 @@
     <%= arg %>
   <%- end -%>
 <%- end -%>
-dns:
-  type: CoreDNS
 etcd:
     external:
         caFile: /etc/kubernetes/pki/etcd/ca.crt
diff -wur templates/v1beta2/config_worker.yaml.erb templates/v1beta3/config_worker.yaml.erb
--- templates/v1beta2/config_worker.yaml.erb	2021-08-09 15:07:53.000000000 -0400
+++ templates/v1beta3/config_worker.yaml.erb	2021-08-09 15:59:07.000000000 -0400
@@ -1,10 +1,9 @@
-apiVersion: kubeadm.k8s.io/v1beta2
+apiVersion: kubeadm.k8s.io/v1beta3
 caCertPath: /etc/kubernetes/pki/ca.crt
 kind: JoinConfiguration
 <%- if @kubernetes_cluster_name != "kubernetes"  -%>
 clusterName: <%= @kubernetes_cluster_name %>
 <%- end -%>
-
 discovery:
   timeout: 5m0s
   bootstrapToken:
@@ -33,4 +32,9 @@
 <% if @feature_gates -%>
 featureGates: <%= @feature_gates %>
 <% end -%>
-
+<% if @skip_phases_join -%>
+skipPhases:
+<% @skip_phases_join.each do |skip_phase| -%>
+- <%= skip_phase %>
+<% end -%>
+<% end -%>

@daianamezdrea
Copy link
Contributor

Hi @treydock, this looks good! Thank you for your contribution!

@daianamezdrea daianamezdrea merged commit 5815384 into puppetlabs:main Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants