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

Feature/k8s win nodes hybrid cluster #2956

Closed
wants to merge 27 commits into from
Closed

Feature/k8s win nodes hybrid cluster #2956

wants to merge 27 commits into from

Conversation

pablodav
Copy link
Contributor

@pablodav pablodav commented Jul 3, 2018

refs #2889

  • Add nodeSelector for some deployments and pods to have compatibility in hybrid clusters.
  • fix for missing default value in item.container for downloads
  • fix for missing Pin priority for debian based

nodeSelector, not added to all deployments yet, it could be evaluated later. (But could be required in future)

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 3, 2018
@pablodav pablodav mentioned this pull request Jul 3, 2018
@ant31 ant31 requested a review from mattymo July 4, 2018 09:35
@ant31
Copy link
Contributor

ant31 commented Jul 4, 2018

ci check this

@@ -54,3 +54,8 @@ spec:
- --default-params={"linear":{"nodesPerReplica":{{ dnsmasq_nodes_per_replica }},"preventSinglePointFailure":true}}
- --logtostderr=true
- --v={{ kube_log_level }}
{% if kube_patch_win_nodes %}
# When having win nodes in cluster without this patch, this pod cloud try to be created in windows
nodeSelector:
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't safe to always add this selector ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the past I have sent merge request with the selector added without if and someone else asked to add something like this.

Copy link
Contributor Author

@pablodav pablodav Jul 4, 2018

Choose a reason for hiding this comment

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

Here I found @woopstar disliked the idea to have the nodeselector: #2556

Copy link
Contributor

Choose a reason for hiding this comment

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

where did you find this label: beta.kubernetes.io/os is it documented somewhere, is it used by other installer (kops, kubeadm ?)

Copy link
Contributor

@ant31 ant31 Jul 4, 2018

Choose a reason for hiding this comment

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

@@ -89,6 +89,7 @@
--ignore-preflight-errors=all
--allow-experimental-upgrades
--allow-release-candidate-upgrades
--force
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks it got inserted but I forgot to remove, anyway it is safe to have this line.
In past two tries to upgrade kubeadm, it failed without --force and asked to add --force flag (tried from v1.10.3 to v1.10.4 and from v1.10.4 to v1.10.5

@ant31
Copy link
Contributor

ant31 commented Jul 4, 2018

Why is this specific to windows, can't we simply add the selector for all kind of installation (remove the 'if' and add the selector in all manifests

@Atoms
Copy link
Member

Atoms commented Jul 4, 2018

agree with @ant31 on selectors

also my comment would be about syntax:

tags:
  - tag1
  - tag2

not

tags: [tag1,tag2]

and same goes for when statements

when:
  - something
  - something else

this way it's more readable

and please squash your commits.

@Atoms Atoms added the feature label Jul 4, 2018
@pablodav
Copy link
Contributor Author

pablodav commented Jul 4, 2018

Here I found @woopstar disliked the idea to have the nodeselector: #2556

@Atoms,
I like the syntax you proposed, but I have just copied the syntax that other tasks already have in this role.

@Atoms
Copy link
Member

Atoms commented Jul 4, 2018

@pablodav this syntax change was introduced when i joined project and not all places changed this so it would be grate if you could change.

@@ -93,6 +93,7 @@
roles:
- { role: kubespray-defaults}
- { role: kubernetes-apps/rotate_tokens, tags: rotate_tokens, when: "secret_changed|default(false)" }
- { role: win_nodes/kubernetes_patch, tags: win_nodes, when: "kubeadm_enabled and kube_patch_win_nodes" }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @Atoms

for when, only this needs to be changed?

Could be?

   roles:
     - role: kubespray-defaults
     - role: kubernetes-apps/rotate_tokens
       tags: 
         - rotate_tokens
       when: 
         - secret_changed|default(false)
     - role: win_nodes/kubernetes_patch
       tags: 
         - win_nodes
       when: 
         - kubeadm_enabled 
         - and kube_patch_win_nodes

I haven't found examples to understand this syntax better

Copy link
Member

Choose a reason for hiding this comment

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

not in playbook file, but in tasks files, i think for roles still not working such syntax (need to check)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, haven't found other line I have changed to change now, probably could be reviewed in future PRs.

@ant31
Copy link
Contributor

ant31 commented Jul 4, 2018

I'm in favor to do the nodeSelector to all deployments.
It doesn't break anything to add this nodeSelector, it adds more precision/safety.
As we move forward into multi-os support (linux/windows) it's going to be required. And I largely prefer not to if guard every piece of code.
cc @mattymo ?

@Atoms
Copy link
Member

Atoms commented Jul 6, 2018

@pablodav you did something wrong :) you don't need to add commits from another people :)

@pablodav
Copy link
Contributor Author

pablodav commented Jul 9, 2018

You are right, looks like when I sync upstream using rebase it adds commits and the pull request is synced with those changes incorrectly, will create new clean pull request.

@pablodav pablodav closed this Jul 9, 2018
@pablodav pablodav mentioned this pull request Jul 9, 2018
@pablodav
Copy link
Contributor Author

pablodav commented Jul 9, 2018

Created new in #2978, please @Atoms, @ant31 check that new merge request.
I'm will try to not add more synchronizations from upstream to my branch for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants