-
Notifications
You must be signed in to change notification settings - Fork 107
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 REQUEST] Ansible role to wrap Kubectl command #1638
Comments
Consider helm as well. |
Prepare example at the end of this task. |
Creation of this role seems to be not reasonable, as we are going to wrap with this role just one Keeping in mind, that with this role we still need to pass parameters to a single shell task, such as My suggestion: - name: Get tokens from the server
shell: |-
kubectl get secret/$(kubectl get sa {{ item }} --namespace kube-system --output jsonpath='{.secrets[0].name}') \
--namespace kube-system \
--output jsonpath='{.data.token}'
args:
executable: /bin/bash
delegate_to: localhost
register: token_results
loop: "{{ users }}"
no_log: true |
Agree with @atsikham. My ideas:
use
|
@to-bar |
I would lean towards @atsikham. Not the biggest Ansible guy but do we really need to have a wrapper like that for something simple like this? |
I should have added, these ideas are sorted in order - let's try 1 & 2 first. If they are enough, 3 & 4 won't be needed. 4 is meant for scenario when we would need to cover/wrap different connection methods for self-hosted K8s than cloud managed service. |
Here is an example - #1655. |
Is your feature request related to a problem? Please describe.
To be able to manage a k8s cluster connection via kubectl in one place, it's suggested to use a separate ansible role and include this role in all necessary places with a fact that defines, should it be executed on k8s master as before or locally.
If there is some place, when connection from a container cannot be used (localhost delegation), it should be explained and left as is, but with the usage of created role.
Describe the solution you'd like
Create ansible role with a parameter that defines kubeconfig location and delegation host.
Describe alternatives you've considered
No, but see details in implementation task #1639
Additional context
No
The text was updated successfully, but these errors were encountered: