如何在 Istio 中设置 AWS ALB 而不是 ELB?
How to set AWS ALB instead of ELB in Istio?
我正在尝试在 Kubernetes 中设置 ALB 负载均衡器而不是默认的 ELB 负载均衡器 AWS.The 负载均衡器必须连接到 istio ingressgateway.I 寻找解决方案但只找到 one。
但是提到的 istio 版本是 V1 并且 istio 中有很多变化 now.I 试图将图表中的服务类型更改为节点端口(根据博客)但该服务仍然作为负载均衡器出现。
有人可以提到如何为 istio ingressgateway 配置 ALB 的步骤吗?
感谢阅读
Step 1 : Change istioingresssgateway service type as nodeport
Step 2 : Install ALB ingress controller
Step 3 : Write ingress.yaml for istioingressgateway as follows:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
namespace: istio-system
name: ingress
labels:
app: ingress
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/subnets: <subnet1>,<subnet2>
spec:
rules:
- http:
paths:
- path: /*
backend:
serviceName: istio-ingressgateway
servicePort: 80
alb.ingress.kubernetes.io/subnets annotation can be avoided if you labelled subnet of vpc with :
kubernetes.io/cluster/: owned
kubernetes.io/role/internal-elb: 1 (for internal ELB)
kubernetes.io/role/elb: 1 (for external ELB)
否则您可以提供两个子网值,每个子网应位于上述 yaml 中的不同可用区
It worked in Istio 1.6
我可以通过 tibin_tomy 在 Istio 1.7.4 上为我工作来确认解决方案。此外,我在第 1 步中使用了 ClusterIP 而不是 NodePort。
Step1 - 将 istioingresssgateway 服务类型更改为 ClusterIP(使用 IstioOperator 安装 Istio):
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: istio
spec:
profile: default
components:
ingressGateways:
- name: istio-ingressgateway
k8s:
service:
type: ClusterIP # Disable classic load balancer creation (default), routing to here will be done via Kubernetes Ingress resource
注意:将“Ingress”部署在与 istio-ingressgateway 相同的命名空间中(默认为 istio-system)。
例如,如果 istio-ingressgateway 在命名空间 istio-system 中,而 Ingress 在命名空间系统中,则 aws-alb-ingress-controller 错误:
"kubebuilder/controller "msg"="Reconciler error" "error"="failed to
reconcile targetGroups due to failed to load serviceAnnotation due to
no object matching key "system/istio-ingressgateway" in local store"
"controller"="alb-ingress-controller"
"request"={"Namespace":"system","Name":"sonata-ingress"}"
当前接受的答案是正确的。不过,我想稍微更新一下。
安装并配置 AWS alb 控制器后,应采取几个步骤使其工作并可用:
- 使用
istioctl manifest generate
命令生成清单列表
- 查找
istio-ingressgateway
服务配置
- 将其更新为 NodePort 类型
- 更新端口配置以具有节点和目标端口的预定义映射。注意
status-port
NodePort
- 使用
istioctl install
命令应用这些清单而不是 installing/updating istio。在某些情况下,依赖 istio helm 安装可能会更好
- 更新入口配置以具有以下注释
alb.ingress.kubernetes.io/healthcheck-port: 'PORT'
alb.ingress.kubernetes.io/healthcheck-path: /healthz/ready
alb.ingress.kubernetes.io/healthcheck-protocol: HTTP```
where PORT equals to the istio status-port NodePort value
This way, you update ALB default configuration for the healthcheck to check Istio healthcheck
我正在尝试在 Kubernetes 中设置 ALB 负载均衡器而不是默认的 ELB 负载均衡器 AWS.The 负载均衡器必须连接到 istio ingressgateway.I 寻找解决方案但只找到 one。 但是提到的 istio 版本是 V1 并且 istio 中有很多变化 now.I 试图将图表中的服务类型更改为节点端口(根据博客)但该服务仍然作为负载均衡器出现。
有人可以提到如何为 istio ingressgateway 配置 ALB 的步骤吗?
感谢阅读
Step 1 : Change istioingresssgateway service type as nodeport
Step 2 : Install ALB ingress controller
Step 3 : Write ingress.yaml for istioingressgateway as follows:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
namespace: istio-system
name: ingress
labels:
app: ingress
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/subnets: <subnet1>,<subnet2>
spec:
rules:
- http:
paths:
- path: /*
backend:
serviceName: istio-ingressgateway
servicePort: 80
alb.ingress.kubernetes.io/subnets annotation can be avoided if you labelled subnet of vpc with :
kubernetes.io/cluster/: owned
kubernetes.io/role/internal-elb: 1 (for internal ELB)
kubernetes.io/role/elb: 1 (for external ELB)
否则您可以提供两个子网值,每个子网应位于上述 yaml 中的不同可用区
It worked in Istio 1.6
我可以通过 tibin_tomy 在 Istio 1.7.4 上为我工作来确认解决方案。此外,我在第 1 步中使用了 ClusterIP 而不是 NodePort。
Step1 - 将 istioingresssgateway 服务类型更改为 ClusterIP(使用 IstioOperator 安装 Istio):
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: istio
spec:
profile: default
components:
ingressGateways:
- name: istio-ingressgateway
k8s:
service:
type: ClusterIP # Disable classic load balancer creation (default), routing to here will be done via Kubernetes Ingress resource
注意:将“Ingress”部署在与 istio-ingressgateway 相同的命名空间中(默认为 istio-system)。 例如,如果 istio-ingressgateway 在命名空间 istio-system 中,而 Ingress 在命名空间系统中,则 aws-alb-ingress-controller 错误:
"kubebuilder/controller "msg"="Reconciler error" "error"="failed to reconcile targetGroups due to failed to load serviceAnnotation due to no object matching key "system/istio-ingressgateway" in local store" "controller"="alb-ingress-controller" "request"={"Namespace":"system","Name":"sonata-ingress"}"
当前接受的答案是正确的。不过,我想稍微更新一下。 安装并配置 AWS alb 控制器后,应采取几个步骤使其工作并可用:
- 使用
istioctl manifest generate
命令生成清单列表 - 查找
istio-ingressgateway
服务配置 - 将其更新为 NodePort 类型
- 更新端口配置以具有节点和目标端口的预定义映射。注意
status-port
NodePort - 使用
istioctl install
命令应用这些清单而不是 installing/updating istio。在某些情况下,依赖 istio helm 安装可能会更好 - 更新入口配置以具有以下注释
alb.ingress.kubernetes.io/healthcheck-port: 'PORT'
alb.ingress.kubernetes.io/healthcheck-path: /healthz/ready
alb.ingress.kubernetes.io/healthcheck-protocol: HTTP```
where PORT equals to the istio status-port NodePort value
This way, you update ALB default configuration for the healthcheck to check Istio healthcheck