云原生

kubeadm(四)——安装ingress-nginx

2019-07-24  本文已影响2人  印随2018

CentOS Linux release 7.6.1810 (Core)

一、创建ingress基础配置和Pod

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml

二、创建Service

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/baremetal/service-nodeport.yaml

三、查看安装过程

kubectl get pods --all-namespaces -l app.kubernetes.io/name=ingress-nginx --watch

四、验证是否安装成功

[root@master ~]# kubectl get svc --all-namespaces
NAMESPACE       NAME            TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
default         kubernetes      ClusterIP   10.96.0.1       <none>        443/TCP                      18m
ingress-nginx   ingress-nginx   NodePort    10.100.80.254   <none>        80:30099/TCP,443:30354/TCP   4m30s
kube-system     kube-dns        ClusterIP   10.96.0.10      <none>        53/UDP,53/TCP,9153/TCP       17m
[root@master ~]# curl http://10.100.80.254:80
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>openresty/1.15.8.1</center>
</body>
</html>
[root@master ~]# curl -k https://10.100.80.254:443
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>openresty/1.15.8.1</center>
</body>
</html>

Ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/deploy/index.md

上一篇 下一篇

猜你喜欢

热点阅读