IKS(IBM Kubernetes Service) の flavor 置き換え(Ubuntu 16 flavors Deprecation 対応)


##### はじめに

[Deprecation of previous bare metal and all Ubuntu 16 flavors](https://www.ibm.com/cloud/blog/announcements/new-bare-metal-servers-available-for-kubernetes-and-openshift-clusters) 

より、Ubuntu16 flavor のサポートが終了するそうなので、IKS(IBM Kubernetes Service) の Ubuntu16 Flavor で稼働しているワーカー・ノードを Ubuntu 18 flavor に置き換えました。

---

##### 環境

IKS(IBM Kubernetes Service) v1.18 　(b2c.4x16.encrypted, Ubuntu16 flavor)


ログは、対象のクラスターを"< CLUSTER1 >" という名前で記載します。

---

##### 参照手順

参照手順：フレーバー (マシン・タイプ) の更新
https://cloud.ibm.com/docs/containers?topic=containers-update&locale=ja#machine_type


----
#####　実施ログ


①事前状態確認

```
$ ibmcloud ks worker-pool ls --cluster <CLUSTER1>

OK
Name      ID                                         Flavor               Workers
default   xxxxxxxxxxxc61xxxxxx0-f9bcxxxxxx-xxxxxx  b2c.8x32.encrypted   2
$
```

```
$ ibmcloud ks worker ls --c <CLUSTER1> --worker-pool default
OK
ID                                                 Public IP       Private IP     Flavor               State    Status   Zone    Version
kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w1   xx.xxx.xx.xxx   xx.xxx.xx.xxx   b2c.8x32.encrypted   normal   Ready    tok04   1.18.10_1532*
kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w2   xx.xxx.xx.xxx   xx.xxx.xx.xxx   b2c.8x32.encrypted   normal   Ready    tok04   1.18.10_1532*


* To update to 1.18.17_1547 version, run 'ibmcloud ks worker update'. Review and make any required version changes before you update: 'https://ibm.biz/upworker'
```




```
$ ibmcloud ks worker get -c <CLUSTER1> --worker kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w1
Retrieving worker kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w1...
OK


ID:             kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w1
State:          normal
Status:         Ready
Private VLAN:   245XXXX
Public VLAN:    245YYYY
Private IP:     xx.xxx.xx.xxx
Public IP:      xxx.xx.xxx.xx
Hardware:       shared
Pool Name:      default
Pool ID:        xxxxxxxxxxc61xxxxxx0-f9bcxxxxxx-xxxxxx
Zone:           tok04
Flavor:         b2c.8x32.encrypted
Version:        1.18.10_1532 (1.18.17_1547 latest)


To update to 1.18.17_1547 version, run 'ibmcloud ks worker update --cluster v<CLUSTER1> --worker kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w1'. Review and make any required version changes before you update: 'https://ibm.biz/upworker'
```
```
$ ibmcloud ks worker get -c <CLUSTER1> -worker kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w2
Retrieving worker kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w2...
OK


ID:            kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w2
State:          normal
Status:         Ready
Private VLAN:   245XXXX
Public VLAN:    245YYYY
Private IP:     xx.xxx.xx.xxx
Public IP:      xxx.xx.xxx.xx
Hardware:       shared
Pool Name:      default
Pool ID:        xxxxxxxxxxc61xxxxxx0-f9bcxxxxxx-xxxxxx
Zone:           tok04
Flavor:         b2c.8x32.encrypted
Version:        1.18.10_1532 (1.18.17_1547 latest)


To update to 1.18.17_1547 version, run 'ibmcloud ks worker update --cluster <CLUSTER1> --worker kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w2'. Review and make any required version changes before you update: 'https://ibm.biz/upworker'
```


②使用可能な flavor の確認

```
$ ibmcloud ks flavors --zone tok04
OK
For more information about these flavors, see 'https://ibm.biz/flavors'
Name                      Cores   Memory   Network Speed   OS             Server Type   Storage   Secondary Storage   Provider
b3c.16x64                 16      64GB     1000Mbps        UBUNTU_18_64   virtual       25GB      100GB               classic
b3c.32x128                32      128GB    1000Mbps        UBUNTU_18_64   virtual       25GB      100GB               classic
b3c.4x16                  4       16GB     1000Mbps        UBUNTU_18_64   virtual       25GB      100GB               classic
b3c.56x242                56      242GB    1000Mbps        UBUNTU_18_64   virtual       25GB      100GB               classic
b3c.8x32                  8       32GB     1000Mbps        UBUNTU_18_64   virtual       25GB      100GB               classic
c3c.16x16                 16      16GB     1000Mbps        UBUNTU_18_64   virtual       25GB      100GB               classic
c3c.16x32                 16      32GB     1000Mbps        UBUNTU_18_64   virtual       25GB      100GB               classic
c3c.32x32                 32      32GB     1000Mbps        UBUNTU_18_64   virtual       25GB      100GB               classic

〜省略〜
```

既存の[b2c.8x32] の 後継、[b3c.8x32] の存在を確認しました。


③ワーカー・プール作成
プール名をクラスター名と同じにしています。

```
$ ibmcloud ks worker-pool create classic --name <CLUSTER1> --cluster <CLUSTER1> --flavor b3c.8x32 --size-per-zone 2
OK
$ echo $?
0
$
```


```
$ ibmcloud ks worker-pool ls --cluster <CLUSTER1>
OK
Name                 ID                                         Flavor               Workers
<CLUSTER1>   xxxxxxxdd34xxxxxx61fxxxxxxxxxx80-bxxxxx  b3c.8x32.encrypted   2
default      xxxxxxxxxxxc61xxxxxx0-f9bcxxxxxx-xxxxxx  b2c.8x32.encrypted   2
```

この時点では、まだワーカー・ノードは追加されません。


④ゾーンを追加します。

```
$ ibmcloud ks zone add classic --zone tok04 -c <CLUSTER1> --worker-pool <CLUSTER1> --private-vlan 245XXXX--public-vlan 245YYYY
OK
$ echo $?
0
```

```
$ ibmcloud ks worker ls --cluster<CLUSTER1>
OK
ID                                                 Public IP       Private IP     Flavor               State               Status                          Zone    Version
kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w1   xx.xxx.xx.xxx   xxx.xx.xxx.xx   b2c.8x32.encrypted   normal              Ready                           tok04   1.18.10_1532*
kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w2   xx.xxx.xx.xxx   xxx.xx.xxx.xx   b2c.8x32.encrypted   normal              Ready                           tok04   1.18.10_1532*
kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w3   -               -              b3c.8x32.encrypted   provision_pending   Preparing to provision worker   tok04   1.18.17_1547
kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w4  -               -              b3c.8x32.encrypted   provision_pending   Preparing to provision worker   tok04   1.18.17_1547
```

ワーカー・ノードの作成が開始されました。


⑤作成完了後、既存のワーカー・プールを削除します。

```
$ ibmcloud ks worker-pool rm --worker-pool default --cluster <CLUSTER1>
Remove worker pool default? [y/N]> y
```


ワーカー・ノードの確認

```
$ ibmcloud ks worker ls --cluster <CLUSTER1>
OK
ID                                                 Public IP        Private IP     Flavor               State    Status   Zone    Version
kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w3    xx.xxx.xx.xxx   xxx.xx.xxx.xx   b3c.8x32.encrypted   normal   Ready    tok04   1.18.17_1547
kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w4    xx.xxx.xx.xxx   xxx.xx.xxx.xx   b3c.8x32.encrypted   normal   Ready    tok04   1.18.17_1547
```

```
$ ibmcloud ks worker get --cluster <CLUSTER1> --worker kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w3 
Retrieving worker kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w3...
OK

ID:             kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w3
State:          normal
Status:         Ready
Private VLAN:   245XXXX
Public VLAN:    245YYYY
Private IP:     xx.xxx.xx.xxx
Public IP:      xxx.xx.xxx.xx
Hardware:       shared
Pool Name:     <CLUSTER1>
Pool ID:        xxxxxxxdd34xxxxxx61fxxxxxxxxxx80-bxxxxx
Zone:           tok04
Flavor:         b3c.8x32.encrypted
Version:        1.18.17_1547
$ ibmcloud ks worker get --cluster <CLUSTER1> --worker kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w4
Retrieving worker kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w4....
OK

ID:             kube-tok04-xxxxxxxxdd3xxxxxx61f13xxxxxxxxx-w4
State:          normal
Status:         Ready
Private VLAN:   245XXXX
Public VLAN:    245YYYY
Private IP:     xx.xxx.xx.xxx
Public IP:      xxx.xx.xxx.xx
Hardware:       shared
Pool Name:     <CLUSTER1>
Pool ID:        xxxxxxxdd34xxxxxx61fxxxxxxxxxx80-bxxxxx
Zone:           tok04
Flavor:         b3c.8x32.encrypted
Version:        1.18.17_1547
$
```

ついでにワーカー・ノードのバージョンも最新になりました。
あとは、対象のIKS で設定している定義の確認や、Pod の稼働確認を行いました。


以上です。