Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp Ignition template #138

Merged
merged 6 commits into from
Feb 18, 2019
Merged

Revamp Ignition template #138

merged 6 commits into from
Feb 18, 2019

Conversation

ymmt2005
Copy link
Member

@ymmt2005 ymmt2005 commented Feb 15, 2019

This PR revamps ignition template implementations.

Changes in REST APIs and command-line usage break backward-compatibility.
Changes in template syntax do not break backward-compatibility.
Template data in etcd are converted automatically.
The etcd schema version is bumped to 3.

One most notable change is that sabakan can now handle multiple Ignition specification versions.
To define an ignition template for spec version 2.3.0, specify version in template YAML as follows:

version: 2.3
passwd: passwd.yml
files:
  - /etc/hostname
...

@ymmt2005 ymmt2005 changed the title Document new API and command-line usage for ignition templates. Revamp Ignition template Feb 15, 2019
There are a lot of internal changes, although old template YAML
can be read with the new implementation.
@ymmt2005 ymmt2005 force-pushed the revamp-metadata-api branch 2 times, most recently from 932255e to f61cce2 Compare February 17, 2019 14:44
This is because the latest stable channel of CoreOS Container
Linux supports Ignition 2.2 only.
@ymmt2005
Copy link
Member Author

cybozu-go/neco/dctest 環境でのコンバージョン結果:

$ sudo systemctl stop sabakan.service
$ sudo ./sabakan --config-file=/etc/sabakan/config.yml
2019-02-17T16:17:42.227886Z boot-0 sabakan info: "upgrading schema version" from="1" to="3"
2019-02-17T16:17:42.292239Z boot-0 sabakan info: "updated schema version" to="2"
2019-02-17T16:17:42.373377Z boot-0 sabakan info: "updated schema version" to="3"
2019-02-17T16:17:42.401696Z boot-0 sabakan info: "resume stateful watching" rev=528
$ ./sabactl ignitions get worker
["9999.99.99"]

$ ./sabactl ignitions get worker 9999.99.99 | jq .template | jq -r '.storage.files[0].contents.source'
data:,LABEL%3Dcontainerd%20%2Fvar%2Flib%2Fcontainerd%20ext4%20x-systemd.device-timeout%3D600%200%200%0ALABEL%3Ddocker%20%20%20%20%20%2Fvar%2Flib%2Fdocker%20%20%20%20%20ext4%20x-systemd.device-timeout%3D600%200%200%0ALABEL%3Dkubelet%20%20%20%20%2Fvar%2Flib%2Fkubelet%20%20%20%20ext4%20x-systemd.device-timeout%3D600%200%200%0ALABEL%3Drkt%20%20%20%20%20%20%20%20%2Fvar%2Flib%2Frkt%20%20%20%20%20%20%20%20ext4%20x-systemd.device-timeout%3D600%200%200%0A

意図通りに変換されている。この状態で rack0-cs1 を以下のように再起動してネットブートできることを確認した。

host-vm$ sudo pmctl node action restart rack0-cs1
host-vm$ sudo pmctl node enter rack0-cs1
...
[  OK  ] Started Wait for chrony to synchronize system clock.
[  OK  ] Reached target System Time Synchronized.
[  OK  ] Started Daily Log Rotation.
         Starting Docker Socket for the API.
[  OK  ] Listening on Docker Socket for the API.
         Starting setup-hw container...
         Starting Load coil container image...
         Starting Load Squid container image...
         Starting Load container images for CKE...
[  OK  ] Started containerd container runtime.
         Starting Docker Application Container Engine...
[  OK  ] Started Docker Application Container Engine.
[  OK  ] Started Load coil container image.
[  OK  ] Started Load Squid container image.
[  OK  ] Started setup-hw container.
         Starting Run setup-hw tool...
[  OK  ] Started Load container images for CKE.
[  OK  ] Started Wait for Network to be Configured.
[  OK  ] Started Run setup-hw tool.
         Starting Serf container on docker...
[  OK  ] Started Serf container on docker.
[  OK  ] Started Set serf tags periodically.
[  OK  ] Reached target Multi-User System.

@ymmt2005 ymmt2005 requested review from binoue, dulltz and morimoto-cybozu and removed request for dulltz February 17, 2019 16:25
Copy link
Contributor

@binoue binoue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

テスト周りの確認を致しました。

よろしくお願いいたします。

Copy link
Contributor

@morimoto-cybozu morimoto-cybozu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@morimoto-cybozu morimoto-cybozu merged commit e624032 into master Feb 18, 2019
@morimoto-cybozu morimoto-cybozu deleted the revamp-metadata-api branch February 18, 2019 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants