diff --git a/README.md b/README.md index 21dc7063..0225febb 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ Name | Description [kubernetes.core.k8s_rollback](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_rollback_module.rst)|Rollback Kubernetes (K8S) Deployments and DaemonSets [kubernetes.core.k8s_scale](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_scale_module.rst)|Set a new size for a Deployment, ReplicaSet, Replication Controller, or Job. [kubernetes.core.k8s_service](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_service_module.rst)|Manage Services on Kubernetes +[kubernetes.core.k8s_taint](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_taint_module.rst)|Taint a node in a Kubernetes/OpenShift cluster diff --git a/docs/kubernetes.core.helm_info_module.rst b/docs/kubernetes.core.helm_info_module.rst index f74546b2..a670da1f 100644 --- a/docs/kubernetes.core.helm_info_module.rst +++ b/docs/kubernetes.core.helm_info_module.rst @@ -172,6 +172,31 @@ Parameters

aliases: namespace
+ + +
+ release_state + +
+ list + / elements=string +
+
added in 2.3.0
+ + + + +
Show releases as per their states.
+
Default value is deployed and failed.
+
If set to all, show all releases without any filter applied.
+
If set to deployed, show deployed releases.
+
If set to failed, show failed releases.
+
If set to pending, show pending releases.
+
If set to superseded, show superseded releases.
+
If set to uninstalled, show uninstalled releases, if helm uninstall --keep-history was used.
+
If set to uninstalling, show releases that are currently being uninstalled.
+ +
@@ -204,11 +229,18 @@ Examples .. code-block:: yaml - - name: Deploy latest version of Grafana chart inside monitoring namespace + - name: Gather information of Grafana chart inside monitoring namespace kubernetes.core.helm_info: name: test release_namespace: monitoring + - name: Gather information about test-chart with pending state + kubernetes.core.helm_info: + name: test-chart + release_namespace: testenv + release_state: + - pending + Return Values diff --git a/docs/kubernetes.core.helm_module.rst b/docs/kubernetes.core.helm_module.rst index a389408a..63ae08f8 100644 --- a/docs/kubernetes.core.helm_module.rst +++ b/docs/kubernetes.core.helm_module.rst @@ -532,6 +532,12 @@ Parameters
+Notes +----- + +.. note:: + - The default idempotency check can fail to report changes when ``release_state`` is set to ``present`` and ``chart_repo_url`` is defined. Install helm diff >= 3.4.1 for better results. + Examples diff --git a/docs/kubernetes.core.helm_plugin_module.rst b/docs/kubernetes.core.helm_plugin_module.rst index ca1f1d03..98d63aa2 100644 --- a/docs/kubernetes.core.helm_plugin_module.rst +++ b/docs/kubernetes.core.helm_plugin_module.rst @@ -150,7 +150,7 @@ Parameters
Name of Helm plugin.
-
Required only if state=absent.
+
Required only if state=absent or state=latest.
@@ -170,6 +170,23 @@ Parameters
Required only if state=present.
+ + +
+ plugin_version + +
+ string +
+
added in 2.3.0
+ + + + +
Plugin version to install. If this is not specified, the latest version is installed.
+
Ignored when state=absent or state=latest.
+ +
@@ -183,10 +200,12 @@ Parameters
If state=present the Helm plugin will be installed.
+
If state=latest the Helm plugin will be updated. Added in version 2.3.0.
If state=absent the Helm plugin will be removed.
@@ -237,6 +256,17 @@ Examples plugin_name: env state: absent + - name: Install Helm plugin with a specific version + kubernetes.core.helm_plugin: + plugin_version: 2.0.1 + plugin_path: https://domain/path/to/plugin.tar.gz + state: present + + - name: Update Helm plugin + kubernetes.core.helm_plugin: + plugin_name: secrets + state: latest + Return Values diff --git a/docs/kubernetes.core.helm_repository_module.rst b/docs/kubernetes.core.helm_repository_module.rst index aa39ede6..6594400c 100644 --- a/docs/kubernetes.core.helm_repository_module.rst +++ b/docs/kubernetes.core.helm_repository_module.rst @@ -40,6 +40,22 @@ Parameters Choices/Defaults Comments + + +
+ api_key + +
+ string +
+
added in 2.3.0
+ + + + +
Token used to authenticate with the API. Can also be specified via K8S_AUTH_API_KEY environment variable.
+ +
@@ -55,6 +71,59 @@ Parameters
The path of a helm binary to use.
+ + +
+ ca_cert + +
+ path +
+
added in 2.3.0
+ + + + +
Path to a CA certificate used to authenticate with the API. The full certificate chain must be provided to avoid certificate validation errors. Can also be specified via K8S_AUTH_SSL_CA_CERT environment variable.
+

aliases: ssl_ca_cert
+ + + + +
+ host + +
+ string +
+
added in 2.3.0
+ + + + +
Provide a URL for accessing the API. Can also be specified via K8S_AUTH_HOST environment variable.
+ + + + +
+ pass_credentials + +
+ boolean +
+
added in 2.3.0
+ + + + + +
Pass credentials to all domains.
+ +
@@ -142,6 +211,27 @@ Parameters

