-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for calico serviceExternalIPs #6928
Added support for calico serviceExternalIPs #6928
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Welcome @anjkl! |
Hi @anjkl. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I signed it |
@@ -154,6 +154,17 @@ | |||
- inventory_hostname == groups['kube-master'][0] | |||
- 'calico_conf.stdout == "0"' | |||
|
|||
- name: Set Service External IPs to empty list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section can be deleted or changed the task below:
- name: Populate Service External IPs
set_fact:
_service_external_ips: "{{ _service_external_ips|default([]) + [ {'cidr': item} ] }}"
to
- name: Populate Service External IPs
set_fact:
_service_external_ips: "{{ _service_external_ips + [ {'cidr': item} ] }}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is nice to remove this section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @oomichi
/ok-to-test
docs/calico.md
Outdated
@@ -93,6 +93,15 @@ This can be enabled by setting the following variable as follow in group_vars (k | |||
calico_advertise_cluster_ips: true | |||
``` | |||
|
|||
Since calico 3.10, Calico supports advertising Kubernetes service ExternalIPs over BGP in addition to cluster IPs advertising. | |||
This can be enabled by setting the following variable as follow in group_vars (k8s-cluster/k8s-net-calico.yml) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: as follow
seems duplicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
@@ -154,6 +154,17 @@ | |||
- inventory_hostname == groups['kube-master'][0] | |||
- 'calico_conf.stdout == "0"' | |||
|
|||
- name: Set Service External IPs to empty list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is nice to remove this section.
@@ -174,6 +185,7 @@ | |||
"spec": { | |||
"logSeverityScreen": "Info", | |||
"nodeToNodeMeshEnabled": {{ nodeToNodeMeshEnabled|default('true') }} , | |||
"serviceExternalIPs": {{ _service_external_ips }}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to https://docs.projectcalico.org/networking/advertise-service-ips this way seems good for me.
One question: Is it fine to specify empty list for calico if calico_advertise_service_external_ips is the default []?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's fine. An empty list is an acceptable value for the serviceExternalIPs key.
For example, applied non-empty list of serviceExternalIPs:
~ cat bgp-conf-0.yaml
kind: BGPConfigurationList
apiVersion: projectcalico.org/v3
items:
- apiVersion: projectcalico.org/v3
kind: BGPConfiguration
metadata:
name: default
spec:
asNumber: 65207
nodeToNodeMeshEnabled: false
serviceExternalIPs:
- cidr: 10.108.13.0/24
~ calicoctl.sh apply -f bgp-conf-0.yaml
Successfully applied 1 'BGPConfiguration' resource(s)
~ calicoctl.sh get bgpconfig default -o yaml
apiVersion: projectcalico.org/v3
kind: BGPConfiguration
metadata:
creationTimestamp: "2020-11-17T04:02:42Z"
name: default
resourceVersion: "1598124"
uid: c205703f-cbeb-4b1e-94a6-468178ca63e3
spec:
asNumber: 65207
nodeToNodeMeshEnabled: false
serviceExternalIPs:
- cidr: 10.108.13.0/24
An empty list is also OK. In this case, it just sets the default behavior for serviceExternalIPs:
~ cat bgp-conf-1.yaml
kind: BGPConfigurationList
apiVersion: projectcalico.org/v3
items:
- apiVersion: projectcalico.org/v3
kind: BGPConfiguration
metadata:
name: default
spec:
asNumber: 65207
nodeToNodeMeshEnabled: false
serviceExternalIPs: []
~ calicoctl.sh apply -f bgp-conf-1.yaml
Successfully applied 1 'BGPConfiguration' resource(s)
~ calicoctl.sh get bgpconfig default -o yaml
apiVersion: projectcalico.org/v3
kind: BGPConfiguration
metadata:
creationTimestamp: "2020-11-17T04:02:42Z"
name: default
resourceVersion: "1598897"
uid: c205703f-cbeb-4b1e-94a6-468178ca63e3
spec:
asNumber: 65207
nodeToNodeMeshEnabled: false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your explanation. I got it.
6397785
to
3f98236
Compare
/lgtm |
3f98236
to
0d72f30
Compare
/retest |
Tests were failed. But it doesn't look like the issue related to my change.
Do I need to do anything? |
I'm on it, no worries, dockerhub changed some things lately and we have yet to adapt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: anjkl, floryut The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Add support of advertising Kubernetes service ExternalIPs over BGP using calico CNI
Calico doc|Advertise service external IP addresses
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: