--- # Set kubeconfig path if not already set - name: Set kubeconfig path ansible.builtin.set_fact: KUBECONFIG: "{{ playbook_dir }}/kubeconfig/config" when: KUBECONFIG is not defined tags: [test] - name: Deploy test pod that exceeds current node resources kubernetes.core.k8s: state: present src: "{{ playbook_dir }}/templates/test-pod.yaml" environment: KUBECONFIG: "{{ KUBECONFIG }}" tags: [test] - name: Check pod status kubernetes.core.k8s_info: api_version: v1 kind: Pod name: karpenter-test-pod namespace: default register: test_pod environment: KUBECONFIG: "{{ KUBECONFIG }}" tags: [test] - name: Display initial pod status ansible.builtin.debug: msg: | Pod Status: {{ test_pod.resources[0].status.phase | default('Unknown') }} {% if test_pod.resources[0].status.conditions is defined %} Conditions: {% for condition in test_pod.resources[0].status.conditions %} - {{ condition.type }}: {{ condition.status }} ({{ condition.reason | default('') }}) {% endfor %} {% endif %} tags: [test]