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

kubernetes: 1.9.7 -> 1.10.3 #41073

Merged
merged 6 commits into from May 26, 2018
Merged

kubernetes: 1.9.7 -> 1.10.3 #41073

merged 6 commits into from May 26, 2018

Conversation

johanot
Copy link
Contributor

@johanot johanot commented May 25, 2018

Motivation for this change

Update kubernetes module and package to 1.10.X.

This PR is a cleaned and rebased version of latest cherry-picks to #38445

This PR also updates kube-dns and kube-dashboard addons to latest versions:

kube-dns: 1.14.4 -> 1.14.10
kube-dashboard: 1.8.2 -> 1.8.3

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

cstrahan and others added 5 commits May 25, 2018 10:50
As shipped with k8s 1.10.3.

Also:
- updated the definition jsons as they are distributed in k8s.
- updated the image uris as they are renamed in k8s
- added imageDigest param as per 7368487
As shipped with k8s 1.10.3.

Also:
- updated the definition jsons as they are distributed in k8s.
- updated the image uris as they are renamed in k8s
- added imageDigest param as per 7368487
VMs were starving, many of the daemons were unable to complete their
tasks resulting in tests failures.

Turned off verbose output from k8s components as it consumes even more resources, and useful error messages actually drown in debug-clutter
@johanot
Copy link
Contributor Author

johanot commented May 25, 2018

@steveej @cstrahan @azazel75 @srhb

I cherry-picked @azazel75 commits for updating dashboard and dns, since they contain the manifest changes. Also, 1.5 gig mem seems to be enough for all tests to run smoothly.

I left out the etcd bump, since I don't think it belongs in this PR.

Hope y'all agree.

};

# go > 1.10 should be fixed by https://github.com/kubernetes/kubernetes/pull/60373
# go > 1.10 should be fixed by https://github.com/kubernetes/kubernetes/pull/60597
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like it's already merged, but I think we should follow whichever version kube is built with upstream, which appears to be 1.9.3. Is there any place where this information is located that we can link to instead? Maybe the changelog?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to https://github.com/kubernetes/community/blob/master/contributors/devel/development.md, minimum Golang version required for 1.10 is v1.9.1. And the official version states in External Dependencies for kubernetes 1.10 is v1.9.3: https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.10.md

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's link to the External Dependencies instead then.

@@ -339,9 +370,9 @@ in {
type = types.str;
};

admissionControl = mkOption {
enableAdmissionPlugins = mkOption {
Copy link
Contributor

Choose a reason for hiding this comment

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

What change does this require a user of admissionControl to make? If any, this should be documented in the release notes for 18.09

@@ -113,8 +134,8 @@ in {
};
spec = {
ports = [{
port = 80;
targetPort = 9090;
port = 443;
Copy link
Contributor

Choose a reason for hiding this comment

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

These port changes look like changes to user-facing behaviour, is that right? If so, we need a release notes for it at the very least.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, the ports changed upstream, so I chose to update them in our manifest

@srhb srhb mentioned this pull request May 25, 2018
8 tasks
@srhb
Copy link
Contributor

srhb commented May 25, 2018

I've built and run the tests on NixOS. Looks good! 👍

@azazel75
Copy link
Contributor

Well done @johanot, do you need any further help?

@coretemp
Copy link
Contributor

I am mostly curious whether anyone is using kubernetes on NixOS in production, since the existence of a module is not the same as a production version module.

In general, some kind of meta-data on services like "experimental" or "just a toy" or "used in a national lab" would be useful.

@johanot
Copy link
Contributor Author

johanot commented May 25, 2018

@coretemp We are using the module for our production cluster. We have a couple of very minor modifications to the module in our setup, which I just haven't gotten around to upstream yet.

@azazel75 Thanks. I'll look into the review comments now and let you know if I need anything further.

@johanot
Copy link
Contributor Author

johanot commented May 25, 2018

@srhb Please review latest commit, when you have time :)

@@ -108,7 +108,7 @@ $ nix-instantiate -E '(import <nixpkgsunstable> {}).gitFull'
<para>
<literal>gnucash</literal> has changed from version 2.4 to 3.x.
If you've been using <literal>gnucash</literal> (version 2.4) instead of
<literal>gnucash26</literal> (version 2.6) you must open your Gnucash
<literal>gnucash26</literal> (version 2.6) you must open your Gnucash
Copy link
Contributor

Choose a reason for hiding this comment

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

No touchy the whitespace of other people! :P

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@srhb now undone! :P

- Added information regarding breaking changes to release note for 18.09
- Changed golang version comment in kubernetes package
- Added @johanot to maintainers list
@srhb
Copy link
Contributor

srhb commented May 26, 2018

I think this is very good quality and quite sufficient for inclusion. :)

@srhb srhb merged commit 2052c16 into NixOS:master May 26, 2018
} // (optionalAttrs cfg.enableRBAC {
kubernetes-dashboard-crb = {
apiVersion = "rbac.authorization.k8s.io/v1beta1";
apiVersion = "rbac.authorization.k8s.io/v1";
Copy link
Contributor

Choose a reason for hiding this comment

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

v1 is repeated in at least two places. Please introduce a variable and use that instead of using the same constant twice.

@@ -59,7 +59,7 @@ in {

services.kubernetes.addonManager.addons = {
kubedns-deployment = {
apiVersion = "apps/v1beta1";
apiVersion = "extensions/v1beta1";
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment for a beta version.

</listitem>
<listitem>
<para>
Recommented way to access the Kubernetes Dashboard is with HTTPS (TLS)
Copy link
Contributor

Choose a reason for hiding this comment

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

  • t -> d (must have)
  • with -> via (nice to have)

and perhaps specify a complete URL to access the kubernetes dashboard, if possible.(wish list)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix the typo in an upcoming PR. Thanks :-)

containers = [{
name = "kubernetes-dashboard";
image = "${name}:${version}";
ports = [{
containerPort = 9090;
containerPort = 8443;
Copy link
Contributor

Choose a reason for hiding this comment

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

8443 is repeated in multiple places.

};
args = [
"--v=2"
"--logtostderr"
Copy link
Contributor

Choose a reason for hiding this comment

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

Motivation for logging to stderr is missing. For production services, I almost never want to do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's customnary in Docker containers: logs are then managed using logging drivers and aggregated using dedicated services. The alternative would be for the spawned process to write to files (as there's probably no logging daemon running in the container), but that approach brings up the issue of using a PersistentVolume just for the logs, which is far more invasive as a choice, in my opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@coretemp No personal preferences involved here. The yaml manifest is a copy of the upstream kube-dns manifest at: https://github.com/kubernetes/kubernetes/blob/release-1.10/cluster/addons/dns/kube-dns.yaml.base. A possible future improvement to the dns submodule could be to add more options for making these things configurable. For now though, I think it's perfectly fine to ship the upstream defaults.

};
args = [
"--v=2"
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is a verbosity level it should have a comment. The numeric value could instead be a named constant saying something about the verbosity level.

@johanot
Copy link
Contributor Author

johanot commented May 26, 2018

@coretemp Thank you for your comments in general. In a couple of weeks (probably) I'll be submitting a few minor improvements to the kubernetes modules in a new PR. Will bear your considerations in mind then.

@NeQuissimus
Copy link
Member

@johanot ! Somehow I missed this PR completely... Thank you for this! 🎉

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

Successfully merging this pull request may close these issues.

None yet

7 participants