您好,我正在尝试在 K8s 中部署 envoy-gateway。我已经创建了一个部署,如 envoy 示例 Github 存储库中所述。 部署成功,但不知何故特使没有为我分配 IP 地址。 粘贴 kubectl 描述 envoy-gateway 输出的片段。
Spec:
Gateway Class Name: example-gateway-class
Listeners:
Allowed Routes:
Namespaces:
From: Same
Name: http
Port: 80
Protocol: HTTP
Status:
Conditions:
Last Transition Time: 2023-05-24T16:46:53Z
Message: The Gateway has been scheduled by Envoy Gateway
Observed Generation: 1
Reason: Accepted
Status: True
Type: Accepted
Last Transition Time: 2023-05-24T16:46:53Z
Message: No addresses have been assigned to the Gateway
Observed Generation: 1
Reason: AddressNotAssigned
Status: False
Type: Programmed
Listeners:
Attached Routes: 3
Conditions:
Last Transition Time: 2023-05-24T16:46:54Z
Message: Listener is ready
Observed Generation: 1
Reason: Programmed
Status: True
Type: Programmed
Name: http
Supported Kinds:
Group: gateway.networking.k8s.io
Kind: HTTPRoute
Group: gateway.networking.k8s.io
Kind: GRPCRoute
Events: <none>
还附上整个部署文件
# This file contains the base resources that the docs/user/HTTP_ROUTING.md guide relies on.
# This includes a GatewayClass, Gateway, Services and Deployments that are used as backends
# for routing traffic.
kind: GatewayClass
apiVersion: gateway.networking.k8s.io/v1beta1
metadata:
name: example-gateway-class
labels:
example: http-routing
spec:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: example-gateway
labels:
example: http-routing
spec:
gatewayClassName: example-gateway-class
listeners:
- name: http
protocol: HTTP
port: 80
---
apiVersion: v1
kind: Service
metadata:
name: example-svc
labels:
example: http-routing
spec:
ports:
- name: http
port: 8080
targetPort: 3000
selector:
app: example-backend
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-backend
labels:
app: example-backend
example: http-routing
spec:
replicas: 1
selector:
matchLabels:
app: example-backend
template:
metadata:
labels:
app: example-backend
spec:
containers:
- name: example-backend
image: gcr.io/k8s-staging-ingressconformance/echoserver:v20221109-7ee2f3e
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
resources:
requests:
cpu: 10m
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: example-route
labels:
example: http-routing
spec:
parentRefs:
- name: example-gateway
rules:
- matches:
- path:
type: PathPrefix
value : /
- backendRefs:
- name: example-svc
port: 8080
任何帮助将不胜感激。非常感谢!!
您是在本地 K8s 集群上执行此操作吗?如果您没有 LoadBalancer(例如 MetalLB),您将不会暴露外部 IP,但您必须进行端口转发才能到达 EG。对于本地开发人员来说通常可以正常工作。
Envoy 网关指南:https://gateway.envoyproxy.io/v1.0.1/tasks/quickstart/#testing-the-configuration
Tetrate Enterprise Gateway(最终只是带有一些特殊功能的 EG)指南:https://docs.tetrate.io/envoy-gateway/howto/demo-chart#set-the-gateway_address