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

Added a variable to enable live-booting with Typhoon (bare-metal flatcar-linux) #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Sadi-a
Copy link

@Sadi-a Sadi-a commented Apr 17, 2023

Until now, Typhoon needed to be installed on a machine. This commit aims to change that through several additions.
First, the worker.yaml and controller.yaml files were renamed to *.tftpl in order to use the themplating functionalities found in Terraform and make it obvious they are used.
Second, a variable named "enable_live", which defaults to false, has been added. This variable's value has several effects : first, the config url used will have os=installed if enable_live is true. Second, which is the interesting part, if it is enabled, we won't install Flatcar and will instead do several operations : we start by checking if a certain partition, which contains the SSH host keys as well as the kubernetes certificates and other files, exists. If it doesn't, this partition is created on the smallest disk, some SSH host keys are generated and the partition is given a label.
After that, we mount the partition in /persist/ and generate some SSH host keys if they don't already exist and give it the required files to run kubernetes. Furthermore, when possible, the services will use /persist instead of /etc to get some files (like for the kubernetes manifests for example).
That way, we always have the same host keys and keep access to the kubernetes cluster.

Furthermore, the bootstrapping, which is just a kubectl apply, was done on machines with a service that was launched with SSH on every single controller. This is also changed through this PR with the addition of the Kubernetes provider as well as a GKE autopilot cluster to workaround the limitations of the Kubernetes provider when it comes to applying manifests (cf official documentation, application of manifests can only be done at plan time).

@Sadi-a Sadi-a self-assigned this Apr 17, 2023
@Sadi-a Sadi-a force-pushed the live_boot branch 3 times, most recently from e33ace4 to adbef8d Compare April 18, 2023 10:03
…car-linux)

Until now, Typhoon needed to be installed on a machine. This commit aims
to change that through several additions.
First, the worker.yaml and controller.yaml files were renamed to *.tftpl in order to
use the themplating functionalities found in Terraform and make it
obvious they are used.
Second, a variable named "enable_live", which defaults to false, has been
added. This variable's value has several effects : first, the config url used
will have os=installed if enable_live is true. Second, which is the interesting part,
if it is enabled, we won't install Flatcar and will instead do several operations : we
start by checking if a certain partition, which contains the SSH host keys as
well as the kubernetes certificates and other files, exists. If it doesn't, this partition
is created on the smallest disk, some SSH host keys are generated and the
partition is given a label.
After that, we mount the partition in /persist/ and generate some SSH
host keys if they don't already exist and give it the required files to
run kubernetes. Furthermore, when possible, the services will use
/persist instead of /etc to get some files (like for the kubernetes
manifests for example).
That way, we always have the same host keys and keep access to the
kubernetes cluster.
@Sadi-a Sadi-a force-pushed the live_boot branch 6 times, most recently from 234a952 to 9f3e543 Compare April 25, 2023 15:04
For some reason, the bootstrapping, which is just a `kubectl apply`, was done on the
machines with a service that was launched with SSH on every single controller.
This commit aims to change this through the addition of the Kubernetes
provider as well as a GKE autopilot cluster to workaround the
limitations of the Kubernetes provider when it comes to applying
manifests (cf official documentation, application of manifests can only
be done at plan time).
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.

1 participant