Allow user to choose networking for containers
this commit provides ability to choose the network. Calico is default. Change-Id: I9dd97385d981db91791cc51ebb9f3265188fa984
This commit is contained in:
parent
35407bc8bd
commit
05e6967318
@ -47,6 +47,10 @@ Properties:
|
||||
- $.class(KubernetesGatewayNode).notNull()
|
||||
- 1
|
||||
|
||||
useFlannel:
|
||||
Contract: $.bool().notNull()
|
||||
Default: false
|
||||
|
||||
dockerRegistry:
|
||||
Contract: $.string()
|
||||
|
||||
@ -75,6 +79,7 @@ Methods:
|
||||
Body:
|
||||
- $._environment: $.find(std:Environment).require()
|
||||
|
||||
|
||||
isAvailable:
|
||||
Body:
|
||||
- Return: $.masterNode.isAvailable()
|
||||
@ -132,17 +137,13 @@ Methods:
|
||||
- $.minionNodes.take($.nodeCount).select($.setupEtcd())
|
||||
- $.gatewayNodes.take($.gatewayCount).select($.setupEtcd())
|
||||
|
||||
- $.masterNode.setupFlannel()
|
||||
- $._deployContainersNetwork()
|
||||
- $.masterNode.setupNode()
|
||||
|
||||
- Parallel:
|
||||
- $.minionNodes.take($.nodeCount).pselect($.setupNode())
|
||||
- $.gatewayNodes.take($.gatewayCount).pselect($.setupNode())
|
||||
|
||||
- Parallel:
|
||||
- $.minionNodes.take($.nodeCount).pselect($.setupFlannel())
|
||||
- $.gatewayNodes.take($.gatewayCount).pselect($.setupFlannel())
|
||||
|
||||
- $._environment.stack.push()
|
||||
- $._updateServicePublicIps()
|
||||
- $.setAttr(lastNodeCount, $.nodeCount)
|
||||
@ -156,6 +157,21 @@ Methods:
|
||||
Return: $.masterNode.getIp()
|
||||
|
||||
|
||||
_deployContainersNetwork:
|
||||
Body:
|
||||
- If: $.useFlannel
|
||||
Then:
|
||||
- $.masterNode.setupFlannel()
|
||||
- Parallel:
|
||||
- $.minionNodes.take($.nodeCount).pselect($.setupFlannel())
|
||||
- $.gatewayNodes.take($.gatewayCount).pselect($.setupFlannel())
|
||||
Else:
|
||||
- Parallel:
|
||||
- $.masterNode.setupCalico()
|
||||
- $.minionNodes.take($.nodeCount).pselect($.setupCalico())
|
||||
- $.gatewayNodes.take($.gatewayCount).pselect($.setupCalico())
|
||||
|
||||
|
||||
createPod:
|
||||
Arguments:
|
||||
- definition:
|
||||
|
@ -99,7 +99,8 @@ Methods:
|
||||
masterIp => $._cluster.masterNode.getIp(),
|
||||
dockerRegistry => $._cluster.dockerRegistry,
|
||||
dockerMirror => $._cluster.dockerMirror,
|
||||
gcloudKey => $._cluster.gcloudKey
|
||||
gcloudKey => $._cluster.gcloudKey,
|
||||
useFlannel => $._cluster.useFlannel
|
||||
))
|
||||
- $.instance.agent.call($template, $resources)
|
||||
- $.setAttr(nodeConfigured, true)
|
||||
|
@ -76,6 +76,7 @@ Methods:
|
||||
IpProtocol: udp
|
||||
External: false
|
||||
- $environment.securityGroupManager.addGroupIngress($securityGroupIngress)
|
||||
|
||||
- $stack: $environment.stack.current()
|
||||
|
||||
- $portName: $stack.resources.get($this.instance.name).properties.networks[0].port.get_resource
|
||||
|
@ -21,6 +21,7 @@ Parameters:
|
||||
dockerRegistry: $dockerRegistry
|
||||
dockerMirror: $dockerMirror
|
||||
gcloudKey: $gcloudKey
|
||||
useFlannel: $useFlannel
|
||||
|
||||
Body: |
|
||||
if args.dockerRegistry:
|
||||
@ -29,8 +30,9 @@ Body: |
|
||||
setupMirror(args.dockerMirror)
|
||||
if args.gcloudKey:
|
||||
loginToGoogleRegistry("'{0}'".format(args.gcloudKey))
|
||||
|
||||
restartDocker()
|
||||
setup('{0} {1} {2}'.format(args.name, args.ip, args.masterIp))
|
||||
setup('{0} {1} {2} {3}'.format(args.name, args.ip, args.masterIp, args.useFlannel))
|
||||
|
||||
Scripts:
|
||||
setup:
|
||||
|
@ -3,6 +3,7 @@
|
||||
# $1 - NAME
|
||||
# $2 - IP
|
||||
# $3 - MASTER_IP
|
||||
# $4 - USE_CALICO
|
||||
|
||||
mkdir -p /var/run/murano-kubernetes
|
||||
|
||||
@ -12,6 +13,10 @@ if [[ $(which systemctl) ]]; then
|
||||
sed -i.bak "s/%%MASTER_IP%%/$3/g" environ/kubelet
|
||||
sed -i.bak "s/%%IP%%/$2/g" environ/kubelet
|
||||
|
||||
if [ "$4" == "False" ]; then
|
||||
echo KUBELET_ARGS=\"--network-plugin=cni --network-plugin-dir=/etc/cni/net.d\" >> environ/kubelet
|
||||
fi
|
||||
|
||||
mkdir -p /etc/kubernetes/
|
||||
|
||||
cp -f environ/kubelet /etc/kubernetes/
|
||||
|
@ -61,6 +61,7 @@ Application:
|
||||
minionNodes: repeat($minionNode, $.appConfiguration.maxMinionCount)
|
||||
nodeCount: $.appConfiguration.minionCount
|
||||
gatewayCount: $.appConfiguration.gatewayCount
|
||||
useFlannel: $.appConfiguration.useFlannel
|
||||
gatewayNodes: repeat($gatewayNode, $.appConfiguration.maxGatewayCount)
|
||||
dockerRegistry: $.appConfiguration.dockerRegistry
|
||||
dockerMirror: $.appConfiguration.dockerMirror
|
||||
@ -105,6 +106,13 @@ Forms:
|
||||
description: >-
|
||||
Check to assign floating IP to Kubernetes nodes
|
||||
required: false
|
||||
- name: useFlannel
|
||||
type: boolean
|
||||
initial: false
|
||||
label: Use Flannel networking instead of Calico
|
||||
description: >-
|
||||
Check, if you are going use the Flannel networking instead of Calico
|
||||
required: false
|
||||
- name: unitNamingPattern
|
||||
type: string
|
||||
initial: kube-#
|
||||
|
Loading…
x
Reference in New Issue
Block a user