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,22 +57,29 @@ Methods:
setupCalico:
Body:
- $._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(
ip => $.getIp(),
masterIp => $._cluster.masterNode.getIp()
))
- $.instance.agent.call($template, $resources)
- $._enableCalicoTraffic()
- 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(
ip => $.getIp(),
masterIp => $._cluster.masterNode.getIp()
))
- $.instance.agent.call($template, $resources)
- $._enableCalicoTraffic()
- $.setAttr(calicoSetup, true)
setupFlannel:
Body:
- $._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)
- 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,22 +65,29 @@ Methods:
setupCalico:
Body:
- $._environment.reporter.report($this, 'Setup Calico network on node {0}'.format($.instance.name))
- $resources: new(sys:Resources)
- $template: $resources.yaml('SetupCalicoNode.template').bind(dict(
ip => $.getIp(),
masterIp => $._cluster.masterNode.getIp()
))
- $.instance.agent.call($template, $resources)
- $._enableCalicoTraffic()
- 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(
ip => $.getIp(),
masterIp => $._cluster.masterNode.getIp()
))
- $.instance.agent.call($template, $resources)
- $._enableCalicoTraffic()
- $.setAttr(calicoSetup, true)
setupFlannel:
Body:
- $._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)
- 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: