Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93eb29f

Browse files
author
dengwei
committed
update
1 parent 2234565 commit 93eb29f

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

_posts/2018-8-21-k8s 1.11 阿里云安装.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -475,33 +475,38 @@ kubectl get svc --namespace kube-system
475475
``` bash
476476
wget 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
500479
image: registry.cn-shenzhen.aliyuncs.com/common-images/defaultbackend:1.4
501480

502481
kubectl 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
507512
wget https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml

0 commit comments

Comments
 (0)