Wie zugreifen/setzen kubernetes-dashboard-service außerhalb eines Clusters?

Habe ich die folgenden Dienste:

ubuntu@master:~$ kubectl get services --all-namespaces
NAMESPACE     NAME                   CLUSTER-IP      EXTERNAL-IP   PORT(S)         AGE
default       kubernetes             100.64.0.1      <none>        443/TCP         48m
kube-system   kube-dns               100.64.0.10     <none>        53/UDP,53/TCP   47m
kube-system   kubernetes-dashboard   100.70.83.136   <nodes>       80/TCP          47m

Ich bin versucht, Zugriff auf kubernetes-dashboard. Die folgende Antwort erscheint angemessen, unter Berücksichtigung der curl ist nicht ein browser.

ubuntu@master:~$ curl 100.70.83.136
 <!doctype html> <html ng-app="kubernetesDashboard"> <head> <meta charset="utf-8"> <title>Kubernetes Dashboard</title> <link  type="image/png" href="assets/images/kubernetes-logo.png"> <meta name="viewport" content="width=device-width"> <link  href="static/vendor.36bb79bb.css"> <link  href="static/app.d2318302.css"> </head> <body> <!--[if lt IE 10]>
      <p class="browsehappy">You are using an <strong>outdated</strong> browser.
      Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your
      experience.</p>
    <![endif]--> <kd-chrome layout="column" layout-fill> </kd-chrome> <script src="static/vendor.633c6c7a.js"></script> <script src="api/appConfig.json"></script> <script src="static/app.9ed974b1.js"></script> </body> </html> 

Laut der Dokumentation ist der richtige access point ist https://localhost/ui. So, ich versuche es und erhalten etwas beunruhigendes Ergebnis. Ist es erwarteten Antwort?

ubuntu@master:~$ curl https://localhost/ui
curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

Versucht das gleiche, ohne Zertifikat-Validierung. Für LOCKE ist es vielleicht OK sein. aber ich habe das gleiche in einem browser, die Verbindung, obwohl port forwarding via vagrant forwarded_port option.

ubuntu@master:~$ curl -k https://localhost/ui
Unauthorized

Was mache ich falsch? und wie sicher kann ich den Zugriff auf die Benutzeroberfläche? Derzeit antwortet er mit Unerlaubten.

Den docs für das Armaturenbrett sagen, das Kennwort wird in der Konfiguration:

ubuntu@master:~$ kubectl config view
apiVersion: v1
clusters: []
contexts: []
current-context: ""
kind: Config
preferences: {}
users: []

aber es scheint, ich habe nichts... Ist es das erwartete Verhalten? Wie kann ich das autorisieren mit dem UI?

  • Haben Sie gesehen, stackoverflow.com/q/34306082/759019 ?
  • Ich habe gesehen, ähnlich. Überall habe ich überprüft, entweder gibt es keine konkrete Antwort (Anweisungen handeln), oder es ist nicht kompatibel mit 1.4.0 kubernetes oder ich bin fehlen einige grundlegende Dinge.
InformationsquelleAutor Andrew | 2016-10-05
Schreibe einen Kommentar