Merge "[kubernetes][app] Modify calico.conf for new version"
This commit is contained in:
commit
7403acc7b1
|
@ -59,7 +59,10 @@ Methods:
|
|||
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()))
|
||||
- $template: $resources.yaml('SetupCalicoNode.template').bind(dict(
|
||||
ip => $.getIp(),
|
||||
masterIp => $._cluster.masterNode.getIp()
|
||||
))
|
||||
- $.instance.agent.call($template, $resources)
|
||||
- $._enableCalicoTraffic()
|
||||
|
||||
|
|
|
@ -67,7 +67,10 @@ Methods:
|
|||
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()))
|
||||
- $template: $resources.yaml('SetupCalicoNode.template').bind(dict(
|
||||
ip => $.getIp(),
|
||||
masterIp => $._cluster.masterNode.getIp()
|
||||
))
|
||||
- $.instance.agent.call($template, $resources)
|
||||
- $._enableCalicoTraffic()
|
||||
|
||||
|
|
|
@ -16,9 +16,10 @@ Name: Setup Calico on Node
|
|||
|
||||
Parameters:
|
||||
ip: $ip
|
||||
masterIp: $masterIp
|
||||
|
||||
Body: |
|
||||
return setupCalico('{0}'.format(args.ip)).stdout
|
||||
return setupCalico('{0} {1}'.format(args.ip, args.masterIp)).stdout
|
||||
|
||||
Scripts:
|
||||
setupCalico:
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{
|
||||
"name": "calico-k8s-network",
|
||||
"name": "calico-k8s-net",
|
||||
"type": "calico",
|
||||
"etcd_authority": "%%MASTER_IP%%:2379",
|
||||
"log_level": "info",
|
||||
"mtu": 1360,
|
||||
"etcd_authority": "%%IP%%:2379",
|
||||
"kubernetes": {
|
||||
"k8s_api_root": "http://%%MASTER_IP%%:8080"
|
||||
},
|
||||
"ipam": {
|
||||
"type": "calico-ipam"
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
# $1 - IP
|
||||
# $2 - MASTER_IP
|
||||
|
||||
# TODO(asilenlov): we need to refactor this script
|
||||
# TODO(asilenkov): we need to refactor this script
|
||||
|
||||
# Install Calico on worker
|
||||
mkdir -p /opt/cni/bin
|
||||
|
@ -19,7 +20,8 @@ cp -f systemd/calico-node.service /etc/systemd/system/
|
|||
systemctl enable calico-node.service
|
||||
|
||||
mkdir -p /etc/cni/net.d
|
||||
sed -i.bak "s/%%MASTER_IP%%/$1/g" 10-calico.conf
|
||||
sed -i.bak "s/%%MASTER_IP%%/$2/g" 10-calico.conf
|
||||
sed -i.bak "s/%%IP%%/$1/g" 10-calico.conf
|
||||
cp -f 10-calico.conf /etc/cni/net.d
|
||||
|
||||
systemctl start calico-node
|
Loading…
Reference in New Issue