gpt4 book ai didi

amazon-ec2 - kubernetes 入口 aws 部署负载均衡器待处理

转载 作者:行者123 更新时间:2023-12-02 12:17:02 25 4
gpt4 key购买 nike

简而言之,这些是我已经完成的步骤:

  • 上线 2 t3 - small aws 中的实例,用 key 预先标记kubernetes.io/cluster/<cluster-name>和值(value)member .
  • 用相同的标签标记新的安全并打开所有提到的端口
    这里 -
    https://kubernetes.io/docs/setup/independent/install-kubeadm/#check-required-ports
  • 已更改 hostnamecurl
    http://169.254.169.254/latest/meta-data/local-hostname
    的输出并经过验证
    hostnamectl
  • 重启
  • 配置awshttps://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html
  • 已创建 IAM role具有完整 ( "*" ) 权限并分配给 EC2
    实例。
  • 已安装 kubelet kubeadm kubectl使用 apt-get
  • 已创建 /etc/default/kubelet有内容KUBELET_EXTRA_ARGS=--cloud-provider=aws
  • kubeadm init --pod-network-cidr=10.244.0.0/16在一个实例上
    并使用输出到 kubeadm join ...其他节点。
  • 已安装 Helm .
  • 已安装 ingress controller使用默认后端。

  • 以前我已经尝试过上述步骤,但是,根据 kubernetes.github.io 上的说明安装了入口。 .两者都以相同的状态结束, EXTERNAL-IP<pending> .

    当前状态是:
    kubectl get pods --all-namespaces -o wide
    NAMESPACE     NAME                                                                   IP              NODE                                           
    ingress ingress-nginx-ingress-controller-77d989fb4d-qz4f5 10.244.1.13 ip-YYY-YY-Y-YYY.ap-south-1.compute.internal
    ingress ingress-nginx-ingress-default-backend-7f7bf55777-dhj75 10.244.1.12 ip-YYY-YY-Y-YYY.ap-south-1.compute.internal
    kube-system coredns-86c58d9df4-bklt8 10.244.1.14 ip-YYY-YY-Y-YYY.ap-south-1.compute.internal
    kube-system coredns-86c58d9df4-ftn8q 10.244.1.16 ip-YYY-YY-Y-YYY.ap-south-1.compute.internal
    kube-system etcd-ip-XXX-XX-XX-XXX.ap-south-1.compute.internal 172.31.12.119 ip-XXX-XX-XX-XXX.ap-south-1.compute.internal
    kube-system kube-apiserver-ip-XXX-XX-XX-XXX.ap-south-1.compute.internal 172.31.12.119 ip-XXX-XX-XX-XXX.ap-south-1.compute.internal
    kube-system kube-controller-manager-ip-XXX-XX-XX-XXX.ap-south-1.compute.internal 172.31.12.119 ip-XXX-XX-XX-XXX.ap-south-1.compute.internal
    kube-system kube-flannel-ds-amd64-87k8p 172.31.12.119 ip-XXX-XX-XX-XXX.ap-south-1.compute.internal
    kube-system kube-flannel-ds-amd64-f4wft 172.31.3.106 ip-YYY-YY-Y-YYY.ap-south-1.compute.internal
    kube-system kube-proxy-79cp2 172.31.3.106 ip-YYY-YY-Y-YYY.ap-south-1.compute.internal
    kube-system kube-proxy-sv7md 172.31.12.119 ip-XXX-XX-XX-XXX.ap-south-1.compute.internal
    kube-system kube-scheduler-ip-XXX-XX-XX-XXX.ap-south-1.compute.internal 172.31.12.119 ip-XXX-XX-XX-XXX.ap-south-1.compute.internal
    kube-system tiller-deploy-5b7c66d59c-fgwcp 10.244.1.15 ip-YYY-YY-Y-YYY.ap-south-1.compute.internal
    kubectl get svc --all-namespaces -o wide
    NAMESPACE     NAME                                    TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE   SELECTOR
    default kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 73m <none>
    ingress ingress-nginx-ingress-controller LoadBalancer 10.97.167.197 <pending> 80:32722/TCP,443:30374/TCP 59m app=nginx-ingress,component=controller,release=ingress
    ingress ingress-nginx-ingress-default-backend ClusterIP 10.109.198.179 <none> 80/TCP 59m app=nginx-ingress,component=default-backend,release=ingress
    kube-system kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP 73m k8s-app=kube-dns
    kube-system tiller-deploy ClusterIP 10.96.216.119 <none> 44134/TCP 67m app=helm,name=tiller
    kubectl describe service -n ingress ingress-nginx-ingress-controller
    Name: ingress-nginx-ingress-controller
    Namespace: ingress
    Labels: app=nginx-ingress
    chart=nginx-ingress-1.4.0
    component=controller
    heritage=Tiller
    release=ingress
    Annotations: service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: *
    Selector: app=nginx-ingress,component=controller,release=ingress
    Type: LoadBalancer
    IP: 10.104.55.18
    Port: http 80/TCP
    TargetPort: http/TCP
    NodePort: http 32318/TCP
    Endpoints: 10.244.1.20:80
    Port: https 443/TCP
    TargetPort: https/TCP
    NodePort: https 32560/TCP
    Endpoints: 10.244.1.20:443
    Session Affinity: None
    External Traffic Policy: Cluster
    Events: <none>

    附加的 IAM 角色内联策略
    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Effect": "Allow",
    "Action": "*",
    "Resource": "*"
    }
    ]
    }

    kubectl 获取节点 -o 宽
    NAME                                           STATUS   ROLES    AGE     VERSION   INTERNAL-IP     EXTERNAL-IP     OS-IMAGE             KERNEL-VERSION   CONTAINER-RUNTIME
    ip-172-31-12-119.ap-south-1.compute.internal Ready master 6d19h v1.13.4 172.31.12.119 XX.XXX.XXX.XX Ubuntu 16.04.5 LTS 4.4.0-1077-aws docker://18.6.3
    ip-172-31-3-106.ap-south-1.compute.internal Ready <none> 6d19h v1.13.4 172.31.3.106 XX.XXX.XX.XXX Ubuntu 16.04.5 LTS 4.4.0-1077-aws docker://18.6.3

    有人可以指出我在这里遗漏了什么,因为互联网上到处都是 Classic ELB会自动部署吗?

    最佳答案

    对于 AWS ELB(经典类型),您必须

  • 明确指定 --cloud-provider=aws在 kube 服务 list 中
    位于/etc/kubernetes/manifests在主节点上:
    kube-controller-manager.yaml
    kube-apiserver.yaml
  • 重启服务:
    sudo systemctl daemon-reloadsudo systemctl restart kubelet


  • 与其他命令一起,根据需要在底部或顶部添加。结果应该类似于:

    在 kube-controller-manager.yaml
    spec:
    containers:
    - command:
    - kube-controller-manager
    - --cloud-provider=aws

    在 kube-apiserver.yaml
    spec:
    containers:
    - command:
    - kube-apiserver
    - --cloud-provider=aws

    关于amazon-ec2 - kubernetes 入口 aws 部署负载均衡器待处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55342907/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com