1Panel-dev / KubePi

🚀 现代化、开源的 K8s 面板,1Panel 官方出品。
GNU General Public License v3.0
2.72k stars 346 forks source link

[Question]mac系统上启动报 init-kube.sh readonly systemd #199

Closed seaurching closed 3 months ago

seaurching commented 7 months ago

在 macOS 上编译二进制启动,显示一条错误日志如下。无法使用 webterminal

time="2024-04-18T12:37:52+08:00" level=info msg="current db version: 2"
time="2024-04-18T12:37:52+08:00" level=error msg="open init-kube.sh: read-only file system"
time="2024-04-18T12:37:52+08:00" level=error msg="exit status 8"

下面是我的 launchd 配置信息,

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Disabled</key>
    <false/>
    <key>EnablePressuredExit</key>
    <true/>
    <key>ExitTimeOut</key>
    <integer>10</integer>
    <key>KeepAlive</key>
    <dict>
        <key>Crashed</key>
        <true/>
        <key>SuccessfulExit</key>
        <true/>
    </dict>
    <key>Label</key>
    <string>com.fit2cloud.kubepi</string>
    <key>LowPriorityBackgroundIO</key>
    <false/>
    <key>LowPriorityIO</key>
    <true/>
    <key>MachServices</key>
    <dict>
        <key>HideUntilCheckIn</key>
        <false/>
        <key>ResetAtClose</key>
        <true/>
    </dict>
    <key>Nice</key>
    <integer>-20</integer>
    <key>ProcessType</key>
    <string>Standard</string>
    <key>Program</key>
    <string>/usr/local/bin/kubepi-server</string>
    <key>EnvironmentVariables</key>
    <dict>
        <key>PATH</key>
        <string>/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/libexec:/opt/fzf/bin:/usr/local/go/bin:/usr/local/mysql/bin:/usr/local/node-v18.10.0/bin</string>
    </dict>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/kubepi-server</string>
        <string>--config-path</string>
        <string>/usr/local/etc/kubepi</string>
    </array>
    <key>RootDirectory</key>
    <string>/usr/local/KubePi/</string>
    <key>RunAtLoad</key>
    <true/>
    <key>StandardErrorPath</key>
    <string>/usr/local/var/log/kubepi.error</string>
    <key>StandardOutPath</key>
    <string>/usr/local/var/log/kubepi.log</string>
    <key>#WorkingDirectory</key>
    <string>/usr/local/KubePi</string>
</dict>
</plist>
seaurching commented 7 months ago

@wanghe-fit2cloud 我的系统里面已经开启了 8080 端口了,这个 proxy 我可以通过 kubepi-server 的配置文件修改吗?


        u, _ := url.Parse("http://localhost:8080")
        proxy := httputil.NewSingleHostReverseProxy(u)
        proxy.ModifyResponse = func(resp *http.Response) error {
            if resp.StatusCode == iris.StatusMovedPermanently {
                // 重定向重写