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

Remove dependency on git from prepare node script #280

Closed
wants to merge 0 commits into from
Closed

Remove dependency on git from prepare node script #280

wants to merge 0 commits into from

Conversation

jonaskello
Copy link
Contributor

@jonaskello jonaskello commented Jan 20, 2023

Reason for PR:
Eliminates dependency on git command

Issue Fixed:
278

Requirements

  • Sqaush commits
  • Documentation
  • Tests

@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jan 20, 2023
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 20, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @jonaskello!

It looks like this is your first PR to kubernetes-sigs/sig-windows-tools 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/sig-windows-tools has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@github-actions github-actions bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jan 20, 2023
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 20, 2023
@jonaskello
Copy link
Contributor Author

jonaskello commented Jan 20, 2023

@jsturtevant I put the gitpath in a variable and made it point to the latest version. It would be better if it pointed to the exact version but I don't see how that could be done without depending on cloning the repo and using git.

Write-Output "Please remember that after you have joined the node to the cluster, that you have to apply the cni daemonset/service and the kube-proxy"
Write-Output "Also remember that for kube-proxy you have to change the its version from the name of the image in the kube-proxy.yml to that of your kubernetes version `n"
# rancher commands
Write-Output "In case you use rancher, use the following commands:"
Write-Output "For Windows you can use the following command: "
Write-Output "(Get-Content `"$(git rev-parse --show-toplevel)/kubeadm/kube-proxy/kube-proxy.yml`") -Replace 'VERSION', '$KubernetesVersion' | Set-Content `"$(git rev-parse --show-toplevel)/kubeadm/kube-proxy/kube-proxy.yml`" `n"
Write-Output "(Get-Content `"$gitpath/kubeadm/kube-proxy/kube-proxy.yml`") -Replace 'VERSION', '$KubernetesVersion' | Set-Content `"$gitpath/kubeadm/kube-proxy/kube-proxy.yml`" `n"
Copy link
Contributor

Choose a reason for hiding this comment

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

is this right?

 Set-Content `"$gitpath/kubeadm/kube-

I would have thought this would be local path

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I misunderstood the original intention here I think. I think this part of the script assumes that you git cloned the whole repo down.

However the guide tells you to download this script with curl and run it. So in that case it will not run from within a cloned repo and local paths will not work. So for that reason I think the commands to apply the manifests for kubeproxy should refer to the online manifests by using http urls.

However then of course the Get-Content needs to be changed to curl commands. I'll do that and see if it makes more sense.

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 ended up first downloading the manifest and then patching the local file with the version. Do you think this will work?

@@ -105,24 +105,26 @@ nssm set kubelet DependOnService containerd

New-NetFirewallRule -Name kubelet -DisplayName 'kubelet' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 10250

$gitpath='https://raw.githubusercontent.com/kubernetes-sigs/sig-windows-tools/master'
Copy link
Contributor

Choose a reason for hiding this comment

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

gitpath varaible is a bit misleading. maybe repositoryRoot or something else?

@jonaskello
Copy link
Contributor Author

Thinking some more on this, perhaps the last part of the script that prints instructions on how to setup kube-proxy could be removed and the instructions moved to the guide document instead?

@jsturtevant
Copy link
Contributor

Thinking some more on this, perhaps the last part of the script that prints instructions on how to setup kube-proxy could be removed and the instructions moved to the guide document instead?

yea this makes sense to me... I think it might already be in those guides? This was added before we had a guide.

@jsturtevant
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 10, 2023
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 15, 2023
@claudiubelu
Copy link
Contributor

LGTM, but needs a rebase.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 28, 2023
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 28, 2023
@jonaskello
Copy link
Contributor Author

Should be rebased now

@jsturtevant
Copy link
Contributor

@jonaskello Could you squash the commits and make sure the commits are valid? (I am not really sure what is invalid about them but hoping squashing will get rid of the warning

@jonaskello jonaskello closed this May 2, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label May 2, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jonaskello, jsturtevant

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 2, 2023
@jonaskello
Copy link
Contributor Author

@jsturtevant Failed to fix this PR, making a new attempt in #299

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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants