Skip to content

Commit

Permalink
Enable dynamic config (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
danj-replicated authored and laverya committed Dec 11, 2023
1 parent 39096e5 commit 62447b9
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/embedded-cluster/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func runK0sInstallCommand(fullcmd string) error {
args := strings.Split(fullcmd, " ")
args = append(args, "--token-file", "/etc/k0s/join-token")
if strings.Contains(fullcmd, "controller") {
args = append(args, "--disable-components", "konnectivity-server")
args = append(args, "--disable-components", "konnectivity-server", "--enable-dynamic-config")
}
cmd := exec.Command(args[0], args[1:]...)
stdout := bytes.NewBuffer(nil)
Expand Down
5 changes: 3 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,9 @@ func generateConfigForHosts(ctx context.Context, hosts ...*cluster.Host) (*v1bet
Spec: &cluster.Spec{
Hosts: hosts,
K0s: &cluster.K0s{
Version: k0sversion.MustParse(defaults.K0sVersion),
Config: k0sconfig,
DynamicConfig: true,
Version: k0sversion.MustParse(defaults.K0sVersion),
Config: k0sconfig,
},
},
}, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type hostcfg struct {
func (h *hostcfg) render() *cluster.Host {
var ifls []string
if h.Role != "worker" {
ifls = []string{"--disable-components konnectivity-server"}
ifls = []string{"--disable-components konnectivity-server --enable-dynamic-config"}
}
ifls = append(ifls, labelsToArg(h.Labels)...)
return &cluster.Host{
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/testdata/override-change-name.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ config: |-
noTaints: true
k0s:
version: v1.27.5+k0s.0
dynamicConfig: false
dynamicConfig: true
config:
apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
Expand Down Expand Up @@ -53,7 +53,7 @@ expected: |-
noTaints: true
k0s:
version: v1.27.5+k0s.0
dynamicConfig: false
dynamicConfig: true
config:
apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/testdata/override-enable-telemetry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ config: |-
noTaints: true
k0s:
version: v1.27.5+k0s.0
dynamicConfig: false
dynamicConfig: true
config:
apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
Expand Down Expand Up @@ -54,7 +54,7 @@ expected: |-
noTaints: true
k0s:
version: v1.27.5+k0s.0
dynamicConfig: false
dynamicConfig: true
config:
apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/testdata/override-setting-ip-forward.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ config: |-
noTaints: true
k0s:
version: v1.27.5+k0s.0
dynamicConfig: false
dynamicConfig: true
config:
apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
Expand Down Expand Up @@ -57,7 +57,7 @@ expected: |-
noTaints: true
k0s:
version: v1.27.5+k0s.0
dynamicConfig: false
dynamicConfig: true
config:
apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/testdata/override-zero-out-sans-list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ config: |-
noTaints: true
k0s:
version: v1.27.5+k0s.0
dynamicConfig: false
dynamicConfig: true
config:
apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
Expand Down Expand Up @@ -58,7 +58,7 @@ expected: |-
noTaints: true
k0s:
version: v1.27.5+k0s.0
dynamicConfig: false
dynamicConfig: true
config:
apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
Expand Down

0 comments on commit 62447b9

Please sign in to comment.