1
0
mirror of https://github.com/rancher/rke.git synced 2025-04-28 03:31:24 +00:00

add support for weave password

This commit is contained in:
Mike Kelley 2018-07-17 21:29:48 -07:00 committed by Alena Prokharchyk
parent 91df7eb4eb
commit 5941368767
3 changed files with 10 additions and 0 deletions

View File

@ -260,6 +260,9 @@ func (c *Cluster) setClusterNetworkDefaults() {
if c.Network.CanalNetworkProvider != nil {
networkPluginConfigDefaultsMap[CanalIface] = c.Network.CanalNetworkProvider.Iface
}
if c.Network.WeaveNetworkProvider != nil {
networkPluginConfigDefaultsMap[WeavePassword] = c.Network.WeaveNetworkProvider.Password
}
for k, v := range networkPluginConfigDefaultsMap {
setDefaultIfEmptyMapValue(c.Network.Options, k, v)
}

View File

@ -51,6 +51,7 @@ const (
CanalFlannelBackendType = "canal_flannel_backend_type"
WeaveNetworkPlugin = "weave"
WeavePasswordKey = "weave_password"
// List of map keys to be used with network templates
@ -88,6 +89,7 @@ const (
FlannelInterface = "FlannelInterface"
FlannelBackend = "FlannelBackend"
CanalInterface = "CanalInterface"
WeavePassword = "WeavePassword"
RBACConfig = "RBACConfig"
ClusterVersion = "ClusterVersion"
)
@ -190,6 +192,7 @@ func (c *Cluster) doCanalDeploy(ctx context.Context) error {
func (c *Cluster) doWeaveDeploy(ctx context.Context) error {
weaveConfig := map[string]interface{}{
ClusterCIDR: c.ClusterCIDR,
WeavePassword: c.Network.Options[WeavePasswordKey],
Image: c.SystemImages.WeaveNode,
CNIImage: c.SystemImages.WeaveCNI,
WeaveLoopbackImage: c.SystemImages.Alpine,

View File

@ -45,6 +45,10 @@ items:
fieldPath: spec.nodeName
- name: IPALLOC_RANGE
value: "{{.ClusterCIDR}}"
{{- if .WeavePassword}}
- name: WEAVE_PASSWORD
value: "{{.WeavePassword}}"
{{- end}}
image: {{.Image}}
livenessProbe:
httpGet: