您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 商业计划书 > k8s笔记010-dashboard部署
k8s笔记010-dashboard部署1.下载kubernetes-dashboard镜像并放到私有仓库[root@harbor~]#dockerpullbestwu/kubernetes-dashboard-amd64:v1.6.3[root@harbor~]#dockertagbestwu/kubernetes-dashboard-amd64:v1.6.3192.168.1.170/tzg-[root@harbor~]#dockerpush192.168.1.170/tzg-prod/kubernetes-dashboard-amd64:v1.6.32.定义Deployment和Service[root@k8s-master01dashboard]#vimkubernetes-dashboard-no-rbac.yamlkind:DeploymentapiVersion:extensions/v1beta1metadata:labels:k8s-app:kubernetes-dashboardname:kubernetes-dashboardnamespace:kube-systemspec:replicas:1revisionHistoryLimit:10selector:matchLabels:k8s-app:kubernetes-dashboardtemplate:metadata:labels:k8s-app:kubernetes-dashboardannotations:scheduler.alpha.kubernetes.io/tolerations:|[{key:dedicated,operator:Equal,value:master,effect:NoSchedule}]spec:containers:-name:kubernetes-dashboardimage:192.168.1.170/tzg-prod/kubernetes-dashboard-amd64:v1.6.3ports:-containerPort:9090protocol:TCPargs:livenessProbe:httpGet:path:/port:9090initialDelaySeconds:30timeoutSeconds:30---kind:ServiceapiVersion:v1metadata:labels:k8s-app:kubernetes-dashboardname:kubernetes-dashboardnamespace:kube-systemspec:ports:-port:80targetPort:9090selector:k8s-app:kubernetes-dashboard3.创建Deployment和Service[root@k8s-master01dashboard]#kubectlcreate-f./kubernetes-dashboard-no-rbac.yamldeploymentkubernetes-dashboardcreatedservicekubernetes-dashboardcreated4.查看创建的对象[root@k8s-master01dashboard]#kubectlgetdeploykubernetes-dashboard--namespace=kube-systemNAMEDESIREDCURRENTUP-TO-DATEAVAILABLEAGEkubernetes-dashboard111120s[root@k8s-master01dashboard]#kubectlgetpods--namespace=kube-systemNAMEREADYSTATUSRESTARTSAGEkube-dns-1869960205-tng143/3Running121dkubernetes-dashboard-245946942-4rj6n1/1Running057s[root@k8s-master01dashboard]#kubectlgetsvc--namespace=kube-systemNAMECLUSTER-IPEXTERNAL-IPPORT(S)AGEkube-dns169.169.0.253/UDP,53/TCP1dkubernetes-dashboard169.169.11.15880/TCP3m5.开放kubernetesapiserver代理[root@k8s-master02~]#kubectlproxy--address=172.18.0.200--port=10000--accept-hosts='^172.18.0.1,^172.18.0.2'Startingtoserveon172.18.0.200:100006.通过浏览器访问访问会跳转到!/overview?namespace=default这里还未实现用户登录认证,可以通过设置apiserver的启动参数--basic-auth来实现
本文标题:k8s笔记010-dashboard部署
链接地址:https://www.777doc.com/doc-4836192 .html