zoukankan      html  css  js  c++  java
  • ingress-nginx安装

    1.通过helm安装

    1.添加仓库
    [root@master01 ~]# helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
    2.更新
    [root@master01 ~]# helm repo update
    3.拉取ingress
    [root@master01 ~]# mkdir -p ingress && cd ingress && helm fetch ingress-nginx/ingress-nginx
    4.解压
    [root@master01 ~]# tar -xvf ingress-nginx-3.15.2.tgz
    

    2.更改模板

    [root@master01 ingress-nginx]# pwd
    /root/ingress/ingress-nginx
    [root@master01 ingress-nginx]# cat values-prod.yaml 
    controller:
      name: controller
      image:
        repository: cnych/ingress-nginx
        tag: "v0.41.2"
        digest: 
    
      dnsPolicy: ClusterFirstWithHostNet
       
      hostNetwork: true
    
      publishService:  # hostNetwork 模式下设置为false,通过节点IP地址上报ingress status数据
        enabled: false
    
      kind: DaemonSet
    
      nodeSelector: 
        kubernetes.io/os: linux
        ingress: "true"
      service:  # HostNetwork 模式不需要创建service
        enabled: false
    
    defaultBackend:
      enabled: true
      name: defaultbackend
      image:
        repository: cnych/ingress-nginx-defaultbackend
        tag: "1.5"
    

    3.创建命名空间,安装ingress-nginx

    1.创建命名空间
    [root@master01 ~]# kubectl create ns ingress-nginx 
    2.指定节点打标签,指定调度
    [root@master01 ~]#  kubectl label node node01 ingress=true
    3.安装ingress
    [root@master01 ingress]# pwd
    /root/ingress
    [root@master01 ~]# helm install --namespace ingress-nginx ingress-nginx ./ingress-nginx -f ./ingress-nginx/values-prod.yaml
    4.查看ingress pod是否成功
    [root@master01 ingress]# kubectl get pod -n ingress-nginx  -owide
    NAME                                            READY   STATUS    RESTARTS   AGE   IP              NODE     NOMINATED NODE   READINESS GATES
    ingress-nginx-controller-nzl8h                  1/1     Running   0          16m   192.168.0.121   node01   <none>           <none>
    ingress-nginx-defaultbackend-796bdb7766-p4qj8   1/1     Running   0          16m   10.244.2.158    node02   <none>           <none>
    [root@master01 ingress]# kubectl get svc -n ingress-nginx 
    NAME                                 TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
    ingress-nginx-controller-admission   ClusterIP   10.100.115.15   <none>        443/TCP   17m
    ingress-nginx-defaultbackend         ClusterIP   10.108.152.89   <none>        80/TCP    17m
    

    4.简单测试下

  • 相关阅读:
    互联网、云大数据相关书籍推荐
    育儿、教育书籍推荐
    MySQL客户端工具的选择
    解决Windows10或者其他版本Windows Update报错的问题
    启动Myeclipse报错“Failed to create the Java Virtual Machine”的解决办法
    mysql的日期存储字段比较int,datetime,timestamp区别
    nginx增加ssl服务方法
    mysql导入出现MySQL Error 1153
    mysql忘记密码修改方法
    清空本地ssh记录数据,ssh: connect to host Ip port 22: Connection refused
  • 原文地址:https://www.cnblogs.com/Applogize/p/14978375.html
Copyright © 2011-2022 走看看