<p>i need create an https url from my dash board using kubectl proxy is only generating http url how to create an https url what command should we run for that token is grtting generated but not login dashboards stays static with no response on entering the token</p>

jaya rohith
<p>You can expose your <code>kubernetes-dashboard</code> service via <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport" rel="nofollow noreferrer">NodePort</a>.</p>

<p>To achieve this, the simplest way would be to edit the current <code>kubernetes-dashboard</code>service configuration and change <code>ClusterIP</code> parameter to <code>NodePort</code>:</p>

<p><code>kubectl edit services kubernetes-dashboard -n kube-system</code></p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"labels":{"k8s-app":"kubernetes-dashboard"}
,"name":"kubernetes-dashboard","namespace":"kube-system"},"spec":{"ports":[{"port":443,"targetPort":8443}],"select
or":{"k8s-app":"kubernetes-dashboard"}}}
  creationTimestamp: null
  labels:
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
  selfLink: /api/v1/namespaces/kube-system/services/kubernetes-dashboard
spec:
  externalTrafficPolicy: Cluster
  ports:
  - port: 443
    protocol: TCP
    targetPort: 8443
  selector:
    k8s-app: kubernetes-dashboard
  sessionAffinity: None
  type: NodePort
status:
  loadBalancer: {}
</code></pre>

<p>Kubernetes then allocates some port from range (30000-32767) and each node should proxy that port to your target service.</p>

<p>You can now check <code>kubernetes-dashboard</code> and look for the port reference:</p>

<p><code>kubectl describe svc kubernetes-dashboard -n kube-system</code></p>

<pre><code>Name:                     kubernetes-dashboard
Namespace:                kube-system
Labels:                   k8s-app=kubernetes-dashboard
Annotations:              kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"Service","me
tadata":{"annotations":{},"labels":{"k8s-app":"kubernetes-dashboard"},"name":"kubernetes-dashboard","namespace":..
.
Selector:                 k8s-app=kubernetes-dashboard
Type:                     NodePort
IP:                       XX.XX.XX.XX
Port:                     &lt;unset&gt;  443/TCP
TargetPort:               8443/TCP
NodePort:                 &lt;unset&gt;  31605/TCP
Endpoints:                XX.XX.XX.XX:8443
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   &lt;none&gt;
</code></pre>

<p>Finally, you can check whether <code>kubernetes-dashboard</code> would be accessible:</p>

<p><code>curl -k https://localhost:31605</code></p>

<p>If you consider to secure a way to talk to your Kubernetes dashboard via <code>Bearer token</code> then take a look at this <a href="https://github.com/kubernetes/dashboard/wiki/Creating-sample-user" rel="nofollow noreferrer">guideline</a>.  </p>
