mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-07 21:42:38 +00:00
Fix broken links in docs (#61)
This commit is contained in:
55
README.md
55
README.md
@@ -24,40 +24,35 @@ Click on the name of a plugin or module to view that content's documentation:
|
|||||||
### Connection plugins
|
### Connection plugins
|
||||||
Name | Description
|
Name | Description
|
||||||
--- | ---
|
--- | ---
|
||||||
[kubernetes.core.kubectl](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.kubectl_connection.rst)|Execute tasks in pods running on Kubernetes.
|
[kubernetes.core.kubectl](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.kubectl_connection.rst)|Execute tasks in pods running on Kubernetes.
|
||||||
|
|
||||||
### Filter plugins
|
|
||||||
Name | Description
|
|
||||||
--- | ---
|
|
||||||
kubernetes.core.k8s_config_resource_name|kubernetes.core k8s_config_resource_name filter plugin
|
|
||||||
|
|
||||||
### Lookup plugins
|
|
||||||
Name | Description
|
|
||||||
--- | ---
|
|
||||||
[kubernetes.core.k8s](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.k8s_lookup.rst)|Query the K8s API
|
|
||||||
|
|
||||||
### Modules
|
|
||||||
Name | Description
|
|
||||||
--- | ---
|
|
||||||
[kubernetes.core.helm](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.helm_module.rst)|Manages Kubernetes packages with the Helm package manager
|
|
||||||
[kubernetes.core.helm_info](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.helm_info_module.rst)|Get information from Helm package deployed inside the cluster
|
|
||||||
[kubernetes.core.helm_plugin](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.helm_plugin_module.rst)|Manage Helm plugins
|
|
||||||
[kubernetes.core.helm_plugin_info](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.helm_plugin_info_module.rst)|Gather information about Helm plugins
|
|
||||||
[kubernetes.core.helm_repository](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.helm_repository_module.rst)|Manage Helm repositories.
|
|
||||||
[kubernetes.core.helm_template](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.helm_template_module.rst)|Render chart templates
|
|
||||||
[kubernetes.core.k8s](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.k8s_module.rst)|Manage Kubernetes (K8s) objects
|
|
||||||
[kubernetes.core.k8s_cluster_info](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.k8s_cluster_info_module.rst)|Describe Kubernetes (K8s) cluster, APIs available and their respective versions
|
|
||||||
[kubernetes.core.k8s_exec](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.k8s_exec_module.rst)|Execute command in Pod
|
|
||||||
[kubernetes.core.k8s_info](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.k8s_info_module.rst)|Describe Kubernetes (K8s) objects
|
|
||||||
[kubernetes.core.k8s_log](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.k8s_log_module.rst)|Fetch logs from Kubernetes resources
|
|
||||||
[kubernetes.core.k8s_rollback](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.k8s_rollback_module.rst)|Rollback Kubernetes (K8S) Deployments and DaemonSets
|
|
||||||
[kubernetes.core.k8s_scale](https://github.com/ansible-collections/community.kubernetes/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/community.kubernetes/blob/main/docs/kubernetes.core.k8s_service_module.rst)|Manage Services on Kubernetes
|
|
||||||
|
|
||||||
### Inventory plugins
|
### Inventory plugins
|
||||||
Name | Description
|
Name | Description
|
||||||
--- | ---
|
--- | ---
|
||||||
[kubernetes.core.k8s](https://github.com/ansible-collections/community.kubernetes/blob/main/docs/kubernetes.core.k8s_inventory.rst)|Kubernetes (K8s) inventory source
|
[kubernetes.core.k8s](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_inventory.rst)|Kubernetes (K8s) inventory source
|
||||||
|
|
||||||
|
### Lookup plugins
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
[kubernetes.core.k8s](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_lookup.rst)|Query the K8s API
|
||||||
|
|
||||||
|
### Modules
|
||||||
|
Name | Description
|
||||||
|
--- | ---
|
||||||
|
[kubernetes.core.helm](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.helm_module.rst)|Manages Kubernetes packages with the Helm package manager
|
||||||
|
[kubernetes.core.helm_info](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.helm_info_module.rst)|Get information from Helm package deployed inside the cluster
|
||||||
|
[kubernetes.core.helm_plugin](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.helm_plugin_module.rst)|Manage Helm plugins
|
||||||
|
[kubernetes.core.helm_plugin_info](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.helm_plugin_info_module.rst)|Gather information about Helm plugins
|
||||||
|
[kubernetes.core.helm_repository](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.helm_repository_module.rst)|Manage Helm repositories.
|
||||||
|
[kubernetes.core.helm_template](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.helm_template_module.rst)|Render chart templates
|
||||||
|
[kubernetes.core.k8s](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_module.rst)|Manage Kubernetes (K8s) objects
|
||||||
|
[kubernetes.core.k8s_cluster_info](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_cluster_info_module.rst)|Describe Kubernetes (K8s) cluster, APIs available and their respective versions
|
||||||
|
[kubernetes.core.k8s_exec](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_exec_module.rst)|Execute command in Pod
|
||||||
|
[kubernetes.core.k8s_info](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_info_module.rst)|Describe Kubernetes (K8s) objects
|
||||||
|
[kubernetes.core.k8s_log](https://github.com/ansible-collections/kubernetes.core/blob/main/docs/kubernetes.core.k8s_log_module.rst)|Fetch logs from Kubernetes resources
|
||||||
|
[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
|
||||||
|
|
||||||
<!--end collection content-->
|
<!--end collection content-->
|
||||||
|
|
||||||
|
|||||||
@@ -202,10 +202,10 @@ Parameters
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Deploy latest version of Grafana chart inside monitoring namespace
|
- name: Deploy latest version of Grafana chart inside monitoring namespace
|
||||||
community.kubernetes.helm_info:
|
kubernetes.core.helm_info:
|
||||||
name: test
|
name: test
|
||||||
release_namespace: monitoring
|
release_namespace: monitoring
|
||||||
|
|
||||||
|
|||||||
@@ -499,10 +499,10 @@ Parameters
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Deploy latest version of Prometheus chart inside monitoring namespace (and create it)
|
- name: Deploy latest version of Prometheus chart inside monitoring namespace (and create it)
|
||||||
community.kubernetes.helm:
|
kubernetes.core.helm:
|
||||||
name: test
|
name: test
|
||||||
chart_ref: stable/prometheus
|
chart_ref: stable/prometheus
|
||||||
release_namespace: monitoring
|
release_namespace: monitoring
|
||||||
@@ -510,12 +510,12 @@ Examples
|
|||||||
|
|
||||||
# From repository
|
# From repository
|
||||||
- name: Add stable chart repo
|
- name: Add stable chart repo
|
||||||
community.kubernetes.helm_repository:
|
kubernetes.core.helm_repository:
|
||||||
name: stable
|
name: stable
|
||||||
repo_url: "https://kubernetes.github.io/ingress-nginx"
|
repo_url: "https://kubernetes.github.io/ingress-nginx"
|
||||||
|
|
||||||
- name: Deploy latest version of Grafana chart inside monitoring namespace with values
|
- name: Deploy latest version of Grafana chart inside monitoring namespace with values
|
||||||
community.kubernetes.helm:
|
kubernetes.core.helm:
|
||||||
name: test
|
name: test
|
||||||
chart_ref: stable/grafana
|
chart_ref: stable/grafana
|
||||||
release_namespace: monitoring
|
release_namespace: monitoring
|
||||||
@@ -523,14 +523,14 @@ Examples
|
|||||||
replicas: 2
|
replicas: 2
|
||||||
|
|
||||||
- name: Deploy Grafana chart on 5.0.12 with values loaded from template
|
- name: Deploy Grafana chart on 5.0.12 with values loaded from template
|
||||||
community.kubernetes.helm:
|
kubernetes.core.helm:
|
||||||
name: test
|
name: test
|
||||||
chart_ref: stable/grafana
|
chart_ref: stable/grafana
|
||||||
chart_version: 5.0.12
|
chart_version: 5.0.12
|
||||||
values: "{{ lookup('template', 'somefile.yaml') | from_yaml }}"
|
values: "{{ lookup('template', 'somefile.yaml') | from_yaml }}"
|
||||||
|
|
||||||
- name: Deploy Grafana chart using values files on target
|
- name: Deploy Grafana chart using values files on target
|
||||||
community.kubernetes.helm:
|
kubernetes.core.helm:
|
||||||
name: test
|
name: test
|
||||||
chart_ref: stable/grafana
|
chart_ref: stable/grafana
|
||||||
release_namespace: monitoring
|
release_namespace: monitoring
|
||||||
@@ -538,7 +538,7 @@ Examples
|
|||||||
- /path/to/values.yaml
|
- /path/to/values.yaml
|
||||||
|
|
||||||
- name: Remove test release and waiting suppression ending
|
- name: Remove test release and waiting suppression ending
|
||||||
community.kubernetes.helm:
|
kubernetes.core.helm:
|
||||||
name: test
|
name: test
|
||||||
state: absent
|
state: absent
|
||||||
wait: true
|
wait: true
|
||||||
@@ -550,14 +550,14 @@ Examples
|
|||||||
dest: /tmp/helm_repo
|
dest: /tmp/helm_repo
|
||||||
|
|
||||||
- name: Deploy Grafana chart from local path
|
- name: Deploy Grafana chart from local path
|
||||||
community.kubernetes.helm:
|
kubernetes.core.helm:
|
||||||
name: test
|
name: test
|
||||||
chart_ref: /tmp/helm_repo/stable/grafana
|
chart_ref: /tmp/helm_repo/stable/grafana
|
||||||
release_namespace: monitoring
|
release_namespace: monitoring
|
||||||
|
|
||||||
# From url
|
# From url
|
||||||
- name: Deploy Grafana chart on 5.6.0 from url
|
- name: Deploy Grafana chart on 5.6.0 from url
|
||||||
community.kubernetes.helm:
|
kubernetes.core.helm:
|
||||||
name: test
|
name: test
|
||||||
chart_ref: "https://github.com/grafana/helm-charts/releases/download/grafana-5.6.0/grafana-5.6.0.tgz"
|
chart_ref: "https://github.com/grafana/helm-charts/releases/download/grafana-5.6.0/grafana-5.6.0.tgz"
|
||||||
release_namespace: monitoring
|
release_namespace: monitoring
|
||||||
|
|||||||
@@ -198,13 +198,13 @@ Parameters
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Gather Helm plugin info
|
- name: Gather Helm plugin info
|
||||||
community.kubernetes.helm_plugin_info:
|
kubernetes.core.helm_plugin_info:
|
||||||
|
|
||||||
- name: Gather Helm env plugin info
|
- name: Gather Helm env plugin info
|
||||||
community.kubernetes.helm_plugin_info:
|
kubernetes.core.helm_plugin_info:
|
||||||
plugin_name: env
|
plugin_name: env
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -236,20 +236,20 @@ Parameters
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Install Helm env plugin
|
- name: Install Helm env plugin
|
||||||
community.kubernetes.helm_plugin:
|
kubernetes.core.helm_plugin:
|
||||||
plugin_path: https://github.com/adamreese/helm-env
|
plugin_path: https://github.com/adamreese/helm-env
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Install Helm plugin from local filesystem
|
- name: Install Helm plugin from local filesystem
|
||||||
community.kubernetes.helm_plugin:
|
kubernetes.core.helm_plugin:
|
||||||
plugin_path: https://domain/path/to/plugin.tar.gz
|
plugin_path: https://domain/path/to/plugin.tar.gz
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Remove Helm env plugin
|
- name: Remove Helm env plugin
|
||||||
community.kubernetes.helm_plugin:
|
kubernetes.core.helm_plugin:
|
||||||
plugin_name: env
|
plugin_name: env
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
|
|||||||
@@ -151,15 +151,15 @@ Parameters
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Add a repository
|
- name: Add a repository
|
||||||
community.kubernetes.helm_repository:
|
kubernetes.core.helm_repository:
|
||||||
name: stable
|
name: stable
|
||||||
repo_url: https://kubernetes.github.io/ingress-nginx
|
repo_url: https://kubernetes.github.io/ingress-nginx
|
||||||
|
|
||||||
- name: Add Red Hat Helm charts repository
|
- name: Add Red Hat Helm charts repository
|
||||||
community.kubernetes.helm_repository:
|
kubernetes.core.helm_repository:
|
||||||
name: redhat-charts
|
name: redhat-charts
|
||||||
repo_url: https://redhat-developer.github.com/redhat-helm-charts
|
repo_url: https://redhat-developer.github.com/redhat-helm-charts
|
||||||
|
|
||||||
|
|||||||
@@ -196,15 +196,15 @@ Parameters
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Render templates to specified directory
|
- name: Render templates to specified directory
|
||||||
community.kubernetes.helm_template:
|
kubernetes.core.helm_template:
|
||||||
chart_ref: stable/prometheus
|
chart_ref: stable/prometheus
|
||||||
output_dir: mycharts
|
output_dir: mycharts
|
||||||
|
|
||||||
- name: Render templates
|
- name: Render templates
|
||||||
community.kubernetes.helm_template:
|
kubernetes.core.helm_template:
|
||||||
chart_ref: stable/prometheus
|
chart_ref: stable/prometheus
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
|||||||
@@ -277,14 +277,14 @@ Notes
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Get Cluster information
|
- name: Get Cluster information
|
||||||
community.kubernetes.k8s_cluster_info:
|
kubernetes.core.k8s_cluster_info:
|
||||||
register: api_status
|
register: api_status
|
||||||
|
|
||||||
- name: Do not invalidate cache before getting information
|
- name: Do not invalidate cache before getting information
|
||||||
community.kubernetes.k8s_cluster_info:
|
kubernetes.core.k8s_cluster_info:
|
||||||
invalidate_cache: False
|
invalidate_cache: False
|
||||||
register: api_status
|
register: api_status
|
||||||
|
|
||||||
|
|||||||
@@ -323,16 +323,16 @@ Notes
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Execute a command
|
- name: Execute a command
|
||||||
community.kubernetes.k8s_exec:
|
kubernetes.core.k8s_exec:
|
||||||
namespace: myproject
|
namespace: myproject
|
||||||
pod: zuul-scheduler
|
pod: zuul-scheduler
|
||||||
command: zuul-scheduler full-reconfigure
|
command: zuul-scheduler full-reconfigure
|
||||||
|
|
||||||
- name: Check RC status of command executed
|
- name: Check RC status of command executed
|
||||||
community.kubernetes.k8s_exec:
|
kubernetes.core.k8s_exec:
|
||||||
namespace: myproject
|
namespace: myproject
|
||||||
pod: busybox-test
|
pod: busybox-test
|
||||||
command: cmd_with_non_zero_exit_code
|
command: cmd_with_non_zero_exit_code
|
||||||
|
|||||||
@@ -500,10 +500,10 @@ Notes
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Get an existing Service object
|
- name: Get an existing Service object
|
||||||
community.kubernetes.k8s_info:
|
kubernetes.core.k8s_info:
|
||||||
api_version: v1
|
api_version: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
name: web
|
name: web
|
||||||
@@ -511,26 +511,26 @@ Examples
|
|||||||
register: web_service
|
register: web_service
|
||||||
|
|
||||||
- name: Get a list of all service objects
|
- name: Get a list of all service objects
|
||||||
community.kubernetes.k8s_info:
|
kubernetes.core.k8s_info:
|
||||||
api_version: v1
|
api_version: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
namespace: testing
|
namespace: testing
|
||||||
register: service_list
|
register: service_list
|
||||||
|
|
||||||
- name: Get a list of all pods from any namespace
|
- name: Get a list of all pods from any namespace
|
||||||
community.kubernetes.k8s_info:
|
kubernetes.core.k8s_info:
|
||||||
kind: Pod
|
kind: Pod
|
||||||
register: pod_list
|
register: pod_list
|
||||||
|
|
||||||
- name: Search for all Pods labelled app=web
|
- name: Search for all Pods labelled app=web
|
||||||
community.kubernetes.k8s_info:
|
kubernetes.core.k8s_info:
|
||||||
kind: Pod
|
kind: Pod
|
||||||
label_selectors:
|
label_selectors:
|
||||||
- app = web
|
- app = web
|
||||||
- tier in (dev, test)
|
- tier in (dev, test)
|
||||||
|
|
||||||
- name: Using vars while using label_selectors
|
- name: Using vars while using label_selectors
|
||||||
community.kubernetes.k8s_info:
|
kubernetes.core.k8s_info:
|
||||||
kind: Pod
|
kind: Pod
|
||||||
label_selectors:
|
label_selectors:
|
||||||
- "app = {{ app_label_web }}"
|
- "app = {{ app_label_web }}"
|
||||||
@@ -538,18 +538,18 @@ Examples
|
|||||||
app_label_web: web
|
app_label_web: web
|
||||||
|
|
||||||
- name: Search for all running pods
|
- name: Search for all running pods
|
||||||
community.kubernetes.k8s_info:
|
kubernetes.core.k8s_info:
|
||||||
kind: Pod
|
kind: Pod
|
||||||
field_selectors:
|
field_selectors:
|
||||||
- status.phase=Running
|
- status.phase=Running
|
||||||
|
|
||||||
- name: List custom objects created using CRD
|
- name: List custom objects created using CRD
|
||||||
community.kubernetes.k8s_info:
|
kubernetes.core.k8s_info:
|
||||||
kind: MyCustomObject
|
kind: MyCustomObject
|
||||||
api_version: "stable.example.com/v1"
|
api_version: "stable.example.com/v1"
|
||||||
|
|
||||||
- name: Wait till the Object is created
|
- name: Wait till the Object is created
|
||||||
community.kubernetes.k8s_info:
|
kubernetes.core.k8s_info:
|
||||||
kind: Pod
|
kind: Pod
|
||||||
wait: yes
|
wait: yes
|
||||||
name: pod-not-yet-created
|
name: pod-not-yet-created
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<ul style="margin: 0; padding: 0"><b>Choices:</b>
|
<ul style="margin: 0; padding: 0"><b>Choices:</b>
|
||||||
<li>community.kubernetes.k8s</li>
|
<li>kubernetes.core.k8s</li>
|
||||||
<li>k8s</li>
|
<li>k8s</li>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
@@ -317,25 +317,25 @@ Parameters
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
# File must be named k8s.yaml or k8s.yml
|
# File must be named k8s.yaml or k8s.yml
|
||||||
|
|
||||||
# Authenticate with token, and return all pods and services for all namespaces
|
# Authenticate with token, and return all pods and services for all namespaces
|
||||||
plugin: community.kubernetes.k8s
|
plugin: kubernetes.core.k8s
|
||||||
connections:
|
connections:
|
||||||
- host: https://192.168.64.4:8443
|
- host: https://192.168.64.4:8443
|
||||||
api_key: xxxxxxxxxxxxxxxx
|
api_key: xxxxxxxxxxxxxxxx
|
||||||
validate_certs: false
|
validate_certs: false
|
||||||
|
|
||||||
# Use default config (~/.kube/config) file and active context, and return objects for a specific namespace
|
# Use default config (~/.kube/config) file and active context, and return objects for a specific namespace
|
||||||
plugin: community.kubernetes.k8s
|
plugin: kubernetes.core.k8s
|
||||||
connections:
|
connections:
|
||||||
- namespaces:
|
- namespaces:
|
||||||
- testing
|
- testing
|
||||||
|
|
||||||
# Use a custom config file, and a specific context.
|
# Use a custom config file, and a specific context.
|
||||||
plugin: community.kubernetes.k8s
|
plugin: kubernetes.core.k8s
|
||||||
connections:
|
connections:
|
||||||
- kubeconfig: /path/to/config
|
- kubeconfig: /path/to/config
|
||||||
context: 'awx/192-168-64-4:8443/developer'
|
context: 'awx/192-168-64-4:8443/developer'
|
||||||
|
|||||||
@@ -366,17 +366,17 @@ Notes
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Get a log from a Pod
|
- name: Get a log from a Pod
|
||||||
community.kubernetes.k8s_log:
|
kubernetes.core.k8s_log:
|
||||||
name: example-1
|
name: example-1
|
||||||
namespace: testing
|
namespace: testing
|
||||||
register: log
|
register: log
|
||||||
|
|
||||||
# This will get the log from the first Pod found matching the selector
|
# This will get the log from the first Pod found matching the selector
|
||||||
- name: Log a Pod matching a label selector
|
- name: Log a Pod matching a label selector
|
||||||
community.kubernetes.k8s_log:
|
kubernetes.core.k8s_log:
|
||||||
namespace: testing
|
namespace: testing
|
||||||
label_selectors:
|
label_selectors:
|
||||||
- app=example
|
- app=example
|
||||||
@@ -384,7 +384,7 @@ Examples
|
|||||||
|
|
||||||
# This will get the log from a single Pod managed by this Deployment
|
# This will get the log from a single Pod managed by this Deployment
|
||||||
- name: Get a log from a Deployment
|
- name: Get a log from a Deployment
|
||||||
community.kubernetes.k8s_log:
|
kubernetes.core.k8s_log:
|
||||||
api_version: apps/v1
|
api_version: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
namespace: testing
|
namespace: testing
|
||||||
@@ -393,7 +393,7 @@ Examples
|
|||||||
|
|
||||||
# This will get the log from a single Pod managed by this DeploymentConfig
|
# This will get the log from a single Pod managed by this DeploymentConfig
|
||||||
- name: Get a log from a DeploymentConfig
|
- name: Get a log from a DeploymentConfig
|
||||||
community.kubernetes.k8s_log:
|
kubernetes.core.k8s_log:
|
||||||
api_version: apps.openshift.io/v1
|
api_version: apps.openshift.io/v1
|
||||||
kind: DeploymentConfig
|
kind: DeploymentConfig
|
||||||
namespace: testing
|
namespace: testing
|
||||||
|
|||||||
@@ -392,27 +392,27 @@ Notes
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Fetch a list of namespaces
|
- name: Fetch a list of namespaces
|
||||||
set_fact:
|
set_fact:
|
||||||
projects: "{{ lookup('community.kubernetes.k8s', api_version='v1', kind='Namespace') }}"
|
projects: "{{ lookup('kubernetes.core.k8s', api_version='v1', kind='Namespace') }}"
|
||||||
|
|
||||||
- name: Fetch all deployments
|
- name: Fetch all deployments
|
||||||
set_fact:
|
set_fact:
|
||||||
deployments: "{{ lookup('community.kubernetes.k8s', kind='Deployment') }}"
|
deployments: "{{ lookup('kubernetes.core.k8s', kind='Deployment') }}"
|
||||||
|
|
||||||
- name: Fetch all deployments in a namespace
|
- name: Fetch all deployments in a namespace
|
||||||
set_fact:
|
set_fact:
|
||||||
deployments: "{{ lookup('community.kubernetes.k8s', kind='Deployment', namespace='testing') }}"
|
deployments: "{{ lookup('kubernetes.core.k8s', kind='Deployment', namespace='testing') }}"
|
||||||
|
|
||||||
- name: Fetch a specific deployment by name
|
- name: Fetch a specific deployment by name
|
||||||
set_fact:
|
set_fact:
|
||||||
deployments: "{{ lookup('community.kubernetes.k8s', kind='Deployment', namespace='testing', resource_name='elastic') }}"
|
deployments: "{{ lookup('kubernetes.core.k8s', kind='Deployment', namespace='testing', resource_name='elastic') }}"
|
||||||
|
|
||||||
- name: Fetch with label selector
|
- name: Fetch with label selector
|
||||||
set_fact:
|
set_fact:
|
||||||
service: "{{ lookup('community.kubernetes.k8s', kind='Service', label_selector='app=galaxy') }}"
|
service: "{{ lookup('kubernetes.core.k8s', kind='Service', label_selector='app=galaxy') }}"
|
||||||
|
|
||||||
# Use parameters from a YAML config
|
# Use parameters from a YAML config
|
||||||
|
|
||||||
@@ -422,11 +422,11 @@ Examples
|
|||||||
|
|
||||||
- name: Using the config (loaded from a file in prior task), fetch the latest version of the object
|
- name: Using the config (loaded from a file in prior task), fetch the latest version of the object
|
||||||
set_fact:
|
set_fact:
|
||||||
service: "{{ lookup('community.kubernetes.k8s', resource_definition=config) }}"
|
service: "{{ lookup('kubernetes.core.k8s', resource_definition=config) }}"
|
||||||
|
|
||||||
- name: Use a config from the local filesystem
|
- name: Use a config from the local filesystem
|
||||||
set_fact:
|
set_fact:
|
||||||
service: "{{ lookup('community.kubernetes.k8s', src='service.yml') }}"
|
service: "{{ lookup('kubernetes.core.k8s', src='service.yml') }}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Synopsis
|
|||||||
- Use the OpenShift Python client to perform CRUD operations on K8s objects.
|
- Use the OpenShift 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.
|
- 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.
|
- Access to the full range of K8s APIs.
|
||||||
- Use the :ref:`community.kubernetes.k8s_info <community.kubernetes.k8s_info_module>` module to obtain a list of items about an object of type ``kind``
|
- Use the :ref:`kubernetes.core.k8s_info <kubernetes.core.k8s_info_module>` module to obtain a list of items about an object of type ``kind``
|
||||||
- Authenticate using either a config file, certificates, password or token.
|
- Authenticate using either a config file, certificates, password or token.
|
||||||
- Supports check mode.
|
- Supports check mode.
|
||||||
|
|
||||||
@@ -821,17 +821,17 @@ Notes
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Create a k8s namespace
|
- name: Create a k8s namespace
|
||||||
community.kubernetes.k8s:
|
kubernetes.core.k8s:
|
||||||
name: testing
|
name: testing
|
||||||
api_version: v1
|
api_version: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a Service object from an inline definition
|
- name: Create a Service object from an inline definition
|
||||||
community.kubernetes.k8s:
|
kubernetes.core.k8s:
|
||||||
state: present
|
state: present
|
||||||
definition:
|
definition:
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
@@ -853,7 +853,7 @@ Examples
|
|||||||
port: 8000
|
port: 8000
|
||||||
|
|
||||||
- name: Remove an existing Service object
|
- name: Remove an existing Service object
|
||||||
community.kubernetes.k8s:
|
kubernetes.core.k8s:
|
||||||
state: absent
|
state: absent
|
||||||
api_version: v1
|
api_version: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
@@ -863,24 +863,24 @@ Examples
|
|||||||
# Passing the object definition from a file
|
# Passing the object definition from a file
|
||||||
|
|
||||||
- name: Create a Deployment by reading the definition from a local file
|
- name: Create a Deployment by reading the definition from a local file
|
||||||
community.kubernetes.k8s:
|
kubernetes.core.k8s:
|
||||||
state: present
|
state: present
|
||||||
src: /testing/deployment.yml
|
src: /testing/deployment.yml
|
||||||
|
|
||||||
- name: >-
|
- name: >-
|
||||||
Read definition file from the Ansible controller file system.
|
Read definition file from the Ansible controller file system.
|
||||||
If the definition file has been encrypted with Ansible Vault it will automatically be decrypted.
|
If the definition file has been encrypted with Ansible Vault it will automatically be decrypted.
|
||||||
community.kubernetes.k8s:
|
kubernetes.core.k8s:
|
||||||
state: present
|
state: present
|
||||||
definition: "{{ lookup('file', '/testing/deployment.yml') | from_yaml }}"
|
definition: "{{ lookup('file', '/testing/deployment.yml') | from_yaml }}"
|
||||||
|
|
||||||
- name: Read definition template file from the Ansible controller file system
|
- name: Read definition template file from the Ansible controller file system
|
||||||
community.kubernetes.k8s:
|
kubernetes.core.k8s:
|
||||||
state: present
|
state: present
|
||||||
template: '/testing/deployment.j2'
|
template: '/testing/deployment.j2'
|
||||||
|
|
||||||
- name: Read definition template file from the Ansible controller file system that uses custom start/end strings
|
- name: Read definition template file from the Ansible controller file system that uses custom start/end strings
|
||||||
community.kubernetes.k8s:
|
kubernetes.core.k8s:
|
||||||
state: present
|
state: present
|
||||||
template:
|
template:
|
||||||
path: '/testing/deployment.j2'
|
path: '/testing/deployment.j2'
|
||||||
@@ -888,14 +888,14 @@ Examples
|
|||||||
variable_end_string: ']]'
|
variable_end_string: ']]'
|
||||||
|
|
||||||
- name: fail on validation errors
|
- name: fail on validation errors
|
||||||
community.kubernetes.k8s:
|
kubernetes.core.k8s:
|
||||||
state: present
|
state: present
|
||||||
definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}"
|
definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}"
|
||||||
validate:
|
validate:
|
||||||
fail_on_error: yes
|
fail_on_error: yes
|
||||||
|
|
||||||
- name: warn on validation errors, check for unexpected properties
|
- name: warn on validation errors, check for unexpected properties
|
||||||
community.kubernetes.k8s:
|
kubernetes.core.k8s:
|
||||||
state: present
|
state: present
|
||||||
definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}"
|
definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}"
|
||||||
validate:
|
validate:
|
||||||
@@ -910,13 +910,13 @@ Examples
|
|||||||
mode: '0664'
|
mode: '0664'
|
||||||
|
|
||||||
- name: Apply metrics-server manifest to the cluster.
|
- name: Apply metrics-server manifest to the cluster.
|
||||||
community.kubernetes.k8s:
|
kubernetes.core.k8s:
|
||||||
state: present
|
state: present
|
||||||
src: ~/metrics-server.yaml
|
src: ~/metrics-server.yaml
|
||||||
|
|
||||||
# Wait for a Deployment to pause before continuing
|
# Wait for a Deployment to pause before continuing
|
||||||
- name: Pause a Deployment.
|
- name: Pause a Deployment.
|
||||||
community.kubernetes.k8s:
|
kubernetes.core.k8s:
|
||||||
definition:
|
definition:
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
|
|||||||
@@ -364,10 +364,10 @@ Notes
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Rollback a failed deployment
|
- name: Rollback a failed deployment
|
||||||
community.kubernetes.k8s_rollback:
|
kubernetes.core.k8s_rollback:
|
||||||
api_version: apps/v1
|
api_version: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
name: web
|
name: web
|
||||||
|
|||||||
@@ -444,10 +444,10 @@ Notes
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Scale deployment up, and extend timeout
|
- name: Scale deployment up, and extend timeout
|
||||||
community.kubernetes.k8s_scale:
|
kubernetes.core.k8s_scale:
|
||||||
api_version: v1
|
api_version: v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
name: elastic
|
name: elastic
|
||||||
@@ -456,7 +456,7 @@ Examples
|
|||||||
wait_timeout: 60
|
wait_timeout: 60
|
||||||
|
|
||||||
- name: Scale deployment down when current replicas match
|
- name: Scale deployment down when current replicas match
|
||||||
community.kubernetes.k8s_scale:
|
kubernetes.core.k8s_scale:
|
||||||
api_version: v1
|
api_version: v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
name: elastic
|
name: elastic
|
||||||
@@ -465,7 +465,7 @@ Examples
|
|||||||
replicas: 2
|
replicas: 2
|
||||||
|
|
||||||
- name: Increase job parallelism
|
- name: Increase job parallelism
|
||||||
community.kubernetes.k8s_scale:
|
kubernetes.core.k8s_scale:
|
||||||
api_version: batch/v1
|
api_version: batch/v1
|
||||||
kind: job
|
kind: job
|
||||||
name: pi-with-timeout
|
name: pi-with-timeout
|
||||||
@@ -475,19 +475,19 @@ Examples
|
|||||||
# Match object using local file or inline definition
|
# Match object using local file or inline definition
|
||||||
|
|
||||||
- name: Scale deployment based on a file from the local filesystem
|
- name: Scale deployment based on a file from the local filesystem
|
||||||
community.kubernetes.k8s_scale:
|
kubernetes.core.k8s_scale:
|
||||||
src: /myproject/elastic_deployment.yml
|
src: /myproject/elastic_deployment.yml
|
||||||
replicas: 3
|
replicas: 3
|
||||||
wait: no
|
wait: no
|
||||||
|
|
||||||
- name: Scale deployment based on a template output
|
- name: Scale deployment based on a template output
|
||||||
community.kubernetes.k8s_scale:
|
kubernetes.core.k8s_scale:
|
||||||
resource_definition: "{{ lookup('template', '/myproject/elastic_deployment.yml') | from_yaml }}"
|
resource_definition: "{{ lookup('template', '/myproject/elastic_deployment.yml') | from_yaml }}"
|
||||||
replicas: 3
|
replicas: 3
|
||||||
wait: no
|
wait: no
|
||||||
|
|
||||||
- name: Scale deployment based on a file from the Ansible controller filesystem
|
- name: Scale deployment based on a file from the Ansible controller filesystem
|
||||||
community.kubernetes.k8s_scale:
|
kubernetes.core.k8s_scale:
|
||||||
resource_definition: "{{ lookup('file', '/myproject/elastic_deployment.yml') | from_yaml }}"
|
resource_definition: "{{ lookup('file', '/myproject/elastic_deployment.yml') | from_yaml }}"
|
||||||
replicas: 3
|
replicas: 3
|
||||||
wait: no
|
wait: no
|
||||||
|
|||||||
@@ -460,10 +460,10 @@ Notes
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. code-block:: yaml+jinja
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: Expose https port with ClusterIP
|
- name: Expose https port with ClusterIP
|
||||||
community.kubernetes.k8s_service:
|
kubernetes.core.k8s_service:
|
||||||
state: present
|
state: present
|
||||||
name: test-https
|
name: test-https
|
||||||
namespace: default
|
namespace: default
|
||||||
@@ -474,7 +474,7 @@ Examples
|
|||||||
key: special
|
key: special
|
||||||
|
|
||||||
- name: Expose https port with ClusterIP using spec
|
- name: Expose https port with ClusterIP using spec
|
||||||
community.kubernetes.k8s_service:
|
kubernetes.core.k8s_service:
|
||||||
state: present
|
state: present
|
||||||
name: test-https
|
name: test-https
|
||||||
namespace: default
|
namespace: default
|
||||||
|
|||||||
Reference in New Issue
Block a user