ingress-nginx安装

详见ingress-nginx Github安装指南。

裸机安装

下载对应版本的所有yaml文件(仅针对tag:nginx-0.30.0):configmap.yamlmandatory.yamlnamespace.yamlrbac.yamlservice-nodeport.yamlwith-rbac.yaml,下载路径分别为:

wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/mandatory.yaml
wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/namespace.yaml
wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/configmap.yaml
wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/rbac.yaml
wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/with-rbac.yaml
wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/provider/baremetal/service-nodeport.yaml

在下载过程中因为是github的缘故,所以可能部分资源下载很慢,在此我在gitee上导入了该仓库,下载即可,也可以访问我在gitee上的仓库,进行其他版本的安装部署:gitee上的ingress-nginx

wget https://gitee.com/LemonLzy/lemonlzy-ingress-nginx/raw/nginx-0.30.0/deploy/static/mandatory.yaml
wget https://gitee.com/LemonLzy/lemonlzy-ingress-nginx/raw/nginx-0.30.0/deploy/static/namespace.yaml
wget https://gitee.com/LemonLzy/lemonlzy-ingress-nginx/raw/nginx-0.30.0/deploy/static/configmap.yaml
wget https://gitee.com/LemonLzy/lemonlzy-ingress-nginx/raw/nginx-0.30.0/deploy/static/rbac.yaml
wget https://gitee.com/LemonLzy/lemonlzy-ingress-nginx/raw/nginx-0.30.0/deploy/static/with-rbac.yaml
wget https://gitee.com/LemonLzy/lemonlzy-ingress-nginx/raw/nginx-0.30.0/deploy/static/provider/baremetal/service-nodeport.yaml

部署当前目录下的所有应用:

[root@node-0 ingress]# kubectl apply -f ./
namespace/ingress-nginx created
configmap/nginx-configuration created
configmap/tcp-services created
configmap/udp-services created
serviceaccount/nginx-ingress-serviceaccount created
clusterrole.rbac.authorization.k8s.io/nginx-ingress-clusterrole created
role.rbac.authorization.k8s.io/nginx-ingress-role created
rolebinding.rbac.authorization.k8s.io/nginx-ingress-role-nisa-binding created
clusterrolebinding.rbac.authorization.k8s.io/nginx-ingress-clusterrole-nisa-binding created
deployment.apps/nginx-ingress-controller created
limitrange/ingress-nginx created
namespace/ingress-nginx unchanged
serviceaccount/nginx-ingress-serviceaccount unchanged
clusterrole.rbac.authorization.k8s.io/nginx-ingress-clusterrole unchanged
role.rbac.authorization.k8s.io/nginx-ingress-role unchanged
rolebinding.rbac.authorization.k8s.io/nginx-ingress-role-nisa-binding unchanged
clusterrolebinding.rbac.authorization.k8s.io/nginx-ingress-clusterrole-nisa-binding unchanged
service/ingress-nginx created
deployment.apps/nginx-ingress-controller configured

验证安装的版本

为了验证正在运行的ingress controller的版本,所以在pod内执行nginx-ingress-controller version命令来查看已安装版本:

[root@node-0 ingress]# POD_NAMESPACE=ingress-nginx
[root@node-0 ingress]# POD_NAME=$(kubectl get pods -n $POD_NAMESPACE -l app.kubernetes.io/name=ingress-nginx -o jsonpath='{.items[0].metadata.name}')
[root@node-0 ingress]# kubectl exec -it $POD_NAME -n $POD_NAMESPACE -- /nginx-ingress-controller --version
-------------------------------------------------------------------------------
NGINX Ingress controller
  Release:       0.30.0
  Build:         git-7e65b90c4
  Repository:    https://github.com/kubernetes/ingress-nginx
  nginx version: nginx/1.17.8

-------------------------------------------------------------------------------

欢迎访问我的个人博客:Lemon - 万事顺遂

你可能感兴趣的:(ingress-nginx安装)