系统相关
首页 > 系统相关> > Ingress-nginx安装部署

Ingress-nginx安装部署

作者:互联网

Ingress-nginx安装部署

1.部署文件下载

# 下载地址
https://github.com/kubernetes/ingress-nginx/tree/nginx-0.30.0

# configmap.yaml 存储配置信息,key/value值
# namespace.yaml 建命名空间
# mandatory.yaml 包含部署deploy相关所有资源(configmap.yaml,namespace.yaml,rbac.yaml,with-rbac.yaml)
# rbac.yaml rbac授权配置,创建Ingress需要使用的
# ServiceAccount,ClusterRole,Role,RoleBinding,ClusterRoleBinding
# with-rbac.yaml 能使用rbac授权的deploy配置,用于构建ingress-controller

https://upload-images.jianshu.io/upload_images/2915374-c5c16b994b4fd71c.png?imageMogr2/auto-orient/strip|imageView2/2/w/661/format/webp
2.service文件下载

# 下载地址
https://github.com/kubernetes/ingress-nginx/tree/nginx-0.30.0

在这里插入图片描述
3.修改mandatory.yaml的镜像源

# 将镜像源 quay.io 替换成 quay.azk8s.cn
sed -i 's/quay.io/quay.azk8s.cn/' mandatory.yaml

4.部署ingress-nginx-controller

kubectl apply -f mandatory.yaml

5.部署ingress-nginx-sevice

kubectl apply -f service-nodeport.yaml

6.部署ingress-nginx

vi ingress-hr-web.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-hr-web
  namespace: default
  annotations: 
    kubernets.io/ingress.class: "nginx"
spec:
  rules:
  - host: hr-web.liuyu.com
    http:
      paths:
      - path: 
        backend:
          serviceName: hr-web-svc
          servicePort: 8999

标签:web,Ingress,mandatory,yaml,部署,ingress,rbac,nginx
来源: https://blog.csdn.net/weixin_41083358/article/details/114831714