File tree Expand file tree Collapse file tree 1 file changed +26
-21
lines changed Expand file tree Collapse file tree 1 file changed +26
-21
lines changed Original file line number Diff line number Diff line change @@ -475,33 +475,38 @@ kubectl get svc --namespace kube-system
475475``` bash
476476wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml
477477
478- # 添加 hostNetwork: true
479- apiVersion: extensions/v1beta1
480- kind: Deployment
481- metadata:
482- name: nginx-ingress-controller
483- namespace: ingress-nginx
484- spec:
485- replicas: 1
486- selector:
487- matchLabels:
488- app: ingress-nginx
489- template:
490- metadata:
491- labels:
492- app: ingress-nginx
493- annotations:
494- prometheus.io/port: ' 10254'
495- prometheus.io/scrape: ' true'
496- spec:
497- hostNetwork: true
498-
499478# 修改 default-http-backend 的images
500479image: registry.cn-shenzhen.aliyuncs.com/common-images/defaultbackend:1.4
501480
502481kubectl apply -f mandatory.yaml
503482
483+ # 添加service开放 30080与30433端口
484+ cat> ingress-nginx-service.yaml<< EOF
485+ apiVersion: v1
486+ kind: Service
487+ metadata:
488+ name: ingress-nginx
489+ namespace: ingress-nginx
490+ spec:
491+ type: NodePort
492+ ports:
493+ - name: http
494+ port: 80
495+ targetPort: 80
496+ nodePort: 30080
497+ protocol: TCP
498+ - name: https
499+ port: 443
500+ targetPort: 443
501+ protocol: TCP
502+ nodePort: 30443
503+ selector:
504+ app: ingress-nginx
505+ ~
506+ EOF
507+ kubectl apply -f ingress-nginx-service.yaml
504508```
509+ 在阿里云新建外网loadblancer,配制tcp的80和443中转到30080和30433
505510## 安装dashboard
506511``` bash
507512wget https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
You can’t perform that action at this time.
0 commit comments