如何在AWS EKS上部署安装nginx ingress controller

Ingress Controller

Ingress Controller 通常是一个负载均衡器,用于将外部流量路由到您的 Kubernetes 集群,并负责 L4-L7 网络服务

Ingress controller 仅覆盖 L7 流量,而入口重新路由 HTTP 和 HTTPS 流量

Type of Ingress Controllers

Cloud-Based Ingress Controllers

  • AKS Application Gateway Ingress Controller
  • AWS ALB Ingress Controller
  • GCP GLBC/GCE-Ingress Controller
     

常用的开源的Ingress Controllers

  • Voyager: HAProxy based Ingress Controller from AppsCode
  • F5: Supports F5's BIG-IP Container Ingress Services
  • ·HAProxy: Community-driven HAProxy Ingress Controller as well as enterprise offerinfrom HAProxy Tech
  • Istio: Ingress Gateway for Istio-enabled clusters
  • Kong: Nginx-based API gateway with community or enterprise options from KongHọ 
  • NGINX: Official Ingress for NGINX and NGINX Plus
  • ·Skipper: HTTP router and reverse proxy from Zalando

应用架构

如何在AWS EKS上部署安装nginx ingress controller_第1张图片
 

 部署EKS集群

  1. 将如下内容存储为eks_cluster_with_exists_vpc.yaml

# creat eks cluster using an existing vpc, it also creat an spot manage group 

---

apiVersion: eksctl.io/v1alpha5

kind: ClusterConfig

metadata:

  name: test

  region: us-east-1 # set the cluster resource region

  version: "1.22"   # set the eks version

vpc:

  id: "vpc-0ec5f2d50b034e416" #replace your vpc id

  cidr: "10.0.0.0/16"  #must match CIDR used by the given VPC

  subnets:

    public:

      us-east-1a:

        id: "subnet-047f29ab2ae67f3f5"

        cidr: "10.0.0.0/20"

      us-east-1b:

        id: "subnet-0cb75eb1aa880ce79"

        cidr: "10.0.16.0/20"

      us-east-1c:

        id: "subnet-095f4ab72620fbab0"

        cidr: "10.0.32.0/20"

managedNodeGroups:

- name: managed-nodes

  labels:

    role: managed-nodes

  instanceType: t3.small

  minSize: 3

  desiredCapacity: 3

  maxSize: 4

  volumeSize: 30

  spot: true

  privateNetworking: false

  ssh:

    publicKeyName: test

2. 使用如下命令创建EKS集群

eksctl create cluster -f eks_cluster_with_exists_vpc.yaml        

 3. 集群创建好之后使用如下命令查看节点

kubectl get nodes

部署nginx ingress Controller

直接使用helm一键部署

helm upgrade --install ingress-nginx ingress-nginx \ --repo https://kubernetes.github.io/ingress-nginx \ --namespace ingress-nginx --create-namespace

若使用kubectl工具则可以使用如下命令进行安装部署

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.7.0/deploy/static/provider/cloud/deploy.yaml

重要说明:部署nginx ingress controller记得要留意兼容性版本

如何在AWS EKS上部署安装nginx ingress controller_第2张图片

 

参考资料

1. https://kubernetes.github.io/ingress-nginx/deploy/#quick-start

 2. https://github.com/kubernetes/ingress-nginx

你可能感兴趣的:(aws,nginx,运维)