Skip to content

Commit

Permalink
Set '--config=/etc/k0s/k0s.yaml' only on controller install (#106)
Browse files Browse the repository at this point in the history
* Set '--config=/etc/k0s/k0s.yaml' only on controller install

Signed-off-by: Jussi Nummelin <[email protected]>

* pull system images from quay.io to mitigate possible docker hub rate limits

Signed-off-by: Jussi Nummelin <[email protected]>

* use 0.11.0 for smokes

Signed-off-by: Jussi Nummelin <[email protected]>
  • Loading branch information
jnummelin committed Mar 11, 2021
1 parent 9535e37 commit 57db321
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
4 changes: 3 additions & 1 deletion config/cluster/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ func (h *Host) K0sInstallCommand() string {
flags.AddUnlessExist(fmt.Sprintf(`--token-file "%s"`, h.K0sJoinTokenPath()))
}

flags.AddUnlessExist(fmt.Sprintf(`--config "%s"`, h.K0sConfigPath()))
if h.IsController() {
flags.AddUnlessExist(fmt.Sprintf(`--config "%s"`, h.K0sConfigPath()))
}

return h.Configurer.K0sCmdf("install %s %s", role, flags.Join())
}
Expand Down
2 changes: 1 addition & 1 deletion config/cluster/host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func TestK0sInstallCommand(t *testing.T) {
h := Host{Role: "worker"}
h.Configurer = &mockconfigurer{}

require.Equal(t, `k0s install worker --token-file "from-configurer" --config "from-configurer"`, h.K0sInstallCommand())
require.Equal(t, `k0s install worker --token-file "from-configurer"`, h.K0sInstallCommand())

h.Role = "controller"
h.Metadata.IsK0sLeader = true
Expand Down
29 changes: 28 additions & 1 deletion smoke-test/k0sctl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,31 @@ spec:
port: 9023
keyPath: ./id_rsa_k0s
k0s:
version: "0.11.0-rc1"
version: "0.11.0"
config:
images:
konnectivity:
image: us.gcr.io/k8s-artifacts-prod/kas-network-proxy/proxy-agent
version: v0.0.13
metricsserver:
image: gcr.io/k8s-staging-metrics-server/metrics-server
version: v0.3.7
kubeproxy:
image: k8s.gcr.io/kube-proxy
version: v1.20.4
coredns:
image: quay.io/jnummelin/coredns
version: 1.7.0
calico:
cni:
image: quay.io/jnummelin/calico-cni
version: v3.16.2
flexvolume:
image: quay.io/jnummelin/calico-pod2daemon-flexvol
version: v3.16.2
node:
image: quay.io/jnummelin/calico-node
version: v3.16.2
kubecontrollers:
image: quay.io/jnummelin/calico-kube-controllers
version: v3.16.2

0 comments on commit 57db321

Please sign in to comment.