Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cilium-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
# --kube-version が無いと helm の既定版で描かれて偽の差分が出る
KV=$(k version -o json | jq -r .serverVersion.gitVersion)
echo "kube-version=$KV"
export HOWTO="bootstrap/talos.md「inlineManifests を直したとき」の render.sh → apply-config → upgrade-k8s を流すこと"
export HOWTO="bootstrap/talos.md「machine config と inlineManifests」の apply.sh → upgrade-k8s を流すこと"

# chart の版は render.sh の bver と同じく先頭の `# version:`
V=$(sed -n '/^# version: /{s/^# version: *//p;q;}' bootstrap/cilium-values.yaml)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/talos-boot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bootstrap/render.sh の machine config を runner の QEMU(KVM)で起動し、クラスタが立つところまで見る。
# 秘密はゼロ(使い捨てとダミー)。外に副作用を出さない: ArgoCD の extraObjects と通知先、
# 本物の ClusterIssuer(自己署名に差し替え)、infisical の SMTP を抜く。手順の元は docs/talos.md。
# 本物の ClusterIssuer(自己署名に差し替え)、infisical の SMTP を抜く。手順の元は bootstrap/talos.md。
name: talos boot

on:
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# 描いた machine config(秘密を平文で含む)は bootstrap/apply.sh がコンテナの /dev/shm に置いて消す。手で描いたときの置き場だけ入らないようにしておく
bootstrap/clusterconfig/
# 2026-10 までの出力先(talos/ を bootstrap/ にまとめる前)。手元に残っていても入らないように
/talos/
# **平文のまま置かないこと。** bootstrap/talos-secrets.sops.yaml と talos.sops.yaml は SOPS 済みのものをコミットする
# (bootstrap/talos.md)。書きかけの平文はこの名前に逃がす。
bootstrap/talos-secrets.plain.yaml
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
| [`mado/`](mado/) | **`main` が落ちたときの入口**。JCOM 側の PC(10.10.0.2)で [mado](https://github.com/danything/mado)(OIDC でログインしてブラウザから RDP する exe)を動かす(`md.doany.io`。クラスタの外) |
| [`recovery/`](recovery/) | **まっさらから建て直す入口**(手順・PV を戻す道具・暗号化した鍵)。git と restic だけで戻す |
| [`tools/`](tools/) + `compose.yaml` | **手元の運用のコマンド(cf・sops・infisical・kubectl・talosctl など)はコンテナで動かす**。`tools/t.ps1 <コマンド>`(Windows の WSL コンテナ。wslc-compose)。手元にコマンドは入れない |
| [`docs/`](docs/) | [決定の記録](docs/decisions.md)、[Talos の作法と検証](docs/talos.md)、[Entra ID の認可](docs/entra.md)、[家のルーター](docs/router.md)、[Cloudflare の API トークン](docs/cloudflare-tokens.md) |
| [`docs/`](docs/) | [決定の記録](docs/decisions.md)、[Entra ID の認可](docs/entra.md)、[家のルーター](docs/router.md)、[Cloudflare の API トークン](docs/cloudflare-tokens.md) |
| [`ROADMAP.md`](ROADMAP.md) | やることと進捗(なぜそうしたかは `docs/decisions.md`) |
| `deploy/argocd.yaml` | このリポジトリ自身の Application 定義(他のリポジトリと同じ場所) |
| [`.sops.yaml`](.sops.yaml) | `bootstrap/*.sops.yaml` を SOPS(age)で暗号化する規則 |
Expand Down
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Z440 は Intel AMT 9.x(ME 9.1)を持つ。OS が止まっていても**電源の
**別名(`LinkAliasConfig`)を別の NIC に付け替えると、古い NIC の住所と接続経路が残る。** `AddressSpec` の名前(`jcom0/10.10.0.4/24`)が同じなので
Talos が消さない。#667 では古い経路が先に当たり、10.10 から一切届かなくなった。hostNetwork・`NET_ADMIN` の使い捨ての Pod で
`ip addr del 10.10.0.4/24 dev ens3f1` をして直した(再起動でも直る)。付け替える前に 10.0 側から入れるようにしておく
(Wi-Fi で BL1500HM につなぎ、`talosctl -e 10.0.0.2 -n 10.0.0.2`、kubectl は server を `https://10.0.0.2:6443` に)。
(Wi-Fi で BL1500HM につなぐ。`tools/t` は 10.10.0.4 に届かなければ 10.0.0.2 に繋ぐ)。

## 済んだこと(記録)

Expand Down
10 changes: 5 additions & 5 deletions bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ArgoCD はここを見ない(例外は [argocd-repos.yaml](argocd-repos.yaml)

| | 何を | いつ |
| --- | --- | --- |
| **machine config**(このディレクトリ) | Talos の設定、Helm で入れるもの(cilium・cert-manager・argocd・infisical・lvm-localpv)、`apiserver-rbac.yaml`、`storage.yaml`、SOPS 済みの Secret 2 つ | `render.sh` → `apply-config` → `upgrade-k8s`([talos.md](talos.md)「上げ方 / 当て直し方」) |
| **machine config**(このディレクトリ) | Talos の設定、Helm で入れるもの(cilium・cert-manager・argocd・infisical・lvm-localpv)、`apiserver-rbac.yaml`、`storage.yaml`、SOPS 済みの Secret 2 つ | `apply.sh` → `upgrade-k8s`([talos.md](talos.md)「当て方」) |
| **ArgoCD**(`deploy/`) | 平文のマニフェスト(`ClusterIssuer`・Gateway・auth・`InfisicalSecret` など)。2026-10 まではここにあって、Application `bootstrap` が当てていた | main へのマージ(prune / selfHeal 付き) |

## ファイル
Expand All @@ -16,7 +16,7 @@ ArgoCD はここを見ない(例外は [argocd-repos.yaml](argocd-repos.yaml)
| ファイル | 中身 |
| --- | --- |
| [render.sh](render.sh) | machine config を組む。下のファイルを全部読む |
| [talos.md](talos.md) | Talos の組み立てと当て直し方 |
| [talos.md](talos.md) | Talos の組み立て・書き方・当て方 |
| [talos.sops.yaml](talos.sops.yaml) | 手で書く machine config(`password` の値だけ SOPS)。先頭のコメントに Talos・Kubernetes・Gateway API の版と schematic |
| [talos-secrets.sops.yaml](talos-secrets.sops.yaml) | クラスタの CA 一式(丸ごと SOPS) |
| [cilium-values.yaml](cilium-values.yaml) | chart の値と版(下の「Helm で入れるもの」) |
Expand Down Expand Up @@ -77,15 +77,15 @@ Namespace は chart が描かないので、`render.sh` が kube-system 以外

**cilium だけは [cilium-drift.yml](../.github/workflows/cilium-drift.yml) が見ている**(下の「cilium」)。**残りは見ていない。**
直したら流す(流し忘れたことは誰も教えてくれない)。描くたびに変わる値は潰してあるので、
`apply-config --dry-run` に出る差分は全部本物([talos.md](talos.md)「inlineManifests を直したとき」)。
`apply-config --dry-run` に出る差分は全部本物([talos.md](talos.md)「machine config と inlineManifests」)。

## cilium

**クラスタの土台。** CNI・kube-proxy の代替・Gateway API を全部これが担う。
決定の経緯は [../docs/decisions.md](../docs/decisions.md)「ルーティングの選定」。

[cilium-values.yaml](cilium-values.yaml) を直したら **`render.sh` → `apply-config` → `upgrade-k8s`**
([talos.md](talos.md)「上げ方 / 当て直し方」)。`helm upgrade` は使わない。値はここが正本で、machine config は
[cilium-values.yaml](cilium-values.yaml) を直したら **`apply.sh` → `upgrade-k8s`**
([talos.md](talos.md)「当て方」)。`helm upgrade` は使わない。値はここが正本で、machine config は
`render.sh` がここから描く派生物(二度書かない。decisions.md「machine config と Cilium の chart をどう連動させるか」)。
**どの設定が何のために要るかは [cilium-values.yaml](cilium-values.yaml) のコメントにある**(ここには写さない)。

Expand Down
17 changes: 17 additions & 0 deletions bootstrap/apply.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
# machine config を描いて、そのまま当てる(talos.md「当て方」)。引数は talosctl apply-config に渡す:
# tools/t --admin bootstrap/apply.sh --dry-run # 差分だけ見る
# tools/t --admin bootstrap/apply.sh --mode=try --timeout 10m # 試しに当てる(確定は --mode=no-reboot で当て直す)
# tools/t --admin bootstrap/apply.sh --mode=no-reboot
# tools/t --admin bootstrap/apply.sh --insecure -n <IP> -e <IP> # maintenance mode のノード(recovery/README.md の 3)
# 描いたものは秘密を平文で含むので、コンテナの tmpfs(/dev/shm)に置いて、終わったら消す。手元のディスクには書かない。
# 中身を見たいときは `tools/t --admin sh -c './bootstrap/render.sh /dev/shm/c && less /dev/shm/c/controlplane.yaml'`。
set -eu
cd "$(dirname -- "$0")/.."
out=$(mktemp -d /dev/shm/clusterconfig.XXXXXX)
# render.sh の作業場所(復号した入力を置く)も tmpfs に
export TMPDIR=/dev/shm
trap 'rm -rf "$out"' EXIT
trap 'exit 130' INT TERM
./bootstrap/render.sh "$out"
talosctl apply-config "$@" -f "$out/controlplane.yaml"
2 changes: 1 addition & 1 deletion bootstrap/render.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# machine config を作る: ./bootstrap/render.sh bootstrap/clusterconfig
# machine config を作る: ./bootstrap/render.sh <出力先>。ふだんは bootstrap/apply.sh が /dev/shm に描いて当てる
# chart の値と版は bootstrap/<name>-values(.sops).yaml、Talos などの版は talos.sops.yaml の先頭のコメントが正本。ここに写さない(../docs/decisions.md)。
# SOPS は自分で復号する。CI は鍵が無いので SECRETS などの env にダミーを渡す。
# 出力は秘密を含み、出力先は丸ごと作り直す。当て方は talos.md。
Expand Down
Loading
Loading