<p>I am trying to configure the Kubernetes UI dashboard. with full admin permissions, so created a YAML file: <code>dashboard-admin.yaml</code>.
contents of my file are below:</p>

<pre><code>apiVersion: rbac.authorization.k8s.io/v1.12.1
kind: ClusterRoleBinding   
metadata:   
    name: kubernetes-dashboard
    labels:
      k8s-app: kubernetes-dashboard
roleRef:        
   apiGroup: rbac.authorization.k8s.io
   kind: ClusterRole    
   name: cluster-admin    
subjects:    
 kind: ServiceAccount      
 name: kubernetes-dashboard    
 namespace: kube-system
</code></pre>

<p>so when I am trying to apply changes to this file by executing the command
<code>kubectl create -f dashboard-admin.yaml</code></p>

<p>1) I'm encountering with an error as stated below:</p>

<pre><code>error: error parsing dashboard-admin.yaml: error converting YAML to JSON: yaml: line 12: mapping values are not allowed in this context
</code></pre>

<p>2) Also, after running the <code>kubectl proxy</code> command, I'm unable to open the dashboard in my local machine using the link below:</p>

<pre><code>http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
</code></pre>

<p>Your error is related to YAML indentation. I've edited the question that shows the correct format. Or if you'd like you can use this one too.</p>

<pre><code>apiVersion: rbac.authorization.k8s.io/v1.12.1
kind: ClusterRoleBinding   
metadata:   
  name: kubernetes-dashboard
  labels:
    k8s-app: kubernetes-dashboard
roleRef:        
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole    
  name: cluster-admin    
subjects:    
- kind: ServiceAccount      
  name: kubernetes-dashboard    
  namespace: kube-system
</code></pre>

<p>Your K8s dashboard will not work unless you have correctly setup the RBAC rule above,</p>
