Fixed issue re-setup the network

Then you scale nodes down or up,
network re-setup

Change-Id: Iad68e5e7a7c3d197576aec980943aff40d4c2b50
This commit is contained in:
Artem Tiumentcev 2017-02-09 18:22:25 +03:00
parent 2d32a114e8
commit 5ca09f16f8
3 changed files with 39 additions and 25 deletions

View File

@ -57,6 +57,8 @@ Methods:
setupCalico:
Body:
- If: not $.getAttr(calicoSetup, false)
Then:
- $._environment.reporter.report($this, 'Setup Calico network on gateway node {0}'.format($.instance.name))
- $resources: new(sys:Resources)
- $template: $resources.yaml('SetupCalicoNode.template').bind(dict(
@ -65,14 +67,19 @@ Methods:
))
- $.instance.agent.call($template, $resources)
- $._enableCalicoTraffic()
- $.setAttr(calicoSetup, true)
setupFlannel:
Body:
- If: not $.getAttr(flannelSetup, false)
Then:
- $._environment.reporter.report($this, 'Setup Flannel network on gateway node {0}'.format($.instance.name))
- $resources: new(sys:Resources)
- $template: $resources.yaml('SetupFlannelNode.template')
- $.instance.agent.call($template, $resources)
- $.setAttr(flannelSetup, true)
setupNode:

View File

@ -65,6 +65,8 @@ Methods:
setupCalico:
Body:
- If: not $.getAttr(calicoSetup, false)
Then:
- $._environment.reporter.report($this, 'Setup Calico network on node {0}'.format($.instance.name))
- $resources: new(sys:Resources)
- $template: $resources.yaml('SetupCalicoNode.template').bind(dict(
@ -73,14 +75,19 @@ Methods:
))
- $.instance.agent.call($template, $resources)
- $._enableCalicoTraffic()
- $.setAttr(calicoSetup, true)
setupFlannel:
Body:
- If: not $.getAttr(flannelSetup, false)
Then:
- $._environment.reporter.report($this, 'Setup Flannel network on node {0}'.format($.instance.name))
- $resources: new(sys:Resources)
- $template: $resources.yaml('SetupFlannelNode.template')
- $.instance.agent.call($template, $resources)
- $.setAttr(flannelSetup, true)
setupNode:

View File

@ -18,7 +18,7 @@ Parameters:
nodeId: $nodeId
Body: |
removeMinion(args.nodeId)
removeMinion('{0}'.format(args.nodeId))
Scripts:
removeMinion: