mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-06 21:12:37 +00:00
Minor doc fixes (#114)
* Spelling fixes * Documentation update * Example update to use FQCN Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
@@ -7,7 +7,7 @@ from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r'''
|
||||
---
|
||||
module: helm
|
||||
|
||||
@@ -120,9 +120,9 @@ options:
|
||||
type: str
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
EXAMPLES = r'''
|
||||
- name: Create helm namespace as HELM 3 doesn't create it automatically
|
||||
k8s:
|
||||
community.kubernetes.k8s:
|
||||
api_version: v1
|
||||
kind: Namespace
|
||||
name: "monitoring"
|
||||
@@ -130,12 +130,12 @@ EXAMPLES = '''
|
||||
|
||||
# From repository
|
||||
- name: Add stable chart repo
|
||||
helm_repository:
|
||||
community.kubernetes.helm_repository:
|
||||
name: stable
|
||||
repo_url: "https://kubernetes-charts.storage.googleapis.com"
|
||||
|
||||
- name: Deploy latest version of Grafana chart inside monitoring namespace with values
|
||||
helm:
|
||||
community.kubernetes.helm:
|
||||
name: test
|
||||
chart_ref: stable/grafana
|
||||
release_namespace: monitoring
|
||||
@@ -143,39 +143,39 @@ EXAMPLES = '''
|
||||
replicas: 2
|
||||
|
||||
- name: Deploy Grafana chart on 5.0.12 with values loaded from template
|
||||
helm:
|
||||
community.kubernetes.helm:
|
||||
name: test
|
||||
chart_ref: stable/grafana
|
||||
chart_version: 5.0.12
|
||||
values: "{{ lookup('template', 'somefile.yaml') | from_yaml }}"
|
||||
|
||||
- name: Remove test release and waiting suppression ending
|
||||
helm:
|
||||
community.kubernetes.helm:
|
||||
name: test
|
||||
state: absent
|
||||
wait: true
|
||||
|
||||
# From git
|
||||
- name: Git clone stable repo on HEAD
|
||||
git:
|
||||
ansible.builtin.git:
|
||||
repo: "http://github.com/helm/charts.git"
|
||||
dest: /tmp/helm_repo
|
||||
|
||||
- name: Deploy Grafana chart from local path
|
||||
helm:
|
||||
community.kubernetes.helm:
|
||||
name: test
|
||||
chart_ref: /tmp/helm_repo/stable/grafana
|
||||
release_namespace: monitoring
|
||||
|
||||
# From url
|
||||
- name: Deploy Grafana chart on 5.0.12 from url
|
||||
helm:
|
||||
community.kubernetes.helm:
|
||||
name: test
|
||||
chart_ref: "https://kubernetes-charts.storage.googleapis.com/grafana-5.0.12.tgz"
|
||||
release_namespace: monitoring
|
||||
'''
|
||||
|
||||
RETURN = """
|
||||
RETURN = r"""
|
||||
status:
|
||||
type: complex
|
||||
description: A dictionary of status output
|
||||
|
||||
@@ -7,11 +7,11 @@ from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r'''
|
||||
---
|
||||
module: helm_info
|
||||
|
||||
short_description: Get informations from Helm package deployed inside the cluster
|
||||
short_description: Get information from Helm package deployed inside the cluster
|
||||
|
||||
version_added: "0.11.0"
|
||||
|
||||
@@ -23,7 +23,7 @@ requirements:
|
||||
- "yaml (https://pypi.org/project/PyYAML/)"
|
||||
|
||||
description:
|
||||
- Get informations (values, states, ...) from Helm package deployed inside the cluster
|
||||
- Get information (values, states, ...) from Helm package deployed inside the cluster
|
||||
|
||||
options:
|
||||
binary_path:
|
||||
@@ -56,14 +56,14 @@ options:
|
||||
aliases: [ kubeconfig ]
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
EXAMPLES = r'''
|
||||
- name: Deploy latest version of Grafana chart inside monitoring namespace
|
||||
helm_info:
|
||||
community.kubernetes.helm_info:
|
||||
name: test
|
||||
release_namespace: monitoring
|
||||
'''
|
||||
|
||||
RETURN = """
|
||||
RETURN = r"""
|
||||
status:
|
||||
type: complex
|
||||
description: A dictionary of status output
|
||||
|
||||
@@ -7,7 +7,7 @@ from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r'''
|
||||
---
|
||||
module: helm_repository
|
||||
|
||||
@@ -59,21 +59,21 @@ options:
|
||||
repo_state:
|
||||
choices: ['present', 'absent']
|
||||
description:
|
||||
- Desirated state of repositoriy.
|
||||
- Desirated state of repository.
|
||||
required: false
|
||||
default: present
|
||||
aliases: [ state ]
|
||||
type: str
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
EXAMPLES = r'''
|
||||
- name: Add default repository
|
||||
helm_repository:
|
||||
community.kubernetes.helm_repository:
|
||||
name: stable
|
||||
repo_url: https://kubernetes-charts.storage.googleapis.com
|
||||
'''
|
||||
|
||||
RETURN = ''' # '''
|
||||
RETURN = r''' # '''
|
||||
|
||||
import traceback
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r'''
|
||||
|
||||
module: k8s
|
||||
|
||||
@@ -147,16 +147,16 @@ requirements:
|
||||
- "PyYAML >= 3.11"
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
EXAMPLES = r'''
|
||||
- name: Create a k8s namespace
|
||||
k8s:
|
||||
community.kubernetes.k8s:
|
||||
name: testing
|
||||
api_version: v1
|
||||
kind: Namespace
|
||||
state: present
|
||||
|
||||
- name: Create a Service object from an inline definition
|
||||
k8s:
|
||||
community.kubernetes.k8s:
|
||||
state: present
|
||||
definition:
|
||||
apiVersion: v1
|
||||
@@ -178,7 +178,7 @@ EXAMPLES = '''
|
||||
port: 8000
|
||||
|
||||
- name: Remove an existing Service object
|
||||
k8s:
|
||||
community.kubernetes.k8s:
|
||||
state: absent
|
||||
api_version: v1
|
||||
kind: Service
|
||||
@@ -188,31 +188,31 @@ EXAMPLES = '''
|
||||
# Passing the object definition from a file
|
||||
|
||||
- name: Create a Deployment by reading the definition from a local file
|
||||
k8s:
|
||||
community.kubernetes.k8s:
|
||||
state: present
|
||||
src: /testing/deployment.yml
|
||||
|
||||
- name: >-
|
||||
Read definition file from the Ansible controller file system.
|
||||
If the definition file has been encrypted with Ansible Vault it will automatically be decrypted.
|
||||
k8s:
|
||||
community.kubernetes.k8s:
|
||||
state: present
|
||||
definition: "{{ lookup('file', '/testing/deployment.yml') | from_yaml }}"
|
||||
|
||||
- name: Read definition file from the Ansible controller file system after Jinja templating
|
||||
k8s:
|
||||
community.kubernetes.k8s:
|
||||
state: present
|
||||
definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}"
|
||||
|
||||
- name: fail on validation errors
|
||||
k8s:
|
||||
community.kubernetes.k8s:
|
||||
state: present
|
||||
definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}"
|
||||
validate:
|
||||
fail_on_error: yes
|
||||
|
||||
- name: warn on validation errors, check for unexpected properties
|
||||
k8s:
|
||||
community.kubernetes.k8s:
|
||||
state: present
|
||||
definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}"
|
||||
validate:
|
||||
@@ -220,7 +220,7 @@ EXAMPLES = '''
|
||||
strict: yes
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
RETURN = r'''
|
||||
result:
|
||||
description:
|
||||
- The created, patched, or otherwise present object. Will be empty in the case of a deletion.
|
||||
|
||||
@@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r'''
|
||||
|
||||
module: k8s_auth
|
||||
|
||||
@@ -75,7 +75,7 @@ requirements:
|
||||
- requests-oauthlib
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
EXAMPLES = r'''
|
||||
- hosts: localhost
|
||||
module_defaults:
|
||||
group/k8s:
|
||||
@@ -88,7 +88,7 @@ EXAMPLES = '''
|
||||
- include_vars: k8s_passwords.yml
|
||||
|
||||
- name: Log in (obtain access token)
|
||||
k8s_auth:
|
||||
community.kubernetes.k8s_auth:
|
||||
username: admin
|
||||
password: "{{ k8s_admin_password }}"
|
||||
register: k8s_auth_results
|
||||
@@ -96,7 +96,7 @@ EXAMPLES = '''
|
||||
# Previous task provides the token/api_key, while all other parameters
|
||||
# are taken from module_defaults
|
||||
- name: Get a list of all pods from any namespace
|
||||
k8s_info:
|
||||
community.kubernetes.k8s_info:
|
||||
api_key: "{{ k8s_auth_results.k8s_auth.api_key }}"
|
||||
kind: Pod
|
||||
register: pod_list
|
||||
@@ -104,7 +104,7 @@ EXAMPLES = '''
|
||||
always:
|
||||
- name: If login succeeded, try to log out (revoke access token)
|
||||
when: k8s_auth_results.k8s_auth.api_key is defined
|
||||
k8s_auth:
|
||||
community.kubernetes.k8s_auth:
|
||||
state: absent
|
||||
api_key: "{{ k8s_auth_results.k8s_auth.api_key }}"
|
||||
'''
|
||||
@@ -112,7 +112,7 @@ EXAMPLES = '''
|
||||
# Returned value names need to match k8s modules parameter names, to make it
|
||||
# easy to pass returned values of k8s_auth to other k8s modules.
|
||||
# Discussion: https://github.com/ansible/ansible/pull/50807#discussion_r248827899
|
||||
RETURN = '''
|
||||
RETURN = r'''
|
||||
k8s_auth:
|
||||
description: Kubernetes authentication facts.
|
||||
returned: success
|
||||
|
||||
@@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r'''
|
||||
|
||||
module: k8s_exec
|
||||
|
||||
@@ -58,15 +58,15 @@ options:
|
||||
required: yes
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
EXAMPLES = r'''
|
||||
- name: Execute a command
|
||||
k8s_exec:
|
||||
community.kubernetes.k8s_exec:
|
||||
namespace: myproject
|
||||
pod: zuul-scheduler
|
||||
command: zuul-scheduler full-reconfigure
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
RETURN = r'''
|
||||
result:
|
||||
description:
|
||||
- The command object
|
||||
|
||||
@@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r'''
|
||||
module: k8s_info
|
||||
|
||||
short_description: Describe Kubernetes (K8s) objects
|
||||
@@ -68,7 +68,7 @@ requirements:
|
||||
- "PyYAML >= 3.11"
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
EXAMPLES = r'''
|
||||
- name: Get an existing Service object
|
||||
k8s_info:
|
||||
api_version: v1
|
||||
@@ -103,7 +103,7 @@ EXAMPLES = '''
|
||||
- status.phase=Running
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
RETURN = r'''
|
||||
resources:
|
||||
description:
|
||||
- The object(s) that exists
|
||||
|
||||
@@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r'''
|
||||
module: k8s_log
|
||||
|
||||
short_description: Fetch logs from Kubernetes resources
|
||||
@@ -48,7 +48,7 @@ options:
|
||||
namespace:
|
||||
description:
|
||||
- Use to specify an object namespace. Use in conjunction with I(api_version), I(kind), and I(name)
|
||||
to identify a specfic object.
|
||||
to identify a specific object.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
@@ -76,16 +76,16 @@ requirements:
|
||||
- "PyYAML >= 3.11"
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
EXAMPLES = r'''
|
||||
- name: Get a log from a Pod
|
||||
k8s_log:
|
||||
community.kubernetes.k8s_log:
|
||||
name: example-1
|
||||
namespace: testing
|
||||
register: log
|
||||
|
||||
# This will get the log from the first Pod found matching the selector
|
||||
- name: Log a Pod matching a label selector
|
||||
k8s_log:
|
||||
community.kubernetes.k8s_log:
|
||||
namespace: testing
|
||||
label_selectors:
|
||||
- app=example
|
||||
@@ -93,7 +93,7 @@ EXAMPLES = '''
|
||||
|
||||
# This will get the log from a single Pod managed by this Deployment
|
||||
- name: Get a log from a Deployment
|
||||
k8s_log:
|
||||
community.kubernetes.k8s_log:
|
||||
api_version: apps/v1
|
||||
kind: Deployment
|
||||
namespace: testing
|
||||
@@ -102,7 +102,7 @@ EXAMPLES = '''
|
||||
|
||||
# This will get the log from a single Pod managed by this DeploymentConfig
|
||||
- name: Get a log from a DeploymentConfig
|
||||
k8s_log:
|
||||
community.kubernetes.k8s_log:
|
||||
api_version: apps.openshift.io/v1
|
||||
kind: DeploymentConfig
|
||||
namespace: testing
|
||||
@@ -110,7 +110,7 @@ EXAMPLES = '''
|
||||
register: log
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
RETURN = r'''
|
||||
log:
|
||||
type: str
|
||||
description:
|
||||
|
||||
@@ -10,7 +10,7 @@ from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r'''
|
||||
|
||||
module: k8s_scale
|
||||
|
||||
@@ -36,9 +36,9 @@ requirements:
|
||||
- "PyYAML >= 3.11"
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
EXAMPLES = r'''
|
||||
- name: Scale deployment up, and extend timeout
|
||||
k8s_scale:
|
||||
community.kubernetes.k8s_scale:
|
||||
api_version: v1
|
||||
kind: Deployment
|
||||
name: elastic
|
||||
@@ -47,7 +47,7 @@ EXAMPLES = '''
|
||||
wait_timeout: 60
|
||||
|
||||
- name: Scale deployment down when current replicas match
|
||||
k8s_scale:
|
||||
community.kubernetes.k8s_scale:
|
||||
api_version: v1
|
||||
kind: Deployment
|
||||
name: elastic
|
||||
@@ -56,7 +56,7 @@ EXAMPLES = '''
|
||||
replicas: 2
|
||||
|
||||
- name: Increase job parallelism
|
||||
k8s_scale:
|
||||
community.kubernetes.k8s_scale:
|
||||
api_version: batch/v1
|
||||
kind: job
|
||||
name: pi-with-timeout
|
||||
@@ -66,25 +66,25 @@ EXAMPLES = '''
|
||||
# Match object using local file or inline definition
|
||||
|
||||
- name: Scale deployment based on a file from the local filesystem
|
||||
k8s_scale:
|
||||
community.kubernetes.k8s_scale:
|
||||
src: /myproject/elastic_deployment.yml
|
||||
replicas: 3
|
||||
wait: no
|
||||
|
||||
- name: Scale deployment based on a template output
|
||||
k8s_scale:
|
||||
community.kubernetes.k8s_scale:
|
||||
resource_definition: "{{ lookup('template', '/myproject/elastic_deployment.yml') | from_yaml }}"
|
||||
replicas: 3
|
||||
wait: no
|
||||
|
||||
- name: Scale deployment based on a file from the Ansible controller filesystem
|
||||
k8s_scale:
|
||||
community.kubernetes.k8s_scale:
|
||||
resource_definition: "{{ lookup('file', '/myproject/elastic_deployment.yml') | from_yaml }}"
|
||||
replicas: 3
|
||||
wait: no
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
RETURN = r'''
|
||||
result:
|
||||
description:
|
||||
- If a change was made, will return the patched object, otherwise returns the existing object.
|
||||
|
||||
@@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r'''
|
||||
|
||||
module: k8s_service
|
||||
|
||||
@@ -121,9 +121,9 @@ requirements:
|
||||
- openshift >= 0.6.2
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
EXAMPLES = r'''
|
||||
- name: Expose https port with ClusterIP
|
||||
k8s_service:
|
||||
community.kubernetes.k8s_service:
|
||||
state: present
|
||||
name: test-https
|
||||
namespace: default
|
||||
@@ -134,7 +134,7 @@ EXAMPLES = '''
|
||||
key: special
|
||||
|
||||
- name: Expose https port with ClusterIP using spec
|
||||
k8s_service:
|
||||
community.kubernetes.k8s_service:
|
||||
state: present
|
||||
name: test-https
|
||||
namespace: default
|
||||
@@ -147,7 +147,7 @@ EXAMPLES = '''
|
||||
key: special
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
RETURN = r'''
|
||||
result:
|
||||
description:
|
||||
- The created, patched, or otherwise present Service object. Will be empty in the case of a deletion.
|
||||
|
||||
Reference in New Issue
Block a user