Fixed httproutes

This commit is contained in:
2026-06-12 13:18:35 +08:00
parent f92e6c4967
commit 7e857d149a
+22 -12
View File
@@ -24,9 +24,7 @@ spec:
env: env:
- name: CLOSURE_ENDPOINT - name: CLOSURE_ENDPOINT
value: "http://closure-api.default.svc.cluster.local/compile" value: "http://closure-api.default.svc.cluster.local/compile"
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
@@ -38,31 +36,43 @@ spec:
- port: 8080 - port: 8080
targetPort: 8080 targetPort: 8080
name: web name: web
--- ---
apiVersion: gateway.networking.k8s.io/v1 apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute kind: HTTPRoute
metadata: metadata:
name: astrojs name: astrojs-http-redirect
spec:
parentRefs:
- name: gateway-prod
namespace: cilium-system
sectionName: http
hostnames:
- "astrojs.k8s.astropenguin.net"
rules:
- filters:
- type: RequestRedirect
requestRedirect:
scheme: https
port: 443
statusCode: 301
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: astrojs-https
spec: spec:
parentRefs: parentRefs:
- name: gateway-prod - name: gateway-prod
namespace: cilium-system namespace: cilium-system
sectionName: k8s-astropenguin-net sectionName: k8s-astropenguin-net
hostnames: hostnames:
- astrojs.k8s.astropenguin.net - "astrojs.k8s.astropenguin.net"
rules: rules:
- matches: - matches:
- path: - path:
type: PathPrefix type: PathPrefix
value: / value: /
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplaceFullPath
replaceFullPath: /
backendRefs: backendRefs:
- name: astrojs - name: astrojs
namespace: default
port: 8080 port: 8080