# k8s module - TypeError: argument of type 'NoneType' is not iterable

**URL:** <https://forum.ansible.com/t/k8s-module-typeerror-argument-of-type-nonetype-is-not-iterable/32139>\
**Category:** Ansible Project\
**Tags:** kubernetes\
**Created:** [February 5, 2020, 4:50am UTC](https://forum.ansible.com/t/k8s-module-typeerror-argument-of-type-nonetype-is-not-iterable/32139 "2020-02-05T04:50:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason3](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@Jason3](https://forum.ansible.com/u/Jason3)\
**Post date:** [February 5, 2020, 4:50am UTC](https://forum.ansible.com/t/k8s-module-typeerror-argument-of-type-nonetype-is-not-iterable/32139/1 "2020-02-05T04:50:56Z")

</div>

Hello,

Trying to apply a yaml definition using the k8s module to my cluster. I’ve never used this module before so i’m trying to work out if i’m just doing something wrong or is this a bug?

playbook:

`

---

<div class="post-metadata">

**Author:** ![Jason3](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@Jason3](https://forum.ansible.com/u/Jason3)\
**Post date:** [February 6, 2020, 5:17am UTC](https://forum.ansible.com/t/k8s-module-typeerror-argument-of-type-nonetype-is-not-iterable/32139/2 "2020-02-06T05:17:19Z")

</div>

I figured it out. I had the path to my kubeconfig set wrong and i was missing ‘context’ and namespace parameters. What finally worked:

`

- hosts: kube-master[0]  
become: no  
tasks:
- name: Install simple app  
k8s:  
definition: ‘{{ item }}’  
kubeconfig: ~/.kube/config-dev  
context: dev  
namespace: default  
state: absent  
with\_items: ‘{{ lookup(“url”, “[https://k8s.io/examples/application/guestbook/redis-master-deployment.yaml](https://k8s.io/examples/application/guestbook/redis-master-deployment.yaml)”, split\_lines=False) | from\_yaml\_all | list }}’  
when: item is not none  
delegate\_to: localhost

`
