Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Rancher v2.5.1をインストールしてみた

Last updated at Posted at 2020-10-27

0. Rancher v2.5.1

Rancher v2.5がリリースされUI等が変わっていると言うことだったので、超久しぶりにRancher v2.5.1をインストールしてみた。
簡単にインストールするため、Dockerを使ったシングルインストールとする。

1. Multipassで仮想マシンを用意する

multipass launch 18.04 --name "rancher-single" -c 2 -m 8g -d 20g --cloud-init ./cloud-init_rancher-single.yaml

cloud-initファイルは適当に以下のようにした

./cloud-init_k3s-single.yaml
#cloud-config
timezone: Asia/Tokyo
password: XXXXXXXXXX
chpasswd: { expire: False }
ssh_pwauth: True

multipassで起動を確認する

$ multipass list
Name                    State             IPv4             Image
rancher-single          Running           10.132.101.245   Ubuntu 18.04 LTS

この後、このrancher-singleへログインして操作していく

2. Dockerのインストール(multipass内のサーバーで実行)

Dockerをインストールするために、rancher-singleへログインする

multipass shell rancher-single

Dockerをインストールする。ついでにログインIDにdockerグループを所属させておく

curl https://releases.rancher.com/install-docker/19.03.sh | sh
sudo usermod -aG docker ubuntu

Dockerのインストール確認

$ docker version
Client: Docker Engine - Community
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 17:02:36 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:01:06 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

3. Rancher v2.5.1をインストールする(multipass内のサーバーで実行)

Rancher v.2.5.1イメージを取得

$ docker pull rancher/rancher:v2.5.1
v2.5.1: Pulling from rancher/rancher
171857c49d0f: Pull complete
419640447d26: Pull complete
61e52f862619: Pull complete
3fa78cf31d15: Pull complete
f8f94d274569: Pull complete
7812c81e3ba3: Pull complete
a7713eb2a1b5: Pull complete
7aebdff0df98: Pull complete
a57ead8a3312: Pull complete
8d3ad480a716: Pull complete
52fd57bd682e: Pull complete
c90b9deff11e: Pull complete
c136426dbfc1: Pull complete
e529b03553be: Pull complete
e698da6e2fa1: Pull complete
09369546bfb3: Pull complete
85d2a8002b4b: Pull complete
85946dfa74d6: Pull complete
6dbf555297f9: Pull complete
Digest: sha256:562bd99192ae857d83b323a7c4be382d6233d6e176f713b5a2fab163b17eca39
Status: Downloaded newer image for rancher/rancher:v2.5.1
docker.io/rancher/rancher:v2.5.1

Rancherを起動

$ docker run -d --restart=unless-stopped \
>    -p 80:80 -p 443:443 \
>    -v /host/rancher:/var/lib/rancher \
>    -v /var/log/rancher/auditlog:/var/log/auditlog \
>    -e AUDIT_LEVEL=3 \
>    --privileged \
>    rancher/rancher:v2.5.1

Rancherの起動を確認

$ docker ps
CONTAINER ID        IMAGE                    COMMAND             CREATED             STATUS              PORTS                                      NAMES
c2fd1881251a        rancher/rancher:v2.5.1   "entrypoint.sh"     7 seconds ago       Up 6 seconds        0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   compassionate_wiles
  1. RancherのUIを開く(multipass外のサーバーで実行)

ブラウザーからMultipassのIPアドレスでRancherのUIを表示する

image.png

複数のKubernetesクラスターを管理するかどうかというデフォルトビューの選択が追加されている。
デフォルト選択のまま進める

image.png

こちらの画面は変更なし。
What's Newが表示された。

image.png

Docker上でKubernetesを起動して、その上でRancherが起動しているのでローカルのKubernetesが表示されている。

image.png

画面が表示されない場合は、以下を参照
※Linux上のMultipassの仮想マシンへ外部ネットワークから接続する - Qiita
https://qiita.com/ynott/items/be8810f83d1db6f4540b

※注: multipassのホストサーバーへのルーティングも追加する必要がある

5. まとめ

非常に久しぶりに新しいバージョンのRancherを動かしてみました。
追加されているツールや機能が沢山ありそうなので、色々確認してみます。

6
4
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

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?