<ul>
<li><p>spark version: v2.4.0</p></li>
<li><p>eks info: v1.10.11-eks</p></li>
</ul>

<p>after submit, got wrong message as follow:</p>

<blockquote>
  <p>019-02-21 15:08:44 WARN  WatchConnectionManager:185 - Exec Failure: HTTP 403, Status: 403 - pods is forbidden: User "system:anonymous" cannot watch pods in the namespace "spark"
  java.net.ProtocolException: Expected HTTP 101 response but was '403 Forbidden'</p>
  
  <p>Exception in thread "main" io.fabric8.kubernetes.client.KubernetesClientException: pods is forbidden: User "system:anonymous" cannot watch pods in the namespace "spark"</p>
</blockquote>

ehnigel
<p>You need to create <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-and-clusterrole" rel="nofollow noreferrer">Role</a> for system:anonymous user to watch pods on your namespace with similar to below yaml</p>

<pre><code>kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  namespace: spark # your namespace
  name: pod-reader # Role name will be needed for binding to user
rules:
- apiGroups: [""] # "" indicates the core API group
  resources: ["pods"]
  verbs: ["get", "watch", "list"]
</code></pre>

<p>Then you need to create <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-and-clusterrole" rel="nofollow noreferrer">RoleBindging</a> to bind this role to <strong>system:anonymous</strong> user with similar to below yaml</p>

<pre><code># This role binding allows "system:anonymous" to read pods in the "spark" namespace.
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: read-pods
  namespace: spark # your namespace
subjects:
- kind: User
  name: system:anonymous # Name is case sensitive
  apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: Role #this must be Role or ClusterRole
  name: pod-reader # this must match the name of the Role or ClusterRole you wish to bind to
  apiGroup: rbac.authorization.k8s.io
</code></pre>

<p><a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/#anonymous-requests" rel="nofollow noreferrer">Documentation</a> for more info about Anonymous requests </p>
