|
| 1 | +--- |
| 2 | +# Source: gateway-api-inference-extension/templates/rbac.yaml |
| 3 | +apiVersion: v1 |
| 4 | +kind: ServiceAccount |
| 5 | +metadata: |
| 6 | + name: inference-gateway-ext-proc-release-name |
| 7 | + namespace: default |
| 8 | + labels: |
| 9 | + app: inference-gateway-ext-proc-release-name |
| 10 | +--- |
| 11 | +# Source: gateway-api-inference-extension/templates/enable_patch_policy.yaml |
| 12 | +apiVersion: v1 |
| 13 | +kind: ConfigMap |
| 14 | +metadata: |
| 15 | + name: envoy-gateway-config |
| 16 | + namespace: envoy-gateway-system |
| 17 | +data: |
| 18 | + envoy-gateway.yaml: | |
| 19 | + apiVersion: gateway.envoyproxy.io/v1alpha1 |
| 20 | + kind: EnvoyGateway |
| 21 | + provider: |
| 22 | + type: Kubernetes |
| 23 | + gateway: |
| 24 | + controllerName: gateway.envoyproxy.io/gatewayclass-controller |
| 25 | + extensionApis: |
| 26 | + enableEnvoyPatchPolicy: true |
| 27 | + enableBackend: true |
| 28 | +--- |
| 29 | +# Source: gateway-api-inference-extension/templates/rbac.yaml |
| 30 | +kind: ClusterRole |
| 31 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 32 | +metadata: |
| 33 | + name: inference-extension-default-release-name |
| 34 | +rules: |
| 35 | +- apiGroups: ["inference.networking.x-k8s.io"] |
| 36 | + resources: ["inferencemodels"] |
| 37 | + verbs: ["get", "watch", "list"] |
| 38 | +- apiGroups: [""] |
| 39 | + resources: ["pods"] |
| 40 | + verbs: ["get", "watch", "list"] |
| 41 | +- apiGroups: ["inference.networking.x-k8s.io"] |
| 42 | + resources: ["inferencepools"] |
| 43 | + verbs: ["get", "watch", "list"] |
| 44 | +- apiGroups: ["discovery.k8s.io"] |
| 45 | + resources: ["endpointslices"] |
| 46 | + verbs: ["get", "watch", "list"] |
| 47 | +- apiGroups: |
| 48 | + - authentication.k8s.io |
| 49 | + resources: |
| 50 | + - tokenreviews |
| 51 | + verbs: |
| 52 | + - create |
| 53 | +- apiGroups: |
| 54 | + - authorization.k8s.io |
| 55 | + resources: |
| 56 | + - subjectaccessreviews |
| 57 | + verbs: |
| 58 | + - create |
| 59 | +--- |
| 60 | +# Source: gateway-api-inference-extension/templates/rbac.yaml |
| 61 | +kind: ClusterRoleBinding |
| 62 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 63 | +metadata: |
| 64 | + name: inference-extension-default-release-name |
| 65 | +subjects: |
| 66 | +- kind: ServiceAccount |
| 67 | + name: inference-gateway-ext-proc-release-name |
| 68 | + namespace: default |
| 69 | +roleRef: |
| 70 | + kind: ClusterRole |
| 71 | + name: inference-extension-default-release-name |
| 72 | +--- |
| 73 | +# Source: gateway-api-inference-extension/templates/ext_proc.yaml |
| 74 | +apiVersion: v1 |
| 75 | +kind: Service |
| 76 | +metadata: |
| 77 | + name: inference-gateway-ext-proc-release-name |
| 78 | + namespace: default |
| 79 | +spec: |
| 80 | + selector: |
| 81 | + app: inference-gateway-ext-proc-release-name |
| 82 | + ports: |
| 83 | + - name: grpc |
| 84 | + protocol: TCP |
| 85 | + port: 9002 |
| 86 | + targetPort: 9002 |
| 87 | + - name: http-metrics |
| 88 | + protocol: TCP |
| 89 | + port: 9090 |
| 90 | + targetPort: 9090 |
| 91 | + type: ClusterIP |
| 92 | +--- |
| 93 | +# Source: gateway-api-inference-extension/templates/ext_proc.yaml |
| 94 | +apiVersion: apps/v1 |
| 95 | +kind: Deployment |
| 96 | +metadata: |
| 97 | + name: inference-gateway-ext-proc-release-name |
| 98 | + namespace: default |
| 99 | + labels: |
| 100 | + app: inference-gateway-ext-proc-release-name |
| 101 | +spec: |
| 102 | + replicas: 1 |
| 103 | + selector: |
| 104 | + matchLabels: |
| 105 | + app: inference-gateway-ext-proc-release-name |
| 106 | + template: |
| 107 | + metadata: |
| 108 | + labels: |
| 109 | + app: inference-gateway-ext-proc-release-name |
| 110 | + spec: |
| 111 | + serviceAccountName: inference-gateway-ext-proc-release-name |
| 112 | + containers: |
| 113 | + - name: inference-gateway-ext-proc |
| 114 | + image: registry-cn-hangzhou.ack.aliyuncs.com/dev/gateway-api-inference-extension/epp:main |
| 115 | + imagePullPolicy: Always |
| 116 | + args: |
| 117 | + - -poolName |
| 118 | + - vllm-llama2-7b-pool |
| 119 | + - -poolNamespace |
| 120 | + - default |
| 121 | + - -v |
| 122 | + - "3" |
| 123 | + - -grpcPort |
| 124 | + - "9002" |
| 125 | + - -grpcHealthPort |
| 126 | + - "9003" |
| 127 | + - -metricsPort |
| 128 | + - "9090" |
| 129 | + ports: |
| 130 | + - name: grpc |
| 131 | + containerPort: 9002 |
| 132 | + - name: grpc-health |
| 133 | + containerPort: 9003 |
| 134 | + - name: metrics |
| 135 | + containerPort: 9090 |
| 136 | + livenessProbe: |
| 137 | + grpc: |
| 138 | + port: 9003 |
| 139 | + service: inference-extension |
| 140 | + initialDelaySeconds: 5 |
| 141 | + periodSeconds: 10 |
| 142 | + readinessProbe: |
| 143 | + grpc: |
| 144 | + port: 9003 |
| 145 | + service: inference-extension |
| 146 | + initialDelaySeconds: 5 |
| 147 | + periodSeconds: 10 |
| 148 | +--- |
| 149 | +# Source: gateway-api-inference-extension/templates/gateway.yaml |
| 150 | +apiVersion: gateway.envoyproxy.io/v1alpha1 |
| 151 | +kind: Backend |
| 152 | +metadata: |
| 153 | + name: backend-release-name |
| 154 | +spec: |
| 155 | + endpoints: |
| 156 | + - fqdn: |
| 157 | + hostname: 'foo.bar.com' |
| 158 | + port: 8080 |
| 159 | +--- |
| 160 | +# Source: gateway-api-inference-extension/templates/traffic_policy.yaml |
| 161 | +apiVersion: gateway.envoyproxy.io/v1alpha1 |
| 162 | +kind: BackendTrafficPolicy |
| 163 | +metadata: |
| 164 | + name: high-connection-route-policy-release-name # 确保引用有 . 前缀 |
| 165 | + namespace: |
| 166 | +spec: |
| 167 | + targetRefs: |
| 168 | + - group: gateway.networking.k8s.io |
| 169 | + kind: HTTPRoute |
| 170 | + name: llm-route-release-name |
| 171 | + circuitBreaker: |
| 172 | + maxConnections: 40000 |
| 173 | + maxPendingRequests: 40000 |
| 174 | + maxParallelRequests: 40000 |
| 175 | + timeout: |
| 176 | + tcp: |
| 177 | + connectTimeout: 24h |
| 178 | +--- |
| 179 | +# Source: gateway-api-inference-extension/templates/extension_policy.yaml |
| 180 | +apiVersion: gateway.envoyproxy.io/v1alpha1 |
| 181 | +kind: EnvoyExtensionPolicy |
| 182 | +metadata: |
| 183 | + name: ext-proc-policy-release-name |
| 184 | + namespace: default |
| 185 | +spec: |
| 186 | + extProc: |
| 187 | + - backendRefs: |
| 188 | + - group: "" |
| 189 | + kind: Service |
| 190 | + name: inference-gateway-ext-proc-release-name |
| 191 | + port: 9002 |
| 192 | + processingMode: |
| 193 | + request: |
| 194 | + body: Buffered |
| 195 | + response: |
| 196 | + messageTimeout: 1000s |
| 197 | + backendSettings: |
| 198 | + circuitBreaker: |
| 199 | + maxConnections: 40000 |
| 200 | + maxPendingRequests: 40000 |
| 201 | + maxParallelRequests: 40000 |
| 202 | + timeout: |
| 203 | + tcp: |
| 204 | + connectTimeout: 24h |
| 205 | + targetRef: |
| 206 | + group: gateway.networking.k8s.io |
| 207 | + kind: HTTPRoute |
| 208 | + name: llm-route-release-name |
| 209 | +--- |
| 210 | +# Source: gateway-api-inference-extension/templates/patch_policy.yaml |
| 211 | +apiVersion: gateway.envoyproxy.io/v1alpha1 |
| 212 | +kind: EnvoyPatchPolicy |
| 213 | +metadata: |
| 214 | + name: custom-response-patch-policy-release-name |
| 215 | + namespace: default |
| 216 | +spec: |
| 217 | + targetRef: |
| 218 | + group: gateway.networking.k8s.io |
| 219 | + kind: Gateway |
| 220 | + name: inference-gateway-release-name |
| 221 | + type: JSONPatch |
| 222 | + jsonPatches: |
| 223 | + - type: "type.googleapis.com/envoy.config.cluster.v3.Cluster" |
| 224 | + name: original_destination_cluster |
| 225 | + operation: |
| 226 | + op: add |
| 227 | + path: "" |
| 228 | + value: |
| 229 | + name: original_destination_cluster |
| 230 | + type: ORIGINAL_DST |
| 231 | + original_dst_lb_config: |
| 232 | + use_http_header: true |
| 233 | + http_header_name: "x-gateway-destination-endpoint" |
| 234 | + connect_timeout: 1000s |
| 235 | + lb_policy: CLUSTER_PROVIDED |
| 236 | + dns_lookup_family: V4_ONLY |
| 237 | + circuit_breakers: |
| 238 | + thresholds: |
| 239 | + - max_connections: 40000 |
| 240 | + max_pending_requests: 40000 |
| 241 | + max_requests: 40000 |
| 242 | + - type: "type.googleapis.com/envoy.config.cluster.v3.Cluster" |
| 243 | + name: "envoyextensionpolicy/default/ext-proc-policy-release-name/extproc/0" |
| 244 | + operation: |
| 245 | + op: add |
| 246 | + path: "/transport_socket" |
| 247 | + value: |
| 248 | + name: "envoy.transport_sockets.tls" |
| 249 | + typed_config: |
| 250 | + "@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext" |
| 251 | + common_tls_context: {} |
| 252 | + - type: "type.googleapis.com/envoy.config.route.v3.RouteConfiguration" |
| 253 | + name: default/inference-gateway-release-name/llm-gw |
| 254 | + operation: |
| 255 | + op: replace |
| 256 | + path: "/virtual_hosts/0/routes/0/route/cluster" |
| 257 | + value: original_destination_cluster |
| 258 | +--- |
| 259 | +# Source: gateway-api-inference-extension/templates/gateway.yaml |
| 260 | +apiVersion: gateway.networking.k8s.io/v1 |
| 261 | +kind: Gateway |
| 262 | +metadata: |
| 263 | + name: inference-gateway-release-name |
| 264 | + namespace: default |
| 265 | +spec: |
| 266 | + gatewayClassName: inference-gateway-release-name |
| 267 | + listeners: |
| 268 | + - name: http |
| 269 | + protocol: HTTP |
| 270 | + port: 8080 |
| 271 | + - name: llm-gw |
| 272 | + protocol: HTTP |
| 273 | + port: 8081 |
| 274 | +--- |
| 275 | +# Source: gateway-api-inference-extension/templates/gateway.yaml |
| 276 | +apiVersion: gateway.networking.k8s.io/v1 |
| 277 | +kind: GatewayClass |
| 278 | +metadata: |
| 279 | + name: inference-gateway-release-name |
| 280 | +spec: |
| 281 | + controllerName: gateway.envoyproxy.io/gatewayclass-controller |
| 282 | +--- |
| 283 | +# Source: gateway-api-inference-extension/templates/gateway.yaml |
| 284 | +apiVersion: gateway.networking.k8s.io/v1 |
| 285 | +kind: HTTPRoute |
| 286 | +metadata: |
| 287 | + name: llm-route-release-name |
| 288 | + namespace: default |
| 289 | +spec: |
| 290 | + parentRefs: |
| 291 | + - name: inference-gateway-release-name |
| 292 | + sectionName: llm-gw |
| 293 | + rules: |
| 294 | + - backendRefs: |
| 295 | + - group: gateway.envoyproxy.io |
| 296 | + kind: Backend |
| 297 | + name: backend-release-name |
| 298 | + timeouts: |
| 299 | + request: "24h" |
| 300 | + backendRequest: "24h" |
0 commit comments