35 Commits

Author SHA1 Message Date
Andrew Rynhard
69fa63a7b2 refactor: perform upgrade upon reboot
This PR introduces a new strategy for upgrades. Instead of attempting to
zap the partition table, create a new one, and then format the
partitions, this change will only update the `vmlinuz`, and
`initramfs.xz` being used to boot. It introduces an A/B style upgrade
process, which will allow for easy rollbacks. One deviation from our
original intention with upgrades is that this change does not completely
reset a node. It falls just short of that and does not reset the
partition table. This forces us to keep the current partition scheme in
mind as we make changes in the future, because an upgrade assumes a
specific partition scheme. We can improve upgrades further in the
future, but this will at least make them more dependable. Finally, one
more feature in this PR is the ability to keep state. This enables
single node clusters to upgrade since we keep the etcd data around.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2020-03-20 17:32:18 -07:00
Andrew Rynhard
64b5b32732 refactor: use go-procfs
This makes use of the external procfs pacakge that is based on the
pacakge we are removing here.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2020-02-19 15:58:57 -08:00
Andrey Smirnov
e1779ac77c feat: implement registry mirror & config for image pull
When images are pulled by Talos or via CRI plugin, configuration
for each registry is applied. Mirrors allow to redirect pull request to
either local registry or cached registry. Auth & TLS enable
authentication and TLS authentication for non-public registries.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-02-14 00:28:59 +03:00
Andrey Smirnov
1edc08aa24 fix: correctly split lines with /dev/kmsg output
This fixes cases when large `log.Printf()` was simply lost as it exceeds
max line length (despite being multi-line string with each line below
1KB). Now console logging should be much more reliable.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-01-27 05:15:09 -08:00
Andrew Rynhard
28782c2d46 fix: stop race condition between kubelet and networkd
The kubelet fails to start if a machine's hostname is not set. If
networkd doesn't set it in time, the kubelet service fails to start.
Addionally, this adds retries to container pulls to ensure that any
temporary network failures don't cause fatal errors if we can't pull
images.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2020-01-20 10:52:53 -05:00
Spencer Smith
5e8cab4dd5 fix: check for installer image before proceeding with upgrade
This PR will add in some code to pre-pull the installer image before we
run an upgrade of a given talos node. Additionally, this will add some
functional args to the install package to allow for specifying whether
or not to pull the installer image. This was needed since there was no
sense in pulling the installer again once we made it that far into the
upgrade process.

Signed-off-by: Spencer Smith <robertspencersmith@gmail.com>
2020-01-09 15:05:28 -08:00
Andrew Rynhard
5a7eb631b2 feat: add installer command to installer container
This replaces the entrypoint.sh shell script with a go binary.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-12-26 06:41:25 -08:00
Andrew Rynhard
cbca760562 fix: set --upgrade flag properly on installs
For some reason, if the `--upgrade` flag wasn't in the form of
`--upgrade=<true|false>` (with an `=`), the flag was always true. This
adds `=` to all flags.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-11-14 19:31:13 -08:00
Andrew Rynhard
17cce5468f feat: add metadata file to boot partition
This introduces the notion of metadata for a node. In this initial pass
there are only two fields. A timestamp to indicate when the install was
performed, and a field to indicate if the install was performed as part
of an upgrade.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-11-05 17:59:45 -08:00
Andrew Rynhard
38692847b3 refactor: pass runtime to initializer
By passing the runtime to the initializer we can flex on install options
better.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-11-03 09:23:37 -08:00
Andrey Smirnov
d3d011c8d2 chore: replace /* */ comments with // comments in license header
This fixes issues with `// +build` directives not being recognized in
source files.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-10-25 14:15:17 -07:00
Andrew Rynhard
d430a37e46 refactor: use go 1.13 error wrapping
This removes the github.com/pkg/errors package in favor of the official
error wrapping in go 1.13.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-10-15 22:20:50 -07:00
Andrey Smirnov
c2cb0f9778 chore: enable 'wsl' linter and fix all the issues
I wish there were less of them :)

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-10-10 01:16:29 +03:00
Andrew Rynhard
4ae8186107 feat: add configurator interface
This moves from translating a config into an internal config
representation, to using an interface. The idea is that an interface
gives us stronger compile time checks, and will prevent us from having to copy
from on struct to another. As long as a concrete type implements the
Configurator interface, it can be used to provide instructions to Talos.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-10-04 07:53:09 -07:00
Andrew Rynhard
8f10647d3f fix: set extra kernel args for all platforms
This change ensures that the installer has access to the machine config
so that it can set the extra kernel arguments when installing.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-09-23 11:50:13 -07:00
Andrew Rynhard
ca35b85300 refactor: improve installation reliability
This change aims to make installations more unified and reliable. It
introduces the concept of a mountpoint manager that is capable of
mounting, unmounting, and moving a set of mountpoints in the correct
order.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-08-01 11:44:40 -07:00
Andrew Rynhard
6852fa969f chore: create raw image as sparse file
This change reduces the size of raw disk significantly by creating it as
a sparse file.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-07-25 11:28:07 -07:00
Andrew Rynhard
0ec17e4169 feat: run rootfs from squashfs
This change moves the rootfs to a squashfs image.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-07-25 08:38:31 -07:00
Andrew Rynhard
cca60ed121
fix: probe specified install device (#818)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-07-02 20:46:29 -07:00
Andrew Rynhard
18a1536b01
feat: use osctl in installer (#654)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-05-15 16:14:30 -07:00
Andrew Rynhard
3c52f5e686
feat: add support for UEFI (#642)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-05-12 10:11:33 -07:00
Andrew Rynhard
64c48353e2
feat: add ability to create multiple entries in extlinux.conf (#636)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-05-10 04:50:26 -07:00
Brad Beam
90ca160e95
refactor(initramfs): Compose Install better (#624)
Signed-off-by: Brad Beam <brad.beam@talos-systems.com>
2019-05-09 12:24:38 -05:00
Andrew Rynhard
86e17c91fb
feat: update partition layout to accomodate upgrades (#621)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-05-07 13:31:34 -07:00
Andrew Rynhard
00eb0658aa
feat: add support for ISO based installations (#606)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-05-02 21:30:06 -07:00
Andrey Smirnov
7da7c8c2ff refactor: add stub unit-tests to non-trivial Go packages (#556)
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-04-17 13:25:22 -07:00
Andrew Rynhard
0d6abdf89c
feat: detect if an install has already occurred (#549)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-04-17 12:43:47 -07:00
Andrew Rynhard
2faf36bd67
feat: add support for extra disk management (#524)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-04-13 22:41:03 -07:00
Andrew Rynhard
e18b5086a9
chore: update org to new name (#480)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-04-03 18:29:21 -07:00
Andrew Rynhard
455aeb742c
chore: expose userdata and osctl client packages (#471)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-04-02 17:11:17 -07:00
Andrew Rynhard
e8469461a8
refactor: improve installer code (#472)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-04-01 08:34:33 -07:00
Andrew Rynhard
31a00ef73a
feat: install bootloader to block device (#455)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-03-18 14:01:58 -07:00
Brad Beam
83d979debc fix(initramfs): fix case where we download a non archive file (#421)
Signed-off-by: Brad Beam <brad.beam@b-rad.info>
2019-03-03 20:22:27 -08:00
Andrew Rynhard
9e947c3fa5
feat: add automated PKI for joining nodes (#406)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-02-23 23:17:56 -08:00
Brad Beam
8ee9022b71 feat: add osinstall cli utility (#368) 2019-02-23 13:18:52 -08:00