feat: Alpine ベースの Claude Code リモート実行 Helm チャート初版 (v2.1.259)
Helm Chart Release / release-chart (push) Successful in 12s
Build Session Image / build-push (push) Successful in 2m15s

gateway(nginx) + manager(python 標準ライブラリ) + セッションごとの使い捨て Pod +
reaper CronJob の構成。ブラウザ(PC/スマホ)からアクセスし、セッション単位で
独立した Alpine コンテナに Git リポジトリ(GitHub/Gitea など)をチェックアウトして
編集・検証・プッシュする。無操作が続いたセッションは Pod ごと自動破棄。

- セキュリティ: セッション NS 分離 / restricted PodSecurity / RBAC はセッション NS の
  pods,services のみの Role / セッション Pod は SA トークン非マウント・非 root・
  readOnlyRootFilesystem・drop ALL caps・seccomp / NetworkPolicy で egress を
  DNS+HTTPS+SSH に限定 / Git ホスト allow-list / ResourceQuota+LimitRange
- ライフサイクル: idleTimeout(Pod 内ウォッチドッグ + manager 回収) / maxLifetime
  (activeDeadlineSeconds) / maxSessions / 予備の孤児掃除 CronJob
- 認証: token(既定) / basic / forward(外部SSO) / none。WebSocket は Cookie トークン
- Claude 認証: ANTHROPIC_API_KEY または CLAUDE_CODE_OAUTH_TOKEN
- CI: helm-release.yaml(未リリース版のみ tag+release+publish) /
  image-update-and-release.yaml(週次 npm 追従) / session-image.yaml(multi-arch build)
- files/ 実体を .Files.Get で ConfigMap 化。helm lint / template 検証済み
This commit is contained in:
2026-09-03 08:10:12 +09:00
parent 457a81a17f
commit 1bd0fec23a
39 changed files with 3745 additions and 1 deletions
+69
View File
@@ -0,0 +1,69 @@
# Gitea(SSH) + GitHub(HTTPS トークン) の両対応構成 + Ingress + 事前ビルド image
#
# 実行例:
# helm upgrade --install claude-code ./claude-code \
# -n claude-code --create-namespace \
# -f examples/gitea-and-github.values.yaml \
# --set anthropic.apiKey="$ANTHROPIC_API_KEY" \
# --set-file git.identities.gitea-ssh.sshPrivateKey=/path/to/id_claude \
# --set-file git.identities.gitea-ssh.knownHosts=/path/to/known_hosts \
# --set git.identities.github-https.token="$GITHUB_PAT"
image:
session:
# CI で publish した事前ビルドイメージ(git + ttyd + claude-code 同梱)
registry: git.cafepieters.com
repository: helmchart/claude-code/session
tag: "2.1.259"
auth:
mode: token
token:
existingSecret: claude-code-access # 事前に kubectl create secret generic で作成
anthropic:
authMode: apiKey
git:
allowedHosts:
- github.com
- 192.168.9.65
- git.cafepieters.com
defaultAuthorName: "Claude"
defaultAuthorEmail: "claude@cafepieters.com"
identities:
gitea-ssh:
type: ssh
# sshPrivateKey / knownHosts は --set-file で注入
# knownHosts は `ssh-keyscan 192.168.9.65` の出力
github-https:
type: https-token
username: "x-access-token"
# token は --set で注入
session:
autoStartClaude: true
idleTimeoutSeconds: 1800
maxLifetimeSeconds: 28800
maxSessions: 8
verifyCommand: "npm test --silent"
autoPush:
enabled: true
branchPrefix: "claude/"
ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
hosts:
- host: claude-code.cafepieters.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: claude-code-tls
hosts:
- claude-code.cafepieters.com