跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

k3s.yaml

94 行 · 3.3 KB历史下载
1# Deploy kubernetes via k3s (which installs a bundled containerd).
2# $ limactl start ./k3s.yaml
3# $ limactl shell k3s kubectl
4#
5# It can be accessed from the host by exporting the kubeconfig file;
6# the ports are already forwarded automatically by lima:
7#
8# $ export KUBECONFIG=$(limactl list k3s --format 'unix://{{.Dir}}/copied-from-guest/kubeconfig.yaml')
9# $ kubectl get no
10# NAME STATUS ROLES AGE VERSION
11# lima-k3s Ready control-plane,master 69s v1.21.1+k3s1
12
13# A multi-node cluster can be created by starting multiple instances of this template
14# connected via the `lima:user-v2` network.
15#
16# $ limactl start --name k3s --network lima:user-v2 template:k3s
17# $ printf "https://lima-%s.internal:6443\n" k3s
18# (The url for the start command printed here)
19# $ limactl shell k3s sudo cat /var/lib/rancher/k3s/server/node-token
20# (The token for the start command printed here)
21#
22# $ limactl start --name k3s-1 --network lima:user-v2 template:k3s \
23# --param url="<URL_FROM_ABOVE>" --param token="<TOKEN_FROM_ABOVE>"
24
25minimumLimaVersion: 2.0.0
26
27base: template:_images/ubuntu-lts
28
29# Mounts are disabled in this template, but can be enabled optionally.
30mounts: []
31# containerd is managed by k3s, not by Lima, so the values are set to false here.
32containerd:
33 system: false
34 user: false
35provision:
36- mode: system
37 script: |
38 #!/bin/sh
39 if [ ! -d /var/lib/rancher/k3s ]; then
40 {{- if .Param.proxy }}
41 INSTALL_K3S_ARTIFACT_URL={{.Param.proxy}}/HTTPS///github.com/k3s-io/k3s/releases/download
42 export INSTALL_K3S_ARTIFACT_URL
43 {{- end}}
44 {{if .Param.mirror }}
45 mkdir -p /etc/rancher/k3s
46 cat <<EOF >/etc/rancher/k3s/registries.yaml
47 mirrors:
48 "*":
49 endpoint:
50 - "{{.Param.mirror}}"
51 EOF
52 {{end}}
53 {{if not ( and .Param.url .Param.token )}}
54 curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --write-kubeconfig-mode 644" sh -
55 {{else}}
56 curl -sfL https://get.k3s.io | K3S_URL={{.Param.url}} K3S_TOKEN={{.Param.token}} sh -
57 {{end}}
58 fi
59probes:
60- script: |
61 #!/bin/bash
62 set -eux -o pipefail
63 {{if not ( and .Param.url .Param.token )}}
64 if ! timeout 30s bash -c "until test -f /etc/rancher/k3s/k3s.yaml; do sleep 3; done"; then
65 echo >&2 "k3s is not running yet"
66 exit 1
67 fi
68 {{end}}
69 hint: |
70 The k3s kubeconfig file has not yet been created.
71 Run "limactl shell k3s sudo journalctl -u k3s" to check the log.
72 If that is still empty, check the bottom of the log at "/var/log/cloud-init-output.log".
73copyToHost:
74- guest: "/etc/rancher/k3s/k3s.yaml"
75 host: "{{.Dir}}/copied-from-guest/kubeconfig.yaml"
76 skipIfMissing: true
77 deleteOnStop: true
78message: |
79 {{- if not ( and .Param.url .Param.token ) -}}
80 To run `kubectl` on the host (assumes kubectl is installed), run the following commands:
81 ------
82 export KUBECONFIG="{{.Dir}}/copied-from-guest/kubeconfig.yaml"
83 kubectl ...
84 ------
85 {{end}}
86param:
87 # The proxy to use when downloading artifacts from k3s.io
88 # For a local proxy use for instance "http://host.lima.internal:3142"
89 proxy: ""
90 # The mirror to use when pulling images from registry
91 # For a local mirror use for instance "http://host.lima.internal:8080"
92 mirror: ""
93 url: ""
94 token: ""