aliases: username
+ + +
+ validate_certs + +
+ boolean +
+
added in 2.3.0
+ + + + + +
Whether or not to verify the API server's SSL certificates. Can also be specified via K8S_AUTH_VERIFY_SSL environment variable.
+

aliases: verify_ssl
+ +
diff --git a/docs/kubernetes.core.helm_template_module.rst b/docs/kubernetes.core.helm_template_module.rst index 9a8ea5c8..7b6a4476 100644 --- a/docs/kubernetes.core.helm_template_module.rst +++ b/docs/kubernetes.core.helm_template_module.rst @@ -131,6 +131,22 @@ Parameters
If the directory already exists, it will be overwritten.
+ + +
+ release_namespace + +
+ string +
+
added in 2.3.0
+ + + + +
namespace scope for this request.
+ +
@@ -148,6 +164,23 @@ Parameters

aliases: values
+ + +
+ show_only + +
+ list + / elements=string +
+
added in 2.3.0
+ + + + +
Only show manifests rendered from the given templates.
+ +
@@ -213,6 +246,24 @@ Examples dest: myfile.yaml content: "{{ result.stdout }}" + - name: Render MutatingWebhooksConfiguration for revision tag "canary", rev "1-13-0" + kubernetes.core.helm_template: + chart_ref: istio/istiod + chart_version: "1.13.0" + release_namespace: "istio-system" + show_only: + - "templates/revision-tags.yaml" + release_values: + revision: "1-13-0" + revisionTags: + - "canary" + register: result + + - name: Write templates to file + copy: + dest: myfile.yaml + content: "{{ result.stdout }}" + Return Values diff --git a/docs/kubernetes.core.k8s_cluster_info_module.rst b/docs/kubernetes.core.k8s_cluster_info_module.rst index bdd83ae4..1bf39519 100644 --- a/docs/kubernetes.core.k8s_cluster_info_module.rst +++ b/docs/kubernetes.core.k8s_cluster_info_module.rst @@ -136,6 +136,41 @@ Parameters
Provide a URL for accessing the API. Can also be specified via K8S_AUTH_HOST environment variable.
+ + +
+ impersonate_groups + +
+ list + / elements=string +
+
added in 2.3.0
+ + + + +
Group(s) to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_GROUPS environment. Example: 'Group1,Group2'
+ + + + +
+ impersonate_user + +
+ string +
+
added in 2.3.0
+ + + + +
Username to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_USER environment.
+ +
@@ -171,6 +206,25 @@ Parameters
The kubernetes configuration can be provided as dictionary. This feature requires a python kubernetes client version >= 17.17.0. Added in version 2.2.0.
+ + +
+ no_proxy + +
+ string +
+
added in 2.3.0
+ + + + +
The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy. Can also be specified via K8S_AUTH_NO_PROXY environment variable.
+
Please note that this module does not pick up typical proxy settings from the environment (e.g. NO_PROXY).
+
This feature requires kubernetes>=19.15.0. When kubernetes library is less than 19.15.0, it fails even no_proxy set in correct.
+
example value is "localhost,.local,.example.com,127.0.0.1,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
+ +
diff --git a/docs/kubernetes.core.k8s_cp_module.rst b/docs/kubernetes.core.k8s_cp_module.rst index 1cf34449..a0c387cc 100644 --- a/docs/kubernetes.core.k8s_cp_module.rst +++ b/docs/kubernetes.core.k8s_cp_module.rst @@ -167,6 +167,41 @@ Parameters
Provide a URL for accessing the API. Can also be specified via K8S_AUTH_HOST environment variable.
+ + +
+ impersonate_groups + +
+ list + / elements=string +
+
added in 2.3.0
+ + + + +
Group(s) to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_GROUPS environment. Example: 'Group1,Group2'
+ + + + +
+ impersonate_user + +
+ string +
+
added in 2.3.0
+ + + + +
Username to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_USER environment.
+ +
@@ -236,6 +271,25 @@ Parameters
This option is ignored when content is set or when state is set to from_pod.
+ + +
+ no_proxy + +
+ string +
+
added in 2.3.0
+ + + + +
The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy. Can also be specified via K8S_AUTH_NO_PROXY environment variable.
+
Please note that this module does not pick up typical proxy settings from the environment (e.g. NO_PROXY).
+
This feature requires kubernetes>=19.15.0. When kubernetes library is less than 19.15.0, it fails even no_proxy set in correct.
+
example value is "localhost,.local,.example.com,127.0.0.1,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
+ +
diff --git a/docs/kubernetes.core.k8s_drain_module.rst b/docs/kubernetes.core.k8s_drain_module.rst index f719e04b..78b97496 100644 --- a/docs/kubernetes.core.k8s_drain_module.rst +++ b/docs/kubernetes.core.k8s_drain_module.rst @@ -147,6 +147,7 @@ Parameters
boolean
+
added in 2.3.0
-
Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained)
+
Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained).
@@ -286,6 +287,41 @@ Parameters
Provide a URL for accessing the API. Can also be specified via K8S_AUTH_HOST environment variable.
+ + +
+ impersonate_groups + +
+ list + / elements=string +
+
added in 2.3.0
+ + + + +
Group(s) to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_GROUPS environment. Example: 'Group1,Group2'
+ + + + +
+ impersonate_user + +
+ string +
+
added in 2.3.0
+ + + + +
Username to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_USER environment.
+ +
@@ -318,6 +354,25 @@ Parameters
The name of the node.
+ + +
+ no_proxy + +
+ string +
+
added in 2.3.0
+ + + + +
The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy. Can also be specified via K8S_AUTH_NO_PROXY environment variable.
+
Please note that this module does not pick up typical proxy settings from the environment (e.g. NO_PROXY).
+
This feature requires kubernetes>=19.15.0. When kubernetes library is less than 19.15.0, it fails even no_proxy set in correct.
+
example value is "localhost,.local,.example.com,127.0.0.1,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
+ +
diff --git a/docs/kubernetes.core.k8s_exec_module.rst b/docs/kubernetes.core.k8s_exec_module.rst index efadf5b5..93c04e79 100644 --- a/docs/kubernetes.core.k8s_exec_module.rst +++ b/docs/kubernetes.core.k8s_exec_module.rst @@ -117,7 +117,7 @@ Parameters -
The command to execute
+
The command to execute.
@@ -134,6 +134,7 @@ Parameters
The name of the container in the pod to connect to.
Defaults to only container if there is only one container in the pod.
+
If not specified, will choose the first container from the given pod as kubectl cmdline does.
@@ -166,6 +167,41 @@ Parameters
Provide a URL for accessing the API. Can also be specified via K8S_AUTH_HOST environment variable.
+ + +
+ impersonate_groups + +
+ list + / elements=string +
+
added in 2.3.0
+ + + + +
Group(s) to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_GROUPS environment. Example: 'Group1,Group2'
+ + + + +
+ impersonate_user + +
+ string +
+
added in 2.3.0
+ + + + +
Username to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_USER environment.
+ +
@@ -195,7 +231,26 @@ Parameters -
The pod namespace name
+
The pod namespace name.
+ + + + +
+ no_proxy + +
+ string +
+
added in 2.3.0
+ + + + +
The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy. Can also be specified via K8S_AUTH_NO_PROXY environment variable.
+
Please note that this module does not pick up typical proxy settings from the environment (e.g. NO_PROXY).
+
This feature requires kubernetes>=19.15.0. When kubernetes library is less than 19.15.0, it fails even no_proxy set in correct.
+
example value is "localhost,.local,.example.com,127.0.0.1,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
@@ -250,7 +305,7 @@ Parameters -
The pod name
+
The pod name.
@@ -267,7 +322,7 @@ Parameters
The URL of an HTTP proxy to use for the connection.
Can also be specified via K8S_AUTH_PROXY environment variable.
-
Please note that this module does not pick up typical proxy settings from the environment (e.g. HTTP_PROXY).
+
Please note that this module does not pick up typical proxy settings from the environment (for example, HTTP_PROXY).
@@ -414,6 +469,13 @@ Examples msg: "cmd failed" when: command_status.rc != 0 + - name: Specify a container name to execute the command on + kubernetes.core.k8s_exec: + namespace: myproject + pod: busybox-test + container: manager + command: echo "hello" + Return Values diff --git a/docs/kubernetes.core.k8s_info_module.rst b/docs/kubernetes.core.k8s_info_module.rst index 518a4599..caa8458b 100644 --- a/docs/kubernetes.core.k8s_info_module.rst +++ b/docs/kubernetes.core.k8s_info_module.rst @@ -173,6 +173,41 @@ Parameters
Provide a URL for accessing the API. Can also be specified via K8S_AUTH_HOST environment variable.
+ + +
+ impersonate_groups + +
+ list + / elements=string +
+
added in 2.3.0
+ + + + +
Group(s) to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_GROUPS environment. Example: 'Group1,Group2'
+ + + + +
+ impersonate_user + +
+ string +
+
added in 2.3.0
+ + + + +
Username to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_USER environment.
+ +
@@ -260,6 +295,25 @@ Parameters
If resource definition is provided, the metadata.namespace value from the resource_definition will override this option.
+ + +
+ no_proxy + +
+ string +
+
added in 2.3.0
+ + + + +
The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy. Can also be specified via K8S_AUTH_NO_PROXY environment variable.
+
Please note that this module does not pick up typical proxy settings from the environment (e.g. NO_PROXY).
+
This feature requires kubernetes>=19.15.0. When kubernetes library is less than 19.15.0, it fails even no_proxy set in correct.
+
example value is "localhost,.local,.example.com,127.0.0.1,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
+ +
diff --git a/docs/kubernetes.core.k8s_inventory.rst b/docs/kubernetes.core.k8s_inventory.rst index 79769c1b..b028a1c4 100644 --- a/docs/kubernetes.core.k8s_inventory.rst +++ b/docs/kubernetes.core.k8s_inventory.rst @@ -351,8 +351,8 @@ Status Authors ~~~~~~~ -- Chris Houseknecht <@chouseknecht> -- Fabian von Feilitzsch <@fabianvf> +- Chris Houseknecht (@chouseknecht) +- Fabian von Feilitzsch (@fabianvf) .. hint:: diff --git a/docs/kubernetes.core.k8s_json_patch_module.rst b/docs/kubernetes.core.k8s_json_patch_module.rst index dad68d7b..68e60743 100644 --- a/docs/kubernetes.core.k8s_json_patch_module.rst +++ b/docs/kubernetes.core.k8s_json_patch_module.rst @@ -155,6 +155,41 @@ Parameters
Provide a URL for accessing the API. Can also be specified via K8S_AUTH_HOST environment variable.
+ + +
+ impersonate_groups + +
+ list + / elements=string +
+
added in 2.3.0
+ + + + +
Group(s) to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_GROUPS environment. Example: 'Group1,Group2'
+ + + + +
+ impersonate_user + +
+ string +
+
added in 2.3.0
+ + + + +
Username to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_USER environment.
+ +
@@ -221,6 +256,25 @@ Parameters
Use in conjunction with api_version, kind, and name to identify a specific object.
+ + +
+ no_proxy + +
+ string +
+
added in 2.3.0
+ + + + +
The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy. Can also be specified via K8S_AUTH_NO_PROXY environment variable.
+
Please note that this module does not pick up typical proxy settings from the environment (e.g. NO_PROXY).
+
This feature requires kubernetes>=19.15.0. When kubernetes library is less than 19.15.0, it fails even no_proxy set in correct.
+
example value is "localhost,.local,.example.com,127.0.0.1,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
+ +
diff --git a/docs/kubernetes.core.k8s_log_module.rst b/docs/kubernetes.core.k8s_log_module.rst index 964c1527..e4a50e38 100644 --- a/docs/kubernetes.core.k8s_log_module.rst +++ b/docs/kubernetes.core.k8s_log_module.rst @@ -174,6 +174,41 @@ Parameters
Provide a URL for accessing the API. Can also be specified via K8S_AUTH_HOST environment variable.
+ + +
+ impersonate_groups + +
+ list + / elements=string +
+
added in 2.3.0
+ + + + +
Group(s) to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_GROUPS environment. Example: 'Group1,Group2'
+ + + + +
+ impersonate_user + +
+ string +
+
added in 2.3.0
+ + + + +
Username to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_USER environment.
+ +
@@ -260,6 +295,25 @@ Parameters
If resource definition is provided, the metadata.namespace value from the resource_definition will override this option.
+ + +
+ no_proxy + +
+ string +
+
added in 2.3.0
+ + + + +
The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy. Can also be specified via K8S_AUTH_NO_PROXY environment variable.
+
Please note that this module does not pick up typical proxy settings from the environment (e.g. NO_PROXY).
+
This feature requires kubernetes>=19.15.0. When kubernetes library is less than 19.15.0, it fails even no_proxy set in correct.
+
example value is "localhost,.local,.example.com,127.0.0.1,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
+ +
diff --git a/docs/kubernetes.core.k8s_lookup.rst b/docs/kubernetes.core.k8s_lookup.rst index 9e428c8b..c80ea0c7 100644 --- a/docs/kubernetes.core.k8s_lookup.rst +++ b/docs/kubernetes.core.k8s_lookup.rst @@ -438,106 +438,28 @@ Common return values are documented `here - Key + Key Returned Description - +
_list
- complex + list + / elements=dictionary
One ore more object definitions returned from the API.

+
Sample:
+
[{'kind': 'ConfigMap', 'apiVersion': 'v1', 'metadata': {'creationTimestamp': '2022-03-04T13:59:49Z', 'name': 'my-config-map', 'namespace': 'default', 'resourceVersion': '418', 'uid': '5714b011-d090-4eac-8272-a0ea82ec0abd'}, 'data': {'key1': 'val1'}}]
- -   - -
- api_version - -
- string -
- - success - -
The versioned schema of this representation of an object.
-
- - - -   - -
- kind - -
- string -
- - success - -
Represents the REST resource this object represents.
-
- - - -   - -
- metadata - -
- complex -
- - success - -
Standard object metadata. Includes name, namespace, annotations, labels, etc.
-
- - - -   - -
- spec - -
- complex -
- - success - -
Specific attributes of the object. Will vary based on the api_version and kind.
-
- - - -   - -
- status - -
- complex -
- - success - -
Current status details for the object.
-
- - -

@@ -549,8 +471,8 @@ Status Authors ~~~~~~~ -- Chris Houseknecht <@chouseknecht> -- Fabian von Feilitzsch <@fabianvf> +- Chris Houseknecht (@chouseknecht) +- Fabian von Feilitzsch (@fabianvf) .. hint:: diff --git a/docs/kubernetes.core.k8s_module.rst b/docs/kubernetes.core.k8s_module.rst index 058b6b96..0c859b01 100644 --- a/docs/kubernetes.core.k8s_module.rst +++ b/docs/kubernetes.core.k8s_module.rst @@ -336,6 +336,26 @@ Parameters
If set to yes, and state is present, an existing object will be replaced.
+ + +
+ generate_name + +
+ string +
+
added in 2.3.0
+ + + + +
Use to specify the basis of an object name and random characters will be added automatically on server to generate a unique name.
+
This option is ignored when state is not set to present or when apply is set to yes.
+
If resource definition is provided, the metadata.generateName value from the resource_definition will override this option.
+
If resource definition is provided, and contains metadata.name, this option is ignored.
+
mutually exclusive with name.
+ +
@@ -351,6 +371,41 @@ Parameters
Provide a URL for accessing the API. Can also be specified via K8S_AUTH_HOST environment variable.
+ + +
+ impersonate_groups + +
+ list + / elements=string +
+
added in 2.3.0
+ + + + +
Group(s) to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_GROUPS environment. Example: 'Group1,Group2'
+ + + + +
+ impersonate_user + +
+ string +
+
added in 2.3.0
+ + + + +
Username to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_USER environment.
+ +
@@ -464,6 +519,25 @@ Parameters
If resource definition is provided, the metadata.namespace value from the resource_definition will override this option.
+ + +
+ no_proxy + +
+ string +
+
added in 2.3.0
+ + + + +
The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy. Can also be specified via K8S_AUTH_NO_PROXY environment variable.
+
Please note that this module does not pick up typical proxy settings from the environment (e.g. NO_PROXY).
+
This feature requires kubernetes>=19.15.0. When kubernetes library is less than 19.15.0, it fails even no_proxy set in correct.
+
example value is "localhost,.local,.example.com,127.0.0.1,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
+ +
@@ -605,6 +679,63 @@ Parameters

aliases: definition, inline
+ + +
+ server_side_apply + +
+ dictionary +
+
added in 2.3.0
+ + + + +
When this option is set, apply runs in the server instead of the client.
+
Ignored if apply is not set or is set to False.
+
This option requires "kubernetes >= 19.15.0".
+ + + + + +
+ field_manager + +
+ string + / required +
+ + + + +
Name of the manager used to track field ownership.
+ + + + + +
+ force_conflicts + +
+ boolean +
+ + + + + +
A conflict is a special status error that occurs when an Server Side Apply operation tries to change a field, which another user also claims to manage.
+
When set to True, server-side apply will force the changes against conflicts.
+ + +
@@ -619,7 +750,7 @@ Parameters
Provide a path to a file containing a valid YAML definition of an object or objects to be created or updated. Mutually exclusive with resource_definition. NOTE: kind, api_version, name, and namespace will be overwritten by corresponding values found in the configuration read in from the src file.
Reads from the local file system. To read from the Ansible controller's file system, including vaulted files, use the file lookup plugin or template lookup plugin, combined with the from_yaml filter, and pass the result to resource_definition. See Examples below.
-
Mutually exclusive with template in case of k8s module.
+
Mutually exclusive with template in case of kubernetes.core.k8s module.
@@ -1058,6 +1189,33 @@ Examples labels: support: patch + # Create object using generateName + - name: create resource using name generated by the server + kubernetes.core.k8s: + state: present + generate_name: pod- + definition: + apiVersion: v1 + kind: Pod + spec: + containers: + - name: py + image: python:3.7-alpine + imagePullPolicy: IfNotPresent + + # Server side apply + - name: Create configmap using server side apply + kubernetes.core.k8s: + namespace: testing + definition: + apiVersion: v1 + kind: ConfigMap + metadata: + name: my-configmap + apply: yes + server_side_apply: + field_manager: ansible + Return Values diff --git a/docs/kubernetes.core.k8s_rollback_module.rst b/docs/kubernetes.core.k8s_rollback_module.rst index a559ce2e..1ef4b4ea 100644 --- a/docs/kubernetes.core.k8s_rollback_module.rst +++ b/docs/kubernetes.core.k8s_rollback_module.rst @@ -172,6 +172,41 @@ Parameters
Provide a URL for accessing the API. Can also be specified via K8S_AUTH_HOST environment variable.
+ + +
+ impersonate_groups + +
+ list + / elements=string +
+
added in 2.3.0
+ + + + +
Group(s) to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_GROUPS environment. Example: 'Group1,Group2'
+ + + + +
+ impersonate_user + +
+ string +
+
added in 2.3.0
+ + + + +
Username to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_USER environment.
+ +
@@ -258,6 +293,25 @@ Parameters
If resource definition is provided, the metadata.namespace value from the resource_definition will override this option.
+ + +
+ no_proxy + +
+ string +
+
added in 2.3.0
+ + + + +
The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy. Can also be specified via K8S_AUTH_NO_PROXY environment variable.
+
Please note that this module does not pick up typical proxy settings from the environment (e.g. NO_PROXY).
+
This feature requires kubernetes>=19.15.0. When kubernetes library is less than 19.15.0, it fails even no_proxy set in correct.
+
example value is "localhost,.local,.example.com,127.0.0.1,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
+ +
diff --git a/docs/kubernetes.core.k8s_scale_module.rst b/docs/kubernetes.core.k8s_scale_module.rst index 9f7ddebc..8d91533f 100644 --- a/docs/kubernetes.core.k8s_scale_module.rst +++ b/docs/kubernetes.core.k8s_scale_module.rst @@ -189,6 +189,41 @@ Parameters
Provide a URL for accessing the API. Can also be specified via K8S_AUTH_HOST environment variable.
+ + +
+ impersonate_groups + +
+ list + / elements=string +
+
added in 2.3.0
+ + + + +
Group(s) to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_GROUPS environment. Example: 'Group1,Group2'
+ + + + +
+ impersonate_user + +
+ string +
+
added in 2.3.0
+ + + + +
Username to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_USER environment.
+ +
@@ -276,6 +311,25 @@ Parameters
If resource definition is provided, the metadata.namespace value from the resource_definition will override this option.
+ + +
+ no_proxy + +
+ string +
+
added in 2.3.0
+ + + + +
The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy. Can also be specified via K8S_AUTH_NO_PROXY environment variable.
+
Please note that this module does not pick up typical proxy settings from the environment (e.g. NO_PROXY).
+
This feature requires kubernetes>=19.15.0. When kubernetes library is less than 19.15.0, it fails even no_proxy set in correct.
+
example value is "localhost,.local,.example.com,127.0.0.1,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
+ +
@@ -462,7 +516,7 @@ Parameters
Provide a path to a file containing a valid YAML definition of an object or objects to be created or updated. Mutually exclusive with resource_definition. NOTE: kind, api_version, name, and namespace will be overwritten by corresponding values found in the configuration read in from the src file.
Reads from the local file system. To read from the Ansible controller's file system, including vaulted files, use the file lookup plugin or template lookup plugin, combined with the from_yaml filter, and pass the result to resource_definition. See Examples below.
-
Mutually exclusive with template in case of k8s module.
+
Mutually exclusive with template in case of kubernetes.core.k8s module.
diff --git a/docs/kubernetes.core.k8s_service_module.rst b/docs/kubernetes.core.k8s_service_module.rst index fa40e51f..8ed24f67 100644 --- a/docs/kubernetes.core.k8s_service_module.rst +++ b/docs/kubernetes.core.k8s_service_module.rst @@ -172,6 +172,41 @@ Parameters
Provide a URL for accessing the API. Can also be specified via K8S_AUTH_HOST environment variable.
+ + +
+ impersonate_groups + +
+ list + / elements=string +
+
added in 2.3.0
+ + + + +
Group(s) to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_GROUPS environment. Example: 'Group1,Group2'
+ + + + +
+ impersonate_user + +
+ string +
+
added in 2.3.0
+ + + + +
Username to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_USER environment.
+ +
@@ -245,6 +280,25 @@ Parameters
Use to specify a Service object namespace.
+ + +
+ no_proxy + +
+ string +
+
added in 2.3.0
+ + + + +
The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy. Can also be specified via K8S_AUTH_NO_PROXY environment variable.
+
Please note that this module does not pick up typical proxy settings from the environment (e.g. NO_PROXY).
+
This feature requires kubernetes>=19.15.0. When kubernetes library is less than 19.15.0, it fails even no_proxy set in correct.
+
example value is "localhost,.local,.example.com,127.0.0.1,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
+ +
@@ -433,7 +487,7 @@ Parameters
Provide a path to a file containing a valid YAML definition of an object or objects to be created or updated. Mutually exclusive with resource_definition. NOTE: kind, api_version, name, and namespace will be overwritten by corresponding values found in the configuration read in from the src file.
Reads from the local file system. To read from the Ansible controller's file system, including vaulted files, use the file lookup plugin or template lookup plugin, combined with the from_yaml filter, and pass the result to resource_definition. See Examples below.
-
Mutually exclusive with template in case of k8s module.
+
Mutually exclusive with template in case of kubernetes.core.k8s module.
diff --git a/docs/kubernetes.core.k8s_taint_module.rst b/docs/kubernetes.core.k8s_taint_module.rst new file mode 100644 index 00000000..1a8f309a --- /dev/null +++ b/docs/kubernetes.core.k8s_taint_module.rst @@ -0,0 +1,660 @@ +.. _kubernetes.core.k8s_taint_module: + + +************************* +kubernetes.core.k8s_taint +************************* + +**Taint a node in a Kubernetes/OpenShift cluster** + + +Version added: 2.3.0 + +.. contents:: + :local: + :depth: 1 + + +Synopsis +-------- +- Taint allows a node to refuse Pod to be scheduled unless that Pod has a matching toleration. +- Untaint will remove taints from nodes as needed. + + + +Requirements +------------ +The below requirements are needed on the host that executes this module. + +- python >= 3.6 +- kubernetes >= 12.0.0 + + +Parameters +---------- + +.. raw:: html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterChoices/DefaultsComments
+
+ api_key + +
+ string +
+
+ +
Token used to authenticate with the API. Can also be specified via K8S_AUTH_API_KEY environment variable.
+
+
+ ca_cert + +
+ path +
+
+ +
Path to a CA certificate used to authenticate with the API. The full certificate chain must be provided to avoid certificate validation errors. Can also be specified via K8S_AUTH_SSL_CA_CERT environment variable.
+

aliases: ssl_ca_cert
+
+
+ client_cert + +
+ path +
+
+ +
Path to a certificate used to authenticate with the API. Can also be specified via K8S_AUTH_CERT_FILE environment variable.
+

aliases: cert_file
+
+
+ client_key + +
+ path +
+
+ +
Path to a key file used to authenticate with the API. Can also be specified via K8S_AUTH_KEY_FILE environment variable.
+

aliases: key_file
+
+
+ context + +
+ string +
+
+ +
The name of a context found in the config file. Can also be specified via K8S_AUTH_CONTEXT environment variable.
+
+
+ host + +
+ string +
+
+ +
Provide a URL for accessing the API. Can also be specified via K8S_AUTH_HOST environment variable.
+
+
+ impersonate_groups + +
+ list + / elements=string +
+
added in 2.3.0
+
+ +
Group(s) to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_GROUPS environment. Example: 'Group1,Group2'
+
+
+ impersonate_user + +
+ string +
+
added in 2.3.0
+
+ +
Username to impersonate for the operation.
+
Can also be specified via K8S_AUTH_IMPERSONATE_USER environment.
+
+
+ kubeconfig + +
+ raw +
+
+ +
Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the Kubernetes client will attempt to load the default configuration file from ~/.kube/config. Can also be specified via K8S_AUTH_KUBECONFIG environment variable.
+
The kubernetes configuration can be provided as dictionary. This feature requires a python kubernetes client version >= 17.17.0. Added in version 2.2.0.
+
+
+ name + +
+ string + / required +
+
+ +
The name of the node.
+
+
+ no_proxy + +
+ string +
+
added in 2.3.0
+
+ +
The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy. Can also be specified via K8S_AUTH_NO_PROXY environment variable.
+
Please note that this module does not pick up typical proxy settings from the environment (e.g. NO_PROXY).
+
This feature requires kubernetes>=19.15.0. When kubernetes library is less than 19.15.0, it fails even no_proxy set in correct.
+
example value is "localhost,.local,.example.com,127.0.0.1,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
+
+
+ password + +
+ string +
+
+ +
Provide a password for authenticating with the API. Can also be specified via K8S_AUTH_PASSWORD environment variable.
+
Please read the description of the username option for a discussion of when this option is applicable.
+
+
+ persist_config + +
+ boolean +
+
+
    Choices: +
  • no
  • +
  • yes
  • +
+
+
Whether or not to save the kube config refresh tokens. Can also be specified via K8S_AUTH_PERSIST_CONFIG environment variable.
+
When the k8s context is using a user credentials with refresh tokens (like oidc or gke/gcloud auth), the token is refreshed by the k8s python client library but not saved by default. So the old refresh token can expire and the next auth might fail. Setting this flag to true will tell the k8s python client to save the new refresh token to the kube config file.
+
Default to false.
+
Please note that the current version of the k8s python client library does not support setting this flag to True yet.
+
The fix for this k8s python library is here: https://github.com/kubernetes-client/python-base/pull/169
+
+
+ proxy + +
+ string +
+
+ +
The URL of an HTTP proxy to use for the connection. Can also be specified via K8S_AUTH_PROXY environment variable.
+
Please note that this module does not pick up typical proxy settings from the environment (e.g. HTTP_PROXY).
+
+
+ proxy_headers + +
+ dictionary +
+
added in 2.0.0
+
+ +
The Header used for the HTTP proxy.
+ +
+
+ basic_auth + +
+ string +
+
+ +
Colon-separated username:password for basic authentication header.
+
Can also be specified via K8S_AUTH_PROXY_HEADERS_BASIC_AUTH environment.
+
+
+ proxy_basic_auth + +
+ string +
+
+ +
Colon-separated username:password for proxy basic authentication header.
+
Can also be specified via K8S_AUTH_PROXY_HEADERS_PROXY_BASIC_AUTH environment.
+
+
+ user_agent + +
+ string +
+
+ +
String representing the user-agent you want, such as foo/1.0.
+
Can also be specified via K8S_AUTH_PROXY_HEADERS_USER_AGENT environment.
+
+
+ replace + +
+ boolean +
+
+
    Choices: +
  • no ←
  • +
  • yes
  • +
+
+
If true, allow taints to be replaced.
+
+
+ state + +
+ string +
+
+
    Choices: +
  • present ←
  • +
  • absent
  • +
+
+
Determines whether to add or remove taints.
+
+
+ taints + +
+ list + / elements=dictionary + / required +
+
+ +
List containing the taints.
+
+
+ effect + +
+ string +
+
+
    Choices: +
  • NoSchedule
  • +
  • NoExecute
  • +
  • PreferNoSchedule
  • +
+
+
The effect of the taint on Pods that do not tolerate the taint.
+
Required when state=present.
+
+
+ key + +
+ string +
+
+ +
The taint key to be applied to a node.
+
+
+ value + +
+ string +
+
+ +
The taint value corresponding to the taint key.
+
+
+ username + +
+ string +
+
+ +
Provide a username for authenticating with the API. Can also be specified via K8S_AUTH_USERNAME environment variable.
+
Please note that this only works with clusters configured to use HTTP Basic Auth. If your cluster has a different form of authentication (e.g. OAuth2 in OpenShift), this option will not work as expected and you should look into the community.okd.k8s_auth module, as that might do what you need.
+
+
+ validate_certs + +
+ boolean +
+
+
    Choices: +
  • no
  • +
  • yes
  • +
+
+
Whether or not to verify the API server's SSL certificates. Can also be specified via K8S_AUTH_VERIFY_SSL environment variable.
+

aliases: verify_ssl
+
+
+ + +Notes +----- + +.. note:: + - To avoid SSL certificate validation errors when ``validate_certs`` is *True*, the full certificate chain for the API server must be provided via ``ca_cert`` or in the kubeconfig file. + + + +Examples +-------- + +.. code-block:: yaml + + - name: Taint node "foo" + kubernetes.core.k8s_taint: + state: present + name: foo + taints: + - effect: NoExecute + key: "key1" + + - name: Taint node "foo" + kubernetes.core.k8s_taint: + state: present + name: foo + taints: + - effect: NoExecute + key: "key1" + value: "value1" + - effect: NoSchedule + key: "key1" + value: "value1" + + - name: Remove taint from "foo". + kubernetes.core.k8s_taint: + state: absent + name: foo + taints: + - effect: NoExecute + key: "key1" + value: "value1" + + + +Return Values +------------- +Common return values are documented `here `_, the following are the fields unique to this module: + +.. raw:: html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyReturnedDescription
+
+ result + +
+ complex +
+
success +
The tainted Node object. Will be empty in the case of a deletion.
+
+
  +
+ api_version + +
+ string +
+
success +
The versioned schema of this representation of an object.
+
+
  +
+ kind + +
+ string +
+
success +
Represents the REST resource this object represents.
+
+
  +
+ metadata + +
+ complex +
+
success +
Standard object metadata. Includes name, namespace, annotations, labels, etc.
+
+
  +
+ spec + +
+ complex +
+
success +
Specific attributes of the object. Will vary based on the api_version and kind.
+
+
  +
+ status + +
+ complex +
+
success +
Current status details for the object.
+
+
+

+ + +Status +------ + + +Authors +~~~~~~~ + +- Alina Buzachis (@alinabuzachis) diff --git a/docs/kubernetes.core.kubectl_connection.rst b/docs/kubernetes.core.kubectl_connection.rst index 595ee405..0e2a391a 100644 --- a/docs/kubernetes.core.kubectl_connection.rst +++ b/docs/kubernetes.core.kubectl_connection.rst @@ -354,7 +354,7 @@ Status Authors ~~~~~~~ -- xuxinkun +- xuxinkun (@xuxinkun) .. hint:: diff --git a/docs/kubernetes.core.kustomize_lookup.rst b/docs/kubernetes.core.kustomize_lookup.rst index 38d328ed..5c368d14 100644 --- a/docs/kubernetes.core.kustomize_lookup.rst +++ b/docs/kubernetes.core.kustomize_lookup.rst @@ -133,106 +133,27 @@ Common return values are documented `here - Key + Key Returned Description - +
_list
- complex + string
-
One ore more object definitions returned from the tool execution.
+
YAML string for the object definitions returned from the tool execution.

+
Sample:
+
{'kind': 'ConfigMap', 'apiVersion': 'v1', 'metadata': {'name': 'my-config-map', 'namespace': 'default'}, 'data': {'key1': 'val1'}}
- -   - -
- api_version - -
- string -
- - success - -
The versioned schema of this representation of an object.
-
- - - -   - -
- kind - -
- string -
- - success - -
Represents the REST resource this object represents.
-
- - - -   - -
- metadata - -
- complex -
- - success - -
Standard object metadata. Includes name, namespace, annotations, labels, etc.
-
- - - -   - -
- spec - -
- complex -
- - success - -
Specific attributes of the object. Will vary based on the api_version and kind.
-
- - - -   - -
- status - -
- complex -
- - success - -
Current status details for the object.
-
- - -

@@ -244,7 +165,7 @@ Status Authors ~~~~~~~ -- Aubin Bikouo <@abikouo> +- Aubin Bikouo (@abikouo) .. hint::