kubernetes - 大使服务保持“待定”
问题描述
目前在 Ubuntu Server 20 LTS 上运行一个全新的“多合一 VM”(堆叠的主/从方法)kubernetes v1.21.1-00
,使用
- cri-o 作为容器运行时接口
- calico 用于网络/安全
还安装了 kubernetes-dashboard(但我想这对我的问题并不重要)。使用本指南安装大使:https ://www.getambassador.io/docs/edge-stack/latest/topics/install/yaml-install/我遇到了服务卡在“待定”状态的问题。
kubectl get svc -n ambassador
打印出以下内容
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ambassador LoadBalancer 10.97.117.249 <pending> 80:30925/TCP,443:32259/TCP 5h
ambassador-admin ClusterIP 10.101.161.169 <none> 8877/TCP,8005/TCP 5h
ambassador-redis ClusterIP 10.110.32.231 <none> 6379/TCP 5h
quote ClusterIP 10.104.150.137 <none> 80/TCP 5h
虽然将服务中的type
fromLoadBalancer
更改为NodePort
正确设置,但我不确定随之而来的影响。同样,我想在这里使用大使作为入口组件 - 使用我的设置(只有一台机器),可能不需要“真正的”负载平衡。
为了涵盖所有子域内容,我设置了一个通配符记录以指向我的机器,这意味着我有一个*.k8s.my-domain.com
指向该主机的 CNAME。不知道,这种方法对于设置入口是否那么聪明。
编辑:事件列表,如下要求:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 116s default-scheduler Successfully assigned ambassador/ambassador-redis-584cd89b45-js5nw to dev-bvpl-099
Normal Pulled 116s kubelet Container image "redis:5.0.1" already present on machine
Normal Created 116s kubelet Created container redis
Normal Started 116s kubelet Started container redis
此外,这是 yaml 演示中待处理的服务(通过 导出kubectl get svc -n ambassador -o yaml ambassador
)
apiVersion: v1
kind: Service
metadata:
annotations:
a8r.io/bugs: https://github.com/datawire/ambassador/issues
a8r.io/chat: http://a8r.io/Slack
a8r.io/dependencies: ambassador-redis.ambassador
a8r.io/description: The Ambassador Edge Stack goes beyond traditional API Gateways
and Ingress Controllers with the advanced edge features needed to support developer
self-service and full-cycle development.
a8r.io/documentation: https://www.getambassador.io/docs/edge-stack/latest/
a8r.io/owner: Ambassador Labs
a8r.io/repository: github.com/datawire/ambassador
a8r.io/support: https://www.getambassador.io/about-us/support/
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"a8r.io/bugs":"https://github.com/datawire/ambassador/issues","a8r.io/chat":"http://a8r.io/Slack","a8r.io/dependencies":"ambassador-redis.ambassador","a8r.io/description":"The Ambassador Edge Stack goes beyond traditional API Gateways and Ingress Controllers with the advanced edge features needed to support developer self-service and full-cycle development.","a8r.io/documentation":"https://www.getambassador.io/docs/edge-stack/latest/","a8r.io/owner":"Ambassador Labs","a8r.io/repository":"github.com/datawire/ambassador","a8r.io/support":"https://www.getambassador.io/about-us/support/"},"labels":{"app.kubernetes.io/component":"ambassador-service","product":"aes"},"name":"ambassador","namespace":"ambassador"},"spec":{"ports":[{"name":"http","port":80,"targetPort":8080},{"name":"https","port":443,"targetPort":8443}],"selector":{"service":"ambassador"},"type":"LoadBalancer"}}
creationTimestamp: "2021-05-22T07:18:23Z"
labels:
app.kubernetes.io/component: ambassador-service
product: aes
name: ambassador
namespace: ambassador
resourceVersion: "4986406"
uid: 68e4582c-be6d-460c-909e-dfc0ad84ae7a
spec:
clusterIP: 10.107.194.191
clusterIPs:
- 10.107.194.191
externalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- name: http
nodePort: 32542
port: 80
protocol: TCP
targetPort: 8080
- name: https
nodePort: 32420
port: 443
protocol: TCP
targetPort: 8443
selector:
service: ambassador
sessionAffinity: None
type: LoadBalancer
status:
loadBalancer: {}
编辑#2:我想知道https://stackoverflow.com/a/44112285/667183是否也适用于我的流程?
解决方案
答案就在这里:https ://serverfault.com/questions/1064313/ambassador-service-stays-pending 。安装后load balancer
整个设置工作。我决定使用metallb
(https://metallb.universe.tf/installation/#installation-by-manifest进行安装)。我决定为单节点 Kubernetes 集群使用以下配置:
apiVersion: v1
kind: ConfigMap
metadata:
namespace: metallb-system
name: config
data:
config: |
address-pools:
- name: default
protocol: layer2
addresses:
- 10.16.0.99-10.16.0.99
几秒钟后,负载均衡器被检测到,一切正常。
推荐阅读
- jquery - 将猫头鹰旋转木马更换为滑动滑块
- python - 创建绘图标题时同时使用 LaTeX Notation 和 `.format()`
- sql-server - SQL 消息 7399 和消息 7303
- python - Python - numpy 数组、小数位、浮点数和小数点的平均值
- php - 如何知道 php 文件是否正在运行?
- javascript - 通过 Node.js ws websockets 中的某个通道发送消息
- android - 从 Web 服务更新 SQLite 数据库
- html - 将路由器出口变量传递给父组件
- r - 渲染闪亮页面时出现数据表问题
- robotframework - 安装robotframework-datadriver 0.3.3但得到以下错误:“python setup.py egg_info”失败,错误代码为1