penguin/AstroJS

Javascript framework for my blog

commit 7e857d149ad9b60267770a3ad1e13bd4747fc722

author斟酌 鵬兄 <tgckpg@gmail.com>
date2026-06-12T05:18:35Z
subjectFixed httproutes
commit 7e857d149ad9b60267770a3ad1e13bd4747fc722
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date:   2026-06-12T05:18:35Z

    Fixed httproutes
---
 k8s/deployments.yaml | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/k8s/deployments.yaml b/k8s/deployments.yaml
index aff4259..9a9b18b 100644
--- a/k8s/deployments.yaml
+++ b/k8s/deployments.yaml
@@ -24,9 +24,7 @@ spec:
           env:
             - name: CLOSURE_ENDPOINT
               value: "http://closure-api.default.svc.cluster.local/compile"
-
 ---
-
 apiVersion: v1
 kind: Service
 metadata:
@@ -38,31 +36,43 @@ spec:
     - port: 8080
       targetPort: 8080
       name: web
-
 ---
-
 apiVersion: gateway.networking.k8s.io/v1
 kind: HTTPRoute
 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:
   parentRefs:
     - name: gateway-prod
       namespace: cilium-system
       sectionName: k8s-astropenguin-net
   hostnames:
-    - astrojs.k8s.astropenguin.net
+    - "astrojs.k8s.astropenguin.net"
   rules:
     - matches:
         - path:
             type: PathPrefix
             value: /
-      filters:
-        - type: URLRewrite
-          urlRewrite:
-            path:
-              type: ReplaceFullPath
-              replaceFullPath: /
       backendRefs:
         - name: astrojs
+          namespace: default
           port: 8080