Skip to content

Commit

Permalink
fix: add more dependencies for bootstrap services
Browse files Browse the repository at this point in the history
CRI now waits for etcd to be up on control plane nodes, this makes sure
that if CRI is going to start kube-apiserver, API server will be able to
connect to local etcd.

Bootkube waits for kubelet to be healthy, as bootkube relies on kubelet
to start its operations.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
  • Loading branch information
smira authored and talos-bot committed Dec 23, 2020
1 parent 73c81c5 commit b4ddfbf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/app/machined/pkg/system/services/bootkube.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (b *Bootkube) PostFunc(r runtime.Runtime, state events.ServiceState) (err e

// DependsOn implements the Service interface.
func (b *Bootkube) DependsOn(r runtime.Runtime) []string {
return []string{"etcd"}
return []string{"etcd", "kubelet"}
}

// Condition implements the Service interface.
Expand Down
9 changes: 8 additions & 1 deletion internal/app/machined/pkg/system/services/cri.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/talos-systems/talos/internal/app/machined/pkg/system/runner/process"
"github.com/talos-systems/talos/internal/app/machined/pkg/system/runner/restart"
"github.com/talos-systems/talos/pkg/conditions"
"github.com/talos-systems/talos/pkg/machinery/config/types/v1alpha1/machine"
"github.com/talos-systems/talos/pkg/machinery/constants"
)

Expand Down Expand Up @@ -49,7 +50,13 @@ func (c *CRI) Condition(r runtime.Runtime) conditions.Condition {

// DependsOn implements the Service interface.
func (c *CRI) DependsOn(r runtime.Runtime) []string {
return []string{"networkd"}
depends := []string{"networkd"}

if r.Config().Machine().Type() != machine.TypeJoin {
depends = append(depends, "etcd")
}

return depends
}

// Runner implements the Service interface.
Expand Down

0 comments on commit b4ddfbf

Please sign in to comment.