gpt4 book ai didi

Kubernetes 公开应用程序 - AWX Operator

转载 作者:行者123 更新时间:2023-12-04 07:40:33 25 4
gpt4 key购买 nike

希望你们一切都好
我目前正在尝试推出 awx-operator在 Kubernetes 集群上,我在从集群外部访问服务时遇到了一些问题。
目前我设置了以下服务:

NAME                   TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
awx NodePort 10.102.30.6 <none> 8080:32155/TCP 110m
awx-operator NodePort 10.110.147.152 <none> 80:31867/TCP 125m
awx-operator-metrics ClusterIP 10.105.190.155 <none> 8383/TCP,8686/TCP 3h17m
awx-postgres ClusterIP None <none> 5432/TCP 3h16m
awx-service ClusterIP 10.102.86.14 <none> 80/TCP 121m
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 17h
我确实设置了 NodePort被称为 awx-operator .我确实尝试创建应用程序的入口。你可以在下面看到:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: awx-ingress
spec:
rules:
- host: awx.mycompany.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: awx
port:
number: 80
当我创建入口时,然后运行 ​​ kubectl describe ingress ,我得到以下输出:
Name:             awx-ingress
Namespace: default
Address:
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
Host Path Backends
---- ---- --------
awx.mycompany.com
/ awx:80 (10.244.1.8:8080)
Annotations: <none>
Events: <none>
现在我不太确定是否 default-http-backend:80错误是一个红鲱鱼,因为我在很多地方都看到了这一点,他们似乎并不太担心,但如果我错了,请纠正我。
请告诉我是否还有其他方法可以解决此问题,我会尽快回复您。

最佳答案

你是对的,空白地址是这里的问题。在传统的云环境中,网络负载均衡器可按需使用,单个 Kubernetes list 足以为 NGINX Ingress Controller 提供一个单一的联系点到外部客户端,并间接地提供给在集群内运行的任何应用程序。
另一方面,裸机环境缺少此选项,需要您稍微不同的设置才能为外部消费者提供相同类型的访问:
Bare-metal environment
这意味着您必须做一些额外的体操才能使入口起作用。你在这里基本上有两个主要选项(都很好描述 here ):

  • 纯软件解决方案:MetalLB
  • NodePort服务。

  • 这里发生的事情是您基本上创建了一个服务类型 NodePort使用与您的入口 Controller pod 匹配的选择器,然后将流量相应地路由到您的入口对象:
    # Source: ingress-nginx/templates/controller-service.yaml
    apiVersion: v1
    kind: Service
    metadata:
    annotations:
    labels:
    helm.sh/chart: ingress-nginx-3.30.0
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/instance: ingress-nginx
    app.kubernetes.io/version: 0.46.0
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: controller
    name: ingress-nginx-controller
    namespace: ingress-nginx
    spec:
    type: NodePort
    ports:
    - name: http
    port: 80
    protocol: TCP
    targetPort: http
    - name: https
    port: 443
    protocol: TCP
    targetPort: https
    selector:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/instance: ingress-nginx
    app.kubernetes.io/component: controller
    可以找到包含该服务的完整 nginx 部署 here .
    如果您想跳过入口,您可能只使用 nodePort服务 awx并直接到达它。

    关于Kubernetes 公开应用程序 - AWX Operator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67503928/

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