-
-
Notifications
You must be signed in to change notification settings - Fork 788
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Installed using Ansible instead of ArgoCD because Cilium replaces the default CNI, so ArgoCD pod cannot be scheduled before Cilium is installed.
- Loading branch information
Showing
9 changed files
with
78 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.POSIX: | ||
|
||
env ?= "prod" | ||
env ?= prod | ||
export KUBECONFIG = $(shell pwd)/kubeconfig.yaml | ||
|
||
default: boot cluster | ||
|
||
|
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,3 +3,8 @@ | |
roles: | ||
- k3s | ||
- automatic_upgrade | ||
|
||
- name: Install Kubernetes addons | ||
hosts: localhost | ||
roles: | ||
- cilium |
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,20 @@ | ||
cilium_repo_url: https://helm.cilium.io | ||
cilium_version: 1.14.4 | ||
cilium_namespace: kube-system | ||
cilium_values: | ||
operator: | ||
replicas: 1 | ||
kubeProxyReplacement: true | ||
l2announcements: | ||
enabled: true | ||
ingressController: | ||
enabled: true | ||
default: true | ||
loadbalancerMode: shared | ||
service: | ||
allocateLoadBalancerNodePorts: false | ||
# TODO the host and port are k3s-specific, generic solution is in progress | ||
# https://github.com/cilium/cilium/issues/19038 | ||
# https://github.com/cilium/cilium/pull/28741 | ||
k8sServiceHost: 127.0.0.1 | ||
k8sServicePort: 6444 |
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: Install Cilium | ||
kubernetes.core.helm: | ||
name: cilium | ||
chart_ref: cilium | ||
chart_repo_url: "{{ cilium_repo_url }}" | ||
chart_version: "{{ cilium_version }}" | ||
release_namespace: "{{ cilium_namespace }}" | ||
values: "{{ cilium_values }}" | ||
|
||
- name: Wait for Cilium CRDs | ||
kubernetes.core.k8s_info: | ||
kind: CustomResourceDefinition | ||
name: "{{ item }}" | ||
loop: | ||
- ciliuml2announcementpolicies.cilium.io | ||
- ciliumloadbalancerippools.cilium.io | ||
register: crd | ||
until: crd.resources | length > 0 | ||
retries: 5 | ||
delay: 10 | ||
|
||
- name: Apply Cilium resources | ||
kubernetes.core.k8s: | ||
template: "{{ item }}" | ||
loop: | ||
- ciliuml2announcementpolicy.yaml | ||
- ciliumloadbalancerippool.yaml |
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,7 @@ | ||
apiVersion: cilium.io/v2alpha1 | ||
kind: CiliumL2AnnouncementPolicy | ||
metadata: | ||
name: default | ||
spec: | ||
externalIPs: true | ||
loadBalancerIPs: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: cilium.io/v2alpha1 | ||
kind: CiliumLoadBalancerIPPool | ||
metadata: | ||
name: default | ||
spec: | ||
cidrs: | ||
{% for cidr in load_balancer_ip_pool %} | ||
- cidr: {{ cidr }} | ||
{% endfor %} |
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