mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-13 04:52:19 +00:00
This is a backport of PR #1056 as merged into main (bd1cacc).
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: Bianca Henderson <beeankha@gmail.com>
This commit is contained in:
@@ -5,28 +5,32 @@
|
||||
|
||||
- name: Add a deployment
|
||||
k8s:
|
||||
namespace: "{{ scale_namespace }}"
|
||||
definition:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: scale-deploy
|
||||
namespace: "{{ scale_namespace }}"
|
||||
labels:
|
||||
app: scale-deploy
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: "{{ k8s_pod_name }}"
|
||||
template: "{{ k8s_pod_template }}"
|
||||
wait: yes
|
||||
app: scale-deploy
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: scale-deploy
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx:latest
|
||||
ports:
|
||||
- containerPort: 80
|
||||
wait: true
|
||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||
apply: yes
|
||||
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
|
||||
apply: true
|
||||
|
||||
- name: Get pods in scale-deploy
|
||||
k8s_info:
|
||||
@@ -44,7 +48,7 @@
|
||||
name: scale-deploy
|
||||
namespace: "{{ scale_namespace }}"
|
||||
replicas: 0
|
||||
wait: yes
|
||||
wait: true
|
||||
register: scale_down
|
||||
check_mode: true
|
||||
|
||||
@@ -75,7 +79,7 @@
|
||||
name: scale-deploy
|
||||
namespace: "{{ scale_namespace }}"
|
||||
replicas: 0
|
||||
wait: yes
|
||||
wait: true
|
||||
register: scale_down
|
||||
check_mode: true
|
||||
|
||||
@@ -106,7 +110,7 @@
|
||||
name: scale-deploy
|
||||
namespace: "{{ scale_namespace }}"
|
||||
replicas: 0
|
||||
wait: yes
|
||||
wait: true
|
||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||
register: scale_down
|
||||
diff: true
|
||||
@@ -138,7 +142,7 @@
|
||||
name: scale-deploy
|
||||
namespace: "{{ scale_namespace }}"
|
||||
replicas: 0
|
||||
wait: yes
|
||||
wait: true
|
||||
register: scale_down_idempotency
|
||||
diff: true
|
||||
|
||||
@@ -159,18 +163,20 @@
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: "{{ k8s_pod_name }}"
|
||||
template: "{{ k8s_pod_template }}"
|
||||
wait: yes
|
||||
app: scale-deploy
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: scale-deploy
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx:latest
|
||||
ports:
|
||||
- containerPort: 80
|
||||
wait: true
|
||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||
apply: yes
|
||||
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
|
||||
apply: true
|
||||
register: reapply_after_scale
|
||||
|
||||
- name: Get pods in scale-deploy
|
||||
@@ -199,7 +205,7 @@
|
||||
wait: yes
|
||||
wait_timeout: "{{ k8s_wait_timeout | default(omit) }}"
|
||||
register: scale_up
|
||||
diff: no
|
||||
diff: false
|
||||
|
||||
- name: Get pods in scale-deploy
|
||||
k8s_info:
|
||||
@@ -228,7 +234,7 @@
|
||||
replicas: 2
|
||||
wait: yes
|
||||
register: scale_up_noop
|
||||
diff: no
|
||||
diff: false
|
||||
|
||||
- name: Get pods in scale-deploy
|
||||
k8s_info:
|
||||
@@ -255,7 +261,7 @@
|
||||
name: scale-deploy
|
||||
namespace: "{{ scale_namespace }}"
|
||||
replicas: 1
|
||||
wait: no
|
||||
wait: false
|
||||
register: scale_down_no_wait
|
||||
diff: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user