mirror of
https://github.com/geerlingguy/ansible-role-kubernetes.git
synced 2025-08-01 13:49:01 +02:00
add cilium
This commit is contained in:
parent
3443efe8db
commit
e43da173b4
@ -51,3 +51,6 @@ kubernetes_flannel_manifest_file: https://raw.githubusercontent.com/coreos/flann
|
|||||||
|
|
||||||
# Calico config files
|
# Calico config files
|
||||||
kubernetes_calico_manifest_file: https://docs.projectcalico.org/v3.10/manifests/calico.yaml
|
kubernetes_calico_manifest_file: https://docs.projectcalico.org/v3.10/manifests/calico.yaml
|
||||||
|
|
||||||
|
# Cilium config files
|
||||||
|
kubernetes_cilium_manifest_file: https://raw.githubusercontent.com/cilium/cilium/v1.9/install/kubernetes/quick-install.yaml
|
||||||
|
@ -60,6 +60,39 @@
|
|||||||
changed_when: "'created' in weave_result.stdout"
|
changed_when: "'created' in weave_result.stdout"
|
||||||
when: kubernetes_pod_network.cni == 'weave'
|
when: kubernetes_pod_network.cni == 'weave'
|
||||||
|
|
||||||
|
- name: Create temporary directory for Cilium kustomization.
|
||||||
|
tempfile:
|
||||||
|
state: directory
|
||||||
|
prefix: "cilium-kustomize."
|
||||||
|
register: cilium_kustomize_dir
|
||||||
|
when: kubernetes_pod_network.cni == 'cilium'
|
||||||
|
|
||||||
|
- name: Get cilium manifest.
|
||||||
|
get_url:
|
||||||
|
url: "{{ kubernetes_cilium_manifest_file }}"
|
||||||
|
dest: "{{ cilium_kustomize_dir.path }}/cilium.yaml"
|
||||||
|
when: kubernetes_pod_network.cni == 'cilium'
|
||||||
|
|
||||||
|
- name: Add cilium kustomization.yaml.
|
||||||
|
template:
|
||||||
|
src: "cilium-kustomization.yaml"
|
||||||
|
dest: "{{ cilium_kustomize_dir.path }}/kustomization.yaml"
|
||||||
|
when: kubernetes_pod_network.cni == 'cilium'
|
||||||
|
|
||||||
|
- name: Add cilium patch.yaml.
|
||||||
|
template:
|
||||||
|
src: "cilium-patch.yaml"
|
||||||
|
dest: "{{ cilium_kustomize_dir.path }}/patch.yaml"
|
||||||
|
when: kubernetes_pod_network.cni == 'cilium'
|
||||||
|
|
||||||
|
- name: Configure Cilium networking.
|
||||||
|
command: "{{ item }}"
|
||||||
|
with_items:
|
||||||
|
- kubectl apply -k {{ cilium_kustomize_dir.path }}
|
||||||
|
register: cilium_result
|
||||||
|
changed_when: "'created' in cilium_result.stdout"
|
||||||
|
when: kubernetes_pod_network.cni == 'cilium'
|
||||||
|
|
||||||
# TODO: Check if taint exists with something like `kubectl describe nodes`
|
# TODO: Check if taint exists with something like `kubectl describe nodes`
|
||||||
# instead of using kubernetes_init_stat.stat.exists check.
|
# instead of using kubernetes_init_stat.stat.exists check.
|
||||||
- name: Allow pods on master node (if configured).
|
- name: Allow pods on master node (if configured).
|
||||||
|
9
templates/cilium-kustomization.yaml
Normal file
9
templates/cilium-kustomization.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
resources:
|
||||||
|
- cilium.yaml
|
||||||
|
|
||||||
|
patchesJson6902:
|
||||||
|
- path: patch.yaml
|
||||||
|
target:
|
||||||
|
version: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
name: cilium-config
|
3
templates/cilium-patch.yaml
Normal file
3
templates/cilium-patch.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
- op: replace
|
||||||
|
path: /data/cluster-pool-ipv4-cidr
|
||||||
|
value: "{{ kubernetes_pod_network.cidr }}"
|
Loading…
Reference in New Issue
Block a user