gpt4 book ai didi

docker - 服务未就绪 : gitlab-managed-apps/ingress-nginx-ingress-controller

转载 作者:行者123 更新时间:2023-12-02 11:32:51 29 4
gpt4 key购买 nike

我想在我的自托管系统上构建一个 gitlab + kubernetes 小 gitops。但是当我尝试从 gitlab kubernetes 部分安装 nginx ingress 时,出现此错误:Service is not ready: gitlab-managed-apps/ingress-nginx-ingress-controller因为我使用自托管的 kubernetes,所以我需要修补 LoadBalancer nginx-ingress 服务。kubectl patch svc ingress-nginx-ingress-controller -n gitlab-managed-apps -p '{"spec": {"type": "LoadBalancer", "externalIPs":["10.0.0.5","10.0.0.6","10.0.0.7"]}}'但这并不能解决问题。
我检查这个命名空间中的事件:

18m         Normal    Started             pod/ingress-nginx-ingress-default-backend-78dd5dc449-fpvwb    Started container nginx-ingress-default-backend
18m Normal Created pod/ingress-nginx-ingress-default-backend-78dd5dc449-fpvwb Created container nginx-ingress-default-backend
18m Normal Started pod/ingress-nginx-ingress-controller-7fdc67ff64-spxsn Started container nginx-ingress-controller
18m Normal Created pod/ingress-nginx-ingress-controller-7fdc67ff64-spxsn Created container nginx-ingress-controller
18m Normal Pulled pod/ingress-nginx-ingress-controller-7fdc67ff64-spxsn Container image "quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.28.0" already present on machine
18m Normal Pulled pod/ingress-nginx-ingress-default-backend-78dd5dc449-fpvwb Container image "k8s.gcr.io/defaultbackend-amd64:1.5" already present on machine
18m Normal ExternalIP service/ingress-nginx-ingress-controller Count: 0 -> 3
13m Normal Killing pod/ingress-nginx-ingress-controller-7fdc67ff64-spxsn Stopping container nginx-ingress-controller
13m Normal Killing pod/ingress-nginx-ingress-default-backend-78dd5dc449-fpvwb Stopping container nginx-ingress-default-backend
13m Warning Unhealthy pod/ingress-nginx-ingress-default-backend-78dd5dc449-fpvwb Readiness probe failed: Get "http://192.168.126.172:8080/healthz": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
12m Warning Unhealthy pod/ingress-nginx-ingress-controller-7fdc67ff64-spxsn Readiness probe failed: HTTP probe failed with statuscode: 500
12m Warning Unhealthy pod/ingress-nginx-ingress-controller-7fdc67ff64-spxsn Liveness probe failed: HTTP probe failed with statuscode: 500
在安装入口 pod 时生成 Readines 和 Liveness 行,终止所有相关的 pods、服务。
来自 install-ingress pod 的日志:
...

[tiller] 2020/09/02 22:41:21 performing install for ingress
[tiller] 2020/09/02 22:41:21 executing 0 crd-install hooks for ingress
[tiller] 2020/09/02 22:41:21 hooks complete for crd-install ingress
[tiller] 2020/09/02 22:41:21 executing 0 pre-install hooks for ingress
[tiller] 2020/09/02 22:41:21 hooks complete for pre-install ingress
[storage] 2020/09/02 22:41:21 getting release history for "ingress"
[storage] 2020/09/02 22:41:21 creating release "ingress.v1"
[kube] 2020/09/02 22:41:21 building resources from manifest
[kube] 2020/09/02 22:41:21 creating 10 resource(s)
[kube] 2020/09/02 22:41:21 beginning wait for 10 resources with timeout of 5m0s
[kube] 2020/09/02 22:41:23 Service is not ready: gitlab-managed-apps/ingress-nginx-ingress-controller
[kube] 2020/09/02 22:41:25 Service is not ready: gitlab-managed-apps/ingress-nginx-ingress-controller
[kube] 2020/09/02 22:41:27 Service is not ready: gitlab-managed-apps/ingress-nginx-ingress-controller
[kube] 2020/09/02 22:41:29 Service is not ready: gitlab-managed-apps/ingress-nginx-ingress-controller

...
当我开始安装 ingress 并修补服务时,ingress 工作,我可以对 ingressm 等进行查询。

最佳答案

安装日志后(安装期间):

kubectl logs pod/install-ingress-nginx -n gitlab-managed-apps
我有同样的问题。对于裸机安装,请使用 MetalLB: https://metallb.universe.tf/installation/https://metallb.universe.tf/configuration/
您可以使用 helm: https://github.com/bitnami/charts/tree/master/bitnami/metallb 然后您必须更改命名空间和名称:
apiVersion: v1
kind: ConfigMap
metadata:
namespace: default
name: metallb
data:
config: |
address-pools:
- addresses:
- 192.168.1.100-192.168.88.110
name: default
protocol: layer2
您需要为 service/ingress-nginx-ingress-controller 获取外部 IP:
kubectl get svc --all-namespaces
有关负载平衡支持的更多信息: https://rancher.com/docs/rancher/v2.x/en/k8s-in-rancher/load-balancers-and-ingress/load-balancers/
https://kubernetes.github.io/ingress-nginx/deploy/baremetal/

关于docker - 服务未就绪 : gitlab-managed-apps/ingress-nginx-ingress-controller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63718833/

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