LoginSignup
0
0

More than 1 year has passed since last update.

TL;DR

下記のドキュメントを参考にして自前のRKE2クラスタにLinkerdをHelmでインストールしました.
Installing Linkerd with Helm

Linkerdとは

Kubernetesネイティブなオープンソースのサービスメッシュです.サービスメッシュを導入することによってマイクロサービスにおけるサービス間通信の管理・可視化が実現できます.巷では同じくサービスメッシュのIstioがよく使われていますが,2021年時点でのベンチマークテストではLinkerdがIstioより軽量かつ高速であるという結果も出ています.
Benchmarking Linkerd and Istio
image.png

Linkerdをインストールする

実装環境

  • Ubuntu 22.04.1 LTS
  • RKE2 v1.24.7(Kubernetes環境)
  • Helm v3.10.1
  • kubectl v1.25.3
  • Linkerd v2.12

インストール準備

CLIのインストール

linkerdコマンドで操作するためにCLIをインストールする必要があります.
下記のコマンドでインストールできます.

curl --proto '=https' --tlsv1.2 -sSfL https://run.linkerd.io/install | sh

インストールしたらパスの追加を忘れずにしましょう.

export PATH=$PATH:/home/<USER_NAME>/.linkerd2/bin

実装環境の検証

先ほどインストールしたlinkerdコマンドを使って検証できます.
以降のインストール前に確認しておくとよいでしょう.

linkerd check --pre

mTLSの証明書の発行

Helmでインストールする場合には自分で生成する必要があります.
ここではstepコマンドを使用して証明書を生成します.

stepのインストール

stepがインストールされていない場合,下記を参考にインストールする必要があります.
https://smallstep.com/docs/step-cli/installation
Debian系のLinuxであれば以下のコマンドでインストールできます.

wget https://dl.step.sm/gh-release/cli/docs-cli-install/v0.21.0/step-cli_0.21.0_amd64.deb
sudo dpkg -i step-cli_0.21.0_amd64.deb

証明書の生成

stepコマンドで秘密鍵からルート証明書を生成します.

step certificate create root.linkerd.cluster.local ca.crt ca.key \
--profile root-ca --no-password --insecure

続いて中間証明書とキーペアを生成します.

step certificate create identity.linkerd.cluster.local issuer.crt issuer.key \
--profile intermediate-ca --not-after 8760h --no-password --insecure \
--ca ca.crt --ca-key ca.key

これでインストールの準備は完了です.
下記の通りファイルが生成されているかを確認してください.

$ ls
ca.crt  ca.key  issuer.crt  issuer.key

インストール

Linkerdリポジトリの追加

以下のコマンドから安定板のLinkerdリポジトリを追加できます.

helm repo add linkerd https://helm.linkerd.io/stable

チャートのインストール

linker-crdsとlinker-control-planeの2つをインストールする必要があります.
linker-control-planeは先ほど生成した証明書ファイルがあるディレクトリで実行してください.

linker-crd

helm install linkerd-crds linkerd/linkerd-crds \
  -n linkerd --create-namespace

linker-control-plane

helm install linkerd-control-plane \
  -n linkerd \
  --set-file identityTrustAnchorsPEM=ca.crt \
  --set-file identity.issuer.tls.crtPEM=issuer.crt \
  --set-file identity.issuer.tls.keyPEM=issuer.key \
  linkerd/linkerd-control-plane

これでLinkerdがインストール出来ました!
ネームスペースがlinkerdであることに注意してhelm listで確認してみてください.

$ helm list -n linkerd
NAME                    NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                           APP VERSION
linkerd-control-plane   linkerd         1               2022-11-07 10:35:02.364075526 +0900 JST deployed        linkerd-control-plane-1.9.4     stable-2.12.2
linkerd-crds            linkerd         1               2022-11-07 10:34:28.202658852 +0900 JST deployed        linkerd-crds-1.4.0
0
0
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
0
0