mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-27 17:41:17 +02:00
* refactor(init): Allow kubeadm init on controlplane This shifts the cluster formation from init(bootstrap) and join(control plane) to init(control plane). This makes use of the previously implemented initToken to provide a TTL for cluster initialization to take place and allows us to mostly treat all control plane nodes equal. This also sets up the path for us to handle master upgrades and not be concerned with odd behavior when upgrading the previously defined init node. To facilitate kubeadm init across all control plane nodes, we make use of the initToken to run `kubeadm init phase certs` command to generate any missing certificates once. All other control plane nodes will attempt to sync the necessary certs/files via all defined trustd endpoints and being the startup process. * feat(init): Add service runner context to PreFunc Signed-off-by: Brad Beam <brad.beam@talos-systems.com>
40 lines
1.5 KiB
Go
40 lines
1.5 KiB
Go
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
package system
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/talos-systems/talos/internal/app/init/pkg/system/conditions"
|
|
"github.com/talos-systems/talos/internal/app/init/pkg/system/health"
|
|
"github.com/talos-systems/talos/internal/app/init/pkg/system/runner"
|
|
"github.com/talos-systems/talos/pkg/userdata"
|
|
)
|
|
|
|
// Service is an interface describing a system service.
|
|
type Service interface {
|
|
// ID is the service id.
|
|
ID(*userdata.UserData) string
|
|
// PreFunc is invoked before a runner is created
|
|
PreFunc(context.Context, *userdata.UserData) error
|
|
// Runner creates runner for the service
|
|
Runner(*userdata.UserData) (runner.Runner, error)
|
|
// PostFunc is invoked after a runner is closed.
|
|
PostFunc(*userdata.UserData) error
|
|
// Condition describes the conditions under which a service should
|
|
// start.
|
|
Condition(*userdata.UserData) conditions.Condition
|
|
// DependsOn returns list of service IDs this service depends on.
|
|
DependsOn(*userdata.UserData) []string
|
|
}
|
|
|
|
// HealthcheckedService is a service which provides health check
|
|
type HealthcheckedService interface {
|
|
// HealtFunc provides function that checks health of the service
|
|
HealthFunc(*userdata.UserData) health.Check
|
|
// HealthSettings returns settings for the health check
|
|
HealthSettings(*userdata.UserData) *health.Settings
|
|
}
|