forked from kubernetes-sigs/kubespray
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overhaul Cilium manifests to match the newer versions (kubernetes-sig…
…s#8717) * [cilium] Separate templates for cilium, cilium-operator, and hubble installations Signed-off-by: necatican <[email protected]> * [cilium] Update cilium-operator templates Signed-off-by: necatican <[email protected]> * [cilium] Allow using custom args and mounting extra volumes for the Cilium Operator Signed-off-by: necatican <[email protected]> * [cilium] Update the cilium configmap to filter out the deprecated variables, and add the new variables Signed-off-by: necatican <[email protected]> * [cilium] Add an option to use Wireguard encryption on Cilium 1.10 and up Signed-off-by: necatican <[email protected]> * [cilium] Update cilium-agent templates Signed-off-by: necatican <[email protected]> * [cilium] Bump Cilium version to 1.11.3 Signed-off-by: necatican <[email protected]>
- Loading branch information
Showing
25 changed files
with
606 additions
and
192 deletions.
There are no files selected for viewing
This file contains 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 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,4 +1,47 @@ | ||
# see roles/network_plugin/cilium/defaults/main.yml | ||
|
||
# cilium_version: "v1.11.0" | ||
# cilium_version: "v1.11.3" | ||
# cilium_identity_allocation_mode: kvstore # kvstore or crd | ||
|
||
# For adding and mounting extra volumes to the cilium operator | ||
# cilium_operator_extra_volumes: [] | ||
# cilium_operator_extra_volume_mounts: [] | ||
|
||
# Name of the cluster. Only relevant when building a mesh of clusters. | ||
# cilium_cluster_name: default | ||
|
||
# Unique ID of the cluster. Must be unique across all conneted clusters and | ||
# in the range of 1 and 255. Only relevant when building a mesh of clusters. | ||
# This value is not defined by default | ||
# cluster-id: | ||
|
||
# Allows to explicitly specify the IPv4 CIDR for native routing. | ||
# When specified, Cilium assumes networking for this CIDR is preconfigured and | ||
# hands traffic destined for that range to the Linux network stack without | ||
# applying any SNAT. | ||
# Generally speaking, specifying a native routing CIDR implies that Cilium can | ||
# depend on the underlying networking stack to route packets to their | ||
# destination. To offer a concrete example, if Cilium is configured to use | ||
# direct routing and the Kubernetes CIDR is included in the native routing CIDR, | ||
# the user must configure the routes to reach pods, either manually or by | ||
# setting the auto-direct-node-routes flag. | ||
# cilium_native_routing_cidr: "" | ||
|
||
# Allows to explicitly specify the IPv6 CIDR for native routing. | ||
# cilium_native_routing_cidr_ipv6: "" | ||
|
||
# Encryption | ||
# Enable transparent network encryption. | ||
# cilium_encryption_enabled: false | ||
|
||
# Encryption method. Can be either ipsec or wireguard. | ||
# Only effective when `cilium_encryption_enabled` is set to true. | ||
# cilium_encryption_type: "ipsec" | ||
|
||
# Enable encryption for pure node to node traffic. | ||
# This option is only effective when `cilium_encryption_type` is set to `ipsec`. | ||
# cilium_ipsec_node_encryption: "false" | ||
|
||
# Enables the fallback to the user-space implementation. | ||
# This option is only effective when `cilium_encryption_type` is set to `wireguard`. | ||
# cilium_wireguard_userspace_fallback: "false" |
This file contains 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 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 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 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,14 +1,66 @@ | ||
--- | ||
- name: Cilium | Check cilium_ipsec_enabled variables | ||
- name: Cilium | Check Cilium encryption `cilium_ipsec_key` for ipsec | ||
assert: | ||
that: | ||
- "cilium_ipsec_key is defined" | ||
msg: "cilium_ipsec_key should be defined to use cilium_ipsec_enabled" | ||
msg: "cilium_ipsec_key should be defined to enable encryption using ipsec" | ||
when: | ||
- cilium_ipsec_enabled | ||
- cilium_encryption_enabled | ||
- cilium_encryption_type == "ipsec" | ||
- cilium_tunnel_mode in ['vxlan'] | ||
|
||
# TODO: Clean this task up when we drop backward compatibility support for `cilium_ipsec_enabled` | ||
- name: Stop if `cilium_ipsec_enabled` is defined and `cilium_encryption_type` is not `ipsec` | ||
assert: | ||
that: cilium_encryption_type == 'ipsec' | ||
msg: > | ||
It is not possible to use `cilium_ipsec_enabled` when `cilium_encryption_type` is set to {{ cilium_encryption_type }}. | ||
when: | ||
- cilium_ipsec_enabled is defined | ||
- cilium_ipsec_enabled | ||
- kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool | ||
|
||
- name: Stop if kernel version is too low for Cilium Wireguard encryption | ||
assert: | ||
that: ansible_kernel.split('-')[0] is version('5.6.0', '>=') | ||
when: | ||
- kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool | ||
- cilium_encryption_enabled | ||
- cilium_encryption_type == "wireguard" | ||
- not ignore_assert_errors | ||
|
||
- name: Stop if bad Cilium identity allocation mode | ||
assert: | ||
that: cilium_identity_allocation_mode in ['crd', 'kvstore'] | ||
msg: "cilium_identity_allocation_mode must be either 'crd' or 'kvstore'" | ||
|
||
- name: Stop if bad Cilium Cluster ID | ||
assert: | ||
that: | ||
- cilium_cluster_id <= 255 | ||
- cilium_cluster_id >= 0 | ||
msg: "'cilium_cluster_id' must be between 1 and 255" | ||
when: cilium_cluster_id is defined | ||
|
||
- name: Stop if bad encryption type | ||
assert: | ||
that: cilium_encryption_type in ['ipsec', 'wireguard'] | ||
msg: "cilium_encryption_type must be either 'ipsec' or 'wireguard'" | ||
when: cilium_encryption_enabled | ||
|
||
- name: Stop if `cilium_encryption_type` is set to "wireguard" and cilium_version is < v1.10.0 | ||
assert: | ||
that: cilium_version | regex_replace('v') is version('1.10', '>') | ||
msg: "cilium_encryption_type is set to 'wireguard' but cilium_version is < v1.10.0" | ||
when: | ||
- cilium_encryption_enabled | ||
- cilium_encryption_type == "wireguard" | ||
|
||
# TODO: Clean this task up when we drop backward compatibility support for `cilium_ipsec_enabled` | ||
- name: Set `cilium_encryption_type` to "ipsec" and if `cilium_ipsec_enabled` is true | ||
set_fact: | ||
cilium_encryption_type: ipsec | ||
cilium_encryption_enabled: true | ||
when: | ||
- cilium_ipsec_enabled is defined | ||
- cilium_ipsec_enabled |
Oops, something went wrong.