<p>I'm  currently trying to setup heketi on kubernetes, i need to create an endpoint like so (i'm using Ansible):</p>
<pre><code>- hosts: 'masters'
  remote_user: kube
  become: yes
  become_user: kube
  vars:
    ansible_python_interpreter: /usr/bin/python3
  tasks:
    - name: &quot;Create gluster endpoints on kubernetes master&quot;
      kubernetes.core.k8s:
        state: present
        definition:
          apiVersion: v1
          kind: Endpoints
          metadata:
            name: glusterfs-cluster
            labels:
              storage.k8s.io/name: glusterfs
              storage.k8s.io/part-of: mine
              storage.k8s.io/created-by: username
          subsets:
            - addresses:
                - ip: 10.0.0.4
                  hostname: gluster1
                - ip: 10.0.0.5
                  hostname: gluster2
                - ip: 10.0.0.6
                  hostname: gluster3
                - ip: 10.0.0.7
                  hostname: gluster4
              ports:
                - port: 1
</code></pre>
<p>When i run ansible playbook on this i am getting this error:</p>
<blockquote>
<p>Failed to create object: Namespace is required for v1.Endpoints</p>
</blockquote>
<p>I can't find any information as to what it's talking about, what is the namespace supposed to be?</p>

<p>An <code>Endpoints</code> resource (like a <code>Pod</code>, <code>Service</code>, <code>Deployment</code>, etc) is a <em>namespaced</em> resource: it cannot be created globally; it must be created inside a specific <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" rel="nofollow noreferrer">namespace</a>.</p>
<p>We can't answer the question, &quot;what is the namespace supposed to be?&quot;, because generally this will be something like &quot;the same namespace as the resources that will rely on this <code>Endpoints</code> resource&quot;.</p>
