-
Notifications
You must be signed in to change notification settings - Fork 2.3k
calico fixes #9435
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
Closed
Closed
calico fixes #9435
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2e94e8a
calico: avoid using outdated `openshift.master.sdn_cluster_network_cidr`
f4ba29f
calico: apply node label to run calico-node daemonset
3e87de8
calico: skip errors if applied objects already exist
dbcbd35
calico: remove DS nodeselector and avoid labelling nodes on new installs
c8b0cb6
Remove outdated calico role and rename calico_master
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,48 @@ | ||
| # Calico | ||
| # Calico (Master) | ||
|
|
||
| Please see [calico_master](../calico_master/README.md) | ||
| Configure Calico components for the Master host. | ||
|
|
||
| ## Requirements | ||
|
|
||
| * Ansible 2.2 | ||
|
|
||
| ## Installation | ||
|
|
||
| To install, set the following inventory configuration parameters: | ||
|
|
||
| * `openshift_use_calico=True` | ||
| * `openshift_use_openshift_sdn=False` | ||
| * `os_sdn_network_plugin_name='cni'` | ||
|
|
||
| By default, Calico will share the etcd used by OpenShift. | ||
| To configure Calico to use a separate instance of etcd, place etcd SSL client certs on your master, | ||
| then set the following variables in your inventory.ini: | ||
|
|
||
| * `calico_etcd_ca_cert_file=/path/to/etcd-ca.crt` | ||
| * `calico_etcd_cert_file=/path/to/etcd-client.crt` | ||
| * `calico_etcd_key_file=/path/to/etcd-client.key` | ||
| * `calico_etcd_endpoints=https://etcd:2379` | ||
|
|
||
| ## Upgrading | ||
|
|
||
| OpenShift-Ansible installs Calico as a self-hosted install. Previously, Calico ran as a systemd service. Running Calico | ||
| in this manner is now deprecated, and must be upgraded to a hosted cluster. Please run the Legacy Upgrade playbook to | ||
| upgrade your existing Calico deployment to a hosted deployment: | ||
|
|
||
| ansible-playbook -i inventory.ini playbooks/byo/calico/legacy_upgrade.yml | ||
|
|
||
| ## Additional Calico/Node and Felix Configuration Options | ||
|
|
||
| Additional parameters that can be defined in the inventory are: | ||
|
|
||
|
|
||
| | Environment | Description | Schema | Default | | ||
| |---------|----------------------|---------|---------| | ||
| | CALICO_IPV4POOL_IPIP | IPIP Mode to use for the IPv4 POOL created at start up. | off, always, cross-subnet | always | | ||
| | CALICO_LOG_DIR | Directory on the host machine where Calico Logs are written.| String | /var/log/calico | | ||
|
|
||
| ### Contact Information | ||
|
|
||
| Author: Dan Osborne <dan@projectcalico.org> | ||
|
|
||
| For support, join the `#openshift` channel on the [calico users slack](calicousers.slack.com). |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,5 +13,5 @@ galaxy_info: | |
| - cloud | ||
| - system | ||
| dependencies: | ||
| - role: lib_utils | ||
| - role: openshift_facts | ||
| - role: container_runtime | ||
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,63 @@ | ||
| --- | ||
| - name: Check for legacy service | ||
| stat: | ||
| path: /lib/systemd/system/calico.service | ||
| get_checksum: false | ||
| get_attributes: false | ||
| get_mime: false | ||
| register: sym | ||
| - fail: | ||
| msg: You are running a systemd based installation of Calico. Please run the calico upgrade playbook to upgrade to a self-hosted installation. | ||
| when: sym.stat.exists | ||
|
|
||
| - name: Configure NetworkManager to ignore Calico interfaces | ||
| copy: | ||
| src: files/calico.conf | ||
| dest: /etc/NetworkManager/conf.d/ | ||
| when: using_network_manager | default(true) | bool | ||
| register: nm | ||
|
|
||
| - name: restart NetworkManager | ||
| systemd: | ||
| name: NetworkManager | ||
| state: restarted | ||
| when: nm.changed | ||
|
|
||
| # TODO: Move into shared vars file | ||
| - name: Load default node image | ||
| - include_tasks: certs.yml | ||
|
|
||
| - name: Calico Master | oc adm policy add-scc-to-user privileged system:serviceaccount:kube-system:calico-node | ||
| oc_adm_policy_user: | ||
| user: system:serviceaccount:kube-system:calico-node | ||
| resource_kind: scc | ||
| resource_name: privileged | ||
| state: present | ||
|
|
||
| - name: Calico Master | oc adm policy add-scc-to-user privileged system:serviceaccount:kube-system:calico-kube-controllers | ||
| oc_adm_policy_user: | ||
| user: system:serviceaccount:kube-system:calico-kube-controllers | ||
| resource_kind: scc | ||
| resource_name: privileged | ||
| state: present | ||
|
|
||
| - name: Calico Master | oc adm policy add-scc-to-user privileged system:serviceaccount:kube-system:calico-upgrade-job | ||
| oc_adm_policy_user: | ||
| user: system:serviceaccount:kube-system:calico-upgrade-job | ||
| resource_kind: scc | ||
| resource_name: privileged | ||
| state: present | ||
|
|
||
| - name: Set default selector for kube-system | ||
| command: > | ||
| {{ openshift_client_binary }} | ||
| --config={{ openshift.common.config_base }}/master/admin.kubeconfig | ||
| annotate ns kube-system openshift.io/node-selector="" --overwrite | ||
|
|
||
| - name: Calico Master | Create temp directory | ||
| command: mktemp -d /tmp/openshift-ansible-XXXXXXX | ||
| register: mktemp | ||
| changed_when: False | ||
|
|
||
| - name: Calico Master | Parse node version | ||
| set_fact: | ||
| calico_node_image: "quay.io/calico/node:v2.6.7" | ||
| when: calico_node_image is not defined | ||
| node_version: "{{ calico_node_image | regex_replace('^.*node:v?(.*)$', '\\1') }}" | ||
| cnx: "{{ calico_node_image | regex_replace('[^-]*', '\\0') }}" | ||
|
|
||
| - name: Prepull Images | ||
| command: "{{ openshift_container_cli }} pull {{ calico_node_image }}" | ||
|
|
||
| - name: Apply node label | ||
| delegate_to: "{{ groups.oo_first_master.0 }}" | ||
| - name: Calico Master | Write Calico v3 | ||
| template: | ||
| dest: "{{ mktemp.stdout }}/calico.yml" | ||
| src: calicov3.yml.j2 | ||
| when: (node_version | regex_search('^[0-9]\.[0-9]\.[0-9]') and node_version >= '3.0.0') or (node_version == 'master') or (cnx == "cnx" and node_version >= '2.0.0') | ||
|
|
||
| - name: Calico Master | Launch Calico | ||
| command: > | ||
| {{ openshift_client_binary }} --config={{ openshift.common.config_base }}/master/admin.kubeconfig label node {{ openshift.node.nodename | lower }} --overwrite projectcalico.org/ds-ready=true | ||
|
|
||
| - name: Wait for node running | ||
| uri: | ||
| url: http://localhost:9099/readiness | ||
| status_code: 204 | ||
| delay: 3 | ||
| retries: 10 | ||
| register: result | ||
| until: result.status == 204 | ||
| {{ openshift_client_binary }} apply | ||
| -f {{ mktemp.stdout }}/calico.yml | ||
| --config={{ openshift.common.config_base }}/master/admin.kubeconfig | ||
| register: calico_create_output | ||
| failed_when: "('already exists' not in calico_create_output.stderr) and ('created' not in calico_create_output.stdout) and calico_create_output.rc != 0" | ||
| changed_when: ('created' in calico_create_output.stdout) | ||
|
|
||
| - name: Calico Master | Delete temp directory | ||
| file: | ||
| name: "{{ mktemp.stdout }}" | ||
| state: absent | ||
| changed_when: False | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@vrutkovs This would explain why you're having issues connecting to services. Calico requires that NetworkManager be disabled on it's interfaces (cali*/tunl0), which you've removed in your PR. If NetworkManager is not disabled for these interfaces you will see frequent connectivity issues to pods (and therefore services).
Uh oh!
There was an error while loading. Please reload this page.
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.
@kprabhak that's somewhat surprising; what are the issues here and which versions of NM do you typically see them with? OpenShift installations (including ones with many, many nodes like OpenShift Online) typically run NetworkManager and we haven't had problems in those configurations.
Might we worth opening a discussion with the NetworkManager project ( https://github.com/NetworkManager/NetworkManager ) about it, since I'm sure they want to figure out if/how NM is interacting.
@thom311 @bengal @lkundrak
Uh oh!
There was an error while loading. Please reload this page.
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.
@dcbw This is due to the design elements for scale that are leveraged by Calico that are not exercised in the same way by ovs. Specifically, when all the pod interfaces on a node are reset by NetworkManager every few minutes, Calico has to withdraw the bgp route, and then wait for bgp route propagation & convergence on subsequent restore of the interfaces.
This is a design artifact of L3 routing protocols (avoiding route flapping in large-scale topologies), and something that will not be exposed in ovs.
Also, to clarify, the requirement is that NetworkManager be configured to ignore calico interfaces only, it can continue to operate on other interfaces on the system.
https://docs.projectcalico.org/v3.2/usage/troubleshooting/#configure-networkmanager
@ozdanborne @mgleung @dmmcquay
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.
We should probably add the NetworkManager config back in so that it will properly ignore any changes to the calico interfaces. This means that we will need to add the calico role that runs on each node back in.