forked from kubernetes-sigs/kubespray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Network plugin custom (kubernetes-sigs#9819)
* network_plugin/custom_cni: add CNI to apply provided manifests Add a new simple custom_cni to install provided Kubernetes manifests. This could be useful to use manifests directly provided by a CNI when there are not support by Kubespray (i.e.: helm chart or any other manifests generation method). Co-authored-by: James Landrein <james.landrein@proton.ch> Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * network_plugin/custom_cni: add test with cilium Co-authored-by: James Landrein <james.landrein@proton.ch> Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> --------- Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> Co-authored-by: James Landrein <james.landrein@proton.ch>
- Loading branch information
1 parent
27eac26
commit b871987
Showing
12 changed files
with
1,184 additions
and
52 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
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 |
---|---|---|
|
@@ -3,6 +3,8 @@ extends: default | |
|
||
ignore: | | ||
.git/ | ||
# Generated file | ||
tests/files/custom_cni/cilium.yaml | ||
|
||
rules: | ||
braces: | ||
|
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
|
||
custom_cni_manifests: [] |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
|
||
- name: Cilium | Check Cilium encryption `cilium_ipsec_key` for ipsec | ||
assert: | ||
that: | ||
- "custom_cni_manifests | length > 0" | ||
msg: "custom_cni_manifests should not be empty" | ||
|
||
- name: Custom CNI | Copy Custom manifests | ||
template: | ||
src: "{{ item }}" | ||
dest: "{{ kube_config_dir }}/{{ item | basename | replace('.j2', '') }}" | ||
mode: 0644 | ||
loop: "{{ custom_cni_manifests }}" | ||
delegate_to: "{{ groups['kube_control_plane'] | first }}" | ||
run_once: true | ||
|
||
- name: Custom CNI | Start Resources | ||
kube: | ||
namespace: "kube-system" | ||
kubectl: "{{ bin_dir }}/kubectl" | ||
filename: "{{ kube_config_dir }}/{{ item | basename | replace('.j2', '') }}" | ||
state: "latest" | ||
wait: true | ||
loop: "{{ custom_cni_manifests }}" | ||
delegate_to: "{{ groups['kube_control_plane'] | first }}" | ||
run_once: true |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Custom CNI manifest generation | ||
|
||
As an example we are using Cilium for testing the network_plugins/custom_cni. | ||
|
||
To update the generated manifests to the latest version do the following: | ||
|
||
```sh | ||
helm repo add cilium https://helm.cilium.io/ | ||
helm repo update | ||
helm template cilium/cilium -n kube-system -f values.yaml > cilium.yaml | ||
``` |
Oops, something went wrong.