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>
This commit is contained in:
Mike Graves
2021-05-06 14:44:17 -04:00
committed by GitHub
parent 2b6a989cf9
commit 01a0815e56
17 changed files with 58 additions and 106 deletions

View File

@@ -21,7 +21,7 @@ author:
- "Fabian von Feilitzsch (@fabianvf)"
description:
- Use the OpenShift Python client to perform CRUD operations on K8s objects.
- Use the Kubernetes Python client to perform CRUD operations on K8s objects.
- Pass the object definition from a source file or inline. See examples for reading
files and using Jinja templates or vault-encrypted files.
- Access to the full range of K8s APIs.
@@ -37,13 +37,6 @@ extends_documentation_fragment:
- kubernetes.core.k8s_wait_options
- kubernetes.core.k8s_delete_options
notes:
- If your OpenShift Python library is not 0.9.0 or newer and you are trying to
remove an item from an associative array/dictionary, for example a label or
an annotation, you will need to explicitly set the value of the item to be
removed to `null`. Simply deleting the entry in the dictionary will not
remove it from openshift or kubernetes.
options:
merge_type:
description:
@@ -52,11 +45,9 @@ options:
- For example, Custom Resource Definitions typically aren't updatable by the usual strategic merge. You may
want to use C(merge) if you see "strategic merge patch format is not supported"
- See U(https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment)
- Requires openshift >= 0.6.2
- If more than one merge_type is given, the merge_types will be tried in order
- If openshift >= 0.6.2, this defaults to C(['strategic-merge', 'merge']), which is ideal for using the same parameters
on resource kinds that combine Custom Resources and built-in resources. For openshift < 0.6.2, the default
is simply C(strategic-merge).
- If more than one C(merge_type) is given, the merge_types will be tried in order. This defaults to
C(['strategic-merge', 'merge']), which is ideal for using the same parameters on resource kinds that
combine Custom Resources and built-in resources.
- mutually exclusive with C(apply)
choices:
- json
@@ -67,7 +58,7 @@ options:
validate:
description:
- how (if at all) to validate the resource definition against the kubernetes schema.
Requires the kubernetes-validate python module and openshift >= 0.8.0
Requires the kubernetes-validate python module.
suboptions:
fail_on_error:
description: whether to fail on validation errors.
@@ -88,7 +79,6 @@ options:
- The full definition of an object is needed to generate the hash - this means that deleting an object created with append_hash
will only work if the same object is passed with state=absent (alternatively, just use state=absent with the name including
the generated hash and append_hash=no)
- Requires openshift >= 0.7.2
default: False
type: bool
apply:
@@ -96,7 +86,6 @@ options:
- C(apply) compares the desired resource definition with the previously supplied resource definition,
ignoring properties that are automatically generated
- C(apply) works better with Services than 'force=yes'
- Requires openshift >= 0.9.2
- mutually exclusive with C(merge_type)
default: False
type: bool
@@ -134,7 +123,7 @@ options:
requirements:
- "python >= 3.6"
- "openshift >= 0.6"
- "kubernetes >= 12.0.0"
- "PyYAML >= 3.11"
- "jsonpatch"
'''

View File

@@ -18,7 +18,7 @@ author:
- Abhijeet Kasurde (@Akasurde)
description:
- Use the OpenShift Python client to perform read operations on K8s objects.
- Use the Kubernetes Python client to perform read operations on K8s objects.
- Authenticate using either a config file, certificates, password or token.
- Supports check mode.
@@ -34,7 +34,7 @@ extends_documentation_fragment:
requirements:
- "python >= 3.6"
- "openshift >= 0.6"
- "kubernetes >= 12.0.0"
- "PyYAML >= 3.11"
'''
@@ -186,7 +186,7 @@ def execute_module(module, client):
'username': configuration.username,
'verify_ssl': configuration.verify_ssl,
}
from openshift import __version__ as version
from kubernetes import __version__ as version
version_info = {
'client': version,
'server': client.version,

View File

@@ -27,7 +27,7 @@ extends_documentation_fragment:
requirements:
- "python >= 3.6"
- "openshift == 0.4.3"
- "kubernetes >= 12.0.0"
- "PyYAML >= 3.11"
notes:

View File

@@ -18,7 +18,7 @@ author:
- "Will Thames (@willthames)"
description:
- Use the OpenShift Python client to perform read operations on K8s objects.
- Use the Kubernetes Python client to perform read operations on K8s objects.
- Access to the full range of K8s APIs.
- Authenticate using either a config file, certificates, password or token.
- Supports check mode.
@@ -50,7 +50,7 @@ extends_documentation_fragment:
requirements:
- "python >= 3.6"
- "openshift >= 0.6"
- "kubernetes >= 12.0.0"
- "PyYAML >= 3.11"
'''

View File

@@ -20,7 +20,7 @@ author:
- "Fabian von Feilitzsch (@fabianvf)"
description:
- Use the OpenShift Python client to perform read operations on K8s log endpoints.
- Use the Kubernetes Python client to perform read operations on K8s log endpoints.
- Authenticate using either a config file, certificates, password or token.
- Supports check mode.
- Analogous to `kubectl logs` or `oc logs`
@@ -57,7 +57,7 @@ options:
requirements:
- "python >= 3.6"
- "openshift >= 0.6"
- "kubernetes >= 12.0.0"
- "PyYAML >= 3.11"
'''

View File

@@ -15,7 +15,7 @@ version_added: "1.0.0"
author:
- "Julien Huon (@julienhuon)"
description:
- Use the OpenShift Python client to perform the Rollback.
- Use the Kubernetes Python client to perform the Rollback.
- Authenticate using either a config file, certificates, password or token.
- Similar to the C(kubectl rollout undo) command.
options:
@@ -32,7 +32,7 @@ extends_documentation_fragment:
- kubernetes.core.k8s_name_options
requirements:
- "python >= 3.6"
- "openshift >= 0.6"
- "kubernetes >= 12.0.0"
- "PyYAML >= 3.11"
'''

View File

@@ -32,7 +32,7 @@ extends_documentation_fragment:
requirements:
- "python >= 3.6"
- "openshift >= 0.6"
- "kubernetes >= 12.0.0"
- "PyYAML >= 3.11"
'''

View File

@@ -18,7 +18,7 @@ short_description: Manage Services on Kubernetes
author: KubeVirt Team (@kubevirt)
description:
- Use Openshift Python SDK to manage Services on Kubernetes
- Use Kubernetes Python SDK to manage Services on Kubernetes
extends_documentation_fragment:
- kubernetes.core.k8s_auth_options
@@ -33,11 +33,9 @@ options:
- For example, Custom Resource Definitions typically aren't updatable by the usual strategic merge. You may
want to use C(merge) if you see "strategic merge patch format is not supported"
- See U(https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment)
- Requires openshift >= 0.6.2
- If more than one merge_type is given, the merge_types will be tried in order
- If openshift >= 0.6.2, this defaults to C(['strategic-merge', 'merge']), which is ideal for using the same parameters
on resource kinds that combine Custom Resources and built-in resources. For openshift < 0.6.2, the default
is simply C(strategic-merge).
- If more than one C(merge_type) is given, the merge_types will be tried in order
- This defaults to C(['strategic-merge', 'merge']), which is ideal for using the same parameters
on resource kinds that combine Custom Resources and built-in resources.
choices:
- json
- merge
@@ -86,7 +84,7 @@ options:
requirements:
- python >= 3.6
- openshift >= 0.6.2
- kubernetes >= 12.0.0
'''
EXAMPLES = r'''