• 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.简单测试下

  • 相关阅读:
    使用android-ndk官方ndkbuild例子
    小米8如何root
    Ubuntu点击dash home就崩溃
    Python自定义排序
    adb命令
    sqoop数据导出导入命令
    Docker命令详解
    如何输出第二列相同的行
    如何使用Xmanager及VNC登录远程桌面
    搭建GoldenGate的单向复制环境
  • 原文地址:https://www.cnblogs.com/Applogize/p/14978375.html
Copyright © 2020-2023  润新知