-
Notifications
You must be signed in to change notification settings - Fork 8
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
config: Use data from config file when available #55
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Issue: If users import the vmss info and then try to use --node or --id, then the command will fail because we will have vmss info + node or vmss info + resource-id and it will not know what to select. Solution: Don't read the current config vmss info if node or id was specified. It is not needed anyway. Initial state: $ ./kubectl-aks config import Let's say aks-nodepool1-17267820-vmss000002 is the node I need to use more frequently: $ ./kubectl-aks config use-node aks-nodepool1-17267820-vmss000002 However, if I need to run one single command in node aks-nodepool1-17267820-vmss000000 Before this PR: $ ./kubectl-aks check-apiserver-connectivity --node aks-nodepool1-17267820-vmss000000 Error: specify either 'node' or VMMS instance information ('subscription', 'node-resource-group', 'vmss' and 'instance-id') After this PR: $ ./kubectl-aks check-apiserver-connectivity --node aks-nodepool1-17267820-vmss000000 Connectivity check: succeeded Signed-off-by: Jose Blanquicet <josebl@microsoft.com>
`kubectl-aks` should use the node information from config file when available. Initial situation: $ ./kubectl-aks config import $ ./kubectl-aks config use-node aks-nodepool1-17267820-vmss000000 Node not available in the confi file will use the API server: $ ./kubectl-aks check-apiserver-connectivity --node jose \Error: getting vm: retrieving Azure resource ID of node jose from API server: nodes "jose" not found Node available in the config file will not use the API server: $ ./kubectl-aks check-apiserver-connectivity --node aks-nodepool1-17267820-vmss000002 |DEBUG[0000] Using VMSS information from config for node aks-nodepool1-17267820-vmss000002 Connectivity check: succeeded Without specifying any node, it will use aks-nodepool1-17267820-vmss000000 (current-node) from config: $ ./kubectl-aks check-apiserver-connectivity Connectivity check: succeeded Signed-off-by: Jose Blanquicet <josebl@microsoft.com>
Signed-off-by: Jose Blanquicet <josebl@microsoft.com>
These changes improve user experience in use cases like the one described in this AKS TSG: https://github.com/MicrosoftDocs/SupportArticles-docs-pr/pull/5675 |
0cfe093
to
b31da3d
Compare
mqasimsarfraz
approved these changes
Feb 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I tested it and it works fine!
I agree being able to use flags like --node
with current config node is better!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves the management of node information in two situations:
Situation 1
Issue: When we set the default node using the
config use-node
command and we still want to run one command in a differente node (using--node
or--id
) without the need of changing the default node, the command will fail because we will have VMSS info + Node or VMSS info + ID and it will not know what to select.Solution: Don't read the current config vmss info if node or id was specified. It is not needed anyway.
Situation 2
kubectl-aks
should use the node information from config file when available: