CoreOS Container LinuxのEOLが発表されたのでFlatcar Container LinuxにMigrationしてみる

# はじめに

CoreOS Container LinuxのEOLが発表されました。

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">CoreOS Container Linux will no longer receive updates after May 26, 2020. For more info, see <a href="https://t.co/dN8My5TpXy">https://t.co/dN8My5TpXy</a></p>&mdash; CoreOS, Inc. (@coreos) <a href="https://twitter.com/coreos/status/1225077628585070592?ref_src=twsrc%5Etfw">February 5, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

> On May 26, 2020, CoreOS Container Linux will reach its end of life and will no longer receive updates. We strongly recommend that users begin migrating their workloads to another operating system as soon as possible.
> 
> 引用元 : [End\-of\-life announcement for CoreOS Container Linux](https://coreos.com/os/eol/)

とのことなので、手元のCoreOSを別のOSに更新してみたいと思います。
EOLのページで紹介されているFedora CoreOSは別途用意済みということもあり、今回は[Flatcar Container Linux](https://www.flatcar-linux.org/)にしてみたいと思います。

業務利用している場合、Fedora CoreOSやOpenShiftへの移行コストを考えるとこれが一番ラクな移行手段かもしれませんね。
聞いたことのない会社からの提供なので、どの程度信用していいか私にはわかりませんけど。

# LOG

## Migration

公式に手順があるのでそのまま実施。
[Updating from CoreOS Container Linux \- Flatcar Container Linux Documentation](https://docs.flatcar-linux.org/os/update-from-container-linux/)

```shell-session
core@coreos ~ $ curl -L -o /tmp/key https://raw.githubusercontent.com/flatcar-linux/coreos-overlay/flatcar-master/coreos-base/coreos-au-key/files/official-v2.pub.pem
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   451  100   451    0     0    491      0 --:--:-- --:--:-- --:--:--   490
core@coreos ~ $ sudo mount --bind /tmp/key /usr/share/update_engine/update-payload-key.pub.pem
core@coreos ~ $ sudo vi /etc/coreos/update.conf
```

```shell-session:/etc/coreos/update.conf
GROUP=stable
SERVER=https://public.update.flatcar-linux.net/v1/update/
```

```shell-session
core@coreos ~ $ cp /usr/share/coreos/release /tmp
core@coreos ~ $ sudo mount --bind /tmp/release /usr/share/coreos/release
core@coreos ~ $ sudo vi /usr/share/coreos/release
```

```shell-session:/usr/share/coreos/release
COREOS_RELEASE_VERSION=0.0.0
COREOS_RELEASE_BOARD=amd64-usr
COREOS_RELEASE_APPID={xxxxxx}
```

```shell-session
core@coreos ~ $ sudo systemctl restart update-engine
core@coreos ~ $ update_engine_client -update
略
```

## 各種確認

Reboot後にFlatcar Container Linuxが上がってくる
同一アカウント/パスワードでとそのままログインできた
SSHログイン後の表示がすでに違う

pull済みのイメージなどは引き継がれる模様

```shell-session
Last login: Thu Feb  6 10:07:24 UTC 2020 from 192.168.2.12 on pts/0
Flatcar Container Linux by Kinvolk stable (2303.3.1)
core@coreos ~ $ cat /etc/os-release
NAME="Flatcar Container Linux by Kinvolk"
ID=flatcar
ID_LIKE=coreos
VERSION=2303.3.1
VERSION_ID=2303.3.1
BUILD_ID=2019-12-17-2005
PRETTY_NAME="Flatcar Container Linux by Kinvolk 2303.3.1 (Rhyolite)"
ANSI_COLOR="38;5;75"
HOME_URL="https://flatcar-linux.org/"
BUG_REPORT_URL="https://issues.flatcar-linux.org"
FLATCAR_BOARD="amd64-usr"

core@coreos ~ $ docker version
Client:
 Version:           18.06.3-ce
 API version:       1.38
 Go version:        go1.10.8
 Git commit:        d7080c1
 Built:             Tue Feb 19 23:07:53 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.3-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.8
  Git commit:       d7080c1
  Built:            Tue Feb 19 23:07:53 2019
  OS/Arch:          linux/amd64
  Experimental:     false

core@coreos ~ $ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
centos              8                   470671670cac        2 weeks ago         237MB
centos              7                   5e35e350aded        2 months ago        203MB
alpine              latest              196d12cf6ab1        17 months ago       4.41MB
```