<p>Using test config with Ignite 2.4 and k8s 1.9:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:util="http://www.springframework.org/schema/util"
           xsi:schemaLocation="
            http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/util
            http://www.springframework.org/schema/util/spring-util.xsd"&gt;

    &lt;bean class="org.apache.ignite.configuration.IgniteConfiguration"&gt;
      &lt;property name="discoverySpi"&gt;
        &lt;bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"&gt;
          &lt;property name="ipFinder"&gt;
            &lt;bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder"/&gt;
          &lt;/property&gt;
        &lt;/bean&gt;
      &lt;/property&gt;
    &lt;/bean&gt;
&lt;/beans&gt;
</code></pre>

<p>Unable to find Kubernetes API Server at <a href="https://kubernetes.default.svc.cluster.local:443" rel="noreferrer">https://kubernetes.default.svc.cluster.local:443</a>
Can I set the API Server URL in the XML config file? How?</p>

<p>@Denis was right. </p>

<p>Kubernetes using RBAC access controlling system and you need to authorize your pod to access to API. </p>

<p>For that, you need to add a <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/" rel="nofollow noreferrer">Service Account</a> to your pod.</p>

<p>So, for do that you need:</p>

<ol>
<li><p>Create a service account and set role for it:</p>

<pre><code>apiVersion: v1
kind: ServiceAccount
metadata:
  name: ignite
  namespace: &lt;Your namespace&gt;
</code></pre></li>
<li><p>I am not sure that permissions to access only pods will be enough for Ignite, but if not - you can add as more permissions as you want. <a href="https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/cluster-roles.yaml" rel="nofollow noreferrer">Here</a> is example of different kind of roles with large list of permissions. So, now we create Cluster Role for your app:</p>

<pre><code>apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
  name: ignite
  namespace: &lt;Your namespace&gt;
rules:
- apiGroups:
  - ""
  resources:
  - pods # Here is resources you can access
  verbs: # That is what you can do with them
  - get
  - list
  - watch
</code></pre></li>
<li><p>Create binding for that role:</p>

<pre><code>kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: ignite
roleRef:
  kind: ClusterRole
  name: ignite
  apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
  name: ignite
  namespace: &lt;Your namespace&gt;
</code></pre></li>
<li><p>Now, you need to associate ServiceAccount to pods with your application:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  ....
spec:
  template:
    spec:
      serviceAccountName: ignite
</code></pre></li>
</ol>

<p>After that, your application will have an access to K8s API. P.S. Do not forget to change <code>&lt;Your namespace&gt;</code> to namespace where you running Ignition.</p>
