community.kubernetes | Kubernetes Collection for Ansible | Automation library
kandi X-RAY | community.kubernetes Summary
kandi X-RAY | community.kubernetes Summary
Kubernetes Collection for Ansible
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of community.kubernetes
community.kubernetes Key Features
community.kubernetes Examples and Code Snippets
Community Discussions
Trending Discussions on community.kubernetes
QUESTION
I am trying to install Helm charts from local path via ansible using the following module:
...ANSWER
Answered 2021-Jun-02 at 06:32According to the documentation here you are looking for the 'values_files' parameter.
QUESTION
I would like to apply the ingress https://projectcontour.io/ to my kubernetes cluster with ansible community.kubernetes.k8s.
The example on https://docs.ansible.com/ansible/latest/collections/community/kubernetes/k8s_module.html shows me how to apply local files, for instance
...ANSWER
Answered 2021-Feb-08 at 10:45When I read the docs, I don't see an option to do that. You could download the file first, then apply it.
QUESTION
I am trying to use the module community.kubernetes.k8s – Manage Kubernetes (K8s) objects with variables from the role (e.g. role/sampleRole/vars file).
I am failing when it comes to the integer point e.g.:
...ANSWER
Answered 2020-Dec-22 at 13:59You could try the following as a workaround; in this example, we're creating a text template, and then using the from_yaml
filter to transform this into our desired data structure:
QUESTION
I'm writing an Ansible task to deploy GitLab in my k3s environment.
According to the doc, I need to execute this to install GitLab using Helm:
...ANSWER
Answered 2020-Nov-11 at 06:08it seems that the GitLab helm chart requires --set parameters and fail with --values
That is an erroneous assumption; what you are running into is that --set
splits on .
because otherwise providing fully-formed YAML on the command line would be painful
The correct values are using sub-objects where the .
occurs:
QUESTION
I was running into this particularly painful Ansible task of:
- Reading JSON from a file.
- Passing the JSON as a string to helm, BUT not quoting it.
ANSWER
Answered 2020-Oct-13 at 22:33Using {{ lookup('file', './stuff.json') | string }}
will force Ansible to evaluate it as a string without adding quotes.
There are several examples in Using filters to manipulate data that use this filter.
Documentation for the filter can be found in the Jinja2 documentation. The documentation states that the filter will:
Make a string unicode if it isn’t already. That way a markup string is not converted back to unicode.
I'm not particularly sure why this corrects the issue, but it did.
QUESTION
I am trying to execute a k8s command, on a Rancher Machine, through an Ansible playbook. The problem is that I am having an error that says the "export" command does not exist on the remote machine, which does not make any sense. The error is:
...ANSWER
Answered 2020-Jun-25 at 19:46The same difference between shell
and command
modules applies on the command
field of this module. What you trying to do is using shell properties which does not work.
Also, commands in different k8s_exec
tasks won't help because, they are not related, so exporting a variable in a first task won't make it available on next tasks, You should put everything on one command.
QUESTION
I am trying to copy a test file (e.g. HelloWorld.txt) from my local machine to a k8s pod on Rancher through Ansible. The thing is that I am getting a cat: no such file or directory. I think I am getting this error because I am using the k8s_exec module to execute the cp command. And since I am using that, I think he is trying to make a copy not from my local machine to the pod but already inside the pod.
Here is the playbook:
...ANSWER
Answered 2020-Jun-22 at 09:52Yes your guess is true, when you exec
into container your command will be executed "inside" pod. In this case you'll be just copying file inside the pod which is not present.
Check out kubectl cp command. This is similar to docker cp
command, which is copying file from host to container. You can use ansible command module
to execute it.
QUESTION
I am currently developing a project where I need to get the pod names of a Kubernetes Cluster running on Rancher using Ansible. The main thing here is that I have a couple of problems that are preventing me from advance. I am currently executing a playbook to try to retrieve this information, instead of running a CLI command, because I want to manipulate those Rancher machines later one (e.g. install an rpm file). Here is the playbook that I am executing tot try to retrieve the pods' names from Rancher:
...ANSWER
Answered 2020-Jun-18 at 16:10You're not supposed to do anything special to use the module except installing the needed python dependencies. See: https://docs.ansible.com/ansible/latest/modules/k8s_info_module.html
- remove the line
- role: ansible.kubernetes-modules
, unless it is a module of yours in which case you have to tell us more because this is not a correct declaration. - remove the collection declaration
- Add the following task somewhere before using the module:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install community.kubernetes
You can use community.kubernetes like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page