LoginSignup
11
1

More than 1 year has passed since last update.

以前の Tanzu Community Edition ドキュメントを Web ブラウザから閲覧してみる。

Posted at

本記事は、「TUNA-JP Advent Calendar 2022」の5日目のエントリです。

昨年は、「はじめての Tanzu Community Edition。(kube-vip 編)補足情報」を投稿したので、今年は「おわりの Tanzu Community Edition」的な投稿をしておこうと思います。

Tanzu Kubernetes Grid の無料版であった Tanzu Community Edition(TCE)が 2022年10月ごろに提供終了になり、かわりに今後は Tanzu Kubernetes Grid が 100 CPU コアまで非商用であれば無料利用できるようになりました。

既にドキュメント サイトもクローズされていますが、まだ自宅などに残された TCE が存在するはずで、TCE のドキュメントを見直したいこともあるかと思います。
そこで、(現状まだ残されている)TCE の GitHub リポジトリを手元にクローンして、Web ブラウザから以前に公開されていたドキュメントを表示してみます。

今回の環境

今回は Photon OS(Linux)4.0で起動していますが、Hugo が動作する環境であれば、他の Linux ディストリビューションや MacOS でも同様に実行できるかなと思います。

  • VMware Photon OS 4.0git、tar を RPM で追加インストール)
  • Hugo 0.97.0
root@photon-machine [ ~ ]# cat /etc/photon-release
VMware Photon OS 4.0
PHOTON_BUILD_NUMBER=2f5aad892

Photon OS は、OVA をデプロイして、基本的な設定(下記)を済ませてあります。

  • root / changeme での初回ログイン、root パスワード設定変更
  • ネットワーク設定(DHCP でもよい)

RPM パッケージは最初に更新しておきます。

root@photon-machine [ ~ ]# tdnf update -y
root@photon-machine [ ~ ]# reboot

OS のファイアウォール(iptables)は停止しておきます。

root@photon-machine [ ~ ]# systemctl stop iptables
root@photon-machine [ ~ ]# systemctl disable iptables

作業で必要な RPM パッケージのインストール

Photon OS の Yum リポジトリから、git と tar をインストールしておきます。

root@photon-machine [ ~ ]# tdnf install -y git tar

GitHub から TCE のリポジトリをクローン

TCE のドキュメントは、TCE の GitHub リポジトリに含まれています。

そこで、ドキュメントがクローズされるまえのタグ(とりあえず v0.12.1 時点)を指定して git clone します。

root@photon-machine [ ~ ]# git clone -b v0.12.1 https://github.com/vmware-tanzu/community-edition.git
Cloning into 'community-edition'...
remote: Enumerating objects: 41295, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 41295 (delta 0), reused 1 (delta 0), pack-reused 41290
Receiving objects: 100% (41295/41295), 81.09 MiB | 8.77 MiB/s, done.
Resolving deltas: 100% (24879/24879), done.
Note: switching to '0acd27591c1d0245a7eb2b2bf72020e8e295db88'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

Updating files: 100% (4197/4197), done.

TCE のドキュメントは Hugo(静的サイト ジェネレータ)で作成されています。Hugo のバージョンは、0.97.0 を利用すると無難そうです。

root@photon-machine [ ~ ]# grep -r HUGO_VERSION ./community-edition/
./community-edition/docs/site/netlify.toml:HUGO_VERSION = "0.97.0"
./community-edition/docs/site/netlify.toml:HUGO_VERSION = "0.97.0"
./community-edition/docs/site/netlify.toml:HUGO_VERSION = "0.97.0"
./community-edition/docs/site/netlify.toml:HUGO_VERSION = "0.97.0"

Hugo のインストール

Hugo も GitHub にあるリンクからダウンロードします。

Hugo をダウンロードします。

root@photon-machine [ ~ ]# curl -OL https://github.com/gohugoio/hugo/releases/download/v0.97.0/hugo_extended_0.97.0_Linux-64bit.tar.gz

Hugo は、tar で展開しつつ /usr/local/bin ディレクトリにインストールします。

root@photon-machine [ ~ ]# tar zxvf ./hugo_extended_0.97.0_Linux-64bit.tar.gz -C /usr/local/bin/ hugo

ドキュメント サイトの表示

それでは、Hugo 内蔵の Web サーバを起動して、ドキュメント サイトを表示してみます。

ここで、マシンの IP アドレスを確認しておきます。このマシンは「192.168.11.85」でした。

root@photon-machine [ ~ ]# ip -4 address show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    altname eno1
    altname enp11s0
    altname ens192
    inet 192.168.11.85/24 brd 192.168.11.255 scope global dynamic eth0
       valid_lft 2422sec preferred_lft 2422sec

ドキュメントのコンテンツが格納されているディレクトリに移動します。

root@photon-machine [ ~ ]# cd ./community-edition/docs/site/

Hugo の Web サーバを起動します。デフォルトは localhost:1313 でリスニングするので、オプションで、このサーバの IP:80 となるように調整しています。

root@photon-machine [ ~/community-edition/docs/site ]# hugo server --bind=192.168.11.85 --port=80 --baseUrl=http://192.168.11.85/ --disableFastRender

Web ブラウザから、下記のアドレスにアクセスすると、以前に公開されていたドキュメントが閲覧できるはずです。

  • http:// <このサーバの IP> /docs/edge/

2022-12-04.png

GitHub からでも以前の .md ファイルを閲覧できますが、ブラウザからのほうが見やすいこともあるかなと思います。

以上。

11
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
1