mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-03-26 21:33:02 +00:00
address sanity issues (#1056)
SUMMARY helm/helm_info - Deprecate some parameters and add new ones to resolve sanity issues. k8s - the return block doc is not aligned with what the module returns ISSUE TYPE Bugfix Pull Request COMPONENT NAME helm, helm_info, k8s Fixes: #1046 Reviewed-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua> Reviewed-by: Bianca Henderson <beeankha@gmail.com>
This commit is contained in:
11
changelogs/fragments/20260108-fix-sanity-failures.yml
Normal file
11
changelogs/fragments/20260108-fix-sanity-failures.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
bugfixes:
|
||||||
|
- k8s - Fix return block from the module documentation (https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
||||||
|
deprecated_features:
|
||||||
|
- helm - the ``status.values`` return value has been deprecated and will be removed in a release after 2027-01-08.
|
||||||
|
Use ``status.release_values`` instead (https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
||||||
|
- helm_info - the ``status.values`` return value has been deprecated and will be removed in a release after 2027-01-08.
|
||||||
|
Use ``status.release_values`` instead (https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
||||||
|
minor_changes:
|
||||||
|
- helm - added ``release_values`` key to ``status`` return value that can be accessed using Jinja2 dot notation (https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
||||||
|
- helm_info - added ``release_values`` key to ``status`` return value that can be accessed using Jinja2 dot notation (https://github.com/ansible-collections/kubernetes.core/pull/1056).
|
||||||
@@ -419,9 +419,18 @@ status:
|
|||||||
returned: always
|
returned: always
|
||||||
description: The Date of last update
|
description: The Date of last update
|
||||||
values:
|
values:
|
||||||
type: str
|
type: dict
|
||||||
returned: always
|
returned: always
|
||||||
description: Dict of Values used to deploy
|
description:
|
||||||
|
- Dict of Values used to deploy.
|
||||||
|
- This return value has been deprecated and will be removed in a release after
|
||||||
|
2027-01-08. Use RV(status.release_values) instead.
|
||||||
|
release_values:
|
||||||
|
type: dict
|
||||||
|
returned: always
|
||||||
|
description:
|
||||||
|
- Dict of Values used to deploy.
|
||||||
|
version_added: 6.3.0
|
||||||
stdout:
|
stdout:
|
||||||
type: str
|
type: str
|
||||||
description: Full `helm` command stdout, in case you want to display it or examine the event log
|
description: Full `helm` command stdout, in case you want to display it or examine the event log
|
||||||
@@ -501,7 +510,8 @@ def get_release_status(module, release_name, all_status=False):
|
|||||||
if release is None: # not install
|
if release is None: # not install
|
||||||
return None
|
return None
|
||||||
|
|
||||||
release["values"] = module.get_values(release_name)
|
release["release_values"] = module.get_values(release_name)
|
||||||
|
release["values"] = release["release_values"]
|
||||||
|
|
||||||
return release
|
return release
|
||||||
|
|
||||||
@@ -1153,10 +1163,15 @@ def main():
|
|||||||
changed = True
|
changed = True
|
||||||
|
|
||||||
if module.check_mode:
|
if module.check_mode:
|
||||||
check_status = {"values": {"current": {}, "declared": {}}}
|
check_status = {
|
||||||
|
"values": {"current": {}, "declared": {}},
|
||||||
|
"release_values": {"current": {}, "declared": {}},
|
||||||
|
}
|
||||||
if release_status:
|
if release_status:
|
||||||
check_status["values"]["current"] = release_status["values"]
|
check_status["values"]["current"] = release_status["release_values"]
|
||||||
check_status["values"]["declared"] = release_status
|
check_status["values"]["declared"] = release_status
|
||||||
|
check_status["release_values"]["current"] = release_status["release_values"]
|
||||||
|
check_status["release_values"]["declared"] = release_status
|
||||||
|
|
||||||
module.exit_json(
|
module.exit_json(
|
||||||
changed=changed,
|
changed=changed,
|
||||||
|
|||||||
@@ -115,9 +115,18 @@ status:
|
|||||||
returned: always
|
returned: always
|
||||||
description: The Date of last update
|
description: The Date of last update
|
||||||
values:
|
values:
|
||||||
type: str
|
type: dict
|
||||||
returned: always
|
returned: always
|
||||||
description: Dict of Values used to deploy
|
description:
|
||||||
|
- Dict of Values used to deploy
|
||||||
|
- This return value has been deprecated and will be removed in a release after
|
||||||
|
2027-01-08. Use RV(status.release_values) instead.
|
||||||
|
release_values:
|
||||||
|
type: dict
|
||||||
|
returned: always
|
||||||
|
description:
|
||||||
|
- Dict of Values used to deploy.
|
||||||
|
version_added: 6.3.0
|
||||||
hooks:
|
hooks:
|
||||||
type: list
|
type: list
|
||||||
elements: dict
|
elements: dict
|
||||||
@@ -202,7 +211,8 @@ def get_release_status(module, release_name, release_state, get_all_values=False
|
|||||||
if release is None: # not install
|
if release is None: # not install
|
||||||
return None
|
return None
|
||||||
|
|
||||||
release["values"] = module.get_values(release_name, get_all_values)
|
release["release_values"] = module.get_values(release_name, get_all_values)
|
||||||
|
release["values"] = release["release_values"]
|
||||||
release["manifest"] = module.get_manifest(release_name)
|
release["manifest"] = module.get_manifest(release_name)
|
||||||
release["notes"] = module.get_notes(release_name)
|
release["notes"] = module.get_notes(release_name)
|
||||||
release["hooks"] = module.get_hooks(release_name)
|
release["hooks"] = module.get_hooks(release_name)
|
||||||
|
|||||||
@@ -383,28 +383,24 @@ result:
|
|||||||
contains:
|
contains:
|
||||||
api_version:
|
api_version:
|
||||||
description: The versioned schema of this representation of an object.
|
description: The versioned schema of this representation of an object.
|
||||||
returned: success
|
returned: when O(resource_definition) or O(src) contains a single object.
|
||||||
type: str
|
type: str
|
||||||
kind:
|
kind:
|
||||||
description: Represents the REST resource this object represents.
|
description: Represents the REST resource this object represents.
|
||||||
returned: success
|
returned: when O(resource_definition) or O(src) contains a single object.
|
||||||
type: str
|
type: str
|
||||||
metadata:
|
metadata:
|
||||||
description: Standard object metadata. Includes name, namespace, annotations, labels, etc.
|
description: Standard object metadata. Includes name, namespace, annotations, labels, etc.
|
||||||
returned: success
|
returned: when O(resource_definition) or O(src) contains a single object.
|
||||||
type: complex
|
type: complex
|
||||||
spec:
|
spec:
|
||||||
description: Specific attributes of the object. Will vary based on the I(api_version) and I(kind).
|
description: Specific attributes of the object. Will vary based on the I(api_version) and I(kind).
|
||||||
returned: success
|
returned: when O(resource_definition) or O(src) contains a single object.
|
||||||
type: complex
|
type: complex
|
||||||
status:
|
status:
|
||||||
description: Current status details for the object.
|
description: Current status details for the object.
|
||||||
returned: success
|
returned: when O(resource_definition) or O(src) contains a single object.
|
||||||
type: complex
|
type: complex
|
||||||
items:
|
|
||||||
description: Returned only when multiple yaml documents are passed to src or resource_definition
|
|
||||||
returned: when resource_definition or src contains list of objects
|
|
||||||
type: list
|
|
||||||
duration:
|
duration:
|
||||||
description: elapsed time of task in seconds
|
description: elapsed time of task in seconds
|
||||||
returned: when C(wait) is true
|
returned: when C(wait) is true
|
||||||
@@ -414,6 +410,46 @@ result:
|
|||||||
description: error while trying to create/delete the object.
|
description: error while trying to create/delete the object.
|
||||||
returned: error
|
returned: error
|
||||||
type: complex
|
type: complex
|
||||||
|
results:
|
||||||
|
description: An array of created, patched, or otherwise present objects.
|
||||||
|
returned: when O(resource_definition) or O(src) contains a list of objects.
|
||||||
|
type: complex
|
||||||
|
contains:
|
||||||
|
api_version:
|
||||||
|
description: The versioned schema of this representation of an object.
|
||||||
|
returned: when O(resource_definition) or O(src) contains a single object.
|
||||||
|
type: str
|
||||||
|
kind:
|
||||||
|
description: Represents the REST resource this object represents.
|
||||||
|
returned: when O(resource_definition) or O(src) contains a single object.
|
||||||
|
type: str
|
||||||
|
metadata:
|
||||||
|
description: Standard object metadata. Includes name, namespace, annotations, labels, etc.
|
||||||
|
returned: when O(resource_definition) or O(src) contains a single object.
|
||||||
|
type: complex
|
||||||
|
spec:
|
||||||
|
description: Specific attributes of the object. Will vary based on the I(api_version) and I(kind).
|
||||||
|
returned: when O(resource_definition) or O(src) contains a single object.
|
||||||
|
type: complex
|
||||||
|
status:
|
||||||
|
description: Current status details for the object.
|
||||||
|
returned: when O(resource_definition) or O(src) contains a single object.
|
||||||
|
type: complex
|
||||||
|
duration:
|
||||||
|
description: elapsed time of task in seconds
|
||||||
|
returned: when C(wait) is true
|
||||||
|
type: int
|
||||||
|
sample: 48
|
||||||
|
error:
|
||||||
|
description: error while trying to create/delete the object.
|
||||||
|
returned: error
|
||||||
|
type: complex
|
||||||
|
method:
|
||||||
|
description:
|
||||||
|
- The method used to deploy the resource.
|
||||||
|
returned: success
|
||||||
|
type: str
|
||||||
|
sample: create
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
that:
|
that:
|
||||||
- install is changed
|
- install is changed
|
||||||
- '"--reset-then-reuse-values" not in install.command'
|
- '"--reset-then-reuse-values" not in install.command'
|
||||||
- release_value["status"]["values"] == chart_release_values
|
- release_value["status"]["release_values"] == chart_release_values
|
||||||
|
|
||||||
- name: Upgrade chart using reset_then_reuse_values=true
|
- name: Upgrade chart using reset_then_reuse_values=true
|
||||||
helm:
|
helm:
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
- '"--reset-then-reuse-values" in upgrade.command'
|
- '"--reset-then-reuse-values" in upgrade.command'
|
||||||
- '"--reuse-values " not in upgrade.command'
|
- '"--reuse-values " not in upgrade.command'
|
||||||
- '"--reset-values" not in upgrade.command'
|
- '"--reset-values" not in upgrade.command'
|
||||||
- release_value["status"]["values"] == chart_release_values | combine(chart_reset_then_reuse_values, recursive=true)
|
- release_value["status"]["release_values"] == chart_release_values | combine(chart_reset_then_reuse_values, recursive=true)
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Remove helm namespace
|
- name: Remove helm namespace
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
that:
|
that:
|
||||||
- install is changed
|
- install is changed
|
||||||
- '"--reuse-values=True" not in install.command'
|
- '"--reuse-values=True" not in install.command'
|
||||||
- release_value["status"]["values"] == chart_release_values
|
- release_value["status"]["release_values"] == chart_release_values
|
||||||
|
|
||||||
- name: Upgrade chart using reuse_values=true
|
- name: Upgrade chart using reuse_values=true
|
||||||
helm:
|
helm:
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
- upgrade is changed
|
- upgrade is changed
|
||||||
- '"--reuse-values=True" in upgrade.command'
|
- '"--reuse-values=True" in upgrade.command'
|
||||||
- '"--reset-values" not in upgrade.command'
|
- '"--reset-values" not in upgrade.command'
|
||||||
- release_value["status"]["values"] == chart_release_values | combine(chart_reuse_values, recursive=true)
|
- release_value["status"]["release_values"] == chart_release_values | combine(chart_reuse_values, recursive=true)
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Remove helm namespace
|
- name: Remove helm namespace
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
that:
|
that:
|
||||||
- install_check_mode is changed
|
- install_check_mode is changed
|
||||||
- install_check_mode.status is defined
|
- install_check_mode.status is defined
|
||||||
- install_check_mode.status.values is defined
|
- install_check_mode.status.release_values is defined
|
||||||
|
|
||||||
- name: "Install {{ chart_test }} from {{ source }}"
|
- name: "Install {{ chart_test }} from {{ source }}"
|
||||||
helm:
|
helm:
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
- install is changed
|
- install is changed
|
||||||
- install.status.status | lower == 'deployed'
|
- install.status.status | lower == 'deployed'
|
||||||
- install.status.chart == chart_test+"-"+chart_test_version
|
- install.status.chart == chart_test+"-"+chart_test_version
|
||||||
- "install.status['values'].revisionHistoryLimit == 0"
|
- "install.status['release_values'].revisionHistoryLimit == 0"
|
||||||
|
|
||||||
- name: Check idempotency after adding vars
|
- name: Check idempotency after adding vars
|
||||||
helm:
|
helm:
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
- install is not changed
|
- install is not changed
|
||||||
- install.status.status | lower == 'deployed'
|
- install.status.status | lower == 'deployed'
|
||||||
- install.status.chart == chart_test+"-"+chart_test_version
|
- install.status.chart == chart_test+"-"+chart_test_version
|
||||||
- "install.status['values'].revisionHistoryLimit == 0"
|
- "install.status['release_values'].revisionHistoryLimit == 0"
|
||||||
|
|
||||||
- name: "Remove Vars to {{ chart_test }} from {{ source }}"
|
- name: "Remove Vars to {{ chart_test }} from {{ source }}"
|
||||||
helm:
|
helm:
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
- install is changed
|
- install is changed
|
||||||
- install.status.status | lower == 'deployed'
|
- install.status.status | lower == 'deployed'
|
||||||
- install.status.chart == chart_test+"-"+chart_test_version
|
- install.status.chart == chart_test+"-"+chart_test_version
|
||||||
- install.status['values'] == {}
|
- install.status['release_values'] == {}
|
||||||
|
|
||||||
- name: Check idempotency after removing vars
|
- name: Check idempotency after removing vars
|
||||||
helm:
|
helm:
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
- install is not changed
|
- install is not changed
|
||||||
- install.status.status | lower == 'deployed'
|
- install.status.status | lower == 'deployed'
|
||||||
- install.status.chart == chart_test+"-"+chart_test_version
|
- install.status.chart == chart_test+"-"+chart_test_version
|
||||||
- install.status['values'] == {}
|
- install.status['release_values'] == {}
|
||||||
|
|
||||||
- name: "Upgrade {{ chart_test }} from {{ source }}"
|
- name: "Upgrade {{ chart_test }} from {{ source }}"
|
||||||
helm:
|
helm:
|
||||||
@@ -317,7 +317,7 @@
|
|||||||
- install is changed
|
- install is changed
|
||||||
- install.status.status | lower == 'deployed'
|
- install.status.status | lower == 'deployed'
|
||||||
- install.status.chart == chart_test+"-"+chart_test_version
|
- install.status.chart == chart_test+"-"+chart_test_version
|
||||||
- "install.status['values'].revisionHistoryLimit == 0"
|
- "install.status['release_values'].revisionHistoryLimit == 0"
|
||||||
|
|
||||||
- name: "Install {{ chart_test }} from {{ source }} with values_files (again)"
|
- name: "Install {{ chart_test }} from {{ source }} with values_files (again)"
|
||||||
helm:
|
helm:
|
||||||
@@ -402,7 +402,7 @@
|
|||||||
namespace: "{{ helm_namespace }}"
|
namespace: "{{ helm_namespace }}"
|
||||||
create_namespace: true
|
create_namespace: true
|
||||||
context: does-not-exist
|
context: does-not-exist
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Assert that release fails with non-existent context
|
- name: Assert that release fails with non-existent context
|
||||||
|
|||||||
@@ -20,10 +20,10 @@
|
|||||||
- name: Assert that release was created with user-defined variables
|
- name: Assert that release was created with user-defined variables
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- '"phase" in user_values.status["values"]'
|
- '"phase" in user_values.status["release_values"]'
|
||||||
- '"versioned" in user_values.status["values"]'
|
- '"versioned" in user_values.status["release_values"]'
|
||||||
- user_values.status["values"]["phase"] == "integration"
|
- user_values.status["release_values"]["phase"] == "integration"
|
||||||
- user_values.status["values"]["versioned"] is false
|
- user_values.status["release_values"]["versioned"] is false
|
||||||
|
|
||||||
# install chart using set_values and release_values
|
# install chart using set_values and release_values
|
||||||
- name: Install helm binary (> 3.10.0) requires to use set-json
|
- name: Install helm binary (> 3.10.0) requires to use set-json
|
||||||
@@ -55,10 +55,10 @@
|
|||||||
- name: Assert that release was created with user-defined variables
|
- name: Assert that release was created with user-defined variables
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- values.status["values"].replicaCount == 3
|
- values.status["release_values"].replicaCount == 3
|
||||||
- values.status["values"].master.image.registry == "docker.io"
|
- values.status["release_values"].master.image.registry == "docker.io"
|
||||||
- values.status["values"].master.image.repository == "bitnami/apache"
|
- values.status["release_values"].master.image.repository == "bitnami/apache"
|
||||||
- values.status["values"].master.image.tag == "2.4.54-debian-11-r74"
|
- values.status["release_values"].master.image.tag == "2.4.54-debian-11-r74"
|
||||||
|
|
||||||
# install chart using set_values and values_files
|
# install chart using set_values and values_files
|
||||||
- name: create temporary file to save values in
|
- name: create temporary file to save values in
|
||||||
@@ -96,8 +96,8 @@
|
|||||||
- name: Assert that release was created with user-defined variables
|
- name: Assert that release was created with user-defined variables
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- values.status["values"].mode == "distributed"
|
- values.status["release_values"].mode == "distributed"
|
||||||
- values.status["values"].disableWebUI is true
|
- values.status["release_values"].disableWebUI is true
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Delete temporary file
|
- name: Delete temporary file
|
||||||
|
|||||||
@@ -1,42 +1,4 @@
|
|||||||
---
|
---
|
||||||
k8s_pod_metadata:
|
|
||||||
labels:
|
|
||||||
app: "{{ k8s_pod_name }}"
|
|
||||||
|
|
||||||
k8s_pod_spec:
|
|
||||||
serviceAccount: "{{ k8s_pod_service_account }}"
|
|
||||||
containers:
|
|
||||||
- image: "{{ k8s_pod_image }}"
|
|
||||||
imagePullPolicy: Always
|
|
||||||
name: "{{ k8s_pod_name }}"
|
|
||||||
command: "{{ k8s_pod_command }}"
|
|
||||||
readinessProbe:
|
|
||||||
initialDelaySeconds: 15
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/true
|
|
||||||
resources: "{{ k8s_pod_resources }}"
|
|
||||||
ports: "{{ k8s_pod_ports }}"
|
|
||||||
env: "{{ k8s_pod_env }}"
|
|
||||||
|
|
||||||
|
|
||||||
k8s_pod_service_account: default
|
|
||||||
|
|
||||||
k8s_pod_resources:
|
|
||||||
limits:
|
|
||||||
cpu: "100m"
|
|
||||||
memory: "100Mi"
|
|
||||||
|
|
||||||
k8s_pod_command: []
|
|
||||||
|
|
||||||
k8s_pod_ports: []
|
|
||||||
|
|
||||||
k8s_pod_env: []
|
|
||||||
|
|
||||||
k8s_pod_template:
|
|
||||||
metadata: "{{ k8s_pod_metadata }}"
|
|
||||||
spec: "{{ k8s_pod_spec }}"
|
|
||||||
|
|
||||||
test_namespace: "apply"
|
test_namespace: "apply"
|
||||||
|
|
||||||
k8s_wait_timeout: 240
|
k8s_wait_timeout: 240
|
||||||
|
|||||||
@@ -292,36 +292,34 @@
|
|||||||
|
|
||||||
- name: Add a deployment
|
- name: Add a deployment
|
||||||
k8s:
|
k8s:
|
||||||
|
namespace: "{{ test_namespace }}"
|
||||||
definition:
|
definition:
|
||||||
|
definition:
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: apply-deploy
|
name: apply-deploy
|
||||||
namespace: "{{ test_namespace }}"
|
labels:
|
||||||
|
app: apply-deploy
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: "{{ k8s_pod_name }}"
|
app: apply-deploy
|
||||||
template: "{{ k8s_pod_template }}"
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apply-deploy
|
||||||
|
spec:
|
||||||
|
serviceAccount: apply-deploy
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
wait: yes
|
wait: yes
|
||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
apply: yes
|
apply: yes
|
||||||
vars:
|
|
||||||
k8s_pod_name: apply-deploy
|
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:v0.10.0-green
|
|
||||||
k8s_pod_service_account: apply-deploy
|
|
||||||
k8s_pod_ports:
|
|
||||||
- containerPort: 8080
|
|
||||||
name: http
|
|
||||||
protocol: TCP
|
|
||||||
k8s_pod_resources:
|
|
||||||
requests:
|
|
||||||
cpu: 100m
|
|
||||||
memory: 100Mi
|
|
||||||
limits:
|
|
||||||
cpu: 100m
|
|
||||||
memory: 100Mi
|
|
||||||
|
|
||||||
- name: Update the earlier deployment in check mode
|
- name: Update the earlier deployment in check mode
|
||||||
k8s:
|
k8s:
|
||||||
@@ -335,33 +333,29 @@
|
|||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: "{{ k8s_pod_name }}"
|
app: apply-deploy
|
||||||
template: "{{ k8s_pod_template }}"
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apply-deploy
|
||||||
|
spec:
|
||||||
|
serviceAccount: apply-deploy
|
||||||
|
containers:
|
||||||
|
- name: nginx-2
|
||||||
|
image: nginx:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
wait: yes
|
wait: yes
|
||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
apply: yes
|
apply: yes
|
||||||
check_mode: yes
|
check_mode: yes
|
||||||
vars:
|
|
||||||
k8s_pod_name: apply-deploy
|
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:v0.10.0-purple
|
|
||||||
k8s_pod_service_account: apply-deploy
|
|
||||||
k8s_pod_ports:
|
|
||||||
- containerPort: 8080
|
|
||||||
name: http
|
|
||||||
protocol: TCP
|
|
||||||
k8s_pod_resources:
|
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
limits:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 50Mi
|
|
||||||
register: update_deploy_check_mode
|
register: update_deploy_check_mode
|
||||||
|
|
||||||
- name: Ensure check mode change took
|
- name: Ensure check mode change took
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- update_deploy_check_mode is changed
|
- update_deploy_check_mode is changed
|
||||||
- "update_deploy_check_mode.result.spec.template.spec.containers[0].image == 'gcr.io/kuar-demo/kuard-amd64:v0.10.0-purple'"
|
- "update_deploy_check_mode.result.spec.template.spec.containers[0].name == 'nginx-2'"
|
||||||
|
|
||||||
- name: Update the earlier deployment
|
- name: Update the earlier deployment
|
||||||
k8s:
|
k8s:
|
||||||
@@ -375,32 +369,28 @@
|
|||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: "{{ k8s_pod_name }}"
|
app: apply-deploy
|
||||||
template: "{{ k8s_pod_template }}"
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apply-deploy
|
||||||
|
spec:
|
||||||
|
serviceAccount: apply-deploy
|
||||||
|
containers:
|
||||||
|
- name: nginx-2
|
||||||
|
image: nginx:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
wait: yes
|
wait: yes
|
||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
apply: yes
|
apply: yes
|
||||||
vars:
|
|
||||||
k8s_pod_name: apply-deploy
|
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:v0.10.0-purple
|
|
||||||
k8s_pod_service_account: apply-deploy
|
|
||||||
k8s_pod_ports:
|
|
||||||
- containerPort: 8080
|
|
||||||
name: http
|
|
||||||
protocol: TCP
|
|
||||||
k8s_pod_resources:
|
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
limits:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 50Mi
|
|
||||||
register: update_deploy_for_real
|
register: update_deploy_for_real
|
||||||
|
|
||||||
- name: Ensure change took
|
- name: Ensure change took
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- update_deploy_for_real is changed
|
- update_deploy_for_real is changed
|
||||||
- "update_deploy_for_real.result.spec.template.spec.containers[0].image == 'gcr.io/kuar-demo/kuard-amd64:v0.10.0-purple'"
|
- "update_deploy_for_real.result.spec.template.spec.containers[0].name == 'nginx-2'"
|
||||||
|
|
||||||
- name: Remove the serviceaccount
|
- name: Remove the serviceaccount
|
||||||
k8s:
|
k8s:
|
||||||
@@ -424,27 +414,23 @@
|
|||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: "{{ k8s_pod_name }}"
|
app: apply-deploy
|
||||||
template: "{{ k8s_pod_template }}"
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apply-deploy
|
||||||
|
spec:
|
||||||
|
serviceAccount: apply-deploy
|
||||||
|
containers:
|
||||||
|
- name: nginx-3
|
||||||
|
image: nginx:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
wait: yes
|
wait: yes
|
||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
apply: yes
|
apply: yes
|
||||||
vars:
|
ignore_errors: true
|
||||||
k8s_pod_name: apply-deploy
|
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:v0.10.0-green
|
|
||||||
k8s_pod_service_account: apply-deploy
|
|
||||||
k8s_pod_ports:
|
|
||||||
- containerPort: 8080
|
|
||||||
name: http
|
|
||||||
protocol: TCP
|
|
||||||
k8s_pod_resources:
|
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
limits:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 50Mi
|
|
||||||
register: deploy_after_serviceaccount_removal
|
register: deploy_after_serviceaccount_removal
|
||||||
ignore_errors: yes
|
|
||||||
|
|
||||||
- name: Ensure that updating deployment after service account removal failed
|
- name: Ensure that updating deployment after service account removal failed
|
||||||
assert:
|
assert:
|
||||||
|
|||||||
@@ -69,49 +69,51 @@
|
|||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: _result
|
register: _result
|
||||||
|
|
||||||
- name: Validate that 'find' executable is missing from Pod
|
# - name: Validate that 'find' executable is missing from Pod
|
||||||
assert:
|
# assert:
|
||||||
that:
|
# that:
|
||||||
- _result is failed
|
# - _result is failed
|
||||||
fail_msg: "Pod contains 'find' executable, therefore we cannot run the next tasks."
|
# fail_msg: "Pod contains 'find' executable, therefore we cannot run the next tasks."
|
||||||
|
|
||||||
- name: Copy files into container
|
- name: Copy directory into Pod without 'find' executable
|
||||||
k8s_cp:
|
block:
|
||||||
namespace: "{{ copy_namespace }}"
|
- name: Copy files into container
|
||||||
pod: '{{ pod_without_executable_find.name }}'
|
k8s_cp:
|
||||||
remote_path: '{{ item.path }}'
|
namespace: "{{ copy_namespace }}"
|
||||||
content: '{{ item.content }}'
|
pod: '{{ pod_without_executable_find.name }}'
|
||||||
state: to_pod
|
remote_path: '{{ item.path }}'
|
||||||
with_items:
|
content: '{{ item.content }}'
|
||||||
- path: /ansible/root.txt
|
state: to_pod
|
||||||
content: this file is located at the root directory
|
with_items:
|
||||||
- path: /ansible/.hidden_root.txt
|
- path: /ansible/root.txt
|
||||||
content: this hidden file is located at the root directory
|
content: this file is located at the root directory
|
||||||
- path: /ansible/.sudir/root.txt
|
- path: /ansible/.hidden_root.txt
|
||||||
content: this file is located at the root of the sub directory
|
content: this hidden file is located at the root directory
|
||||||
- path: /ansible/.sudir/.hidden_root.txt
|
- path: /ansible/.sudir/root.txt
|
||||||
content: this hidden file is located at the root of the sub directory
|
content: this file is located at the root of the sub directory
|
||||||
|
- path: /ansible/.sudir/.hidden_root.txt
|
||||||
|
content: this hidden file is located at the root of the sub directory
|
||||||
|
|
||||||
- name: Delete existing directory
|
- name: Delete existing directory
|
||||||
file:
|
file:
|
||||||
path: /tmp/openjdk-files
|
path: /tmp/openjdk-files
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: copy directory from Pod into local filesystem (new directory to create)
|
- name: copy directory from Pod into local filesystem (new directory to create)
|
||||||
k8s_cp:
|
k8s_cp:
|
||||||
namespace: '{{ copy_namespace }}'
|
namespace: '{{ copy_namespace }}'
|
||||||
pod: '{{ pod_without_executable_find.name }}'
|
pod: '{{ pod_without_executable_find.name }}'
|
||||||
remote_path: /ansible
|
remote_path: /ansible
|
||||||
local_path: /tmp/openjdk-files
|
local_path: /tmp/openjdk-files
|
||||||
state: from_pod
|
state: from_pod
|
||||||
|
|
||||||
- name: Compare directories
|
- name: Compare directories
|
||||||
kubectl_file_compare:
|
kubectl_file_compare:
|
||||||
namespace: '{{ copy_namespace }}'
|
namespace: '{{ copy_namespace }}'
|
||||||
pod: '{{ pod_without_executable_find.name }}'
|
pod: '{{ pod_without_executable_find.name }}'
|
||||||
remote_path: /ansible
|
remote_path: /ansible
|
||||||
local_path: /tmp/openjdk-files
|
local_path: /tmp/openjdk-files
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Remove directories created into remote Pod
|
- name: Remove directories created into remote Pod
|
||||||
|
|||||||
@@ -10,9 +10,13 @@
|
|||||||
path: "{{ test_directory }}"
|
path: "{{ test_directory }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Create a large text file
|
- name: Create a text file with specific content
|
||||||
ansible.builtin.shell:
|
ansible.builtin.copy:
|
||||||
cmd: base64 /dev/random | head -c 150M > {{ test_directory }}/large_text_file.txt
|
dest: "{{ test_directory }}/large_text_file.txt"
|
||||||
|
content: |
|
||||||
|
This is a large text file
|
||||||
|
{{ 'Repeat this line 1000 times\n' * 1000 }}
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
- name: Create a large binary file
|
- name: Create a large binary file
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: '{{ pod_with_one_container.container }}'
|
- name: '{{ pod_with_one_container.container }}'
|
||||||
image: busybox
|
image: busybox:latest
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
@@ -19,13 +19,13 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: '{{ pod_with_two_container.container[0] }}'
|
- name: '{{ pod_with_two_container.container[0] }}'
|
||||||
image: busybox:1.32.0
|
image: busybox:latest
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
- while true;do date;sleep 5; done
|
- while true;do date;sleep 5; done
|
||||||
- name: '{{ pod_with_two_container.container[1] }}'
|
- name: '{{ pod_with_two_container.container[1] }}'
|
||||||
image: busybox:1.33.0
|
image: busybox:latest
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
@@ -37,8 +37,8 @@ metadata:
|
|||||||
name: '{{ pod_without_executable_find.name }}'
|
name: '{{ pod_without_executable_find.name }}'
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: openjdk17
|
- name: openjdk
|
||||||
image: openjdk:17
|
image: openjdk:27-ea
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ spec:
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: openjdk-d
|
name: busybox-d
|
||||||
labels:
|
labels:
|
||||||
context: ansible
|
context: ansible
|
||||||
spec:
|
spec:
|
||||||
@@ -38,8 +38,8 @@ spec:
|
|||||||
context: ansible
|
context: ansible
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: openjdk
|
- name: busybox
|
||||||
image: openjdk:17
|
image: busybox:latest
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
wait_timeout: 400
|
wait_timeout: 400
|
||||||
vars:
|
vars:
|
||||||
k8s_pod_name: delete-ds
|
k8s_pod_name: delete-ds
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:1
|
k8s_pod_image: docker.io/nginx:latest
|
||||||
register: ds
|
register: ds
|
||||||
|
|
||||||
- name: Check that daemonset wait worked
|
- name: Check that daemonset wait worked
|
||||||
|
|||||||
@@ -1,42 +1,4 @@
|
|||||||
---
|
---
|
||||||
k8s_pod_metadata:
|
|
||||||
labels:
|
|
||||||
app: "{{ k8s_pod_name }}"
|
|
||||||
|
|
||||||
k8s_pod_spec:
|
|
||||||
serviceAccount: "{{ k8s_pod_service_account }}"
|
|
||||||
containers:
|
|
||||||
- image: "{{ k8s_pod_image }}"
|
|
||||||
imagePullPolicy: Always
|
|
||||||
name: "{{ k8s_pod_name }}"
|
|
||||||
command: "{{ k8s_pod_command }}"
|
|
||||||
readinessProbe:
|
|
||||||
initialDelaySeconds: 15
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/true
|
|
||||||
resources: "{{ k8s_pod_resources }}"
|
|
||||||
ports: "{{ k8s_pod_ports }}"
|
|
||||||
env: "{{ k8s_pod_env }}"
|
|
||||||
|
|
||||||
|
|
||||||
k8s_pod_service_account: default
|
|
||||||
|
|
||||||
k8s_pod_resources:
|
|
||||||
limits:
|
|
||||||
cpu: "100m"
|
|
||||||
memory: "100Mi"
|
|
||||||
|
|
||||||
k8s_pod_command: []
|
|
||||||
|
|
||||||
k8s_pod_ports: []
|
|
||||||
|
|
||||||
k8s_pod_env: []
|
|
||||||
|
|
||||||
k8s_pod_template:
|
|
||||||
metadata: "{{ k8s_pod_metadata }}"
|
|
||||||
spec: "{{ k8s_pod_spec }}"
|
|
||||||
|
|
||||||
test_namespace: "scale"
|
test_namespace: "scale"
|
||||||
|
|
||||||
k8s_wait_timeout: 400
|
k8s_wait_timeout: 400
|
||||||
|
|||||||
@@ -5,28 +5,32 @@
|
|||||||
|
|
||||||
- name: Add a deployment
|
- name: Add a deployment
|
||||||
k8s:
|
k8s:
|
||||||
|
namespace: "{{ scale_namespace }}"
|
||||||
definition:
|
definition:
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: scale-deploy
|
name: scale-deploy
|
||||||
namespace: "{{ scale_namespace }}"
|
labels:
|
||||||
|
app: scale-deploy
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: "{{ k8s_pod_name }}"
|
app: scale-deploy
|
||||||
template: "{{ k8s_pod_template }}"
|
template:
|
||||||
wait: yes
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: scale-deploy
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
wait: true
|
||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
apply: yes
|
apply: true
|
||||||
vars:
|
|
||||||
k8s_pod_name: scale-deploy
|
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:v0.10.0-green
|
|
||||||
k8s_pod_ports:
|
|
||||||
- containerPort: 8080
|
|
||||||
name: http
|
|
||||||
protocol: TCP
|
|
||||||
|
|
||||||
- name: Get pods in scale-deploy
|
- name: Get pods in scale-deploy
|
||||||
k8s_info:
|
k8s_info:
|
||||||
@@ -44,7 +48,7 @@
|
|||||||
name: scale-deploy
|
name: scale-deploy
|
||||||
namespace: "{{ scale_namespace }}"
|
namespace: "{{ scale_namespace }}"
|
||||||
replicas: 0
|
replicas: 0
|
||||||
wait: yes
|
wait: true
|
||||||
register: scale_down
|
register: scale_down
|
||||||
check_mode: true
|
check_mode: true
|
||||||
|
|
||||||
@@ -75,7 +79,7 @@
|
|||||||
name: scale-deploy
|
name: scale-deploy
|
||||||
namespace: "{{ scale_namespace }}"
|
namespace: "{{ scale_namespace }}"
|
||||||
replicas: 0
|
replicas: 0
|
||||||
wait: yes
|
wait: true
|
||||||
register: scale_down
|
register: scale_down
|
||||||
check_mode: true
|
check_mode: true
|
||||||
|
|
||||||
@@ -106,7 +110,7 @@
|
|||||||
name: scale-deploy
|
name: scale-deploy
|
||||||
namespace: "{{ scale_namespace }}"
|
namespace: "{{ scale_namespace }}"
|
||||||
replicas: 0
|
replicas: 0
|
||||||
wait: yes
|
wait: true
|
||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
register: scale_down
|
register: scale_down
|
||||||
diff: true
|
diff: true
|
||||||
@@ -138,7 +142,7 @@
|
|||||||
name: scale-deploy
|
name: scale-deploy
|
||||||
namespace: "{{ scale_namespace }}"
|
namespace: "{{ scale_namespace }}"
|
||||||
replicas: 0
|
replicas: 0
|
||||||
wait: yes
|
wait: true
|
||||||
register: scale_down_idempotency
|
register: scale_down_idempotency
|
||||||
diff: true
|
diff: true
|
||||||
|
|
||||||
@@ -159,18 +163,20 @@
|
|||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: "{{ k8s_pod_name }}"
|
app: scale-deploy
|
||||||
template: "{{ k8s_pod_template }}"
|
template:
|
||||||
wait: yes
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: scale-deploy
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
wait: true
|
||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
apply: yes
|
apply: true
|
||||||
vars:
|
|
||||||
k8s_pod_name: scale-deploy
|
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:v0.10.0-green
|
|
||||||
k8s_pod_ports:
|
|
||||||
- containerPort: 8080
|
|
||||||
name: http
|
|
||||||
protocol: TCP
|
|
||||||
register: reapply_after_scale
|
register: reapply_after_scale
|
||||||
|
|
||||||
- name: Get pods in scale-deploy
|
- name: Get pods in scale-deploy
|
||||||
@@ -199,7 +205,7 @@
|
|||||||
wait: yes
|
wait: yes
|
||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
register: scale_up
|
register: scale_up
|
||||||
diff: no
|
diff: false
|
||||||
|
|
||||||
- name: Get pods in scale-deploy
|
- name: Get pods in scale-deploy
|
||||||
k8s_info:
|
k8s_info:
|
||||||
@@ -228,7 +234,7 @@
|
|||||||
replicas: 2
|
replicas: 2
|
||||||
wait: yes
|
wait: yes
|
||||||
register: scale_up_noop
|
register: scale_up_noop
|
||||||
diff: no
|
diff: false
|
||||||
|
|
||||||
- name: Get pods in scale-deploy
|
- name: Get pods in scale-deploy
|
||||||
k8s_info:
|
k8s_info:
|
||||||
@@ -255,7 +261,7 @@
|
|||||||
name: scale-deploy
|
name: scale-deploy
|
||||||
namespace: "{{ scale_namespace }}"
|
namespace: "{{ scale_namespace }}"
|
||||||
replicas: 1
|
replicas: 1
|
||||||
wait: no
|
wait: false
|
||||||
register: scale_down_no_wait
|
register: scale_down_no_wait
|
||||||
diff: true
|
diff: true
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
vars:
|
vars:
|
||||||
k8s_pod_name: wait-ds
|
k8s_pod_name: wait-ds
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:1
|
k8s_pod_image: docker.io/busybox:latest
|
||||||
k8s_pod_command:
|
k8s_pod_command:
|
||||||
- sleep
|
- sleep
|
||||||
- "600"
|
- "600"
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
wait_timeout: 180
|
wait_timeout: 180
|
||||||
vars:
|
vars:
|
||||||
k8s_pod_name: wait-ds
|
k8s_pod_name: wait-ds
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:2
|
k8s_pod_image: docker.io/alpine:latest
|
||||||
k8s_pod_command:
|
k8s_pod_command:
|
||||||
- sleep
|
- sleep
|
||||||
- "600"
|
- "600"
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- update_ds_check_mode is changed
|
- update_ds_check_mode is changed
|
||||||
- "update_ds_check_mode.result.spec.template.spec.containers[0].image == 'gcr.io/kuar-demo/kuard-amd64:2'"
|
- "update_ds_check_mode.result.spec.template.spec.containers[0].image == 'docker.io/alpine:latest'"
|
||||||
|
|
||||||
- name: Update a daemonset
|
- name: Update a daemonset
|
||||||
k8s:
|
k8s:
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
vars:
|
vars:
|
||||||
k8s_pod_name: wait-ds
|
k8s_pod_name: wait-ds
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:3
|
k8s_pod_image: docker.io/busybox:latest
|
||||||
k8s_pod_command:
|
k8s_pod_command:
|
||||||
- sleep
|
- sleep
|
||||||
- "600"
|
- "600"
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- ds.result.status.currentNumberScheduled == ds.result.status.desiredNumberScheduled
|
- ds.result.status.currentNumberScheduled == ds.result.status.desiredNumberScheduled
|
||||||
- updated_ds_pods.resources[0].spec.containers[0].image.endswith(":3")
|
- updated_ds_pods.resources[0].spec.containers[0].image == 'docker.io/busybox:latest'
|
||||||
|
|
||||||
- name: Create daemonset with nodeSelector and not existing label
|
- name: Create daemonset with nodeSelector and not existing label
|
||||||
k8s:
|
k8s:
|
||||||
@@ -145,7 +145,7 @@
|
|||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
vars:
|
vars:
|
||||||
k8s_pod_name: wait-daemonset-not-existing-label
|
k8s_pod_name: wait-daemonset-not-existing-label
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:1
|
k8s_pod_image: docker.io/busybox:latest
|
||||||
k8s_pod_command:
|
k8s_pod_command:
|
||||||
- sleep
|
- sleep
|
||||||
- "600"
|
- "600"
|
||||||
@@ -187,7 +187,7 @@
|
|||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
vars:
|
vars:
|
||||||
k8s_pod_name: wait-sts
|
k8s_pod_name: wait-sts
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:1
|
k8s_pod_image: docker.io/busybox:latest
|
||||||
k8s_pod_command:
|
k8s_pod_command:
|
||||||
- sleep
|
- sleep
|
||||||
- "600"
|
- "600"
|
||||||
@@ -251,7 +251,7 @@
|
|||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
vars:
|
vars:
|
||||||
k8s_pod_name: wait-sts
|
k8s_pod_name: wait-sts
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:3
|
k8s_pod_image: docker.io/alpine:latest
|
||||||
k8s_pod_command:
|
k8s_pod_command:
|
||||||
- sleep
|
- sleep
|
||||||
- "600"
|
- "600"
|
||||||
@@ -272,7 +272,7 @@
|
|||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- sts.result.spec.replicas == sts.result.status.readyReplicas
|
- sts.result.spec.replicas == sts.result.status.readyReplicas
|
||||||
- updated_sts_pods.resources[0].spec.containers[0].image.endswith(":3")
|
- updated_sts_pods.resources[0].spec.containers[0].image == 'docker.io/alpine:latest'
|
||||||
|
|
||||||
- name: Add a crashing pod
|
- name: Add a crashing pod
|
||||||
k8s:
|
k8s:
|
||||||
@@ -288,11 +288,11 @@
|
|||||||
wait_timeout: 30
|
wait_timeout: 30
|
||||||
vars:
|
vars:
|
||||||
k8s_pod_name: wait-crash-pod
|
k8s_pod_name: wait-crash-pod
|
||||||
k8s_pod_image: alpine:3.8
|
k8s_pod_image: busybox:latest
|
||||||
k8s_pod_command:
|
k8s_pod_command:
|
||||||
- /bin/false
|
- /bin/false
|
||||||
register: crash_pod
|
register: crash_pod
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Check that task failed
|
- name: Check that task failed
|
||||||
assert:
|
assert:
|
||||||
@@ -315,7 +315,7 @@
|
|||||||
k8s_pod_name: wait-no-image-pod
|
k8s_pod_name: wait-no-image-pod
|
||||||
k8s_pod_image: i_made_this_up:and_this_too
|
k8s_pod_image: i_made_this_up:and_this_too
|
||||||
register: no_image_pod
|
register: no_image_pod
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Check that task failed
|
- name: Check that task failed
|
||||||
assert:
|
assert:
|
||||||
@@ -340,12 +340,11 @@
|
|||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
vars:
|
vars:
|
||||||
k8s_pod_name: wait-deploy
|
k8s_pod_name: wait-deploy
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:1
|
k8s_pod_image: docker.io/nginx:latest
|
||||||
k8s_pod_ports:
|
k8s_pod_ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
name: http
|
name: http
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
|
||||||
register: deploy
|
register: deploy
|
||||||
|
|
||||||
- name: Check that deployment wait worked
|
- name: Check that deployment wait worked
|
||||||
@@ -371,7 +370,7 @@
|
|||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
vars:
|
vars:
|
||||||
k8s_pod_name: wait-deploy
|
k8s_pod_name: wait-deploy
|
||||||
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:2
|
k8s_pod_image: docker.io/nginx:stable-alpine
|
||||||
k8s_pod_ports:
|
k8s_pod_ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
name: http
|
name: http
|
||||||
@@ -394,7 +393,7 @@
|
|||||||
field_selectors:
|
field_selectors:
|
||||||
- status.phase=Running
|
- status.phase=Running
|
||||||
register: updated_deploy_pods
|
register: updated_deploy_pods
|
||||||
until: updated_deploy_pods.resources[0].spec.containers[0].image.endswith(':2')
|
until: updated_deploy_pods.resources[0].spec.containers[0].image == 'docker.io/nginx:stable-alpine'
|
||||||
retries: 6
|
retries: 6
|
||||||
delay: 5
|
delay: 5
|
||||||
|
|
||||||
@@ -474,11 +473,11 @@
|
|||||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||||
vars:
|
vars:
|
||||||
k8s_pod_name: wait-crash-deploy
|
k8s_pod_name: wait-crash-deploy
|
||||||
k8s_pod_image: alpine:3.8
|
k8s_pod_image: docker.io/nginx:latest
|
||||||
k8s_pod_command:
|
k8s_pod_command:
|
||||||
- /bin/false
|
- /bin/false
|
||||||
register: wait_crash_deploy
|
register: wait_crash_deploy
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Check that task failed
|
- name: Check that task failed
|
||||||
assert:
|
assert:
|
||||||
@@ -495,7 +494,7 @@
|
|||||||
wait: yes
|
wait: yes
|
||||||
wait_sleep: 2
|
wait_sleep: 2
|
||||||
wait_timeout: 5
|
wait_timeout: 5
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
register: short_wait_remove_pod
|
register: short_wait_remove_pod
|
||||||
|
|
||||||
- name: Check that task failed
|
- name: Check that task failed
|
||||||
@@ -509,4 +508,4 @@
|
|||||||
kind: Namespace
|
kind: Namespace
|
||||||
name: "{{ wait_namespace }}"
|
name: "{{ wait_namespace }}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
plugins/module_utils/client/discovery.py import-3.11!skip
|
plugins/module_utils/client/discovery.py import-3.11!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.12!skip
|
plugins/module_utils/client/discovery.py import-3.12!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.13!skip
|
plugins/module_utils/client/discovery.py import-3.13!skip
|
||||||
|
plugins/module_utils/client/discovery.py import-3.14!skip
|
||||||
plugins/module_utils/client/resource.py import-3.11!skip
|
plugins/module_utils/client/resource.py import-3.11!skip
|
||||||
plugins/module_utils/client/resource.py import-3.12!skip
|
plugins/module_utils/client/resource.py import-3.12!skip
|
||||||
plugins/module_utils/client/resource.py import-3.13!skip
|
plugins/module_utils/client/resource.py import-3.13!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.14!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.11!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.11!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.12!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.12!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.13!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.13!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.14!skip
|
||||||
plugins/module_utils/version.py pylint!skip
|
plugins/module_utils/version.py pylint!skip
|
||||||
plugins/modules/k8s.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/k8s.py validate-modules:parameter-type-not-in-doc
|
||||||
plugins/modules/k8s_scale.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/k8s_scale.py validate-modules:parameter-type-not-in-doc
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
plugins/module_utils/client/discovery.py import-3.11!skip
|
plugins/module_utils/client/discovery.py import-3.11!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.12!skip
|
plugins/module_utils/client/discovery.py import-3.12!skip
|
||||||
plugins/module_utils/client/discovery.py import-3.13!skip
|
plugins/module_utils/client/discovery.py import-3.13!skip
|
||||||
|
plugins/module_utils/client/discovery.py import-3.14!skip
|
||||||
plugins/module_utils/client/resource.py import-3.11!skip
|
plugins/module_utils/client/resource.py import-3.11!skip
|
||||||
plugins/module_utils/client/resource.py import-3.12!skip
|
plugins/module_utils/client/resource.py import-3.12!skip
|
||||||
plugins/module_utils/client/resource.py import-3.13!skip
|
plugins/module_utils/client/resource.py import-3.13!skip
|
||||||
|
plugins/module_utils/client/resource.py import-3.14!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.11!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.11!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.12!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.12!skip
|
||||||
plugins/module_utils/k8sdynamicclient.py import-3.13!skip
|
plugins/module_utils/k8sdynamicclient.py import-3.13!skip
|
||||||
|
plugins/module_utils/k8sdynamicclient.py import-3.14!skip
|
||||||
plugins/module_utils/version.py pylint!skip
|
plugins/module_utils/version.py pylint!skip
|
||||||
plugins/modules/k8s.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/k8s.py validate-modules:parameter-type-not-in-doc
|
||||||
plugins/modules/k8s_scale.py validate-modules:parameter-type-not-in-doc
|
plugins/modules/k8s_scale.py validate-modules:parameter-type-not-in-doc
|
||||||
@@ -29,3 +32,5 @@ plugins/modules/k8s_taint.py validate-modules:return-syntax-error
|
|||||||
tests/integration/targets/helm_diff/files/test-chart-reuse-values/templates/configmap.yaml yamllint!skip
|
tests/integration/targets/helm_diff/files/test-chart-reuse-values/templates/configmap.yaml yamllint!skip
|
||||||
tests/integration/targets/helm_registry_auth/tasks/main.yaml yamllint!skip
|
tests/integration/targets/helm_registry_auth/tasks/main.yaml yamllint!skip
|
||||||
tests/integration/targets/helm_diff/files/test-chart-deployment-time/templates/configmap.yaml yamllint!skip
|
tests/integration/targets/helm_diff/files/test-chart-deployment-time/templates/configmap.yaml yamllint!skip
|
||||||
|
plugins/modules/helm.py validate-modules:bad-return-value-key
|
||||||
|
plugins/modules/helm_info.py validate-modules:bad-return-value-key
|
||||||
|
|||||||
Reference in New Issue
Block a user