內(nèi)容要點(diǎn):
專注于為中小企業(yè)提供成都網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)福田免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了1000+企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過(guò)網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。1、環(huán)境介紹
2、web界面部署
一、環(huán)境介紹:
1、此篇作為k8s群集部署的最后一步,前幾步博客地址:
kubernetes二進(jìn)制集群部署一——etcd存儲(chǔ)組件、flannel網(wǎng)絡(luò)組件部署:
kubernetes二進(jìn)制集群部署二——單master集群部署+多master群及部署:
kubernetes二進(jìn)制集群部署三——負(fù)載均衡調(diào)度器部署:
2、dashborad 官方文件地址:https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dashboard
二、web界面部署:
?在?master01上操作: //創(chuàng)建?dashborad(控制面板)工作目錄: [root@localhost?k8s]#?mkdir?dashboard //拷貝官方文件(總共6個(gè)): [root@localhost?dashboard]#?ls?? dashboard-configmap.yaml???dashboard-rbac.yaml????dashboard-service.yaml dashboard-controller.yaml??dashboard-secret.yaml??k8s-admin.yaml //加載、創(chuàng)建所有的文件: [root@localhost?dashboard]#?kubectl?create?-f?dashboard-rbac.yaml role.rbac.authorization.k8s.io/kubernetes-dashboard-minimal?created rolebinding.rbac.authorization.k8s.io/kubernetes-dashboard-minimal?created [root@localhost?dashboard]#?kubectl?create?-f?dashboard-secret.yaml secret/kubernetes-dashboard-certs?created secret/kubernetes-dashboard-key-holder?created [root@localhost?dashboard]#?kubectl?create?-f?dashboard-configmap.yaml configmap/kubernetes-dashboard-settings?created [root@localhost?dashboard]#?kubectl?create?-f?dashboard-controller.yaml serviceaccount/kubernetes-dashboard?created deployment.apps/kubernetes-dashboard?created [root@localhost?dashboard]#?kubectl?create?-f?dashboard-service.yaml service/kubernetes-dashboard?created //完成創(chuàng)建后查看創(chuàng)建在指定的?kube-system命名空間下: [root@localhost?dashboard]#?kubectl?get?pods?-n?kube-system NAME????????????????????????????????????READY???STATUS????RESTARTS???AGE kubernetes-dashboard-65f974f565-rs2h5???1/1?????Running???0??????????4m23s //查看如何訪問(wèn): [root@localhost?dashboard]#?kubectl?get?pods,svc?-n?kube-system NAME????????????????????????????????????????READY???STATUS????RESTARTS???AGE pod/kubernetes-dashboard-65f974f565-x9vrg???1/1?????Running???0??????????8m32s NAME???????????????????????????TYPE???????CLUSTER-IP???EXTERNAL-IP???PORT(S)?????????AGE service/kubernetes-dashboard???NodePort???10.0.0.110???<none>????????443:30001/TCP???8m18s
此時(shí),我們用谷歌瀏覽器訪問(wèn):https://192.168.109.131:30001/
原因:沒(méi)有自簽證書(shū)
如何解決:寫(xiě)一個(gè)證書(shū)
在?master01上: [root@localhost?dashboard]#?vim?dashboard-cert.sh cat?>?dashboard-csr.json?<<EOF { ???"CN":?"Dashboard", ???"hosts":?[], ???"key":?{ ???????"algo":?"rsa", ???????"size":?2048 ???}, ???"names":?[ ???????{ ???????????"C":?"CN", ???????????"L":?"BeiJing", ???????????"ST":?"BeiJing" ???????} ???] } EOF K8S_CA=$1 cfssl?gencert?-ca=$K8S_CA/ca.pem?-ca-key=$K8S_CA/ca-key.pem?-config=$K8S_CA/ca-config.json?-profile=kubernetes?dashboard-csr.json?|?cfssljson?-bare?dashboard kubectl?delete?secret?kubernetes-dashboard-certs?-n?kube-system kubectl?create?secret?generic?kubernetes-dashboard-certs?--from-file=./?-n?kube-system //接下來(lái),就是生成證書(shū): [root@localhost?dashboard]#?bash?dashboard-cert.sh?/root/k8s/k8s-cert/ [root@localhost?dashboard]#?vim?dashboard-controller.yaml 在?args目錄下,添加證書(shū)的路徑: ... (省略內(nèi)容) ... args: ??????????#?PLATFORM-SPECIFIC?ARGS?HERE ??????????-?--auto-generate-certificates ??????????-?--tls-key-file=dashboard-key.pem ??????????-?--tls-cert-file=dashboard.pem ... (省略內(nèi)容) ...
//接下來(lái),進(jìn)行重新部署: [root@localhost?dashboard]#??kubectl?apply?-f?dashboard-controller.yaml? Warning:?kubectl?apply?should?be?used?on?resource?created?by?either?kubectl?create?--save-config?or?kubectl?apply serviceaccount/kubernetes-dashboard?configured Warning:?kubectl?apply?should?be?used?on?resource?created?by?either?kubectl?create?--save-config?or?kubectl?apply deployment.apps/kubernetes-dashboard?configured
然后,我們?cè)俅卧L問(wèn)剛剛的那個(gè)網(wǎng)站:https://192.168.220.136:30001/
選擇接受風(fēng)險(xiǎn)并繼續(xù),選擇令牌:
接下來(lái),我們要做的就是生成令牌,在瀏覽器中填入即可:
//生成令牌: [root@localhost?dashboard]#?kubectl?create?-f?k8s-admin.yaml //保存: [root@localhost?dashboard]#?kubectl?get?secret?-n?kube-system NAME???????????????????????????????TYPE??????????????????????????????????DATA???AGE dashboard-admin-token-829rp????????kubernetes.io/service-account-token???3??????9s default-token-rsrxp????????????????kubernetes.io/service-account-token???3??????3h20m kubernetes-dashboard-certs?????????Opaque????????????????????????????????11?????12m kubernetes-dashboard-key-holder????Opaque????????????????????????????????2??????119m kubernetes-dashboard-token-6rdlf???kubernetes.io/service-account-token???3??????118m //查看令牌: [root@localhost?dashboard]#?kubectl?describe?secret?dashboard-admin-token-829rp?-n?kube-system
而下面,就是生成令牌的一段密文:
我們把這段密文復(fù)制,然后粘貼到,瀏覽器上面的空白處即可:
然后,我們可以在控制面板上,管理我們的各個(gè)組件,查看各類信息和概況等等,非常的方便
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
本文名稱:kubernetes二進(jìn)制集群部署四——部署web界面-創(chuàng)新互聯(lián)
網(wǎng)頁(yè)路徑:http://jinyejixie.com/article48/dipehp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站收錄、小程序開(kāi)發(fā)、網(wǎng)站策劃、網(wǎng)站制作、自適應(yīng)網(wǎng)站、電子商務(wù)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容