LoginSignup
0
1

More than 5 years have passed since last update.

Ubuntu16.04 desktop版でOpenShift(MiniShift)を導入した時の備忘録

Last updated at Posted at 2018-02-11

Ubuntu 16.04 desktop版にOpenShift Originを動作させるためにMiniShiftをインストールする機会があったのでその備忘録です。

公式ドキュメント

Installing Minishift
https://docs.openshift.org/latest/minishift/getting-started/installing.html

前提

  • OS: Ubuntu 16.04 desktop
  • ユーザ: developer
  • dockerがインストールされていること
  • 利用するOSにVT-xやAMD-vなどの仮想化支援機能が有効になっていること
  • VMwareWorkstationの場合は、「Intel VT-x/EPTまたはAMD-V/RVIを仮想化(V)」を有効にする。 スクリーンショット 2018-02-11 18.26.22.png

インストール手順

libvirtとqemu-kvmをインストール
$ sudo apt install libvirt-bin qemu-kvm

libvirtdグループに自分自身を追加
$ sudo usermod -a -G libvirtd developer

現在のセッションを更新してグループを適用
$ newgrp libvirtd

KVMドライバのバイナリインストール
$ sudo curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.7.0/docker-machine-driver-kvm -o /usr/local/bin/docker-machine-driver-kvm

KVMドライバのバイナリに実行権限を付与
$ sudo chmod +x /usr/local/bin/docker-machine-driver-kvm

minishiftのバイナリをminishiftのリリースページより取得
$ sudo curl -L https://github.com/minishift/minishift/releases/download/v1.12.0/minishift-1.12.0-linux-amd64.tgz -o minishift-1.12.0-linux-amd64.tgz

minishiftのバイナリを/usr/bin(パスの通ったディレクト)に解凍
$ sudo tar xf minishift-1.12.0-linux-amd64.tgz -C /usr/bin --strip=1 minishift-1.12.0-linux-amd64/minishift

minishiftの起動
$ minishift start --openshift-version v3.7.1 --iso-url centos --cpus 2 --memory 2GB --disk-size 20GB
openshiftのバージョン:v3.7.1、CPU:2コア、Memory:2GB、Disk容量:20GBで、isoをcentosで指定

起動するとOpenShiftのログインメッセージが出力されます。
```
The server is accessible via web console at:
https://192.168.42.78:8443

You are logged in as:
User: developer
Password:

To login as administrator:
oc login -u system:admin
```

環境変数設定
eval $(minishift oc-env) # OpenShiftのクライアント(ocコマンド)
eval $(minishift docker-env) # MiniShiftのVM内のDockerとの接続
source <(oc completion bash) # コマンドとリソースのシェル補完

OpenShift CLIログイン
```
$ oc login -u developer
Logged into "https://192.168.42.78:8443" as "developer" using existing credentials.

You have one project on this server: "myproject"

Using project "myproject".
```

これでOpenShiftが使えるようになりました。
比較的簡単にOpenShiftが起動するので、お試しでインストールしてみたらいかがでしょうか?

0
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
0
1