minishift V1.28.0をV1.29.0にバージョンアップする

# V1.29.0 latest (^^;

https://github.com/minishift/minishift/releases

いつの間にか最新版はminishift V1.29.0になっていたのですね。
って訳で、わたしの環境もVersion Upしたいと思います。

# minishiftのバージョンアップ方法
[okd > Updating Minishift](https://docs.okd.io/latest/minishift/getting-started/updating.html)より
> ```
$ minishift update
```

至って単純ですね.


# 実際にminishiftをV1.28.0からV1.29.0にバージョンアップしてみる
ではやってみましょう

```bash
[tak@centos76 ~]$ minishift update
Do you want to update from 1.28.0 to 1.29.0 now? [y/N]: y
Update failed: Directory '/usr/local/bin' doesn't have write permission.
Please fix the permission issue and try running the command again.
```

んっとどうしよっかな。rootユーザになるか権限を付与するか…。
ここはrootになってみましょう。

```bash
[tak@centos76 ~]$ su -
パスワード: <PASSWORD>
最終ログイン: 2018/12/27 (木) 23:59:02 JST日時 pts/0
[root@centos76 ~]# minishift update
Do you want to update from 1.28.0 to 1.29.0 now? [y/N]: y
Downloading https://github.com/minishift/minishift/releases/download/v1.29.0/minishift-1.29.0-linux-amd64.tgz
 9.00 MiB / 9.00 MiB [=================================================================================================================================================================================] 100.00% 0s
 65 B / 65 B [=========================================================================================================================================================================================] 100.00% 0s

Updated successfully to Minishift version 1.29.0.

Current Installed add-ons are locally present at: /root/.minishift/addons
The add-ons for 1.29.0 available at: https://github.com/minishift/minishift/tree/v1.29.0/addons

Do you want to update the default add-ons? [y/N]: y
Default add-ons will be updated the next time you run any 'minishift' command.
[root@centos76 ~]# exit
ログアウト
```

そういえば起動したままだったので...

```bash
[tak@centos76 ~]$ minishift stop
Stopping the OpenShift cluster...
Cluster stopped.
[tak@centos76 ~]$ minishift start
-- Starting profile 'minishift'
-- Check if deprecated options are used ... OK
-- Checking if https://github.com is reachable ... OK
-- Checking if requested OpenShift version 'v3.11.0' is valid ... OK
-- Checking if requested OpenShift version 'v3.11.0' is supported ... OK
-- Checking if requested hypervisor 'kvm' is supported on this platform ... OK
-- Checking if KVM driver is installed ... 
   Driver is available at /usr/local/bin/docker-machine-driver-kvm ... 
   Checking driver binary is executable ... OK
-- Checking if Libvirt is installed ... OK
-- Checking if Libvirt default network is present ... OK
-- Checking if Libvirt default network is active ... OK
-- Checking the ISO URL ... OK
-- Checking if provided oc flags are supported ... OK
-- Starting the OpenShift cluster using 'kvm' hypervisor ...
-- Starting Minishift VM ............................................................................... OK
-- Checking for IP address ... OK
-- Checking for nameservers ... OK
-- Checking if external host is reachable from the Minishift VM ... 
   Pinging 8.8.8.8 ... OK
-- Checking HTTP connectivity from the VM ... 
   Retrieving http://minishift.io/index.html ... OK
-- Checking if persistent storage volume is mounted ... OK
-- Checking available disk space ... 52% used OK
-- Writing current configuration for static assignment of IP address ... WARN
-- OpenShift cluster will be configured with ...
   Version: v3.11.0
-- Copying oc binary from the OpenShift container image to VM ... OK
-- Starting OpenShift cluster .............................................................................................
Getting a Docker client ...
Checking if image openshift/origin-control-plane:v3.11.0 is available ...
Checking type of volume mount ...
Determining server IP ...
Using public hostname IP 192.168.42.246 as the host IP
Checking if OpenShift is already running ...
Checking for supported Docker version (=>1.22) ...
Checking if insecured registry is configured properly in Docker ...
Checking if required ports are available ...
Checking if OpenShift client is configured properly ...
Checking if image openshift/origin-control-plane:v3.11.0 is available ...
Starting OpenShift using openshift/origin-control-plane:v3.11.0 ...
I0102 16:41:34.890205    2174 flags.go:30] Running "create-kubelet-flags"
I0102 16:41:37.057767    2174 run_kubelet.go:49] Running "start-kubelet"
I0102 16:41:38.684245    2174 run_self_hosted.go:181] Waiting for the kube-apiserver to be ready ...
I0102 16:44:55.111244    2174 interface.go:26] Installing "kube-proxy" ...
I0102 16:44:55.112033    2174 interface.go:26] Installing "kube-dns" ...
I0102 16:44:55.112063    2174 interface.go:26] Installing "openshift-service-cert-signer-operator" ...
I0102 16:44:55.112297    2174 interface.go:26] Installing "openshift-apiserver" ...
I0102 16:44:55.112496    2174 apply_template.go:81] Installing "openshift-apiserver"
I0102 16:44:55.114485    2174 apply_template.go:81] Installing "kube-proxy"
I0102 16:44:55.116793    2174 apply_template.go:81] Installing "kube-dns"
I0102 16:44:55.117431    2174 apply_template.go:81] Installing "openshift-service-cert-signer-operator"
I0102 16:46:39.964244    2174 interface.go:41] Finished installing "kube-proxy" "kube-dns" "openshift-service-cert-signer-operator" "openshift-apiserver"
I0102 16:48:57.764407    2174 run_self_hosted.go:242] openshift-apiserver available
I0102 16:48:57.765339    2174 interface.go:26] Installing "openshift-controller-manager" ...
I0102 16:48:57.765385    2174 apply_template.go:81] Installing "openshift-controller-manager"
I0102 16:49:26.146821    2174 interface.go:41] Finished installing "openshift-controller-manager"
Adding default OAuthClient redirect URIs ...
Adding router ...
Adding sample-templates ...
Adding persistent-volumes ...
Adding centos-imagestreams ...
Adding registry ...
Adding web-console ...
I0102 16:49:31.520071    2174 interface.go:26] Installing "openshift-router" ...
I0102 16:49:31.520225    2174 interface.go:26] Installing "sample-templates" ...
I0102 16:49:31.520256    2174 interface.go:26] Installing "persistent-volumes" ...
I0102 16:49:31.520280    2174 interface.go:26] Installing "centos-imagestreams" ...
I0102 16:49:31.520335    2174 interface.go:26] Installing "openshift-image-registry" ...
I0102 16:49:31.520364    2174 interface.go:26] Installing "openshift-web-console-operator" ...
I0102 16:49:31.521027    2174 apply_template.go:81] Installing "openshift-web-console-operator"
I0102 16:49:31.523281    2174 apply_list.go:67] Installing "centos-imagestreams"
I0102 16:49:32.483254    2174 interface.go:26] Installing "sample-templates/mariadb" ...
I0102 16:49:32.483291    2174 interface.go:26] Installing "sample-templates/postgresql" ...
I0102 16:49:32.483312    2174 interface.go:26] Installing "sample-templates/dancer quickstart" ...
I0102 16:49:32.483330    2174 interface.go:26] Installing "sample-templates/django quickstart" ...
I0102 16:49:32.483349    2174 interface.go:26] Installing "sample-templates/jenkins pipeline ephemeral" ...
I0102 16:49:32.483368    2174 interface.go:26] Installing "sample-templates/sample pipeline" ...
I0102 16:49:32.483385    2174 interface.go:26] Installing "sample-templates/mongodb" ...
I0102 16:49:32.483403    2174 interface.go:26] Installing "sample-templates/mysql" ...
I0102 16:49:32.483421    2174 interface.go:26] Installing "sample-templates/cakephp quickstart" ...
I0102 16:49:32.483439    2174 interface.go:26] Installing "sample-templates/nodejs quickstart" ...
I0102 16:49:32.483457    2174 interface.go:26] Installing "sample-templates/rails quickstart" ...
I0102 16:49:32.483642    2174 apply_list.go:67] Installing "sample-templates/rails quickstart"
I0102 16:49:32.484292    2174 apply_list.go:67] Installing "sample-templates/mariadb"
I0102 16:49:32.484589    2174 apply_list.go:67] Installing "sample-templates/postgresql"
I0102 16:49:32.484912    2174 apply_list.go:67] Installing "sample-templates/dancer quickstart"
I0102 16:49:32.485339    2174 apply_list.go:67] Installing "sample-templates/django quickstart"
I0102 16:49:32.486035    2174 apply_list.go:67] Installing "sample-templates/jenkins pipeline ephemeral"
I0102 16:49:32.486525    2174 apply_list.go:67] Installing "sample-templates/sample pipeline"
I0102 16:49:32.487392    2174 apply_list.go:67] Installing "sample-templates/mongodb"
I0102 16:49:32.487776    2174 apply_list.go:67] Installing "sample-templates/mysql"
I0102 16:49:32.488144    2174 apply_list.go:67] Installing "sample-templates/cakephp quickstart"
I0102 16:49:32.488471    2174 apply_list.go:67] Installing "sample-templates/nodejs quickstart"
I0102 16:50:46.597314    2174 interface.go:41] Finished installing "sample-templates/mariadb" "sample-templates/postgresql" "sample-templates/dancer quickstart" "sample-templates/django quickstart" "sample-templates/jenkins pipeline ephemeral" "sample-templates/sample pipeline" "sample-templates/mongodb" "sample-templates/mysql" "sample-templates/cakephp quickstart" "sample-templates/nodejs quickstart" "sample-templates/rails quickstart"
I0102 16:50:46.597365    2174 interface.go:41] Finished installing "openshift-router" "sample-templates" "persistent-volumes" "centos-imagestreams" "openshift-image-registry" "openshift-web-console-operator"
Server Information ...
OpenShift server started.

The server is accessible via web console at:
    https://192.168.42.246:8443/console

```


> Default add-ons will be updated the next time you run any 'minishift' command.

と言う割には、その気配がないが...。


## バージョン確認

```bash
[tak@centos76 ~]$ minishift version
minishift v1.29.0+72fa7b2
```

# Add-onsのアップデート
やっぱりこの一言が↓が気になっていたのでrootで`minishift start`実行してみました。
> Default add-ons will be updated the next time you run any 'minishift' command.

```bash
[root@centos76 ~]# minishift start
Minishift was upgraded from v1.28.0 to v1.29.0. Running post update actions.
--- Updating default add-ons ... OK
Default add-ons 'anyuid, admin-user, xpaas, registry-route, che, htpasswd-identity-provider, admissions-webhook, redhat-registry-login' installed
-- Starting profile 'minishift'
-- Check if deprecated options are used ... OK
-- Checking if https://github.com is reachable ... OK
-- Checking if requested OpenShift version 'v3.11.0' is valid ... OK
-- Checking if requested OpenShift version 'v3.11.0' is supported ... OK
-- Checking if requested hypervisor 'kvm' is supported on this platform ... OK
-- Checking if KVM driver is installed ... 
   Driver is available at /usr/local/bin/docker-machine-driver-kvm ... 
   Checking driver binary is executable ... OK
-- Checking if Libvirt is installed ... OK
-- Checking if Libvirt default network is present ... OK
-- Checking if Libvirt default network is active ... OK
-- Checking the ISO URL ... OK
-- Downloading OpenShift binary 'oc' version 'v3.11.0'
 53.89 MiB / 53.89 MiB [===============================================================================================================================================================================] 100.00% 0s-- Downloading OpenShift v3.11.0 checksums ... OK
-- Checking if provided oc flags are supported ... OK
-- Starting the OpenShift cluster using 'kvm' hypervisor ...
-- Minishift VM will be configured with ...
   Memory:    4 GB
   vCPUs :    2
   Disk size: 20 GB

   Downloading ISO 'https://github.com/minishift/minishift-centos-iso/releases/download/v1.13.0/minishift-centos7.iso'
 346.00 MiB / 346.00 MiB [=============================================================================================================================================================================] 100.00% 0s
-- Starting Minishift VM ...... FAIL E0103 03:56:52.728638   13573 start.go:494] Error starting the VM: Error creating the VM. Error creating machine: Error in driver during machine creation: virError(Code=9, Domain=20, Message='操作は失敗しました: ドメイン 'minishift' がすでに UUID c1f482a7-598f-4d09-a9ce-f831e4d89e3c を用いて存在します'). Retrying.
Error starting the VM: Error creating the VM. Error creating machine: Error in driver during machine creation: virError(Code=9, Domain=20, Message='操作は失敗しました: ドメイン 'minishift' がすでに UUID c1f482a7-598f-4d09-a9ce-f831e4d89e3c を用いて存在します')
```
ちゃんとAdd-Onsもアップデートされたみたい(^^♪
VMは一般ユーザ`tak`でやっているから操作失敗だけども…。
多分大丈夫。

もしかしたら`/usr/local/bin`に`+w`するのが正解だったのだろうか…。

# add-onsがrootの領域にDLされている…(汗
よくよくログを確認したら`/root/.minishift/addons`となっている。

```bash
Current Installed add-ons are locally present at: /root/.minishift/addons
```

環境壊したかな…。

```bash
[tak@centos76 ~]$ minishift update -f
Nothing to update.
Already using the latest version: 1.29.0.
[tak@centos76 ~]$ minishift update -f --update-addons
Nothing to update.
Already using the latest version: 1.29.0.
```

add-ons増えてますね…

```bash
[root@centos76 ~]# ls -alF ~/.minishift/addons
合計 0
drwxr-xr-x. 10 root root 173  1月  3 03:53 ./
drwxr-xr-x.  9 root root  99  1月  3 03:53 ../
drwxr-xr-x.  2 root root  61  1月  3 01:29 admin-user/
drwxr-xr-x.  2 root root  56  1月  3 03:53 admissions-webhook/
drwxr-xr-x.  2 root root  53  1月  3 01:29 anyuid/
drwxr-xr-x.  3 root root  81  1月  3 01:29 che/
drwxr-xr-x.  2 root root 112  1月  3 01:29 htpasswd-identity-provider/
drwxr-xr-x.  2 root root  83  1月  3 03:53 redhat-registry-login/
drwxr-xr-x.  2 root root  34  1月  3 01:29 registry-route/
drwxr-xr-x.  4 root root  50  1月  3 01:29 xpaas/
[root@centos76 ~]# ls -alF /home/tak/.minishift/addons/
合計 0
drwxrwxr-x. 8 tak tak 118 12月 22 17:58 ./
drwxrwxr-x. 9 tak tak 144 12月 22 18:03 ../
drwxr-xr-x. 2 tak tak  61 12月 22 17:58 admin-user/
drwxr-xr-x. 2 tak tak  53 12月 22 17:58 anyuid/
drwxr-xr-x. 3 tak tak  81 12月 22 17:58 che/
drwxr-xr-x. 2 tak tak 112 12月 22 17:58 htpasswd-identity-provider/
drwxr-xr-x. 2 tak tak  34 12月 22 17:58 registry-route/
drwxr-xr-x. 4 tak tak  50 12月 22 17:58 xpaas/
```

仕方がないのでrootにあるのをCOPYしちゃう

```bash
[root@centos76 ~]# \cp -R --force ~/.minishift/addons/* /home/tak/.minishift/addons/
[root@centos76 ~]# chown -R tak:tak /home/tak/.minishift/addons/
```

# 結局正解は
多分、`/usr/local/bin/minishift`に`+w`権限を与えるが正解だったかな( ;∀;)