mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-08 14:02:38 +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:
@@ -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"
|
||||
|
||||
k8s_wait_timeout: 400
|
||||
|
||||
@@ -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