You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Hasura Hub克隆的hello-react应用部署后无法运行求助

Fixing Hello-React App Deployment Issue on Hasura

Looks like you've hit a classic port mismatch issue here—let's break this down and fix it quickly:

The Root Cause

Your React app's development server is running on its default port (3000, confirmed by the "starting the development server" log message), but your Kubernetes service configuration is pointing to port 8080 via targetPort: 8080. Kubernetes can't route traffic to the correct port, which is why your deployment isn't working as expected.

Step-by-Step Fix

  1. Update the Kubernetes Service Configuration
    Open the microservices/ui/k8s.yaml file, navigate to the service.spec.ports section, and change the targetPort value from 8080 to 3000:

    service:
      spec:
        ports:
          - port: 80
            targetPort: 3000  # Modified from 8080 to match React's default port
            protocol: TCP
            name: http
    
  2. Reapply the Microservice Config
    Run this command to push your updated configuration to Hasura:

    hasura ms apply -n user ui
    
  3. Verify the Deployment
    Check the logs again to confirm the service is running and reachable:

    hasura ms logs -n user ui
    

    Once you see the React server running message, try accessing your app again—it should load properly now.

Bonus: Custom Port Scenario

If you’ve configured your React app to run on a custom port (for example, by adding PORT=4000 to your package.json start script), make sure to set targetPort to that custom number instead of 3000.

内容的提问来源于stack exchange,提问作者Pushpinder Singh Grewal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 08:42:01