Commit Graph

82 Commits

Author SHA1 Message Date
abikouo
39b6c43ab7 add support for user impersonation for k8s modules (#250)
add support for user impersonation for k8s modules

SUMMARY

k8s module should not allow user to perform operation using impersonation as describe here
https://kubernetes.io/docs/reference/access-authn-authz/authentication/#user-impersonation
This pull request closes #40

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
2021-11-17 13:25:06 +00:00
itaru2622
9e2d78404f add no_proxy support to k8s* (#272)
add no_proxy support to k8s*

SUMMARY

close #271

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

plugins/module_utils/args_common.py
plugins/modules/k8s*
ADDITIONAL INFORMATION


It requires latest kubernetes library(>=19.15.0) to use this feature.


pip install kubernetes>=19.15.0
then, use following snippet yaml:

  - k8s:
      state: present
      src: "deployment.yaml"
      proxy:      "http://proxy.yourdomain.com:8080/"
      no_proxy:   "localhost,.yourdomain.com,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192,168.0.0/16"

or use environment variable K8S_AUTH_NO_PROXY as well as K8S_AUTH_PROXY.

Reviewed-by: None <None>
Reviewed-by: None <None>
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
2021-11-10 18:25:30 +00:00
Mike Graves
bf26f5a3be Don't wait on *List resources for info module (#253)
Don't wait on *List resources for info module

SUMMARY

We can't use the same wait logic on *List resources because they lack
the same metadata that other resources have. We should ensure that we
are waiting on the items in the list, but not the list itself. Waiting
on the list itself results in unexpected behavior.
This fixes the waiting logic when waiting on a list to wait until the
list being queried contains one or more items, or the wait timeout has
been reached. Each item in the list can then be waited on with the usual
wait logic.

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: None <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
2021-11-08 18:12:25 +00:00
Abhijeet Kasurde
91b80b1d1d Enable black formatting test (#259)
Enable black formatting test

SUMMARY
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/action/k8s_info.py
plugins/connection/kubectl.py
plugins/doc_fragments/helm_common_options.py
plugins/doc_fragments/k8s_auth_options.py
plugins/doc_fragments/k8s_delete_options.py
plugins/doc_fragments/k8s_name_options.py
plugins/doc_fragments/k8s_resource_options.py
plugins/doc_fragments/k8s_scale_options.py
plugins/doc_fragments/k8s_state_options.py
plugins/doc_fragments/k8s_wait_options.py
plugins/filter/k8s.py
plugins/inventory/k8s.py
plugins/lookup/k8s.py
plugins/lookup/kustomize.py
plugins/module_utils/ansiblemodule.py
plugins/module_utils/apply.py
plugins/module_utils/args_common.py
plugins/module_utils/client/discovery.py
plugins/module_utils/client/resource.py
plugins/module_utils/common.py
plugins/module_utils/exceptions.py
plugins/module_utils/hashes.py
plugins/module_utils/helm.py
plugins/module_utils/k8sdynamicclient.py
plugins/module_utils/selector.py
plugins/modules/helm.py
plugins/modules/helm_info.py
plugins/modules/helm_plugin.py
plugins/modules/helm_plugin_info.py
plugins/modules/helm_repository.py
plugins/modules/helm_template.py
plugins/modules/k8s.py
plugins/modules/k8s_cluster_info.py
plugins/modules/k8s_cp.py
plugins/modules/k8s_drain.py
plugins/modules/k8s_exec.py
plugins/modules/k8s_info.py
plugins/modules/k8s_json_patch.py
plugins/modules/k8s_log.py
plugins/modules/k8s_rollback.py
plugins/modules/k8s_scale.py
plugins/modules/k8s_service.py
tests/integration/targets/kubernetes/library/test_tempfile.py
tests/unit/module_utils/test_apply.py
tests/unit/module_utils/test_common.py
tests/unit/module_utils/test_discoverer.py
tests/unit/module_utils/test_hashes.py
tests/unit/module_utils/test_marshal.py
tests/unit/module_utils/test_selector.py
tox.ini

Reviewed-by: None <None>
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
2021-10-18 15:32:05 +00:00
Mike Graves
4010987d1f Add support for dry run (#245)
Add support for dry run

SUMMARY

Kubernetes server-side dry run will be used when the kubernetes client
version is >=18.20.0. For older versions of the client, the existing
client side speculative change implementation will be used.
The effect of this change should be mostly transparent to the end user
and is reflected in the fact the tests have not changed but should still
pass. With this change, there are a few edge cases that will be
improved. One example of these edge cases is to use check mode on an
existing Service resource. With dry run this will correctly report no
changes, while the older client side implementation will erroneously
report changes to the port spec.

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
Reviewed-by: None <None>
2021-10-15 14:20:43 +00:00
abikouo
c65512357d k8s - allow resource definition using generateName (#238)
k8s - allow resource definition using generateName

SUMMARY

#35

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

k8s
ADDITIONAL INFORMATION



- name: create pod using generateName
  k8s:
    namespace: test
    generate_name: pod-
    definition:
       kind: Pod
       spec:
          containers:
          - name: py
            image: python:3.7-alpine

- name: create pod using generateName
  k8s:
    namespace: test
    definition:
       kind: Pod
       metadata:
          generateName: pod-
       spec:
          containers:
          - name: py
            image: python:3.7-alpine

Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
Reviewed-by: None <None>
2021-09-30 14:58:50 +00:00
abikouo
8e46f92703 Helm uninstall now support wait parameter (#235)
Helm uninstall now support wait parameter

SUMMARY

closes #33

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION



- helm:
    chart_name: test
    state: absent
    wait: yes

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
Reviewed-by: None <None>
2021-09-29 16:21:37 +00:00
Gonéri Le Bouder
938f7e12e8 common/_wait_for: ensure label_selectors is optional (#239)
common/_wait_for: ensure label_selectors is optional

Depends-On: ansible/ansible-zuul-jobs#1125
The label_selectors is a new parameter for _wait_for that was
introduced in #158.
The value is new and it can be set to None to make it optional. It should
not be mandatory a non optional parameter.

Reviewed-by: None <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
2021-09-22 22:37:06 +00:00
Mike Graves
b397439972 Fix resource cache not being used (#228)
Fix resource cache not being used

SUMMARY

This was some bad copy/paste from the openshift client. The resource
cache was never being used resulting in unnecessary HTTP requests.

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: None <None>
Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
Reviewed-by: None <None>
2021-09-09 15:26:58 +00:00
abikouo
d78b64d792 add support for in-memory kubeconfig (#212)
add support for in-memory kubeconfig

SUMMARY

k8s module support now authentication with kubeconfig parameter as file and dict.

Closes #139
ISSUE TYPE


Feature Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
2021-08-30 09:31:07 +00:00
Mike Graves
77775f25a7 Re-enable support for turbo mode (#169)
Re-enable support for turbo mode

SUMMARY

This re-enables the ability to add turbo mode. It also adds a few more
tests to cover some cases that had been broken in turbo mode previously.
Testing with turbo mode is not currently enabled, and would fail until ansible-collections/cloud.common#69 can be merged and a new cloud.common release is done. This also does not add cloud.common to the collection dependencies until a decision has been made about how enabling/disabling turbo mode will work when cloud.common is already installed.

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
Reviewed-by: None <None>
2021-08-20 15:49:49 +00:00
abikouo
a4701a6806 replace iterator by generator (#205)
Fix network_sanity_ee_tests

SUMMARY

Network sanity ee tests are broken

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
2021-08-17 13:33:27 +00:00
Joshua K
25590804cb Add support for waiting on a StatefulSet. (#195)
Add support for waiting on a StatefulSet.

SUMMARY
This PR implements support for waiting on StatefulSet for readiness similar to how the other waiters currently work.
ISSUE TYPE

Feature Pull Request

ADDITIONAL INFORMATION
This was designed to (mostly) mimic the behaviour of the StatefulSetStatusViewer used by kubectl rollout status -w.

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Joshua K <None>
Reviewed-by: None <None>
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
2021-07-30 14:41:45 +00:00
abikouo
4b682666f1 k8s - add label_selectors options (#158)
k8s - add label_selectors options

SUMMARY
k8s now support label_selectors options same as k8s_info

Resolves #43

ISSUE TYPE


Feature Pull Request


COMPONENT NAME

k8s

Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
2021-07-29 09:56:34 +00:00
abikouo
c330c7ec65 k8s_cp - a new module for copying files to/from a Pod (#127)
* k8s_cp module

* add documentation for k8s_cp module

* add doc for the new module

* pods should be running

* support for binary, archive and zip file

* sanity

* Delete file.txt

* remove unused

* set back

* Update collection.txt

* Update test_copy_errors.yml

* Update plugins/modules/k8s_cp.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Update k8s_cp.py

* Update k8s_cp.py

* tar binary requirements

* Update common.py

* Update k8s_cp.py

* Update k8s_cp.py

* replace kind with binary file

* Update test_copy_large_file.yml

* Update plugins/action/k8s_info.py

Co-authored-by: Mike Graves <mgraves@redhat.com>

* Update k8s_info.py

* Update k8s_info.py

* Update k8s_cp.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Mike Graves <mgraves@redhat.com>
2021-07-26 13:21:34 +02:00
abikouo
3c36b6fa0f k8s support diff mode (#146)
* support diff mode for k8s module

* Update and rename 145-k8s-add-support-diff-mode.yml to 146-k8s-add-support-diff-mode.yml

* Update 146-k8s-add-support-diff-mode.yml

* Update changelogs/fragments/146-k8s-add-support-diff-mode.yml

Co-authored-by: Mike Graves <mgraves@redhat.com>

* update k8s_scale and k8s_json_patch

* diff for k8s_scale  and k8s_json_patch

Co-authored-by: Mike Graves <mgraves@redhat.com>
2021-07-21 14:29:28 +02:00
Abhijeet Kasurde
5fb3ecbb50 common: import k8sdynamicclient directly (#163) 2021-07-09 10:02:35 +05:30
Mike Graves
15799b2dd5 Check that auth value is not None (#151)
* Check that auth value is not None

The previous check for truth prevented the verify_ssl param from being
set to false, thus forcing ssl verfication in every case.

* Add changelog fragment

* Fix linting
2021-06-24 12:15:27 -04:00
Mike Graves
2eca446f09 Remove turbo mode functionality (#149)
* Remove turbo mode functionality

* Add changelog fragment

* Fix linting issue

* Update docs
2021-06-23 18:50:32 -04:00
Mike Graves
c11a255026 Fix apply on Ansible 2.9 (#135)
* Fix apply on Ansible 2.9

For some reason the apply function can't be correctly imported in
Ansible 2.9. This just renames it to get it to import. I've also added
molecule testing on multiple Ansible versions.

* Add changelog fragment
2021-06-16 11:28:46 -04:00
abikouo
46494a18bd Revert "k8s ability to wait on arbitrary property (#105)" (#133)
This reverts commit 4ccb15d4ad.
2021-06-15 14:32:21 +02:00
abikouo
4ccb15d4ad k8s ability to wait on arbitrary property (#105)
* missing implementation of jsonpath library

* not tested

* sanity

* save

* updates

* Update args_common.py

* lint validation

* fix

* Update k8s.py

* attribute should match for all

* select wait

* Revert "select wait"

This reverts commit a20a1f6f01.

* sanity

* Update molecule/default/tasks/waiter.yml

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Update jsonpath_extractor.py

* Update k8s_wait_options.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-15 10:44:26 +02:00
abikouo
58dba6bf22 k8s apply - fix list merge for array attribute with empty dict (#131)
Fix k8s apply
2021-06-15 10:41:55 +02:00
Mike Graves
ef82b78a2f Support multiple resources with same GVK (#119)
In replicating the openshift client functionality we forgot to bring
over a fix for multiple resources with the same group version and kind.
This is specifically a problem for openshift templates.
2021-06-04 13:19:02 -04:00
Mike Graves
5b5777d202 Split JSON patch out into a new module (#99)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-24 18:05:48 +05:30
Mike Graves
0bbc9ca999 Account for updated pods when waiting on DaemonSet (#102)
* Account for updated pods when waiting on DaemonSet

The exising logic that's used to determine when a DaemonSet is ready
fails to account for the fact that a RollingUpdate first kills the pod
and then creates a new one. Simply checking if the
desiredNumberScheduled equals the numberReady will succeed in cases
when the old pod takes time to shut down, and would report that the new
Deployment is ready despite the fact that the old pod has not been
replaced, yet.

* Add changelog fragment
2021-05-19 09:29:22 -04:00
abikouo
192cae1507 k8s - patch existing resource (#90)
* patch only

* add changelogs

* Rename 89-k8s-add-parameter-patch_only.yml to 90-k8s-add-parameter-patch_only.yml

* Update 90-k8s-add-parameter-patch_only.yml

* patch_only parameter changed to state=patched

* Update 90-k8s-add-parameter-patch_only.yml

* Update plugins/modules/k8s.py

Co-authored-by: Fabian von Feilitzsch <fabian@fabianism.us>

* Update molecule/default/tasks/patched.yml

Co-authored-by: John Mazzitelli <mazz@redhat.com>

* Update molecule/default/tasks/patched.yml

Co-authored-by: John Mazzitelli <mazz@redhat.com>

* sanity issue

Co-authored-by: Fabian von Feilitzsch <fabian@fabianism.us>
Co-authored-by: John Mazzitelli <mazz@redhat.com>
2021-05-19 11:03:11 +02:00
Mike Graves
01a0815e56 Replace openshift client with kubernetes client (#96)
* Replace openshift client with kubernetes client

This commit primarily just removes mentions of openshift from the docs
and updates the requirements. Most of the work to replace the client has
been done through the following commits:

edc48ee577
c214376cac
48c5170018
2b6a989cf9

* Add changelog fragment

* Update changelogs/fragments/96-replace-openshift-client.yaml

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Update plugins/modules/k8s.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Update plugins/modules/k8s_info.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Update plugins/modules/k8s_service.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* Bump minimum kubernetes version to 12.0.0

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-06 14:44:17 -04:00
Mike Graves
2b6a989cf9 Replicate base resource for lists functionality (#89)
* Replicate base resource for lists functionality

This replicates specific functionality from the openshift client to more
reliably retrieve the base resource from a resource list.

* Add changelog fragment
2021-05-05 10:09:22 -04:00
abikouo
963aa3fbe6 support merge_type`json` (#83)
Fixes #54
2021-04-28 09:06:43 -04:00
abikouo
d29f8c1eb7 add option proxy_headers for k8s modules (#58)
* add option proxy_headers for k8s modules

* Update and rename 50-add-support-for-proxy_headers-on-authentication to 58-add-support-for-proxy_headers-on-authentication.yaml

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-04-28 08:44:57 +02:00
Mike Graves
0e740a1f45 Enable the ansible turbo module (#68)
- enable the AnsibleTurboModule: Use AnsibleTurboModule when the `cloud.common` collection is available.
- Add dependency install step to molecule: Molecule won't install dependencies from galaxy.yml. We need to explicitly list them in a requirements.yml file and then enable the dependency step for molecule test.
2021-04-23 13:10:46 -04:00
Mike Graves
8b2d39d6d2 Fix client regression from turbo mode refactor (#79)
* Fix client regression from turbo mode refactor

The turbo mode refactoring introduced a regression where the kubernetes
client can fail to find the kubeconfig. This happens because
get_api_client is called twice and the second time it is called without
the module being passed as an argument. Without this, the configuration
will use defaults. This will be a problem if the user has specified a
location for the kubeconfig that's different from default, for example.

* Add tests
2021-04-22 15:13:38 -04:00
Alina Buzachis
48c5170018 Replicate apply method in the DynamicClient (#45)
* * Replicate apply method in the DynamicClient

Signed-off-by: Alina Buzachis <abuzachis@redhat.com>

* * Add changelog fragment

Signed-off-by: Alina Buzachis <abuzachis@redhat.com>
2021-04-22 14:58:53 -04:00
abikouo
361061c727 k8s loop flattening for template argument (#49)
* repo migration

* Update and rename 411-k8s-loop-flattening-and-continue_on_error.yaml to 49-k8s-loop-flattening-and-continue_on_error.yaml

* Update plugins/modules/k8s.py

Co-authored-by: Mike Graves <mgraves@redhat.com>

* split into multiple lines

* linting

* Update .gitignore

* Update template.yml

* merge

* Update template.yml

* deep copy environment

* deepcopy

* lint

* remove useless comment

* multiple definition

* tests update

* jmespath

* Update ci.yml

* Update template.yml

Co-authored-by: Mike Graves <mgraves@redhat.com>
2021-04-22 19:28:07 +02:00
Alina Buzachis
c214376cac Add cache_file parameter for DynamicClient (#46) 2021-04-21 09:57:52 +05:30
Abhijeet Kasurde
a5a850d1da Remove KubernetesAnsibleModule class (#70)
Co-authored-by: Mike Graves <mgraves@redhat.com>
2021-04-20 21:02:59 +05:30
Alina Buzachis
edc48ee577 Add configmap/secret hash functionality (#48)
* * * Add configmap/secret hash functionality

Signed-off-by: Alina Buzachis <abuzachis@redhat.com>

* * Add changelog fragment

Signed-off-by: Alina Buzachis <abuzachis@redhat.com>
2021-04-20 08:27:25 -04:00
Abhijeet Kasurde
cc10268adf k8s inventory - remove trailing slashes from hostname (#63)
When the user provides a hostname with trailing slashes like
https://localhost:6443/, the openshift library fails to
enumerate the APIs from the given cluster.

This fix removes any extra trailing slashes before sending it
to the openshift DynamicClient.

Fixes: #52

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-04-20 13:15:29 +05:30
Abhijeet Kasurde
5a0f5d6b93 helm: handle multiline output (#64)
Fixes: #399

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-04-20 12:07:28 +05:30
Mike Graves
ba586a8ed8 Rename from community.kubernetes to kubernetes.core (#6)
* Rename from community.kubernetes to kubernetes.core

This goes through and renames community.kubernetes to kubernetes.core.
Most of this was generated from the downstream build script that was
used on the community repository, plus whatever hand edits I could find
that were needed.

The downstream build and test process has also been removed as this
repository is now the downstream repository.

* Fix CONTRIBUTING.md
2021-04-08 08:48:27 -04:00
Abhijeet Kasurde
c9157ce713 k8s: fix get_api_client usage in inventory plugin (#395)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-03-26 14:36:47 -04:00
Gonéri Le Bouder
39660dd40e refactoring for ansible_module.turbo integration (#313)
* refactoring for ansible_module.turbo integration

This refactoring prepares the integration of `ansible_module.turbo`

- Delay the loading of `common.py`, move the shared structure in
  `args_common`.
- Avoid the use of one single object per module, this to increase the
  amount of Python structure that we can cache.
- Cache the Kubernetes client.

See: https://github.com/ansible-collections/community.kubernetes/pull/270

Co-authored-by: Jill Rouleau <jill.rouleau@bespokess.com>
2021-03-16 17:16:18 -04:00
Mike Graves
07915509c1 Remove deprecated KubernetesRawModule (#379)
* Remove deprecated KubernetesRawModule

* Add changelog fragment
2021-03-16 09:05:07 -04:00
Mike Graves
c4182ad84f Fix helm ignoring given context (#387)
Fixes: #385
2021-03-15 10:04:06 +05:30
Mike Graves
9f7b6fb3ff Honor wait_timeout in k8s_info for missing resource (#360)
* Honor wait in k8s_info for missing resource

The wait logic in the k8s_info module immediately returns when no
resources are found, regardless whether a wait_timeout has been
specified. This expands the logic to wait when a name has been provided.
The case this is specifically meant to address is when querying for a
resource that is indirectly created by another resource, for example, a
pod created by a deployment or an operator.

The existing logic in every other case should remain as it was before.
This means if a query might return more than one resource--all pods with
some label, for example--the module will return immediately if no pods
are found, even if a wait_timeout has been provided.

* Add changelog fragment
2021-02-16 10:19:22 -07:00
Mike Graves
b26afc3518 Fix Secret check_mode (#343)
When adding a Secret and using stringData, check_mode will always show
changes. An existing resource fetched from Kubernetes will have the
stringData already base64 encoded and merged into the data attribute.
This change performs the base64 encoding and merging with the provided
definition to more accurately represent the current state of the
cluster.

This change only affects check_mode. When making any changes to the
cluster the stringData is passed along as provided in the definition.

Closes #282.
2021-01-14 11:05:11 -05:00
Mike Graves
a9b8cc68d5 Add support for configuring garbage collection (#334)
* Add support for configuring garbage collection

This surfaces deleteOptions functionality in a top-level delete_options
parameter.

* Add changelog fragment

* Remove kind and apiVersion from delete_options

* Add release version to docs
2021-01-12 14:17:18 -05:00
Abhijeet Kasurde
9059f2c526 k8s: Handle ValueError raised (#330) 2021-01-12 21:38:58 +05:30
Gonéri Le Bouder
221631c06a helm: add support for the K8S_ envvars (#319)
Add support for:

- K8S_AUTH_HOST
- K8S_AUTH_API_KEY
- K8S_AUTH_VERIFY_SSL
- K8S_AUTH_SSL_CA_CERT

This commit also refactor the way we pass K8S related configuration to `helm`:

All the calls are now done in a new module_utils module (`helm.py`).
The handling of the `kube_*` variables has also been moved in this new
module.

We need https://github.com/helm/helm/pull/8622 to be able to ignore the
certificate validation. As a workaround, the generate a temporary
kubeconfig configuration file.

Closes: #279
2020-12-11 11:41:08 -05:00