Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
153661cc
Unverified
Commit
153661cc
authored
6 years ago
by
k8s-ci-robot
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #3284 from mattymo/more_calico_legacy
Put back legacy support for calico ippools and bgp settings
parents
ffbe9e7f
c83350e5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
roles/network_plugin/calico/tasks/check.yml
+2
-1
2 additions, 1 deletion
roles/network_plugin/calico/tasks/check.yml
roles/network_plugin/calico/tasks/install.yml
+37
-7
37 additions, 7 deletions
roles/network_plugin/calico/tasks/install.yml
with
39 additions
and
8 deletions
roles/network_plugin/calico/tasks/check.yml
+
2
−
1
View file @
153661cc
...
...
@@ -10,7 +10,7 @@
run_once
:
yes
-
name
:
"
Get
current
version
of
calico
cluster
version"
shell
:
"
{{
bin_dir
}}/calicoctl
version
|
grep
'Cluster
Version'
|
awk
'{
print
$3}'"
shell
:
"
{{
bin_dir
}}/calicoctl
version
|
grep
'Cluster
Version
:
'
|
awk
'{
print
$3}'"
register
:
calico_version_on_server
run_once
:
yes
delegate_to
:
"
{{
groups['kube-master'][0]
}}"
...
...
@@ -22,6 +22,7 @@
that
:
-
calico_version_on_server.stdout|version_compare('v2.6.5', '>=')
msg
:
"
Your
version
of
calico
is
not
fresh
enough
for
upgrade"
when
:
calico_upgrade_enabled
-
name
:
"
Set
upgrade
flag
when
version
needs
to
be
updated"
set_fact
:
...
...
This diff is collapsed.
Click to expand it.
roles/network_plugin/calico/tasks/install.yml
+
37
−
7
View file @
153661cc
---
-
name
:
Calico | Write Calico cni config
template
:
src
:
"
cni-calico.conflist.j2"
...
...
@@ -103,6 +102,24 @@
delegate_to
:
"
{{
groups['kube-master'][0]
}}"
when
:
-
'
calico_conf.stdout
==
"0"'
-
calico_version | version_compare("v3.0.0", ">=")
-
name
:
Calico | Configure calico network pool (legacy)
shell
:
>
echo '
{ "kind": "ipPool",
"spec": {"disabled": false, "ipip": {"enabled": {{ ipip }}, "mode": "{{ ipip_mode|lower }}"},
"nat-outgoing": {{ nat_outgoing|default(false) and not peer_with_router|default(false) }}},
"apiVersion": "v1",
"metadata": {"cidr": "{{ kube_pods_subnet }}"}
}' | {{ bin_dir }}/calicoctl apply -f -
environment
:
NO_DEFAULT_POOLS
:
true
run_once
:
true
delegate_to
:
"
{{
groups['kube-master'][0]
}}"
when
:
-
'
calico_conf.stdout
==
"0"'
-
calico_version | version_compare("v3.0.0", "<")
-
name
:
"
Determine
nodeToNodeMesh
needed
state"
set_fact
:
...
...
@@ -112,7 +129,6 @@
-
inventory_hostname in groups['k8s-cluster']
run_once
:
yes
-
name
:
Calico | Set global as_num
shell
:
>
echo '
...
...
@@ -127,6 +143,21 @@
"asNumber": {{ global_as_num }} }} ' | {{ bin_dir }}/calicoctl --skip-exists create -f -
run_once
:
true
delegate_to
:
"
{{
groups['kube-master'][0]
}}"
when
:
-
calico_version | version_compare('v3.0.0', '>=')
-
name
:
Calico | Set global as_num (legacy)
command
:
"
{{
bin_dir}}/calicoctl
config
set
asNumber
{{
global_as_num
}}"
run_once
:
true
when
:
-
calico_version | version_compare('v3.0.0', '<')
-
name
:
Calico | Disable node mesh (legacy)
command
:
"
{{
bin_dir
}}/calicoctl
config
set
nodeToNodeMesh
off"
run_once
:
yes
when
:
-
calico_version | version_compare('v3.0.0', '<')
-
nodeToMeshEnabled|default(True)
-
name
:
Calico | Configure peering with router(s)
shell
:
>
...
...
@@ -147,7 +178,7 @@
with_items
:
-
"
{{
peers|default([])
}}"
when
:
-
calico_version
_on_server.stdout|
version_compare('v3.0.0', '>')
or calico_upgrade_enabled
-
calico_version
|
version_compare('v3.0.0', '>
=
')
-
peer_with_router|default(false)
-
inventory_hostname in groups['k8s-cluster']
...
...
@@ -164,8 +195,7 @@
delay
:
"
{{
retry_stagger
|
random
+
3
}}"
with_items
:
"
{{
peers|default([])
}}"
when
:
-
calico_version_on_server.stdout|version_compare('v3.0.0', '<')
-
not calico_upgrade_enabled
-
calico_version | version_compare('v3.0.0', '<')
-
peer_with_router|default(false)
-
inventory_hostname in groups['k8s-cluster']
...
...
@@ -188,7 +218,7 @@
with_items
:
-
"
{{
groups['calico-rr']
|
default([])
}}"
when
:
-
calico_version
_on_server.stdout|
version_compare('v3.0.0', '>')
or calico_upgrade_enabled
-
calico_version
|
version_compare('v3.0.0', '>
=
')
-
peer_with_calico_rr|default(false)
-
inventory_hostname in groups['k8s-cluster']
-
hostvars[item]['cluster_id'] == cluster_id
...
...
@@ -208,7 +238,7 @@
delay
:
"
{{
retry_stagger
|
random
+
3
}}"
with_items
:
"
{{
groups['calico-rr']
|
default([])
}}"
when
:
-
calico_version
_on_server.stdout|
version_compare('v3.0.0', '<')
-
calico_version
|
version_compare('v3.0.0', '<')
-
not calico_upgrade_enabled
-
peer_with_calico_rr|default(false)
-
hostvars[item]['cluster_id'] == cluster_id
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment