1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-12 21:24:00 +00:00

make cluster.yml optional in --local

This commit is contained in:
galal-hussein
2018-01-15 06:36:28 +02:00
parent 8ea54f573f
commit 447eb6a479
4 changed files with 65 additions and 24 deletions

33
cluster/local.go Normal file
View File

@@ -0,0 +1,33 @@
package cluster
import (
"github.com/rancher/rke/services"
"github.com/rancher/types/apis/management.cattle.io/v3"
)
func GetLocalRKEConfig() *v3.RancherKubernetesEngineConfig {
rkeLocalNode := GetLocalRKENodeConfig()
rkeServices := v3.RKEConfigServices{
Kubelet: v3.KubeletService{
BaseService: v3.BaseService{
Image: DefaultK8sImage,
ExtraArgs: map[string]string{"fail-swap-on": "false"},
},
},
}
return &v3.RancherKubernetesEngineConfig{
Nodes: []v3.RKEConfigNode{*rkeLocalNode},
Services: rkeServices,
}
}
func GetLocalRKENodeConfig() *v3.RKEConfigNode {
rkeLocalNode := &v3.RKEConfigNode{
Address: LocalNodeAddress,
HostnameOverride: LocalNodeHostname,
User: LocalNodeUser,
Role: []string{services.ControlRole, services.WorkerRole, services.ETCDRole},
}
return rkeLocalNode
}