generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 155
Closed
Description
SUMMARY
kubernetes.core.k8s module fails to create DaemonSet when desired number of scheduled Pods is 0.
Root cause (check steps to reproduce first): Because we don't have any node with non_exisiting_label
desired number of Pods will be 0. Kubernetes won't create .status.updatedNumberScheduled
field (at least on version v1.27), because we still are not going to create any Pods.
ISSUE TYPE
- Bug Report
COMPONENT NAME
kubernetes.core.plugins.module_utils.k8s.waiter
ANSIBLE VERSION
ansible [core 2.17.1]
config file = None
configured module search path = ['/home/azaleski/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/azaleski/.local/lib/python3.10/site-packages/ansible
ansible collection location = /home/azaleski/.ansible/collections:/usr/share/ansible/collections
executable location = /home/azaleski/.local/bin/ansible
python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3)
jinja version = 3.1.3
libyaml = True
COLLECTION VERSION
# /home/azaleski/.ansible/collections/ansible_collections
Collection Version
--------------- -------
kubernetes.core 5.0.0
CONFIGURATION
$ ansible-config dump --only-changed
CONFIG_FILE() = None
OS / ENVIRONMENT
Ubuntu 22.04 on controller
Kubernetes v1.27
Kubernetes Python package: kubernetes-30.1.0
STEPS TO REPRODUCE
- name: Create daemonset
kubernetes.core.k8s:
state: present
wait: true
definition:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: my-daemonset
namespace: default
spec:
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-container
image: nginx
nodeSelector:
non_exisiting_label: 1
EXPECTED RESULTS
Expected behavior is having this task with attribute "wait: true" to finish successfully as we number of desired pods = number of exiting pods =0
ACTUAL RESULTS
Current behavior: finished with timeout status
TASK [Create daemonset] ****************************************************************************************************************************************************************************************************************************
fatal: [controlplane]: FAILED! => {"changed": true, "duration": 120, "method": "create", "msg": "\"DaemonSet\" \"my-daemonset\": Timed out waiting on resource", "result": {"apiVersion": "apps/v1", "kind": "DaemonSet", "metadata": {"annotations": {"deprecated.daemonset.template.generation": "1"}, "creationTimestamp": "2024-06-28T07:56:37Z", "generation": 1, "managedFields": [{"apiVersion": "apps/v1", "fieldsType": "FieldsV1", "fieldsV1": {"f:metadata": {"f:annotations": {".": {}, "f:deprecated.daemonset.template.generation": {}}}, "f:spec": {"f:revisionHistoryLimit": {}, "f:selector": {}, "f:template": {"f:metadata": {"f:labels": {".": {}, "f:app": {}}}, "f:spec": {"f:containers": {"k:{\"name\":\"my-container\"}": {".": {}, "f:image": {}, "f:imagePullPolicy": {}, "f:name": {}, "f:resources": {}, "f:terminationMessagePath": {}, "f:terminationMessagePolicy": {}}}, "f:dnsPolicy": {}, "f:nodeSelector": {}, "f:restartPolicy": {}, "f:schedulerName": {}, "f:securityContext": {}, "f:terminationGracePeriodSeconds": {}}}, "f:updateStrategy": {"f:rollingUpdate": {".": {}, "f:maxSurge": {}, "f:maxUnavailable": {}}, "f:type": {}}}}, "manager": "OpenAPI-Generator", "operation": "Update", "time": "2024-06-28T07:56:37Z"}, {"apiVersion": "apps/v1", "fieldsType": "FieldsV1", "fieldsV1": {"f:status": {"f:observedGeneration": {}}}, "manager": "kube-controller-manager", "operation": "Update", "subresource": "status", "time": "2024-06-28T07:56:37Z"}], "name": "my-daemonset", "namespace": "default", "resourceVersion": "1085313", "uid": "58b4d018-2999-4259-abe2-e79e6b1b6249"}, "spec": {"revisionHistoryLimit": 10, "selector": {"matchLabels": {"app": "my-app"}}, "template": {"metadata": {"creationTimestamp": null, "labels": {"app": "my-app"}}, "spec": {"containers": [{"image": "nginx", "imagePullPolicy": "Always", "name": "my-container", "resources": {}, "terminationMessagePath": "/dev/termination-log", "terminationMessagePolicy": "File"}], "dnsPolicy": "ClusterFirst", "nodeSelector": {"non_exisiting_label": "1"}, "restartPolicy": "Always", "schedulerName": "default-scheduler", "securityContext": {}, "terminationGracePeriodSeconds": 30}}, "updateStrategy": {"rollingUpdate": {"maxSurge": 0, "maxUnavailable": 1}, "type": "RollingUpdate"}}, "status": {"currentNumberScheduled": 0, "desiredNumberScheduled": 0, "numberMisscheduled": 0, "numberReady": 0, "observedGeneration": 1}}}
Metadata
Metadata
Assignees
Labels
No labels