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

Expose a lot of params - mostly to ease deployments in a different overlay network range #82

Merged
merged 24 commits into from
Apr 5, 2018

Conversation

mrwulf
Copy link
Contributor

@mrwulf mrwulf commented Mar 21, 2018

New Parameters in kube_tool:

  • Cluster service api address (needed for api cert if deploying in a different network )

New Parameters in module:

  • docker_version
  • kube_dns_version
  • kube_proxy_version
  • kube_api_ip
  • kube_dns_ip
  • cni_node_cidr (boolean instead of string)
  • cni_cluster_cidr (just the value instead of the option and value)

Other changes:

  • Use standard taint for master (and added tolerations for daemonsets)
  • More IPs added to api cert
  • Switched kubectl create for add-ons to be kubectl apply

Tested with:
centos 7.4
kubernetes 1.9.4
flannel 0.10.0
kube-dns 1.14.8
etcd 3.1.10
cni 0.6.0
docker 17.05.0.ce

@mrwulf
Copy link
Contributor Author

mrwulf commented Mar 21, 2018

Forgot to mention I also removed the kube-proxy mode=userspace option. Newer versions use iptables by default. I initially mentioned this in #78

@scotty-c
Copy link
Contributor

scotty-c commented Mar 21, 2018

@mrwulf Thanks for the PR. There are a lot of changes here and we will need to do some testing internally then get back to you.

By any chance have you tested this with Weave or older versions of Kubernetes

@scotty-c
Copy link
Contributor

@mrwulf Can you also update the README for all the changes

@scotty-c
Copy link
Contributor

scotty-c commented Apr 2, 2018

@mrwulf An update on this PR, we have sign off internally how we will manage backwards compatibility of K8 versions. So you will see movement on this PR this week

@@ -14,17 +14,19 @@ def OtherParams.create(os, version, container_runtime, cni_provider, bootstrap_c
kubernetes_package_version = version
end

cni_cluster_cidr = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These values need to be empty for Weave. When using weave this cause the Puppet run to fail.

==> kube-master: Error: Evaluation Error: Error while evaluating a Resource Statement, Class[Kubernetes]: parameter 'cni_cluster_cidr' expects a value of type Undef or String, got Boolean (file: /tmp/modules/role/manifests/kubernetes/master.pp, line: 3, column: 3) on node kube-master.lan

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrwulf This PR looks good, I have tested it across multiple OS and network providers. I just need the above issue fixed for Weave and it will be ready to merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated-

@@ -15,7 +15,7 @@ spec:
- --allow-privileged=true
<% if @kubernetes_version =~ /1[.](8|9)[.]\d/ -%>- --enable-bootstrap-token-auth=true<% end %>
<% if @kubernetes_version =~ /1[.](6|7)[.]\d/ -%>- --experimental-bootstrap-token-auth=true<% end %>
- --service-cluster-ip-range=10.96.0.0/12
- --service-cluster-ip-range=<%= @cni_cluster_cidr %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be the cluster cidr pool, this should be the service cidr pool. Can you please change that as it breaks the calico networking

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a cluster_service_cidr param to the puppet class to handle this. It isn't obvious which networking solutions require this, though. Maybe it should be added to kube_tool too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrwulf I agree it's not straightforward. Weave, Flannel and Calico act quite differently and need different configurations. End users usually only know how to configure one of the providers. We are trying to abstract the difference in configuration as much as possible in Kubetool

- --experimental-bootstrap-token-auth=true
<%- end -%>
<%- if (@cluster_service_cidr and not @cluster_service_cidr.empty?) -%>
- --service-cluster-ip-range=<%= @cni_cluster_cidr %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be @cluster_service_cidr not @cni_cluster_cidr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry found just that last bug and it should be ready to merge

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doh- sorry! I changed the condition, but forgot to change the actual value. Fixed now

@scotty-c
Copy link
Contributor

scotty-c commented Apr 5, 2018

LGTM

@scotty-c scotty-c merged commit 970891b into puppetlabs:master Apr 5, 2018
@scotty-c
Copy link
Contributor

scotty-c commented Apr 5, 2018

@mrwulf Thanks for a great PR !!!!

@davejrt davejrt added this to the 1.1.0 milestone Apr 15, 2018
lionce pushed a commit to lionce/puppetlabs-kubernetes that referenced this pull request Dec 19, 2019
(MODULES-7192) - Improved error message for incorrect formatting
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.

3 participants