actualized for kubespray version 2.28.0
This commit is contained in:
@@ -24,22 +24,11 @@
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
|
||||
|
||||
- name: Stop if incompatible network plugin and cloudprovider
|
||||
assert:
|
||||
that:
|
||||
- calico_ipip_mode == 'Never'
|
||||
- calico_vxlan_mode in ['Always', 'CrossSubnet']
|
||||
msg: "When using cloud_provider azure and network_plugin calico calico_ipip_mode must be 'Never' and calico_vxlan_mode 'Always' or 'CrossSubnet'"
|
||||
when:
|
||||
- cloud_provider is defined and cloud_provider == 'azure'
|
||||
run_once: true
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
|
||||
- name: Stop if supported Calico versions
|
||||
assert:
|
||||
that:
|
||||
- "calico_version in calico_crds_archive_checksums.keys()"
|
||||
msg: "Calico version not supported {{ calico_version }} not in {{ calico_crds_archive_checksums.keys() }}"
|
||||
- "calico_version in calico_crds_archive_checksums.no_arch.keys()"
|
||||
msg: "Calico version not supported {{ calico_version }} not in {{ calico_crds_archive_checksums.no_arch.keys() }}"
|
||||
run_once: true
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
|
||||
@@ -76,7 +65,7 @@
|
||||
- name: Assert that current calico version is enough for upgrade
|
||||
assert:
|
||||
that:
|
||||
- calico_version_on_server.stdout is version(calico_min_version_required, '>=')
|
||||
- calico_version_on_server.stdout.removeprefix('v') is version(calico_min_version_required, '>=')
|
||||
msg: >
|
||||
Your version of calico is not fresh enough for upgrade.
|
||||
Minimum version is {{ calico_min_version_required }} supported by the previous kubespray release.
|
||||
@@ -157,12 +146,16 @@
|
||||
check_mode: false
|
||||
register: calico
|
||||
run_once: true
|
||||
when: ipv4_stack | bool
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
|
||||
- name: "Set calico_pool_conf"
|
||||
set_fact:
|
||||
calico_pool_conf: '{{ calico.stdout | from_json }}'
|
||||
when: calico.rc == 0 and calico.stdout
|
||||
when:
|
||||
- ipv4_stack | bool
|
||||
- calico is defined
|
||||
- calico.rc == 0 and calico.stdout
|
||||
run_once: true
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
|
||||
@@ -175,10 +168,45 @@
|
||||
- not calico_pool_conf.spec.vxlanMode is defined or calico_pool_conf.spec.vxlanMode == calico_vxlan_mode
|
||||
msg: "Your inventory doesn't match the current cluster configuration"
|
||||
when:
|
||||
- ipv4_stack | bool
|
||||
- calico_pool_conf is defined
|
||||
run_once: true
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
|
||||
- name: "Get Calico {{ calico_pool_name }}-ipv6 configuration"
|
||||
command: "{{ bin_dir }}/calicoctl.sh get ipPool {{ calico_pool_name }}-ipv6 -o json"
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
check_mode: false
|
||||
register: calico_ipv6
|
||||
run_once: true
|
||||
when: ipv6_stack | bool
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
|
||||
- name: "Set calico_pool_ipv6_conf"
|
||||
set_fact:
|
||||
calico_pool_conf: '{{ calico_ipv6.stdout | from_json }}'
|
||||
when:
|
||||
- ipv6_stack | bool
|
||||
- alico_ipv6 is defined
|
||||
- calico_ipv6.rc == 0 and calico_ipv6.stdout
|
||||
run_once: true
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
|
||||
- name: "Check if ipv6 inventory match current cluster configuration"
|
||||
assert:
|
||||
that:
|
||||
- calico_pool_conf.spec.blockSize | int == calico_pool_blocksize_ipv6 | int
|
||||
- calico_pool_conf.spec.cidr == (calico_pool_cidr_ipv6 | default(kube_pods_subnet_ipv6))
|
||||
- not calico_pool_conf.spec.ipipMode is defined or calico_pool_conf.spec.ipipMode == calico_ipip_mode_ipv6
|
||||
- not calico_pool_conf.spec.vxlanMode is defined or calico_pool_conf.spec.vxlanMode == calico_vxlan_mode_ipv6
|
||||
msg: "Your ipv6 inventory doesn't match the current cluster configuration"
|
||||
when:
|
||||
- ipv6_stack | bool
|
||||
- calico_pool_ipv6_conf is defined
|
||||
run_once: true
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
|
||||
- name: "Check kdd calico_datastore if calico_apiserver_enabled"
|
||||
assert:
|
||||
that: calico_datastore == "kdd"
|
||||
@@ -202,7 +230,6 @@
|
||||
that:
|
||||
- "calico_ipip_mode_ipv6 in ['Never']"
|
||||
msg: "Calico doesn't support ipip tunneling for the IPv6"
|
||||
when:
|
||||
- enable_dual_stack_networks
|
||||
when: ipv6_stack | bool
|
||||
run_once: true
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
changed_when: false
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- ipv4_stack | bool
|
||||
|
||||
- name: Calico | Ensure that calico_pool_cidr is within kube_pods_subnet when defined
|
||||
assert:
|
||||
@@ -91,8 +92,9 @@
|
||||
msg: "{{ calico_pool_cidr }} is not within or equal to {{ kube_pods_subnet }}"
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- 'calico_conf.stdout == "0"'
|
||||
- ipv4_stack | bool
|
||||
- calico_pool_cidr is defined
|
||||
- 'calico_conf.stdout == "0"'
|
||||
|
||||
- name: Calico | Check if calico IPv6 network pool has already been configured
|
||||
# noqa risky-shell-pipe - grep will exit 1 if no match found
|
||||
@@ -107,7 +109,7 @@
|
||||
changed_when: false
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- enable_dual_stack_networks
|
||||
- ipv6_stack
|
||||
|
||||
- name: Calico | Ensure that calico_pool_cidr_ipv6 is within kube_pods_subnet_ipv6 when defined
|
||||
assert:
|
||||
@@ -115,29 +117,29 @@
|
||||
msg: "{{ calico_pool_cidr_ipv6 }} is not within or equal to {{ kube_pods_subnet_ipv6 }}"
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- ipv6_stack | bool
|
||||
- calico_conf_ipv6.stdout is defined and calico_conf_ipv6.stdout == "0"
|
||||
- calico_pool_cidr_ipv6 is defined
|
||||
- enable_dual_stack_networks
|
||||
|
||||
- name: Calico | kdd specific configuration
|
||||
when:
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- ('kube_control_plane' in group_names)
|
||||
- calico_datastore == "kdd"
|
||||
block:
|
||||
- name: Calico | Check if extra directory is needed
|
||||
stat:
|
||||
path: "{{ local_release_dir }}/calico-{{ calico_version }}-kdd-crds/{{ 'kdd' if (calico_version is version('v3.22.3', '<')) else 'crd' }}"
|
||||
path: "{{ local_release_dir }}/calico-{{ calico_version }}-kdd-crds/{{ 'kdd' if (calico_version is version('3.22.3', '<')) else 'crd' }}"
|
||||
register: kdd_path
|
||||
- name: Calico | Set kdd path when calico < v3.22.3
|
||||
set_fact:
|
||||
calico_kdd_path: "{{ local_release_dir }}/calico-{{ calico_version }}-kdd-crds{{ '/kdd' if kdd_path.stat.exists is defined and kdd_path.stat.exists }}"
|
||||
when:
|
||||
- calico_version is version('v3.22.3', '<')
|
||||
- name: Calico | Set kdd path when calico > v3.22.2
|
||||
- calico_version is version('3.22.3', '<')
|
||||
- name: Calico | Set kdd path when calico > 3.22.2
|
||||
set_fact:
|
||||
calico_kdd_path: "{{ local_release_dir }}/calico-{{ calico_version }}-kdd-crds{{ '/crd' if kdd_path.stat.exists is defined and kdd_path.stat.exists }}"
|
||||
when:
|
||||
- calico_version is version('v3.22.2', '>')
|
||||
- calico_version is version('3.22.2', '>')
|
||||
- name: Calico | Create calico manifests for kdd
|
||||
assemble:
|
||||
src: "{{ calico_kdd_path }}"
|
||||
@@ -206,6 +208,7 @@
|
||||
- name: Calico | Configure Calico IP Pool
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- ipv4_stack | bool
|
||||
block:
|
||||
- name: Calico | Get existing calico network pool
|
||||
command: "{{ bin_dir }}/calicoctl.sh get ippool {{ calico_pool_name }} -o json"
|
||||
@@ -256,7 +259,7 @@
|
||||
- name: Calico | Configure Calico IPv6 Pool
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- enable_dual_stack_networks | bool
|
||||
- ipv6_stack | bool
|
||||
block:
|
||||
- name: Calico | Get existing calico ipv6 network pool
|
||||
command: "{{ bin_dir }}/calicoctl.sh get ippool {{ calico_pool_name }}-ipv6 -o json"
|
||||
@@ -321,7 +324,7 @@
|
||||
nodeToNodeMeshEnabled: "false"
|
||||
when:
|
||||
- peer_with_router | default(false) or peer_with_calico_rr | default(false)
|
||||
- inventory_hostname in groups['k8s_cluster']
|
||||
- ('k8s_cluster' in group_names)
|
||||
run_once: true
|
||||
|
||||
- name: Calico | Configure Calico BGP
|
||||
@@ -350,7 +353,15 @@
|
||||
{% if not calico_no_global_as_num | default(false) %}"asNumber": {{ global_as_num }},{% endif %}
|
||||
"nodeToNodeMeshEnabled": {{ nodeToNodeMeshEnabled | default('true') }} ,
|
||||
{% if calico_advertise_cluster_ips | default(false) %}
|
||||
"serviceClusterIPs": [{"cidr": "{{ kube_service_addresses }}" } {{ ',{"cidr":"' + kube_service_addresses_ipv6 + '"}' if enable_dual_stack_networks else '' }}],{% endif %}
|
||||
"serviceClusterIPs": >-
|
||||
{%- if ipv4_stack and ipv6_stack-%}
|
||||
[{"cidr": "{{ kube_service_addresses }}", "cidr": "{{ kube_service_addresses_ipv6 }}"}],
|
||||
{%- elif ipv6_stack-%}
|
||||
[{"cidr": "{{ kube_service_addresses_ipv6 }}"}],
|
||||
{%- else -%}
|
||||
[{"cidr": "{{ kube_service_addresses }}"}],
|
||||
{%- endif -%}
|
||||
{% endif %}
|
||||
{% if calico_advertise_service_loadbalancer_ips | length > 0 %}"serviceLoadBalancerIPs": {{ _service_loadbalancer_ips }},{% endif %}
|
||||
"serviceExternalIPs": {{ _service_external_ips | default([]) }}
|
||||
}
|
||||
@@ -382,7 +393,7 @@
|
||||
- {name: kubernetes-services-endpoint, file: kubernetes-services-endpoint.yml, type: cm }
|
||||
register: calico_node_manifests
|
||||
when:
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- ('kube_control_plane' in group_names)
|
||||
- rbac_enabled or item.type not in rbac_resources
|
||||
|
||||
- name: Calico | Create calico manifests for typha
|
||||
@@ -394,7 +405,7 @@
|
||||
- {name: calico, file: calico-typha.yml, type: typha}
|
||||
register: calico_node_typha_manifest
|
||||
when:
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- ('kube_control_plane' in group_names)
|
||||
- typha_enabled
|
||||
|
||||
- name: Calico | get calico apiserver caBundle
|
||||
@@ -421,7 +432,7 @@
|
||||
- {name: calico, file: calico-apiserver.yml, type: calico-apiserver}
|
||||
register: calico_apiserver_manifest
|
||||
when:
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- ('kube_control_plane' in group_names)
|
||||
- calico_apiserver_enabled
|
||||
|
||||
- name: Start Calico resources
|
||||
@@ -473,7 +484,7 @@
|
||||
with_items:
|
||||
- {name: calico, file: calico-ipamconfig.yml, type: ipam}
|
||||
when:
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- ('kube_control_plane' in group_names)
|
||||
- calico_datastore == "kdd"
|
||||
|
||||
- name: Calico | Create ipamconfig resources
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
when:
|
||||
- calico_rr_id is defined
|
||||
- calico_group_id is defined
|
||||
- inventory_hostname in groups['calico_rr']
|
||||
- ('calico_rr' in group_names)
|
||||
|
||||
- name: Calico | Configure peering with route reflectors at global scope
|
||||
command:
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
cmd: "{{ bin_dir }}/calicoctl.sh get node {{ inventory_hostname }}"
|
||||
register: output_get_node
|
||||
when:
|
||||
- inventory_hostname in groups['k8s_cluster']
|
||||
- ('k8s_cluster' in group_names)
|
||||
- local_as is defined
|
||||
- groups['calico_rr'] | default([]) | length == 0
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
@@ -50,7 +50,7 @@
|
||||
until: output.rc == 0
|
||||
delay: "{{ retry_stagger | random + 3 }}"
|
||||
when:
|
||||
- inventory_hostname in groups['k8s_cluster']
|
||||
- ('k8s_cluster' in group_names)
|
||||
- local_as is defined
|
||||
- groups['calico_rr'] | default([]) | length == 0
|
||||
- output_get_node.rc == 0
|
||||
@@ -77,7 +77,7 @@
|
||||
until: output.rc == 0
|
||||
delay: "{{ retry_stagger | random + 3 }}"
|
||||
when:
|
||||
- inventory_hostname in groups['k8s_cluster']
|
||||
- ('k8s_cluster' in group_names)
|
||||
- local_as is defined
|
||||
- groups['calico_rr'] | default([]) | length == 0
|
||||
- output_get_node.rc != 0
|
||||
@@ -97,9 +97,12 @@
|
||||
"asNumber": "{{ item.as }}",
|
||||
"node": "{{ inventory_hostname }}",
|
||||
"peerIP": "{{ item.router_id }}",
|
||||
{% if calico_version is version('v3.26.0', '>=') and (item.filters | default([]) | length > 0) %}
|
||||
{% if calico_version is version('3.26.0', '>=') and (item.filters | default([]) | length > 0) %}
|
||||
"filters": {{ item.filters }},
|
||||
{% endif %}
|
||||
{% if calico_version is version('3.23.0', '>=') and (item.numallowedlocalasnumbers | default(0) > 0) %}
|
||||
"numAllowedLocalASNumbers": {{ item.numallowedlocalasnumbers }},
|
||||
{% endif %}
|
||||
"sourceAddress": "{{ item.sourceaddress | default('UseNodeIP') }}"
|
||||
}}
|
||||
register: output
|
||||
@@ -110,4 +113,4 @@
|
||||
- "{{ peers | default([]) | selectattr('scope', 'undefined') | list | union(peers | default([]) | selectattr('scope', 'defined') | selectattr('scope', 'equalto', 'node') | list ) }}"
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
when:
|
||||
- inventory_hostname in groups['k8s_cluster']
|
||||
- ('k8s_cluster' in group_names)
|
||||
|
||||
@@ -20,17 +20,6 @@
|
||||
- "'plugins' in calico_cni_config"
|
||||
- "'etcd_endpoints' in calico_cni_config.plugins.0"
|
||||
|
||||
- name: Calico | Get kubelet hostname
|
||||
shell: >-
|
||||
set -o pipefail && {{ kubectl }} get node -o custom-columns='NAME:.metadata.name,INTERNAL-IP:.status.addresses[?(@.type=="InternalIP")].address'
|
||||
| egrep "{{ ansible_all_ipv4_addresses | join('$|') }}$" | cut -d" " -f1
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: calico_kubelet_name
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
when:
|
||||
- "cloud_provider is defined"
|
||||
|
||||
- name: Calico | Gather os specific variables
|
||||
include_vars: "{{ item }}"
|
||||
with_first_found:
|
||||
|
||||
@@ -72,7 +72,7 @@ spec:
|
||||
initialDelaySeconds: 90
|
||||
periodSeconds: 10
|
||||
name: calico-apiserver
|
||||
{% if calico_version is version('v3.28.0', '>=') %}
|
||||
{% if calico_version is version('3.28.0', '>=') %}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /readyz
|
||||
@@ -176,6 +176,7 @@ rules:
|
||||
- ipamblocks
|
||||
- blockaffinities
|
||||
- caliconodestatuses
|
||||
- tiers
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
@@ -183,7 +184,7 @@ rules:
|
||||
- create
|
||||
- update
|
||||
- delete
|
||||
{% if calico_version is version('v3.28.0', '>=') %}
|
||||
{% if calico_version is version('3.28.0', '>=') %}
|
||||
- apiGroups:
|
||||
- policy
|
||||
resourceNames:
|
||||
|
||||
@@ -53,13 +53,15 @@ data:
|
||||
"type": "host-local",
|
||||
"subnet": "usePodCidr"
|
||||
},
|
||||
{% else %}
|
||||
{% else %}
|
||||
"ipam": {
|
||||
"type": "calico-ipam",
|
||||
{% if enable_dual_stack_networks %}
|
||||
"assign_ipv6": "true",
|
||||
{% endif %}
|
||||
"assign_ipv4": "true"
|
||||
{% if ipv4_stack %}
|
||||
"assign_ipv4": "true"{{ ',' if (ipv6_stack and ipv4_stack) }}
|
||||
{% endif %}
|
||||
{% if ipv6_stack %}
|
||||
"assign_ipv6": "true"
|
||||
{% endif %}
|
||||
},
|
||||
{% endif %}
|
||||
{% if calico_allow_ip_forwarding %}
|
||||
|
||||
@@ -86,6 +86,13 @@ rules:
|
||||
verbs:
|
||||
- watch
|
||||
- list
|
||||
# Watch for changes to Kubernetes AdminNetworkPolicies.
|
||||
- apiGroups: ["policy.networking.k8s.io"]
|
||||
resources:
|
||||
- adminnetworkpolicies
|
||||
verbs:
|
||||
- watch
|
||||
- list
|
||||
# Used by Calico for policy information.
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
@@ -121,10 +128,17 @@ rules:
|
||||
- hostendpoints
|
||||
- blockaffinities
|
||||
- caliconodestatuses
|
||||
- tiers
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
# Calico creates some tiers on startup.
|
||||
- apiGroups: ["crd.projectcalico.org"]
|
||||
resources:
|
||||
- tiers
|
||||
verbs:
|
||||
- create
|
||||
# Calico must create and update some CRDs on startup.
|
||||
- apiGroups: ["crd.projectcalico.org"]
|
||||
resources:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
# This manifest installs the calico/node container, as well
|
||||
# as the Calico CNI plugins and network config on
|
||||
# each master and worker node in a Kubernetes cluster.
|
||||
# each control plane and worker node in a Kubernetes cluster.
|
||||
kind: DaemonSet
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
@@ -13,6 +13,10 @@ spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: calico-node
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
maxUnavailable: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
@@ -30,10 +34,16 @@ spec:
|
||||
{{ calico_ds_nodeselector }}
|
||||
priorityClassName: system-node-critical
|
||||
hostNetwork: true
|
||||
dnsPolicy: ClusterFirstWithHostNet
|
||||
serviceAccountName: calico-node
|
||||
tolerations:
|
||||
- operator: Exists
|
||||
# Make sure calico-node gets scheduled on all nodes.
|
||||
- effect: NoSchedule
|
||||
operator: Exists
|
||||
# Mark the pod as a critical add-on for rescheduling.
|
||||
- key: CriticalAddonsOnly
|
||||
operator: Exists
|
||||
- effect: NoExecute
|
||||
operator: Exists
|
||||
# Minimize downtime during a rolling upgrade or deletion; tell Kubernetes to do a "force
|
||||
# deletion": https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods.
|
||||
terminationGracePeriodSeconds: 0
|
||||
@@ -90,9 +100,11 @@ spec:
|
||||
# Name of the CNI config file to create.
|
||||
- name: CNI_CONF_NAME
|
||||
value: "10-calico.conflist"
|
||||
# Install CNI binaries
|
||||
- name: UPDATE_CNI_BINARIES
|
||||
value: "true"
|
||||
{% if calico_mtu is defined %}
|
||||
# CNI MTU Config variable
|
||||
- name: CNI_MTU
|
||||
value: "{{ calico_veth_mtu | default(calico_mtu) }}"
|
||||
{% endif %}
|
||||
# Prevents the container from sleeping forever.
|
||||
- name: SLEEP
|
||||
value: "false"
|
||||
@@ -117,14 +129,29 @@ spec:
|
||||
name: cni-bin-dir
|
||||
securityContext:
|
||||
privileged: true
|
||||
# Adds a Flex Volume Driver that creates a per-pod Unix Domain Socket to allow Dikastes
|
||||
# to communicate with Felix over the Policy Sync API.
|
||||
- name: flexvol-driver
|
||||
image: {{ calico_flexvol_image_repo }}:{{ calico_flexvol_image_tag }}
|
||||
# This init container mounts the necessary filesystems needed by the BPF data plane
|
||||
# i.e. bpf at /sys/fs/bpf and cgroup2 at /run/calico/cgroup. Calico-node initialisation is executed
|
||||
# in best effort fashion, i.e. no failure for errors, to not disrupt pod creation in iptable mode.
|
||||
- name: "mount-bpffs"
|
||||
image: {{ calico_node_image_repo }}:{{ calico_node_image_tag }}
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
command: ["calico-node", "-init", "-best-effort"]
|
||||
volumeMounts:
|
||||
- name: flexvol-driver-host
|
||||
mountPath: /host/driver
|
||||
- mountPath: /sys/fs
|
||||
name: sys-fs
|
||||
# Bidirectional is required to ensure that the new mount we make at /sys/fs/bpf propagates to the host
|
||||
# so that it outlives the init container.
|
||||
mountPropagation: Bidirectional
|
||||
- mountPath: /var/run/calico
|
||||
name: var-run-calico
|
||||
# Bidirectional is required to ensure that the new mount we make at /run/calico/cgroup propagates to the host
|
||||
# so that it outlives the init container.
|
||||
mountPropagation: Bidirectional
|
||||
# Mount /proc/ from host which usually is an init program at /nodeproc. It's needed by mountns binary,
|
||||
# executed by calico-node, to mount root cgroup2 fs at /run/calico/cgroup to attach CTLB programs correctly.
|
||||
- mountPath: /nodeproc
|
||||
name: nodeproc
|
||||
readOnly: true
|
||||
securityContext:
|
||||
privileged: true
|
||||
containers:
|
||||
@@ -205,10 +232,7 @@ spec:
|
||||
key: calico_backend
|
||||
# Cluster type to identify the deployment type
|
||||
- name: CLUSTER_TYPE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: calico-config
|
||||
key: cluster_type
|
||||
value: "k8s,bgp"
|
||||
# Set noderef for node controller.
|
||||
- name: CALICO_K8S_NODE_REF
|
||||
valueFrom:
|
||||
@@ -230,14 +254,18 @@ spec:
|
||||
value: "{{ calico_iptables_backend }}"
|
||||
- name: FELIX_IPTABLESLOCKTIMEOUTSECS
|
||||
value: "{{ calico_iptables_lock_timeout_secs }}"
|
||||
# should be set in etcd before deployment
|
||||
# # Configure the IP Pool from which Pod IPs will be chosen.
|
||||
# - name: CALICO_IPV4POOL_CIDR
|
||||
# value: "{{ calico_pool_cidr | default(kube_pods_subnet) }}"
|
||||
# The default IPv4 pool to create on startup if none exists. Pod IPs will be
|
||||
# chosen from this range. Changing this value after installation will have
|
||||
# no effect. This should fall within `--cluster-cidr`.
|
||||
# - name: CALICO_IPV4POOL_CIDR
|
||||
# value: "192.168.0.0/16"
|
||||
- name: CALICO_IPV4POOL_IPIP
|
||||
value: "{{ calico_ipv4pool_ipip }}"
|
||||
# Enable or Disable VXLAN on the default IP pool.
|
||||
- name: CALICO_IPV4POOL_VXLAN
|
||||
value: "Never"
|
||||
- name: FELIX_IPV6SUPPORT
|
||||
value: "{{ enable_dual_stack_networks | default(false) }}"
|
||||
value: "{{ ipv6_stack | default(false) }}"
|
||||
# Set Felix logging to "info"
|
||||
- name: FELIX_LOGSEVERITYSCREEN
|
||||
value: "{{ calico_loglevel }}"
|
||||
@@ -280,9 +308,18 @@ spec:
|
||||
- name: IP_AUTODETECTION_METHOD
|
||||
value: "can-reach=$(NODEIP)"
|
||||
{% endif %}
|
||||
{% if ipv4_stack %}
|
||||
- name: IP
|
||||
value: "autodetect"
|
||||
{% if calico_ip6_auto_method is defined and enable_dual_stack_networks %}
|
||||
{% else %}
|
||||
- name: IP
|
||||
value: none
|
||||
{% endif %}
|
||||
{% if ipv6_stack %}
|
||||
- name: IP6
|
||||
value: autodetect
|
||||
{% endif %}
|
||||
{% if calico_ip6_auto_method is defined and ipv6_stack %}
|
||||
- name: IP6_AUTODETECTION_METHOD
|
||||
value: "{{ calico_ip6_auto_method }}"
|
||||
{% endif %}
|
||||
@@ -290,10 +327,6 @@ spec:
|
||||
- name: FELIX_MTUIFACEPATTERN
|
||||
value: "{{ calico_felix_mtu_iface_pattern }}"
|
||||
{% endif %}
|
||||
{% if enable_dual_stack_networks %}
|
||||
- name: IP6
|
||||
value: autodetect
|
||||
{% endif %}
|
||||
{% if calico_use_default_route_src_ipaddr | default(false) %}
|
||||
- name: FELIX_DEVICEROUTESOURCEADDRESS
|
||||
valueFrom:
|
||||
@@ -324,7 +357,9 @@ spec:
|
||||
privileged: true
|
||||
resources:
|
||||
limits:
|
||||
{% if calico_node_cpu_limit != "0" %}
|
||||
cpu: {{ calico_node_cpu_limit }}
|
||||
{% endif %}
|
||||
memory: {{ calico_node_memory_limit }}
|
||||
requests:
|
||||
cpu: {{ calico_node_cpu_requests }}
|
||||
@@ -391,15 +426,10 @@ spec:
|
||||
{% endif %}
|
||||
- name: policysync
|
||||
mountPath: /var/run/nodeagent
|
||||
{% if calico_bpf_enabled %}
|
||||
# For eBPF mode, we need to be able to mount the BPF filesystem at /sys/fs/bpf so we mount in the
|
||||
# parent directory.
|
||||
- name: sysfs
|
||||
mountPath: /sys/fs/
|
||||
# Bidirectional means that, if we mount the BPF filesystem at /sys/fs/bpf it will propagate to the host.
|
||||
# If the host is known to mount that filesystem already then Bidirectional can be omitted.
|
||||
mountPropagation: Bidirectional
|
||||
{% endif %}
|
||||
- name: bpffs
|
||||
mountPath: /sys/fs/bpf
|
||||
- name: cni-log-dir
|
||||
mountPath: /var/log/calico/cni
|
||||
readOnly: true
|
||||
@@ -456,12 +486,18 @@ spec:
|
||||
hostPath:
|
||||
path: "/etc/kubernetes/ssl/"
|
||||
{% endif %}
|
||||
{% if calico_bpf_enabled %}
|
||||
- name: sysfs
|
||||
- name: sys-fs
|
||||
hostPath:
|
||||
path: /sys/fs/
|
||||
type: DirectoryOrCreate
|
||||
{% endif %}
|
||||
- name: bpffs
|
||||
hostPath:
|
||||
path: /sys/fs/bpf
|
||||
type: Directory
|
||||
# mount /proc at /nodeproc to be used by mount-bpffs initContainer to mount root cgroup2 fs.
|
||||
- name: nodeproc
|
||||
hostPath:
|
||||
path: /proc
|
||||
# Used to access CNI logs.
|
||||
- name: cni-log-dir
|
||||
hostPath:
|
||||
@@ -471,12 +507,3 @@ spec:
|
||||
hostPath:
|
||||
type: DirectoryOrCreate
|
||||
path: /var/run/nodeagent
|
||||
# Used to install Flex Volume Driver
|
||||
- name: flexvol-driver-host
|
||||
hostPath:
|
||||
type: DirectoryOrCreate
|
||||
path: "{{ kubelet_flexvolumes_plugins_dir | default('/usr/libexec/kubernetes/kubelet-plugins/volume/exec') }}/nodeagent~uds"
|
||||
updateStrategy:
|
||||
rollingUpdate:
|
||||
maxUnavailable: {{ serial | default('20%') }}
|
||||
type: RollingUpdate
|
||||
|
||||
@@ -126,6 +126,10 @@ spec:
|
||||
- name: TYPHA_PROMETHEUSMETRICSPORT
|
||||
value: "{{ typha_prometheusmetricsport }}"
|
||||
{% endif %}
|
||||
{% if calico_ipam_host_local %}
|
||||
- name: USE_POD_CIDR
|
||||
value: "true"
|
||||
{% endif %}
|
||||
{% if typha_secure %}
|
||||
volumeMounts:
|
||||
- mountPath: /etc/typha
|
||||
@@ -135,10 +139,6 @@ spec:
|
||||
subPath: ca.crt
|
||||
name: cacert
|
||||
readOnly: true
|
||||
{% endif %}
|
||||
{% if calico_ipam_host_local %}
|
||||
- name: USE_POD_CIDR
|
||||
value: "true"
|
||||
{% endif %}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
|
||||
@@ -22,7 +22,7 @@ calico_pool_blocksize: 26
|
||||
|
||||
# Calico doesn't support ipip tunneling for the IPv6.
|
||||
calico_ipip_mode_ipv6: Never
|
||||
calico_vxlan_mode_ipv6: Never
|
||||
calico_vxlan_mode_ipv6: Always
|
||||
|
||||
# add default ipv6 ippool blockSize
|
||||
calico_pool_blocksize_ipv6: 122
|
||||
@@ -58,7 +58,7 @@ calico_felix_floating_ips: Disabled
|
||||
|
||||
# Limits for apps
|
||||
calico_node_memory_limit: 500M
|
||||
calico_node_cpu_limit: 300m
|
||||
calico_node_cpu_limit: "0"
|
||||
calico_node_memory_requests: 64M
|
||||
calico_node_cpu_requests: 150m
|
||||
calico_felix_chaininsertmode: Insert
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
---
|
||||
cilium_min_version_required: "1.10"
|
||||
cilium_min_version_required: "1.15"
|
||||
# Log-level
|
||||
cilium_debug: false
|
||||
|
||||
cilium_mtu: ""
|
||||
cilium_enable_ipv4: true
|
||||
cilium_enable_ipv6: false
|
||||
cilium_mtu: "0"
|
||||
cilium_enable_ipv4: "{{ ipv4_stack }}"
|
||||
cilium_enable_ipv6: "{{ ipv6_stack }}"
|
||||
|
||||
# Enable l2 announcement from cilium to replace Metallb Ref: https://docs.cilium.io/en/v1.14/network/l2-announcements/
|
||||
cilium_l2announcements: false
|
||||
|
||||
# Cilium agent health port
|
||||
cilium_agent_health_port: "{%- if cilium_version | regex_replace('v') is version('1.11.6', '>=') -%}9879{%- else -%}9876{%- endif -%}"
|
||||
cilium_agent_health_port: "9879"
|
||||
|
||||
# Identity allocation mode selects how identities are shared between cilium
|
||||
# nodes by setting how they are stored. The options are "crd" or "kvstore".
|
||||
@@ -26,7 +26,7 @@ cilium_agent_health_port: "{%- if cilium_version | regex_replace('v') is version
|
||||
# - --synchronize-k8s-nodes
|
||||
# - --identity-allocation-mode=kvstore
|
||||
# - Ref: https://docs.cilium.io/en/stable/internals/cilium_operator/#kvstore-operations
|
||||
cilium_identity_allocation_mode: kvstore
|
||||
cilium_identity_allocation_mode: crd
|
||||
|
||||
# Etcd SSL dirs
|
||||
cilium_cert_dir: /etc/cilium/certs
|
||||
@@ -46,30 +46,29 @@ cilium_tunnel_mode: vxlan
|
||||
# LoadBalancer Mode (snat/dsr/hybrid) Ref: https://docs.cilium.io/en/stable/network/kubernetes/kubeproxy-free/#dsr-mode
|
||||
cilium_loadbalancer_mode: snat
|
||||
|
||||
# -- Configure Loadbalancer IP Pools
|
||||
cilium_loadbalancer_ip_pools: []
|
||||
|
||||
# Optional features
|
||||
cilium_enable_prometheus: false
|
||||
# Enable if you want to make use of hostPort mappings
|
||||
cilium_enable_portmap: false
|
||||
# Monitor aggregation level (none/low/medium/maximum)
|
||||
cilium_monitor_aggregation: medium
|
||||
# Kube Proxy Replacement mode (strict/partial)
|
||||
cilium_kube_proxy_replacement: partial
|
||||
# Kube Proxy Replacement mode (true/false)
|
||||
cilium_kube_proxy_replacement: false
|
||||
|
||||
# If not defined `cilium_dns_proxy_enable_transparent_mode`, it will following the Cilium behavior.
|
||||
# When Cilium is configured to replace kube-proxy, it automatically enables dnsProxy, which will conflict with nodelocaldns.
|
||||
# You can set `false` avoid conflict with nodelocaldns.
|
||||
# https://github.com/cilium/cilium/issues/33144
|
||||
# cilium_dns_proxy_enable_transparent_mode:
|
||||
|
||||
# If upgrading from Cilium < 1.5, you may want to override some of these options
|
||||
# to prevent service disruptions. See also:
|
||||
# http://docs.cilium.io/en/stable/install/upgrade/#changes-that-may-require-action
|
||||
cilium_preallocate_bpf_maps: false
|
||||
|
||||
# `cilium_tofqdns_enable_poller` is deprecated in 1.8, removed in 1.9
|
||||
cilium_tofqdns_enable_poller: false
|
||||
|
||||
# `cilium_enable_legacy_services` is deprecated in 1.6, removed in 1.9
|
||||
cilium_enable_legacy_services: false
|
||||
|
||||
# Deploy cilium even if kube_network_plugin is not cilium.
|
||||
# This enables to deploy cilium alongside another CNI to replace kube-proxy.
|
||||
cilium_deploy_additionally: false
|
||||
|
||||
# Auto direct nodes routes can be used to advertise pods routes in your cluster
|
||||
# without any tunelling (with `cilium_tunnel_mode` sets to `disabled`).
|
||||
# This works only if you have a L2 connectivity between all your nodes.
|
||||
@@ -101,8 +100,8 @@ cilium_encryption_enabled: false
|
||||
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
|
||||
# This option is only effective when `cilium_encryption_type` is set to `wireguard`.
|
||||
cilium_encryption_node_encryption: false
|
||||
|
||||
# If your kernel or distribution does not support WireGuard, Cilium agent can be configured to fall back on the user-space implementation.
|
||||
# When this flag is enabled and Cilium detects that the kernel has no native support for WireGuard,
|
||||
@@ -116,6 +115,7 @@ cilium_wireguard_userspace_fallback: false
|
||||
# In case they select the Pod at egress, then the bandwidth enforcement will be disabled for those Pods.
|
||||
# Bandwidth Manager requires a v5.1.x or more recent Linux kernel.
|
||||
cilium_enable_bandwidth_manager: false
|
||||
cilium_enable_bandwidth_manager_bbr: false
|
||||
|
||||
# IP Masquerade Agent
|
||||
# https://docs.cilium.io/en/stable/concepts/networking/masquerading/
|
||||
@@ -138,16 +138,19 @@ cilium_non_masquerade_cidrs:
|
||||
### Indicates whether to masquerade traffic to the link local prefix.
|
||||
### If the masqLinkLocal is not set or set to false, then 169.254.0.0/16 is appended to the non-masquerade CIDRs list.
|
||||
cilium_masq_link_local: false
|
||||
cilium_masq_link_local_ipv6: false
|
||||
### A time interval at which the agent attempts to reload config from disk
|
||||
cilium_ip_masq_resync_interval: 60s
|
||||
|
||||
# Hubble
|
||||
### Enable Hubble without install
|
||||
cilium_enable_hubble: false
|
||||
### Enable Hubble Metrics
|
||||
### Enable Hubble-ui
|
||||
cilium_enable_hubble_ui: "{{ cilium_enable_hubble }}"
|
||||
### Enable Hubble Metrics (deprecated)
|
||||
cilium_enable_hubble_metrics: false
|
||||
### if cilium_enable_hubble_metrics: true
|
||||
cilium_hubble_metrics: {}
|
||||
cilium_hubble_metrics: []
|
||||
# - dns
|
||||
# - drop
|
||||
# - tcp
|
||||
@@ -159,12 +162,25 @@ cilium_hubble_install: false
|
||||
### Enable auto generate certs if cilium_hubble_install: true
|
||||
cilium_hubble_tls_generate: false
|
||||
|
||||
cilium_hubble_export_file_max_backups: "5"
|
||||
cilium_hubble_export_file_max_size_mb: "10"
|
||||
|
||||
cilium_hubble_export_dynamic_enabled: false
|
||||
cilium_hubble_export_dynamic_config_content:
|
||||
- name: all
|
||||
fieldMask: []
|
||||
includeFilters: []
|
||||
excludeFilters: []
|
||||
filePath: "/var/run/cilium/hubble/events.log"
|
||||
|
||||
### Capacity of Hubble events buffer. The provided value must be one less than an integer power of two and no larger than 65535
|
||||
### (ie: 1, 3, ..., 2047, 4095, ..., 65535) (default 4095)
|
||||
# cilium_hubble_event_buffer_capacity: 4095
|
||||
### Buffer size of the channel to receive monitor events.
|
||||
# cilium_hubble_event_queue_size: 50
|
||||
|
||||
cilium_gateway_api_enabled: false
|
||||
|
||||
# The default IP address management mode is "Cluster Scope".
|
||||
# https://docs.cilium.io/en/stable/concepts/networking/ipam/
|
||||
cilium_ipam_mode: cluster-pool
|
||||
@@ -189,7 +205,8 @@ cilium_ipam_mode: cluster-pool
|
||||
|
||||
|
||||
# Extra arguments for the Cilium agent
|
||||
cilium_agent_custom_args: []
|
||||
cilium_agent_custom_args: [] # deprecated
|
||||
cilium_agent_extra_args: []
|
||||
|
||||
# For adding and mounting extra volumes to the cilium agent
|
||||
cilium_agent_extra_volumes: []
|
||||
@@ -213,9 +230,19 @@ cilium_operator_extra_volumes: []
|
||||
cilium_operator_extra_volume_mounts: []
|
||||
|
||||
# Extra arguments for the Cilium Operator
|
||||
cilium_operator_custom_args: []
|
||||
cilium_operator_custom_args: [] # deprecated
|
||||
cilium_operator_extra_args: []
|
||||
|
||||
# Tolerations of the cilium operator
|
||||
cilium_operator_tolerations:
|
||||
- operator: "Exists"
|
||||
|
||||
# Unique ID of the cluster. Must be unique across all connected
|
||||
# clusters and in the range of 1 to 255. Only required for Cluster Mesh,
|
||||
# may be 0 if Cluster Mesh is not used.
|
||||
cilium_cluster_id: 0
|
||||
# Name of the cluster. Only relevant when building a mesh of clusters.
|
||||
# The "default" name cannot be used if the Cluster ID is different from 0.
|
||||
cilium_cluster_name: default
|
||||
|
||||
# Make Cilium take ownership over the `/etc/cni/net.d` directory on the node, renaming all non-Cilium CNI configurations to `*.cilium_bak`.
|
||||
@@ -258,7 +285,7 @@ cilium_enable_bpf_masquerade: false
|
||||
# host stack (true) or directly and more efficiently out of BPF (false) if
|
||||
# the kernel supports it. The latter has the implication that it will also
|
||||
# bypass netfilter in the host namespace.
|
||||
cilium_enable_host_legacy_routing: true
|
||||
cilium_enable_host_legacy_routing: false
|
||||
|
||||
# -- Enable use of the remote node identity.
|
||||
# ref: https://docs.cilium.io/en/v1.7/install/upgrade/#configmap-remote-node-identity
|
||||
@@ -275,6 +302,25 @@ cilium_monitor_aggregation_flags: "all"
|
||||
|
||||
cilium_enable_bpf_clock_probe: true
|
||||
|
||||
# -- Enable BGP Control Plane
|
||||
cilium_enable_bgp_control_plane: false
|
||||
|
||||
|
||||
# -- Configure BGP Instances (New bgpv2 API v1.16+)
|
||||
cilium_bgp_cluster_configs: []
|
||||
|
||||
# -- Configure BGP Peers (New bgpv2 API v1.16+)
|
||||
cilium_bgp_peer_configs: []
|
||||
|
||||
# -- Configure BGP Advertisements (New bgpv2 API v1.16+)
|
||||
cilium_bgp_advertisements: []
|
||||
|
||||
# -- Configure BGP Node Config Overrides (New bgpv2 API v1.16+)
|
||||
cilium_bgp_node_config_overrides: []
|
||||
|
||||
# -- Configure BGP Peers (Legacy < v1.16)
|
||||
cilium_bgp_peering_policies: []
|
||||
|
||||
# -- Whether to enable CNP status updates.
|
||||
cilium_disable_cnp_status_updates: true
|
||||
|
||||
@@ -283,9 +329,9 @@ cilium_rolling_restart_wait_retries_count: 30
|
||||
cilium_rolling_restart_wait_retries_delay_seconds: 10
|
||||
|
||||
# Cilium changed the default metrics exporter ports in 1.12
|
||||
cilium_agent_scrape_port: "{{ cilium_version | regex_replace('v') is version('1.12', '>=') | ternary('9962', '9090') }}"
|
||||
cilium_operator_scrape_port: "{{ cilium_version | regex_replace('v') is version('1.12', '>=') | ternary('9963', '6942') }}"
|
||||
cilium_hubble_scrape_port: "{{ cilium_version | regex_replace('v') is version('1.12', '>=') | ternary('9965', '9091') }}"
|
||||
cilium_agent_scrape_port: "9962"
|
||||
cilium_operator_scrape_port: "9963"
|
||||
cilium_hubble_scrape_port: "9965"
|
||||
|
||||
# Cilium certgen args for generate certificate for hubble mTLS
|
||||
cilium_certgen_args:
|
||||
@@ -304,21 +350,5 @@ cilium_certgen_args:
|
||||
hubble-relay-client-cert-secret-name: hubble-relay-client-certs
|
||||
hubble-relay-server-cert-generate: false
|
||||
|
||||
# A list of extra rules variables to add to clusterrole for cilium operator, formatted like:
|
||||
# cilium_clusterrole_rules_operator_extra_vars:
|
||||
# - apiGroups:
|
||||
# - '""'
|
||||
# resources:
|
||||
# - pods
|
||||
# verbs:
|
||||
# - delete
|
||||
# - apiGroups:
|
||||
# - '""'
|
||||
# resources:
|
||||
# - nodes
|
||||
# verbs:
|
||||
# - list
|
||||
# - watch
|
||||
# resourceNames:
|
||||
# - toto
|
||||
cilium_clusterrole_rules_operator_extra_vars: []
|
||||
cilium_enable_host_firewall: false
|
||||
cilium_policy_audit_mode: false
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
---
|
||||
- name: Cilium | Start Resources
|
||||
kube:
|
||||
name: "{{ item.item.name }}"
|
||||
namespace: "kube-system"
|
||||
kubectl: "{{ bin_dir }}/kubectl"
|
||||
resource: "{{ item.item.type }}"
|
||||
filename: "{{ kube_config_dir }}/{{ item.item.name }}-{{ item.item.file }}"
|
||||
state: "latest"
|
||||
loop: "{{ cilium_node_manifests.results }}"
|
||||
when: inventory_hostname == groups['kube_control_plane'][0] and not item is skipped
|
||||
- name: Cilium | Install
|
||||
command: "{{ bin_dir }}/cilium install --version {{ cilium_version }} -f {{ kube_config_dir }}/cilium-values.yaml"
|
||||
when: inventory_hostname == groups['kube_control_plane'][0]
|
||||
|
||||
- name: Cilium | Wait for pods to run
|
||||
command: "{{ kubectl }} -n kube-system get pods -l k8s-app=cilium -o jsonpath='{.items[?(@.status.containerStatuses[0].ready==false)].metadata.name}'" # noqa literal-compare
|
||||
@@ -19,15 +12,218 @@
|
||||
failed_when: false
|
||||
when: inventory_hostname == groups['kube_control_plane'][0]
|
||||
|
||||
- name: Cilium | Hubble install
|
||||
kube:
|
||||
name: "{{ item.item.name }}"
|
||||
namespace: "kube-system"
|
||||
kubectl: "{{ bin_dir }}/kubectl"
|
||||
resource: "{{ item.item.type }}"
|
||||
filename: "{{ kube_config_dir }}/addons/hubble/{{ item.item.name }}-{{ item.item.file }}"
|
||||
state: "latest"
|
||||
loop: "{{ cilium_hubble_manifests.results }}"
|
||||
- name: Cilium | Wait for CiliumLoadBalancerIPPool CRD to be present
|
||||
command: "{{ kubectl }} wait --for condition=established --timeout=60s crd/ciliumloadbalancerippools.cilium.io"
|
||||
register: cillium_lbippool_crd_ready
|
||||
retries: "{{ cilium_rolling_restart_wait_retries_count | int }}"
|
||||
delay: "{{ cilium_rolling_restart_wait_retries_delay_seconds | int }}"
|
||||
failed_when: false
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0] and not item is skipped
|
||||
- cilium_enable_hubble and cilium_hubble_install
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cilium_loadbalancer_ip_pools is defined and (cilium_loadbalancer_ip_pools|length>0)
|
||||
|
||||
- name: Cilium | Create CiliumLoadBalancerIPPool manifests
|
||||
template:
|
||||
src: "{{ item.name }}/{{ item.file }}.j2"
|
||||
dest: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
|
||||
mode: "0644"
|
||||
with_items:
|
||||
- {name: cilium, file: cilium-loadbalancer-ip-pool.yml, type: CiliumLoadBalancerIPPool}
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cillium_lbippool_crd_ready is defined and cillium_lbippool_crd_ready.rc is defined and cillium_lbippool_crd_ready.rc == 0
|
||||
- cilium_loadbalancer_ip_pools is defined and (cilium_loadbalancer_ip_pools|length>0)
|
||||
|
||||
- name: Cilium | Apply CiliumLoadBalancerIPPool from cilium_loadbalancer_ip_pools
|
||||
kube:
|
||||
name: "{{ item.name }}"
|
||||
kubectl: "{{ bin_dir }}/kubectl"
|
||||
resource: "{{ item.type }}"
|
||||
filename: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
|
||||
state: "latest"
|
||||
loop:
|
||||
- {name: cilium, file: cilium-loadbalancer-ip-pool.yml, type: CiliumLoadBalancerIPPool}
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cillium_lbippool_crd_ready is defined and cillium_lbippool_crd_ready.rc is defined and cillium_lbippool_crd_ready.rc == 0
|
||||
- cilium_loadbalancer_ip_pools is defined and (cilium_loadbalancer_ip_pools|length>0)
|
||||
|
||||
- name: Cilium | Wait for CiliumBGPPeeringPolicy CRD to be present
|
||||
command: "{{ kubectl }} wait --for condition=established --timeout=60s crd/ciliumbgppeeringpolicies.cilium.io"
|
||||
register: cillium_bgpppolicy_crd_ready
|
||||
retries: "{{ cilium_rolling_restart_wait_retries_count | int }}"
|
||||
delay: "{{ cilium_rolling_restart_wait_retries_delay_seconds | int }}"
|
||||
failed_when: false
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cilium_bgp_peering_policies is defined and (cilium_bgp_peering_policies|length>0)
|
||||
|
||||
- name: Cilium | Create CiliumBGPPeeringPolicy manifests
|
||||
template:
|
||||
src: "{{ item.name }}/{{ item.file }}.j2"
|
||||
dest: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
|
||||
mode: "0644"
|
||||
with_items:
|
||||
- {name: cilium, file: cilium-bgp-peering-policy.yml, type: CiliumBGPPeeringPolicy}
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cillium_bgpppolicy_crd_ready is defined and cillium_bgpppolicy_crd_ready.rc is defined and cillium_bgpppolicy_crd_ready.rc == 0
|
||||
- cilium_bgp_peering_policies is defined and (cilium_bgp_peering_policies|length>0)
|
||||
|
||||
- name: Cilium | Apply CiliumBGPPeeringPolicy from cilium_bgp_peering_policies
|
||||
kube:
|
||||
name: "{{ item.name }}"
|
||||
kubectl: "{{ bin_dir }}/kubectl"
|
||||
resource: "{{ item.type }}"
|
||||
filename: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
|
||||
state: "latest"
|
||||
loop:
|
||||
- {name: cilium, file: cilium-bgp-peering-policy.yml, type: CiliumBGPPeeringPolicy}
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cillium_bgpppolicy_crd_ready is defined and cillium_bgpppolicy_crd_ready.rc is defined and cillium_bgpppolicy_crd_ready.rc == 0
|
||||
- cilium_bgp_peering_policies is defined and (cilium_bgp_peering_policies|length>0)
|
||||
|
||||
- name: Cilium | Wait for CiliumBGPClusterConfig CRD to be present
|
||||
command: "{{ kubectl }} wait --for condition=established --timeout=60s crd/ciliumbgpclusterconfigs.cilium.io"
|
||||
register: cillium_bgpcconfig_crd_ready
|
||||
retries: "{{ cilium_rolling_restart_wait_retries_count | int }}"
|
||||
delay: "{{ cilium_rolling_restart_wait_retries_delay_seconds | int }}"
|
||||
failed_when: false
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cilium_bgp_cluster_configs is defined and (cilium_bgp_cluster_configs|length>0)
|
||||
|
||||
- name: Cilium | Create CiliumBGPClusterConfig manifests
|
||||
template:
|
||||
src: "{{ item.name }}/{{ item.file }}.j2"
|
||||
dest: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
|
||||
mode: "0644"
|
||||
with_items:
|
||||
- {name: cilium, file: cilium-bgp-cluster-config.yml, type: CiliumBGPClusterConfig}
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cillium_bgpcconfig_crd_ready is defined and cillium_bgpcconfig_crd_ready.rc is defined and cillium_bgpcconfig_crd_ready.rc == 0
|
||||
- cilium_bgp_cluster_configs is defined and (cilium_bgp_cluster_configs|length>0)
|
||||
|
||||
- name: Cilium | Apply CiliumBGPClusterConfig from cilium_bgp_cluster_configs
|
||||
kube:
|
||||
name: "{{ item.name }}"
|
||||
kubectl: "{{ bin_dir }}/kubectl"
|
||||
resource: "{{ item.type }}"
|
||||
filename: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
|
||||
state: "latest"
|
||||
loop:
|
||||
- {name: cilium, file: cilium-bgp-cluster-config.yml, type: CiliumBGPClusterConfig}
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cillium_bgpcconfig_crd_ready is defined and cillium_bgpcconfig_crd_ready.rc is defined and cillium_bgpcconfig_crd_ready.rc == 0
|
||||
- cilium_bgp_cluster_configs is defined and (cilium_bgp_cluster_configs|length>0)
|
||||
|
||||
- name: Cilium | Wait for CiliumBGPPeerConfig CRD to be present
|
||||
command: "{{ kubectl }} wait --for condition=established --timeout=60s crd/ciliumbgppeerconfigs.cilium.io"
|
||||
register: cillium_bgppconfig_crd_ready
|
||||
retries: "{{ cilium_rolling_restart_wait_retries_count | int }}"
|
||||
delay: "{{ cilium_rolling_restart_wait_retries_delay_seconds | int }}"
|
||||
failed_when: false
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cilium_bgp_peer_configs is defined and (cilium_bgp_peer_configs|length>0)
|
||||
|
||||
- name: Cilium | Create CiliumBGPPeerConfig manifests
|
||||
template:
|
||||
src: "{{ item.name }}/{{ item.file }}.j2"
|
||||
dest: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
|
||||
mode: "0644"
|
||||
with_items:
|
||||
- {name: cilium, file: cilium-bgp-peer-config.yml, type: CiliumBGPPeerConfig}
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cillium_bgppconfig_crd_ready is defined and cillium_bgppconfig_crd_ready.rc is defined and cillium_bgppconfig_crd_ready.rc == 0
|
||||
- cilium_bgp_peer_configs is defined and (cilium_bgp_peer_configs|length>0)
|
||||
|
||||
- name: Cilium | Apply CiliumBGPPeerConfig from cilium_bgp_peer_configs
|
||||
kube:
|
||||
name: "{{ item.name }}"
|
||||
kubectl: "{{ bin_dir }}/kubectl"
|
||||
resource: "{{ item.type }}"
|
||||
filename: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
|
||||
state: "latest"
|
||||
loop:
|
||||
- {name: cilium, file: cilium-bgp-peer-config.yml, type: CiliumBGPPeerConfig}
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cillium_bgppconfig_crd_ready is defined and cillium_bgppconfig_crd_ready.rc is defined and cillium_bgppconfig_crd_ready.rc == 0
|
||||
- cilium_bgp_peer_configs is defined and (cilium_bgp_peer_configs|length>0)
|
||||
|
||||
- name: Cilium | Wait for CiliumBGPAdvertisement CRD to be present
|
||||
command: "{{ kubectl }} wait --for condition=established --timeout=60s crd/ciliumbgpadvertisements.cilium.io"
|
||||
register: cillium_bgpadvert_crd_ready
|
||||
retries: "{{ cilium_rolling_restart_wait_retries_count | int }}"
|
||||
delay: "{{ cilium_rolling_restart_wait_retries_delay_seconds | int }}"
|
||||
failed_when: false
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cilium_bgp_advertisements is defined and (cilium_bgp_advertisements|length>0)
|
||||
|
||||
- name: Cilium | Create CiliumBGPAdvertisement manifests
|
||||
template:
|
||||
src: "{{ item.name }}/{{ item.file }}.j2"
|
||||
dest: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
|
||||
mode: "0644"
|
||||
with_items:
|
||||
- {name: cilium, file: cilium-bgp-advertisement.yml, type: CiliumBGPAdvertisement}
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cillium_bgpadvert_crd_ready is defined and cillium_bgpadvert_crd_ready.rc is defined and cillium_bgpadvert_crd_ready.rc == 0
|
||||
- cilium_bgp_advertisements is defined and (cilium_bgp_advertisements|length>0)
|
||||
|
||||
- name: Cilium | Apply CiliumBGPAdvertisement from cilium_bgp_advertisements
|
||||
kube:
|
||||
name: "{{ item.name }}"
|
||||
kubectl: "{{ bin_dir }}/kubectl"
|
||||
resource: "{{ item.type }}"
|
||||
filename: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
|
||||
state: "latest"
|
||||
loop:
|
||||
- {name: cilium, file: cilium-bgp-advertisement.yml, type: CiliumBGPAdvertisement}
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cillium_bgpadvert_crd_ready is defined and cillium_bgpadvert_crd_ready.rc is defined and cillium_bgpadvert_crd_ready.rc == 0
|
||||
- cilium_bgp_advertisements is defined and (cilium_bgp_advertisements|length>0)
|
||||
|
||||
- name: Cilium | Wait for CiliumBGPNodeConfigOverride CRD to be present
|
||||
command: "{{ kubectl }} wait --for condition=established --timeout=60s crd/ciliumbgpnodeconfigoverrides.cilium.io"
|
||||
register: cilium_bgp_node_config_crd_ready
|
||||
retries: "{{ cilium_rolling_restart_wait_retries_count | int }}"
|
||||
delay: "{{ cilium_rolling_restart_wait_retries_delay_seconds | int }}"
|
||||
failed_when: false
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cilium_bgp_advertisements is defined and (cilium_bgp_advertisements|length>0)
|
||||
|
||||
- name: Cilium | Create CiliumBGPNodeConfigOverride manifests
|
||||
template:
|
||||
src: "{{ item.name }}/{{ item.file }}.j2"
|
||||
dest: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
|
||||
mode: "0644"
|
||||
with_items:
|
||||
- {name: cilium, file: cilium-bgp-node-config-override.yml, type: CiliumBGPNodeConfigOverride}
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cilium_bgp_node_config_crd_ready is defined and cilium_bgp_node_config_crd_ready.rc is defined and cilium_bgp_node_config_crd_ready.rc == 0
|
||||
- cilium_bgp_node_config_overrides is defined and (cilium_bgp_node_config_overrides|length>0)
|
||||
|
||||
- name: Cilium | Apply CiliumBGPNodeConfigOverride from cilium_bgp_node_config_overrides
|
||||
kube:
|
||||
name: "{{ item.name }}"
|
||||
kubectl: "{{ bin_dir }}/kubectl"
|
||||
resource: "{{ item.type }}"
|
||||
filename: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
|
||||
state: "latest"
|
||||
loop:
|
||||
- {name: cilium, file: cilium-bgp-node-config-override.yml, type: CiliumBGPNodeConfigOverride}
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cilium_bgp_node_config_crd_ready is defined and cilium_bgp_node_config_crd_ready.rc is defined and cilium_bgp_node_config_crd_ready.rc == 0
|
||||
- cilium_bgp_node_config_overrides is defined and (cilium_bgp_node_config_overrides|length>0)
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
when:
|
||||
- cilium_ipsec_enabled is defined
|
||||
- cilium_ipsec_enabled
|
||||
- kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool
|
||||
- kube_network_plugin == 'cilium' or cilium_deploy_additionally
|
||||
|
||||
- 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
|
||||
- kube_network_plugin == 'cilium' or cilium_deploy_additionally
|
||||
- cilium_encryption_enabled
|
||||
- cilium_encryption_type == "wireguard"
|
||||
- not ignore_assert_errors
|
||||
@@ -48,9 +48,9 @@
|
||||
msg: "cilium_encryption_type must be either 'ipsec' or 'wireguard'"
|
||||
when: cilium_encryption_enabled
|
||||
|
||||
- name: Stop if cilium_version is < v1.10.0
|
||||
- name: Stop if cilium_version is < {{ cilium_min_version_required }}
|
||||
assert:
|
||||
that: cilium_version | regex_replace('v') is version(cilium_min_version_required, '>=')
|
||||
that: cilium_version is version(cilium_min_version_required, '>=')
|
||||
msg: "cilium_version is too low. Minimum version {{ cilium_min_version_required }}"
|
||||
|
||||
# TODO: Clean this task up when we drop backward compatibility support for `cilium_ipsec_enabled`
|
||||
|
||||
@@ -30,58 +30,6 @@
|
||||
when:
|
||||
- cilium_identity_allocation_mode == "kvstore"
|
||||
|
||||
- name: Cilium | Create hubble dir
|
||||
file:
|
||||
path: "{{ kube_config_dir }}/addons/hubble"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cilium_hubble_install
|
||||
|
||||
- name: Cilium | Create Cilium node manifests
|
||||
template:
|
||||
src: "{{ item.name }}/{{ item.file }}.j2"
|
||||
dest: "{{ kube_config_dir }}/{{ item.name }}-{{ item.file }}"
|
||||
mode: "0644"
|
||||
loop:
|
||||
- {name: cilium, file: config.yml, type: cm}
|
||||
- {name: cilium-operator, file: crb.yml, type: clusterrolebinding}
|
||||
- {name: cilium-operator, file: cr.yml, type: clusterrole}
|
||||
- {name: cilium, file: crb.yml, type: clusterrolebinding}
|
||||
- {name: cilium, file: cr.yml, type: clusterrole}
|
||||
- {name: cilium, file: secret.yml, type: secret, when: "{{ cilium_encryption_enabled and cilium_encryption_type == 'ipsec' }}"}
|
||||
- {name: cilium, file: ds.yml, type: ds}
|
||||
- {name: cilium-operator, file: deploy.yml, type: deploy}
|
||||
- {name: cilium-operator, file: sa.yml, type: sa}
|
||||
- {name: cilium, file: sa.yml, type: sa}
|
||||
register: cilium_node_manifests
|
||||
when:
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- item.when | default(True) | bool
|
||||
|
||||
- name: Cilium | Create Cilium Hubble manifests
|
||||
template:
|
||||
src: "{{ item.name }}/{{ item.file }}.j2"
|
||||
dest: "{{ kube_config_dir }}/addons/hubble/{{ item.name }}-{{ item.file }}"
|
||||
mode: "0644"
|
||||
loop:
|
||||
- {name: hubble, file: config.yml, type: cm}
|
||||
- {name: hubble, file: crb.yml, type: clusterrolebinding}
|
||||
- {name: hubble, file: cr.yml, type: clusterrole}
|
||||
- {name: hubble, file: cronjob.yml, type: cronjob, when: "{{ cilium_hubble_tls_generate }}"}
|
||||
- {name: hubble, file: deploy.yml, type: deploy}
|
||||
- {name: hubble, file: job.yml, type: job, when: "{{ cilium_hubble_tls_generate }}"}
|
||||
- {name: hubble, file: sa.yml, type: sa}
|
||||
- {name: hubble, file: service.yml, type: service}
|
||||
register: cilium_hubble_manifests
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- cilium_enable_hubble and cilium_hubble_install
|
||||
- item.when | default(True) | bool
|
||||
|
||||
- name: Cilium | Enable portmap addon
|
||||
template:
|
||||
src: 000-cilium-portmap.conflist.j2
|
||||
@@ -89,6 +37,14 @@
|
||||
mode: "0644"
|
||||
when: cilium_enable_portmap
|
||||
|
||||
- name: Cilium | Render values
|
||||
template:
|
||||
src: values.yaml.j2
|
||||
dest: "{{ kube_config_dir }}/cilium-values.yaml"
|
||||
mode: "0644"
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
|
||||
- name: Cilium | Copy Ciliumcli binary from download dir
|
||||
copy:
|
||||
src: "{{ local_release_dir }}/cilium"
|
||||
|
||||
@@ -1,188 +0,0 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: cilium-operator
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
# to automatically delete [core|kube]dns pods so that are starting to being
|
||||
# managed by Cilium
|
||||
- pods
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- delete
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- nodes
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
# To remove node taints
|
||||
- nodes
|
||||
# To set NetworkUnavailable false on startup
|
||||
- nodes/status
|
||||
verbs:
|
||||
- patch
|
||||
- apiGroups:
|
||||
- discovery.k8s.io
|
||||
resources:
|
||||
- endpointslices
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- services
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
# to perform LB IP allocation for BGP
|
||||
- services/status
|
||||
verbs:
|
||||
- update
|
||||
- patch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
# to perform the translation of a CNP that contains `ToGroup` to its endpoints
|
||||
- services
|
||||
- endpoints
|
||||
# to check apiserver connectivity
|
||||
- namespaces
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- cilium.io
|
||||
resources:
|
||||
- ciliumnetworkpolicies
|
||||
- ciliumnetworkpolicies/status
|
||||
- ciliumnetworkpolicies/finalizers
|
||||
- ciliumclusterwidenetworkpolicies
|
||||
- ciliumclusterwidenetworkpolicies/status
|
||||
- ciliumclusterwidenetworkpolicies/finalizers
|
||||
- ciliumendpoints
|
||||
- ciliumendpoints/status
|
||||
- ciliumendpoints/finalizers
|
||||
- ciliumnodes
|
||||
- ciliumnodes/status
|
||||
- ciliumnodes/finalizers
|
||||
- ciliumidentities
|
||||
- ciliumidentities/status
|
||||
- ciliumidentities/finalizers
|
||||
- ciliumlocalredirectpolicies
|
||||
- ciliumlocalredirectpolicies/status
|
||||
- ciliumlocalredirectpolicies/finalizers
|
||||
{% if cilium_version | regex_replace('v') is version('1.11', '>=') %}
|
||||
- ciliumendpointslices
|
||||
{% endif %}
|
||||
{% if cilium_version | regex_replace('v') is version('1.12', '>=') %}
|
||||
- ciliumbgploadbalancerippools
|
||||
- ciliumloadbalancerippools
|
||||
- ciliumloadbalancerippools/status
|
||||
- ciliumbgppeeringpolicies
|
||||
- ciliumenvoyconfigs
|
||||
{% endif %}
|
||||
{% if cilium_version | regex_replace('v') is version('1.15', '>=') %}
|
||||
- ciliumbgppeerconfigs
|
||||
- ciliumbgpadvertisements
|
||||
- ciliumbgpnodeconfigs
|
||||
{% endif %}
|
||||
verbs:
|
||||
- '*'
|
||||
- apiGroups:
|
||||
- apiextensions.k8s.io
|
||||
resources:
|
||||
- customresourcedefinitions
|
||||
verbs:
|
||||
- create
|
||||
- get
|
||||
- list
|
||||
- update
|
||||
- watch
|
||||
# For cilium-operator running in HA mode.
|
||||
#
|
||||
# Cilium operator running in HA mode requires the use of ResourceLock for Leader Election
|
||||
# between multiple running instances.
|
||||
# The preferred way of doing this is to use LeasesResourceLock as edits to Leases are less
|
||||
# common and fewer objects in the cluster watch "all Leases".
|
||||
- apiGroups:
|
||||
- coordination.k8s.io
|
||||
resources:
|
||||
- leases
|
||||
verbs:
|
||||
- create
|
||||
- get
|
||||
- update
|
||||
{% if cilium_version | regex_replace('v') is version('1.12', '>=') %}
|
||||
- apiGroups:
|
||||
- apiextensions.k8s.io
|
||||
resources:
|
||||
- customresourcedefinitions
|
||||
verbs:
|
||||
- update
|
||||
resourceNames:
|
||||
- ciliumbgploadbalancerippools.cilium.io
|
||||
- ciliumbgppeeringpolicies.cilium.io
|
||||
- ciliumclusterwideenvoyconfigs.cilium.io
|
||||
- ciliumclusterwidenetworkpolicies.cilium.io
|
||||
- ciliumegressgatewaypolicies.cilium.io
|
||||
- ciliumegressnatpolicies.cilium.io
|
||||
- ciliumendpoints.cilium.io
|
||||
- ciliumendpointslices.cilium.io
|
||||
- ciliumenvoyconfigs.cilium.io
|
||||
- ciliumexternalworkloads.cilium.io
|
||||
- ciliumidentities.cilium.io
|
||||
- ciliumlocalredirectpolicies.cilium.io
|
||||
- ciliumnetworkpolicies.cilium.io
|
||||
- ciliumnodes.cilium.io
|
||||
{% if cilium_version | regex_replace('v') is version('1.14', '>=') %}
|
||||
- ciliumnodeconfigs.cilium.io
|
||||
- ciliumcidrgroups.cilium.io
|
||||
- ciliuml2announcementpolicies.cilium.io
|
||||
- ciliumpodippools.cilium.io
|
||||
- ciliumloadbalancerippools.cilium.io
|
||||
{% endif %}
|
||||
{% if cilium_version | regex_replace('v') is version('1.15', '>=') %}
|
||||
- ciliumbgpclusterconfigs.cilium.io
|
||||
- ciliumbgppeerconfigs.cilium.io
|
||||
- ciliumbgpadvertisements.cilium.io
|
||||
- ciliumbgpnodeconfigs.cilium.io
|
||||
- ciliumbgpnodeconfigoverrides.cilium.io
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% for rules in cilium_clusterrole_rules_operator_extra_vars %}
|
||||
- apiGroups:
|
||||
{% for api in rules['apiGroups'] %}
|
||||
- {{ api }}
|
||||
{% endfor %}
|
||||
resources:
|
||||
{% for resource in rules['resources'] %}
|
||||
- {{ resource }}
|
||||
{% endfor %}
|
||||
verbs:
|
||||
{% for verb in rules['verbs'] %}
|
||||
- {{ verb }}
|
||||
{% endfor %}
|
||||
{% if 'resourceNames' in rules %}
|
||||
resourceNames:
|
||||
{% for resourceName in rules['resourceNames'] %}
|
||||
- {{ resourceName }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: cilium-operator
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: cilium-operator
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: cilium-operator
|
||||
namespace: kube-system
|
||||
@@ -1,170 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: cilium-operator
|
||||
namespace: kube-system
|
||||
labels:
|
||||
io.cilium/app: operator
|
||||
name: cilium-operator
|
||||
spec:
|
||||
{% if groups.k8s_cluster | length == 1 %}
|
||||
replicas: 1
|
||||
{% else %}
|
||||
replicas: {{ cilium_operator_replicas }}
|
||||
{% endif %}
|
||||
selector:
|
||||
matchLabels:
|
||||
io.cilium/app: operator
|
||||
name: cilium-operator
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
maxUnavailable: 1
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
{% if cilium_enable_prometheus %}
|
||||
annotations:
|
||||
prometheus.io/port: "{{ cilium_operator_scrape_port }}"
|
||||
prometheus.io/scrape: "true"
|
||||
{% endif %}
|
||||
labels:
|
||||
io.cilium/app: operator
|
||||
name: cilium-operator
|
||||
spec:
|
||||
containers:
|
||||
- name: cilium-operator
|
||||
image: "{{ cilium_operator_image_repo }}:{{ cilium_operator_image_tag }}"
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
command:
|
||||
- cilium-operator
|
||||
args:
|
||||
- --config-dir=/tmp/cilium/config-map
|
||||
- --debug=$(CILIUM_DEBUG)
|
||||
{% if cilium_operator_custom_args is string %}
|
||||
- {{ cilium_operator_custom_args }}
|
||||
{% else %}
|
||||
{% for flag in cilium_operator_custom_args %}
|
||||
- {{ flag }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
env:
|
||||
- name: K8S_NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: spec.nodeName
|
||||
- name: CILIUM_K8S_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: metadata.namespace
|
||||
- name: CILIUM_DEBUG
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: debug
|
||||
name: cilium-config
|
||||
optional: true
|
||||
- name: AWS_ACCESS_KEY_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: cilium-aws
|
||||
key: AWS_ACCESS_KEY_ID
|
||||
optional: true
|
||||
- name: AWS_SECRET_ACCESS_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: cilium-aws
|
||||
key: AWS_SECRET_ACCESS_KEY
|
||||
optional: true
|
||||
- name: AWS_DEFAULT_REGION
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: cilium-aws
|
||||
key: AWS_DEFAULT_REGION
|
||||
optional: true
|
||||
{% if cilium_kube_proxy_replacement == 'strict' %}
|
||||
- name: KUBERNETES_SERVICE_HOST
|
||||
value: "{{ kube_apiserver_global_endpoint | urlsplit('hostname') }}"
|
||||
- name: KUBERNETES_SERVICE_PORT
|
||||
value: "{{ kube_apiserver_global_endpoint | urlsplit('port') }}"
|
||||
{% endif %}
|
||||
{% if cilium_enable_prometheus %}
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: metadata.namespace
|
||||
ports:
|
||||
- name: prometheus
|
||||
containerPort: {{ cilium_operator_scrape_port }}
|
||||
hostPort: {{ cilium_operator_scrape_port }}
|
||||
protocol: TCP
|
||||
{% endif %}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
{% if cilium_enable_ipv4 %}
|
||||
host: 127.0.0.1
|
||||
{% else %}
|
||||
host: '::1'
|
||||
{% endif %}
|
||||
path: /healthz
|
||||
port: 9234
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 3
|
||||
volumeMounts:
|
||||
- name: cilium-config-path
|
||||
mountPath: /tmp/cilium/config-map
|
||||
readOnly: true
|
||||
{% if cilium_identity_allocation_mode == "kvstore" %}
|
||||
- name: etcd-config-path
|
||||
mountPath: /var/lib/etcd-config
|
||||
readOnly: true
|
||||
- name: etcd-secrets
|
||||
mountPath: "{{ cilium_cert_dir }}"
|
||||
readOnly: true
|
||||
{% endif %}
|
||||
{% for volume_mount in cilium_operator_extra_volume_mounts %}
|
||||
- {{ volume_mount | to_nice_yaml(indent=2) | indent(14) }}
|
||||
{% endfor %}
|
||||
hostNetwork: true
|
||||
dnsPolicy: ClusterFirstWithHostNet
|
||||
restartPolicy: Always
|
||||
priorityClassName: system-node-critical
|
||||
serviceAccount: cilium-operator
|
||||
serviceAccountName: cilium-operator
|
||||
# In HA mode, cilium-operator pods must not be scheduled on the same
|
||||
# node as they will clash with each other.
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- topologyKey: kubernetes.io/hostname
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
io.cilium/app: operator
|
||||
tolerations:
|
||||
- operator: Exists
|
||||
volumes:
|
||||
- name: cilium-config-path
|
||||
configMap:
|
||||
name: cilium-config
|
||||
{% if cilium_identity_allocation_mode == "kvstore" %}
|
||||
# To read the etcd config stored in config maps
|
||||
- name: etcd-config-path
|
||||
configMap:
|
||||
name: cilium-config
|
||||
defaultMode: 420
|
||||
items:
|
||||
- key: etcd-config
|
||||
path: etcd.config
|
||||
# To read the k8s etcd secrets in case the user might want to use TLS
|
||||
- name: etcd-secrets
|
||||
hostPath:
|
||||
path: "{{ cilium_cert_dir }}"
|
||||
{% endif %}
|
||||
{% for volume in cilium_operator_extra_volumes %}
|
||||
- {{ volume | to_nice_yaml(indent=2) | indent(10) }}
|
||||
{% endfor %}
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: cilium-operator
|
||||
namespace: kube-system
|
||||
@@ -0,0 +1,12 @@
|
||||
{% for cilium_bgp_advertisement in cilium_bgp_advertisements %}
|
||||
---
|
||||
apiVersion: "cilium.io/v2alpha1"
|
||||
kind: CiliumBGPAdvertisement
|
||||
metadata:
|
||||
name: "{{ cilium_bgp_advertisement.name }}"
|
||||
{% if cilium_bgp_advertisement.labels %}
|
||||
labels: {{ cilium_bgp_advertisement.labels | to_yaml }}
|
||||
{% endif %}
|
||||
spec:
|
||||
{{ cilium_bgp_advertisement.spec | to_yaml | indent(4) }}
|
||||
{% endfor %}
|
||||
@@ -0,0 +1,9 @@
|
||||
{% for cilium_bgp_cluster_config in cilium_bgp_cluster_configs %}
|
||||
---
|
||||
apiVersion: "cilium.io/v2alpha1"
|
||||
kind: CiliumBGPClusterConfig
|
||||
metadata:
|
||||
name: "{{ cilium_bgp_cluster_config.name }}"
|
||||
spec:
|
||||
{{ cilium_bgp_cluster_config.spec | to_yaml | indent(2) }}
|
||||
{% endfor %}
|
||||
@@ -0,0 +1,9 @@
|
||||
{% for cilium_bgp_node_config_override in cilium_bgp_node_config_overrides %}
|
||||
---
|
||||
apiVersion: "cilium.io/v2alpha1"
|
||||
kind: CiliumBGPNodeConfigOverride
|
||||
metadata:
|
||||
name: "{{ cilium_bgp_node_config_override.name }}"
|
||||
spec:
|
||||
{{ cilium_bgp_node_config_override.spec | to_yaml | indent(2) }}
|
||||
{% endfor %}
|
||||
@@ -0,0 +1,9 @@
|
||||
{% for cilium_bgp_peer_config in cilium_bgp_peer_configs %}
|
||||
---
|
||||
apiVersion: "cilium.io/v2alpha1"
|
||||
kind: CiliumBGPPeerConfig
|
||||
metadata:
|
||||
name: "{{ cilium_bgp_peer_config.name }}"
|
||||
spec:
|
||||
{{ cilium_bgp_peer_config.spec | to_yaml | indent(2) }}
|
||||
{% endfor %}
|
||||
@@ -0,0 +1,9 @@
|
||||
{% for cilium_bgp_peering_policy in cilium_bgp_peering_policies %}
|
||||
---
|
||||
apiVersion: "cilium.io/v2alpha1"
|
||||
kind: CiliumBGPPeeringPolicy
|
||||
metadata:
|
||||
name: "{{ cilium_bgp_peering_policy.name }}"
|
||||
spec:
|
||||
{{ cilium_bgp_peering_policy.spec | to_yaml | indent(2) }}
|
||||
{% endfor %}
|
||||
@@ -0,0 +1,16 @@
|
||||
{% for cilium_loadbalancer_ip_pool in cilium_loadbalancer_ip_pools %}
|
||||
---
|
||||
apiVersion: "cilium.io/v2alpha1"
|
||||
kind: CiliumLoadBalancerIPPool
|
||||
metadata:
|
||||
name: "{{ cilium_loadbalancer_ip_pool.name }}"
|
||||
spec:
|
||||
blocks:
|
||||
{% for cblock in cilium_loadbalancer_ip_pool.cidrs | default([]) %}
|
||||
- cidr: "{{ cblock }}"
|
||||
{% endfor %}
|
||||
{% for rblock in cilium_loadbalancer_ip_pool.ranges | default([]) %}
|
||||
- start: "{{ rblock.start }}"
|
||||
stop: "{{ rblock.stop | default(rblock.start) }}"
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
@@ -1,282 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: cilium-config
|
||||
namespace: kube-system
|
||||
data:
|
||||
identity-allocation-mode: {{ cilium_identity_allocation_mode }}
|
||||
|
||||
{% if cilium_identity_allocation_mode == "kvstore" %}
|
||||
# This etcd-config contains the etcd endpoints of your cluster. If you use
|
||||
# TLS please make sure you follow the tutorial in https://cilium.link/etcd-config
|
||||
etcd-config: |-
|
||||
---
|
||||
endpoints:
|
||||
{% for ip_addr in etcd_access_addresses.split(',') %}
|
||||
- {{ ip_addr }}
|
||||
{% endfor %}
|
||||
|
||||
# In case you want to use TLS in etcd, uncomment the 'ca-file' line
|
||||
# and create a kubernetes secret by following the tutorial in
|
||||
# https://cilium.link/etcd-config
|
||||
ca-file: "{{ cilium_cert_dir }}/ca_cert.crt"
|
||||
|
||||
# In case you want client to server authentication, uncomment the following
|
||||
# lines and create a kubernetes secret by following the tutorial in
|
||||
# https://cilium.link/etcd-config
|
||||
key-file: "{{ cilium_cert_dir }}/key.pem"
|
||||
cert-file: "{{ cilium_cert_dir }}/cert.crt"
|
||||
|
||||
# kvstore
|
||||
# https://docs.cilium.io/en/latest/cmdref/kvstore/
|
||||
kvstore: etcd
|
||||
kvstore-opt: '{"etcd.config": "/var/lib/etcd-config/etcd.config"}'
|
||||
{% endif %}
|
||||
|
||||
# If you want metrics enabled in all of your Cilium agents, set the port for
|
||||
# which the Cilium agents will have their metrics exposed.
|
||||
# This option deprecates the "prometheus-serve-addr" in the
|
||||
# "cilium-metrics-config" ConfigMap
|
||||
# NOTE that this will open the port on ALL nodes where Cilium pods are
|
||||
# scheduled.
|
||||
{% if cilium_enable_prometheus %}
|
||||
prometheus-serve-addr: ":{{ cilium_agent_scrape_port }}"
|
||||
operator-prometheus-serve-addr: ":{{ cilium_operator_scrape_port }}"
|
||||
enable-metrics: "true"
|
||||
{% endif %}
|
||||
|
||||
# If you want to run cilium in debug mode change this value to true
|
||||
debug: "{{ cilium_debug }}"
|
||||
enable-ipv4: "{{ cilium_enable_ipv4 }}"
|
||||
enable-ipv6: "{{ cilium_enable_ipv6 }}"
|
||||
# If a serious issue occurs during Cilium startup, this
|
||||
# invasive option may be set to true to remove all persistent
|
||||
# state. Endpoints will not be restored using knowledge from a
|
||||
# prior Cilium run, so they may receive new IP addresses upon
|
||||
# restart. This also triggers clean-cilium-bpf-state.
|
||||
clean-cilium-state: "false"
|
||||
# If you want to clean cilium BPF state, set this to true;
|
||||
# Removes all BPF maps from the filesystem. Upon restart,
|
||||
# endpoints are restored with the same IP addresses, however
|
||||
# any ongoing connections may be disrupted briefly.
|
||||
# Loadbalancing decisions will be reset, so any ongoing
|
||||
# connections via a service may be loadbalanced to a different
|
||||
# backend after restart.
|
||||
clean-cilium-bpf-state: "false"
|
||||
|
||||
# Users who wish to specify their own custom CNI configuration file must set
|
||||
# custom-cni-conf to "true", otherwise Cilium may overwrite the configuration.
|
||||
custom-cni-conf: "false"
|
||||
|
||||
{% if cilium_version | regex_replace('v') is version('1.14.0', '>=') %}
|
||||
# Tell the agent to generate and write a CNI configuration file
|
||||
write-cni-conf-when-ready: /host/etc/cni/net.d/05-cilium.conflist
|
||||
cni-exclusive: "{{ cilium_cni_exclusive }}"
|
||||
cni-log-file: "{{ cilium_cni_log_file }}"
|
||||
{% endif %}
|
||||
|
||||
# If you want cilium monitor to aggregate tracing for packets, set this level
|
||||
# to "low", "medium", or "maximum". The higher the level, the less packets
|
||||
# that will be seen in monitor output.
|
||||
monitor-aggregation: "{{ cilium_monitor_aggregation }}"
|
||||
|
||||
# ct-global-max-entries-* specifies the maximum number of connections
|
||||
# supported across all endpoints, split by protocol: tcp or other. One pair
|
||||
# of maps uses these values for IPv4 connections, and another pair of maps
|
||||
# use these values for IPv6 connections.
|
||||
#
|
||||
# If these values are modified, then during the next Cilium startup the
|
||||
# tracking of ongoing connections may be disrupted. This may lead to brief
|
||||
# policy drops or a change in loadbalancing decisions for a connection.
|
||||
#
|
||||
# For users upgrading from Cilium 1.2 or earlier, to minimize disruption
|
||||
# during the upgrade process, comment out these options.
|
||||
bpf-ct-global-tcp-max: "524288"
|
||||
bpf-ct-global-any-max: "262144"
|
||||
|
||||
# Pre-allocation of map entries allows per-packet latency to be reduced, at
|
||||
# the expense of up-front memory allocation for the entries in the maps. The
|
||||
# default value below will minimize memory usage in the default installation;
|
||||
# users who are sensitive to latency may consider setting this to "true".
|
||||
#
|
||||
# This option was introduced in Cilium 1.4. Cilium 1.3 and earlier ignore
|
||||
# this option and behave as though it is set to "true".
|
||||
#
|
||||
# If this value is modified, then during the next Cilium startup the restore
|
||||
# of existing endpoints and tracking of ongoing connections may be disrupted.
|
||||
# This may lead to policy drops or a change in loadbalancing decisions for a
|
||||
# connection for some time. Endpoints may need to be recreated to restore
|
||||
# connectivity.
|
||||
#
|
||||
# If this option is set to "false" during an upgrade from 1.3 or earlier to
|
||||
# 1.4 or later, then it may cause one-time disruptions during the upgrade.
|
||||
preallocate-bpf-maps: "{{ cilium_preallocate_bpf_maps }}"
|
||||
|
||||
# Regular expression matching compatible Istio sidecar istio-proxy
|
||||
# container image names
|
||||
sidecar-istio-proxy-image: "cilium/istio_proxy"
|
||||
|
||||
# Encapsulation mode for communication between nodes
|
||||
# Possible values:
|
||||
# - disabled
|
||||
# - vxlan (default)
|
||||
# - geneve
|
||||
{% if cilium_version | regex_replace('v') is version('1.14.0', '<') %}
|
||||
tunnel: "{{ cilium_tunnel_mode }}"
|
||||
{% elif cilium_version | regex_replace('v') is version('1.14.0', '>=') and cilium_tunnel_mode == 'disabled' %}
|
||||
routing-mode: 'native'
|
||||
{% elif cilium_version | regex_replace('v') is version('1.14.0', '>=') and cilium_tunnel_mode != 'disabled' %}
|
||||
routing-mode: 'tunnel'
|
||||
tunnel-protocol: "{{ cilium_tunnel_mode }}"
|
||||
{% endif %}
|
||||
|
||||
## DSR setting
|
||||
bpf-lb-mode: "{{ cilium_loadbalancer_mode }}"
|
||||
|
||||
# l2
|
||||
enable-l2-announcements: "{{ cilium_l2announcements }}"
|
||||
|
||||
# Enable Bandwidth Manager
|
||||
# Cilium’s bandwidth manager supports the kubernetes.io/egress-bandwidth Pod annotation.
|
||||
# Bandwidth enforcement currently does not work in combination with L7 Cilium Network Policies.
|
||||
# In case they select the Pod at egress, then the bandwidth enforcement will be disabled for those Pods.
|
||||
# Bandwidth Manager requires a v5.1.x or more recent Linux kernel.
|
||||
{% if cilium_enable_bandwidth_manager %}
|
||||
enable-bandwidth-manager: "true"
|
||||
{% endif %}
|
||||
|
||||
# Name of the cluster. Only relevant when building a mesh of clusters.
|
||||
cluster-name: "{{ cilium_cluster_name }}"
|
||||
|
||||
# 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.
|
||||
#cluster-id: 1
|
||||
{% if cilium_cluster_id is defined %}
|
||||
cluster-id: "{{ cilium_cluster_id }}"
|
||||
{% endif %}
|
||||
|
||||
# `wait-bpf-mount` is removed after v1.10.4
|
||||
# https://github.com/cilium/cilium/commit/d2217045cb3726a7f823174e086913b69b8090da
|
||||
{% if cilium_version | regex_replace('v') is version('1.10.4', '<') %}
|
||||
# wait-bpf-mount makes init container wait until bpf filesystem is mounted
|
||||
wait-bpf-mount: "false"
|
||||
{% endif %}
|
||||
|
||||
kube-proxy-replacement: "{{ cilium_kube_proxy_replacement }}"
|
||||
|
||||
# `native-routing-cidr` is deprecated in 1.10, removed in 1.12.
|
||||
# Replaced by `ipv4-native-routing-cidr`
|
||||
# https://github.com/cilium/cilium/pull/16695
|
||||
{% if cilium_version | regex_replace('v') is version('1.12', '<') %}
|
||||
native-routing-cidr: "{{ cilium_native_routing_cidr }}"
|
||||
{% else %}
|
||||
{% if cilium_native_routing_cidr | length %}
|
||||
ipv4-native-routing-cidr: "{{ cilium_native_routing_cidr }}"
|
||||
{% endif %}
|
||||
{% if cilium_native_routing_cidr_ipv6 | length %}
|
||||
ipv6-native-routing-cidr: "{{ cilium_native_routing_cidr_ipv6 }}"
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
auto-direct-node-routes: "{{ cilium_auto_direct_node_routes }}"
|
||||
|
||||
operator-api-serve-addr: "{{ cilium_operator_api_serve_addr }}"
|
||||
|
||||
# Hubble settings
|
||||
{% if cilium_enable_hubble %}
|
||||
enable-hubble: "true"
|
||||
{% if cilium_enable_hubble_metrics %}
|
||||
hubble-metrics-server: ":{{ cilium_hubble_scrape_port }}"
|
||||
hubble-metrics:
|
||||
{% for hubble_metrics_cycle in cilium_hubble_metrics %}
|
||||
{{ hubble_metrics_cycle }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if cilium_hubble_event_buffer_capacity is defined %}
|
||||
hubble-event-buffer-capacity: "{{ cilium_hubble_event_buffer_capacity }}"
|
||||
{% endif %}
|
||||
{% if cilium_hubble_event_queue_size is defined %}
|
||||
hubble-event-queue-size: "{{ cilium_hubble_event_queue_size }}"
|
||||
{% endif %}
|
||||
hubble-listen-address: ":4244"
|
||||
{% if cilium_enable_hubble and cilium_hubble_install %}
|
||||
hubble-disable-tls: "{% if cilium_hubble_tls_generate %}false{% else %}true{% endif %}"
|
||||
hubble-tls-cert-file: /var/lib/cilium/tls/hubble/server.crt
|
||||
hubble-tls-key-file: /var/lib/cilium/tls/hubble/server.key
|
||||
hubble-tls-client-ca-files: /var/lib/cilium/tls/hubble/client-ca.crt
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
# IP Masquerade Agent
|
||||
enable-ip-masq-agent: "{{ cilium_ip_masq_agent_enable }}"
|
||||
|
||||
{% for key, value in cilium_config_extra_vars.items() %}
|
||||
{{ key }}: "{{ value }}"
|
||||
{% endfor %}
|
||||
|
||||
# Enable transparent network encryption
|
||||
{% if cilium_encryption_enabled %}
|
||||
{% if cilium_encryption_type == "ipsec" %}
|
||||
enable-ipsec: "true"
|
||||
ipsec-key-file: /etc/ipsec/keys
|
||||
encrypt-node: "{{ cilium_ipsec_node_encryption }}"
|
||||
{% endif %}
|
||||
|
||||
{% if cilium_encryption_type == "wireguard" %}
|
||||
enable-wireguard: "true"
|
||||
enable-wireguard-userspace-fallback: "{{ cilium_wireguard_userspace_fallback }}"
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
# IPAM settings
|
||||
ipam: "{{ cilium_ipam_mode }}"
|
||||
{% if cilium_ipam_mode == "cluster-pool" %}
|
||||
cluster-pool-ipv4-cidr: "{{ cilium_pool_cidr | default(kube_pods_subnet) }}"
|
||||
cluster-pool-ipv4-mask-size: "{{ cilium_pool_mask_size | default(kube_network_node_prefix) }}"
|
||||
{% if cilium_enable_ipv6 %}
|
||||
cluster-pool-ipv6-cidr: "{{ cilium_pool_cidr_ipv6 | default(kube_pods_subnet_ipv6) }}"
|
||||
cluster-pool-ipv6-mask-size: "{{ cilium_pool_mask_size_ipv6 | default(kube_network_node_prefix_ipv6) }}"
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
agent-health-port: "{{ cilium_agent_health_port }}"
|
||||
|
||||
{% if cilium_version | regex_replace('v') is version('1.11', '>=') and cilium_cgroup_host_root != '' %}
|
||||
cgroup-root: "{{ cilium_cgroup_host_root }}"
|
||||
{% endif %}
|
||||
|
||||
bpf-map-dynamic-size-ratio: "{{ cilium_bpf_map_dynamic_size_ratio }}"
|
||||
|
||||
enable-ipv4-masquerade: "{{ cilium_enable_ipv4_masquerade }}"
|
||||
enable-ipv6-masquerade: "{{ cilium_enable_ipv6_masquerade }}"
|
||||
|
||||
enable-bpf-masquerade: "{{ cilium_enable_bpf_masquerade }}"
|
||||
|
||||
enable-host-legacy-routing: "{{ cilium_enable_host_legacy_routing }}"
|
||||
|
||||
enable-remote-node-identity: "{{ cilium_enable_remote_node_identity }}"
|
||||
|
||||
enable-well-known-identities: "{{ cilium_enable_well_known_identities }}"
|
||||
|
||||
monitor-aggregation-flags: "{{ cilium_monitor_aggregation_flags }}"
|
||||
|
||||
enable-bpf-clock-probe: "{{ cilium_enable_bpf_clock_probe }}"
|
||||
|
||||
disable-cnp-status-updates: "{{ cilium_disable_cnp_status_updates }}"
|
||||
{% if cilium_ip_masq_agent_enable %}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: ip-masq-agent
|
||||
namespace: kube-system
|
||||
data:
|
||||
config: |
|
||||
nonMasqueradeCIDRs:
|
||||
{% for cidr in cilium_non_masquerade_cidrs %}
|
||||
- {{ cidr }}
|
||||
{% endfor %}
|
||||
masqLinkLocal: {{ cilium_masq_link_local | bool }}
|
||||
resyncInterval: "{{ cilium_ip_masq_resync_interval }}"
|
||||
{% endif %}
|
||||
@@ -1,155 +0,0 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: cilium
|
||||
rules:
|
||||
- apiGroups:
|
||||
- networking.k8s.io
|
||||
resources:
|
||||
- networkpolicies
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- discovery.k8s.io
|
||||
resources:
|
||||
- endpointslices
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- namespaces
|
||||
- services
|
||||
- pods
|
||||
- endpoints
|
||||
- nodes
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
{% if cilium_version | regex_replace('v') is version('1.12', '<') %}
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- pods
|
||||
- pods/finalizers
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- update
|
||||
- delete
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- pods
|
||||
- nodes
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- update
|
||||
{% endif %}
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- nodes
|
||||
- nodes/status
|
||||
verbs:
|
||||
- patch
|
||||
- apiGroups:
|
||||
- apiextensions.k8s.io
|
||||
resources:
|
||||
- customresourcedefinitions
|
||||
verbs:
|
||||
# Deprecated for removal in v1.10
|
||||
- create
|
||||
- list
|
||||
- watch
|
||||
- update
|
||||
|
||||
# This is used when validating policies in preflight. This will need to stay
|
||||
# until we figure out how to avoid "get" inside the preflight, and then
|
||||
# should be removed ideally.
|
||||
- get
|
||||
- apiGroups:
|
||||
- cilium.io
|
||||
resources:
|
||||
- ciliumnetworkpolicies
|
||||
- ciliumnetworkpolicies/status
|
||||
- ciliumclusterwidenetworkpolicies
|
||||
- ciliumclusterwidenetworkpolicies/status
|
||||
- ciliumendpoints
|
||||
- ciliumendpoints/status
|
||||
- ciliumnodes
|
||||
- ciliumnodes/status
|
||||
- ciliumidentities
|
||||
- ciliumlocalredirectpolicies
|
||||
- ciliumlocalredirectpolicies/status
|
||||
- ciliumegressnatpolicies
|
||||
{% if cilium_version | regex_replace('v') is version('1.11', '>=') %}
|
||||
- ciliumendpointslices
|
||||
{% endif %}
|
||||
{% if cilium_version | regex_replace('v') is version('1.12', '>=') %}
|
||||
- ciliumbgploadbalancerippools
|
||||
- ciliumbgppeeringpolicies
|
||||
{% endif %}
|
||||
{% if cilium_version | regex_replace('v') is version('1.11.5', '<') %}
|
||||
- ciliumnetworkpolicies/finalizers
|
||||
- ciliumclusterwidenetworkpolicies/finalizers
|
||||
- ciliumendpoints/finalizers
|
||||
- ciliumnodes/finalizers
|
||||
- ciliumidentities/finalizers
|
||||
- ciliumlocalredirectpolicies/finalizers
|
||||
{% endif %}
|
||||
{% if cilium_version | regex_replace('v') is version('1.14', '>=') %}
|
||||
- ciliuml2announcementpolicies/status
|
||||
{% endif %}
|
||||
{% if cilium_version | regex_replace('v') is version('1.15', '>=') %}
|
||||
- ciliumbgpnodeconfigs
|
||||
- ciliumbgpnodeconfigs/status
|
||||
- ciliumbgpadvertisements
|
||||
- ciliumbgppeerconfigs
|
||||
{% endif %}
|
||||
verbs:
|
||||
- '*'
|
||||
{% if cilium_version | regex_replace('v') is version('1.12', '>=') %}
|
||||
- apiGroups:
|
||||
- cilium.io
|
||||
resources:
|
||||
- ciliumclusterwideenvoyconfigs
|
||||
- ciliumenvoyconfigs
|
||||
- ciliumegressgatewaypolicies
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
{% endif %}
|
||||
{% if cilium_version | regex_replace('v') is version('1.14', '>=') %}
|
||||
- apiGroups:
|
||||
- cilium.io
|
||||
resources:
|
||||
- ciliumcidrgroups
|
||||
- ciliuml2announcementpolicies
|
||||
- ciliumpodippools
|
||||
- ciliuml2announcementpolicies/status
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
{% if cilium_version %}
|
||||
- apiGroups:
|
||||
- coordination.k8s.io
|
||||
resources:
|
||||
- leases
|
||||
verbs:
|
||||
- create
|
||||
- get
|
||||
- update
|
||||
- list
|
||||
- delete
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: cilium
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: cilium
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: cilium
|
||||
namespace: kube-system
|
||||
@@ -1,446 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: cilium
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: cilium
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: cilium
|
||||
updateStrategy:
|
||||
rollingUpdate:
|
||||
# Specifies the maximum number of Pods that can be unavailable during the update process.
|
||||
maxUnavailable: 2
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
{% if cilium_enable_prometheus %}
|
||||
prometheus.io/port: "{{ cilium_agent_scrape_port }}"
|
||||
prometheus.io/scrape: "true"
|
||||
{% endif %}
|
||||
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"dedicated","operator":"Equal","value":"master","effect":"NoSchedule"}]'
|
||||
labels:
|
||||
k8s-app: cilium
|
||||
spec:
|
||||
containers:
|
||||
- name: cilium-agent
|
||||
image: "{{ cilium_image_repo }}:{{ cilium_image_tag }}"
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
command:
|
||||
- cilium-agent
|
||||
args:
|
||||
- --config-dir=/tmp/cilium/config-map
|
||||
{% if cilium_mtu != "" %}
|
||||
- --mtu={{ cilium_mtu }}
|
||||
{% endif %}
|
||||
{% if cilium_agent_custom_args is string %}
|
||||
- {{ cilium_agent_custom_args }}
|
||||
{% else %}
|
||||
{% for flag in cilium_agent_custom_args %}
|
||||
- {{ flag }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
startupProbe:
|
||||
httpGet:
|
||||
host: '127.0.0.1'
|
||||
path: /healthz
|
||||
port: {{ cilium_agent_health_port }}
|
||||
scheme: HTTP
|
||||
httpHeaders:
|
||||
- name: "brief"
|
||||
value: "true"
|
||||
failureThreshold: 105
|
||||
periodSeconds: 2
|
||||
successThreshold: 1
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
host: '127.0.0.1'
|
||||
path: /healthz
|
||||
port: {{ cilium_agent_health_port }}
|
||||
scheme: HTTP
|
||||
httpHeaders:
|
||||
- name: "brief"
|
||||
value: "true"
|
||||
failureThreshold: 10
|
||||
periodSeconds: 30
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 5
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
host: 127.0.0.1
|
||||
path: /healthz
|
||||
port: {{ cilium_agent_health_port }}
|
||||
scheme: HTTP
|
||||
httpHeaders:
|
||||
- name: "brief"
|
||||
value: "true"
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 30
|
||||
successThreshold: 1
|
||||
failureThreshold: 3
|
||||
timeoutSeconds: 5
|
||||
env:
|
||||
- name: K8S_NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: spec.nodeName
|
||||
- name: CILIUM_K8S_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: metadata.namespace
|
||||
- name: CILIUM_CLUSTERMESH_CONFIG
|
||||
value: /var/lib/cilium/clustermesh/
|
||||
{% if cilium_kube_proxy_replacement == 'strict' %}
|
||||
- name: KUBERNETES_SERVICE_HOST
|
||||
value: "{{ kube_apiserver_global_endpoint | urlsplit('hostname') }}"
|
||||
- name: KUBERNETES_SERVICE_PORT
|
||||
value: "{{ kube_apiserver_global_endpoint | urlsplit('port') }}"
|
||||
{% endif %}
|
||||
{% for env_var in cilium_agent_extra_env_vars %}
|
||||
- {{ env_var | to_nice_yaml(indent=2) | indent(10) }}
|
||||
{% endfor %}
|
||||
lifecycle:
|
||||
{% if cilium_version | regex_replace('v') is version('1.14', '<') %}
|
||||
postStart:
|
||||
exec:
|
||||
command:
|
||||
- "/cni-install.sh"
|
||||
- "--cni-exclusive={{ cilium_cni_exclusive | string | lower }}"
|
||||
{% if cilium_version | regex_replace('v') is version('1.12', '>=') %}
|
||||
- "--enable-debug={{ cilium_debug | string | lower }}"
|
||||
- "--log-file={{ cilium_cni_log_file }}"
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
preStop:
|
||||
exec:
|
||||
command:
|
||||
- /cni-uninstall.sh
|
||||
resources:
|
||||
limits:
|
||||
cpu: {{ cilium_cpu_limit }}
|
||||
memory: {{ cilium_memory_limit }}
|
||||
requests:
|
||||
cpu: {{ cilium_cpu_requests }}
|
||||
memory: {{ cilium_memory_requests }}
|
||||
{% if cilium_enable_prometheus or cilium_enable_hubble_metrics %}
|
||||
ports:
|
||||
{% endif %}
|
||||
{% if cilium_enable_prometheus %}
|
||||
- name: prometheus
|
||||
containerPort: {{ cilium_agent_scrape_port }}
|
||||
hostPort: {{ cilium_agent_scrape_port }}
|
||||
protocol: TCP
|
||||
{% endif %}
|
||||
{% if cilium_enable_hubble_metrics %}
|
||||
- name: hubble-metrics
|
||||
containerPort: {{ cilium_hubble_scrape_port }}
|
||||
hostPort: {{ cilium_hubble_scrape_port }}
|
||||
protocol: TCP
|
||||
{% endif %}
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
- name: bpf-maps
|
||||
mountPath: /sys/fs/bpf
|
||||
mountPropagation: Bidirectional
|
||||
- name: cilium-run
|
||||
mountPath: /var/run/cilium
|
||||
{% if cilium_version | regex_replace('v') is version('1.13.1', '<') %}
|
||||
- name: cni-path
|
||||
mountPath: /host/opt/cni/bin
|
||||
{% endif %}
|
||||
- name: etc-cni-netd
|
||||
mountPath: /host/etc/cni/net.d
|
||||
{% if cilium_identity_allocation_mode == "kvstore" %}
|
||||
- name: etcd-config-path
|
||||
mountPath: /var/lib/etcd-config
|
||||
readOnly: true
|
||||
- name: etcd-secrets
|
||||
mountPath: "{{ cilium_cert_dir }}"
|
||||
readOnly: true
|
||||
{% endif %}
|
||||
- name: clustermesh-secrets
|
||||
mountPath: /var/lib/cilium/clustermesh
|
||||
readOnly: true
|
||||
- name: cilium-config-path
|
||||
mountPath: /tmp/cilium/config-map
|
||||
readOnly: true
|
||||
{% if cilium_ip_masq_agent_enable %}
|
||||
- name: ip-masq-agent
|
||||
mountPath: /etc/config
|
||||
readOnly: true
|
||||
{% endif %}
|
||||
# Needed to be able to load kernel modules
|
||||
- name: lib-modules
|
||||
mountPath: /lib/modules
|
||||
readOnly: true
|
||||
- name: xtables-lock
|
||||
mountPath: /run/xtables.lock
|
||||
{% if cilium_encryption_enabled and cilium_encryption_type == "ipsec" %}
|
||||
- name: cilium-ipsec-secrets
|
||||
mountPath: /etc/ipsec
|
||||
readOnly: true
|
||||
{% endif %}
|
||||
{% if cilium_hubble_install %}
|
||||
- name: hubble-tls
|
||||
mountPath: /var/lib/cilium/tls/hubble
|
||||
readOnly: true
|
||||
{% endif %}
|
||||
{% for volume_mount in cilium_agent_extra_volume_mounts %}
|
||||
- {{ volume_mount | to_nice_yaml(indent=2) | indent(10) }}
|
||||
{% endfor %}
|
||||
# In managed etcd mode, Cilium must be able to resolve the DNS name of the etcd service
|
||||
{% if cilium_identity_allocation_mode == "kvstore" %}
|
||||
dnsPolicy: ClusterFirstWithHostNet
|
||||
{% endif %}
|
||||
hostNetwork: true
|
||||
initContainers:
|
||||
{% if cilium_version | regex_replace('v') is version('1.11', '>=') and cilium_cgroup_auto_mount %}
|
||||
- name: mount-cgroup
|
||||
image: "{{ cilium_image_repo }}:{{ cilium_image_tag }}"
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
env:
|
||||
- name: CGROUP_ROOT
|
||||
value: {{ cilium_cgroup_host_root }}
|
||||
- name: BIN_PATH
|
||||
value: /opt/cni/bin
|
||||
command:
|
||||
- sh
|
||||
- -ec
|
||||
# The statically linked Go program binary is invoked to avoid any
|
||||
# dependency on utilities like sh and mount that can be missing on certain
|
||||
# distros installed on the underlying host. Copy the binary to the
|
||||
# same directory where we install cilium cni plugin so that exec permissions
|
||||
# are available.
|
||||
- |
|
||||
cp /usr/bin/cilium-mount /hostbin/cilium-mount;
|
||||
nsenter --cgroup=/hostproc/1/ns/cgroup --mount=/hostproc/1/ns/mnt "${BIN_PATH}/cilium-mount" $CGROUP_ROOT;
|
||||
rm /hostbin/cilium-mount
|
||||
volumeMounts:
|
||||
- name: hostproc
|
||||
mountPath: /hostproc
|
||||
- name: cni-path
|
||||
mountPath: /hostbin
|
||||
securityContext:
|
||||
privileged: true
|
||||
{% endif %}
|
||||
{% if cilium_version | regex_replace('v') is version('1.11.7', '>=') %}
|
||||
- name: apply-sysctl-overwrites
|
||||
image: "{{ cilium_image_repo }}:{{ cilium_image_tag }}"
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
env:
|
||||
- name: BIN_PATH
|
||||
value: /opt/cni/bin
|
||||
command:
|
||||
- sh
|
||||
- -ec
|
||||
# The statically linked Go program binary is invoked to avoid any
|
||||
# dependency on utilities like sh that can be missing on certain
|
||||
# distros installed on the underlying host. Copy the binary to the
|
||||
# same directory where we install cilium cni plugin so that exec permissions
|
||||
# are available.
|
||||
- |
|
||||
cp /usr/bin/cilium-sysctlfix /hostbin/cilium-sysctlfix;
|
||||
nsenter --mount=/hostproc/1/ns/mnt "${BIN_PATH}/cilium-sysctlfix";
|
||||
rm /hostbin/cilium-sysctlfix
|
||||
volumeMounts:
|
||||
- name: hostproc
|
||||
mountPath: /hostproc
|
||||
- name: cni-path
|
||||
mountPath: /hostbin
|
||||
securityContext:
|
||||
privileged: true
|
||||
{% endif %}
|
||||
- name: clean-cilium-state
|
||||
image: "{{ cilium_image_repo }}:{{ cilium_image_tag }}"
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
command:
|
||||
- /init-container.sh
|
||||
env:
|
||||
- name: CILIUM_ALL_STATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: cilium-config
|
||||
key: clean-cilium-state
|
||||
optional: true
|
||||
- name: CILIUM_BPF_STATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: cilium-config
|
||||
key: clean-cilium-bpf-state
|
||||
optional: true
|
||||
# Removed in 1.11 and up.
|
||||
# https://github.com/cilium/cilium/commit/f7a3f59fd74983c600bfce9cac364b76d20849d9
|
||||
{% if cilium_version | regex_replace('v') is version('1.11', '<') %}
|
||||
- name: CILIUM_WAIT_BPF_MOUNT
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: wait-bpf-mount
|
||||
name: cilium-config
|
||||
optional: true
|
||||
{% endif %}
|
||||
{% if cilium_kube_proxy_replacement == 'strict' %}
|
||||
- name: KUBERNETES_SERVICE_HOST
|
||||
value: "{{ kube_apiserver_global_endpoint | urlsplit('hostname') }}"
|
||||
- name: KUBERNETES_SERVICE_PORT
|
||||
value: "{{ kube_apiserver_global_endpoint | urlsplit('port') }}"
|
||||
{% endif %}
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
- name: bpf-maps
|
||||
mountPath: /sys/fs/bpf
|
||||
{% if cilium_version | regex_replace('v') is version('1.11', '>=') %}
|
||||
# Required to mount cgroup filesystem from the host to cilium agent pod
|
||||
- name: cilium-cgroup
|
||||
mountPath: {{ cilium_cgroup_host_root }}
|
||||
mountPropagation: HostToContainer
|
||||
{% endif %}
|
||||
- name: cilium-run
|
||||
mountPath: /var/run/cilium
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
{% if cilium_version | regex_replace('v') is version('1.13.1', '>=') %}
|
||||
# Install the CNI binaries in an InitContainer so we don't have a writable host mount in the agent
|
||||
- name: install-cni-binaries
|
||||
image: "{{ cilium_image_repo }}:{{ cilium_image_tag }}"
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
command:
|
||||
- "/install-plugin.sh"
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 10Mi
|
||||
securityContext:
|
||||
privileged: true
|
||||
terminationMessagePolicy: FallbackToLogsOnError
|
||||
volumeMounts:
|
||||
- name: cni-path
|
||||
mountPath: /host/opt/cni/bin
|
||||
{% endif %}
|
||||
restartPolicy: Always
|
||||
priorityClassName: system-node-critical
|
||||
serviceAccount: cilium
|
||||
serviceAccountName: cilium
|
||||
terminationGracePeriodSeconds: 1
|
||||
hostNetwork: true
|
||||
# In managed etcd mode, Cilium must be able to resolve the DNS name of the etcd service
|
||||
{% if cilium_identity_allocation_mode == "kvstore" %}
|
||||
dnsPolicy: ClusterFirstWithHostNet
|
||||
{% endif %}
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- topologyKey: kubernetes.io/hostname
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
k8s-app: cilium
|
||||
tolerations:
|
||||
- operator: Exists
|
||||
volumes:
|
||||
# To keep state between restarts / upgrades
|
||||
- name: cilium-run
|
||||
hostPath:
|
||||
path: /var/run/cilium
|
||||
type: DirectoryOrCreate
|
||||
# To keep state between restarts / upgrades for bpf maps
|
||||
- name: bpf-maps
|
||||
hostPath:
|
||||
path: /sys/fs/bpf
|
||||
type: DirectoryOrCreate
|
||||
{% if cilium_version | regex_replace('v') is version('1.11', '>=') %}
|
||||
# To mount cgroup2 filesystem on the host
|
||||
- name: hostproc
|
||||
hostPath:
|
||||
path: /proc
|
||||
type: Directory
|
||||
# To keep state between restarts / upgrades for cgroup2 filesystem
|
||||
- name: cilium-cgroup
|
||||
hostPath:
|
||||
path: {{ cilium_cgroup_host_root }}
|
||||
type: DirectoryOrCreate
|
||||
{% endif %}
|
||||
# To install cilium cni plugin in the host
|
||||
- name: cni-path
|
||||
hostPath:
|
||||
path: /opt/cni/bin
|
||||
type: DirectoryOrCreate
|
||||
# To install cilium cni configuration in the host
|
||||
- name: etc-cni-netd
|
||||
hostPath:
|
||||
path: /etc/cni/net.d
|
||||
type: DirectoryOrCreate
|
||||
# To be able to load kernel modules
|
||||
- name: lib-modules
|
||||
hostPath:
|
||||
path: /lib/modules
|
||||
# To access iptables concurrently with other processes (e.g. kube-proxy)
|
||||
- name: xtables-lock
|
||||
hostPath:
|
||||
path: /run/xtables.lock
|
||||
type: FileOrCreate
|
||||
{% if cilium_identity_allocation_mode == "kvstore" %}
|
||||
# To read the etcd config stored in config maps
|
||||
- name: etcd-config-path
|
||||
configMap:
|
||||
name: cilium-config
|
||||
# note: the leading zero means this number is in octal representation: do not remove it
|
||||
defaultMode: 0400
|
||||
items:
|
||||
- key: etcd-config
|
||||
path: etcd.config
|
||||
# To read the k8s etcd secrets in case the user might want to use TLS
|
||||
- name: etcd-secrets
|
||||
hostPath:
|
||||
path: "{{ cilium_cert_dir }}"
|
||||
{% endif %}
|
||||
# To read the clustermesh configuration
|
||||
- name: clustermesh-secrets
|
||||
secret:
|
||||
secretName: cilium-clustermesh
|
||||
# note: the leading zero means this number is in octal representation: do not remove it
|
||||
defaultMode: 0400
|
||||
optional: true
|
||||
# To read the configuration from the config map
|
||||
- name: cilium-config-path
|
||||
configMap:
|
||||
name: cilium-config
|
||||
{% if cilium_ip_masq_agent_enable %}
|
||||
- name: ip-masq-agent
|
||||
configMap:
|
||||
name: ip-masq-agent
|
||||
optional: true
|
||||
items:
|
||||
- key: config
|
||||
path: ip-masq-agent
|
||||
{% endif %}
|
||||
{% if cilium_encryption_enabled and cilium_encryption_type == "ipsec" %}
|
||||
- name: cilium-ipsec-secrets
|
||||
secret:
|
||||
secretName: cilium-ipsec-keys
|
||||
{% endif %}
|
||||
{% if cilium_hubble_install %}
|
||||
- name: hubble-tls
|
||||
projected:
|
||||
# note: the leading zero means this number is in octal representation: do not remove it
|
||||
defaultMode: 0400
|
||||
sources:
|
||||
- secret:
|
||||
name: hubble-server-certs
|
||||
optional: true
|
||||
items:
|
||||
- key: ca.crt
|
||||
path: client-ca.crt
|
||||
- key: tls.crt
|
||||
path: server.crt
|
||||
- key: tls.key
|
||||
path: server.key
|
||||
{% endif %}
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: cilium
|
||||
namespace: kube-system
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
data:
|
||||
keys: {{ cilium_ipsec_key }}
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: cilium-ipsec-keys
|
||||
namespace: kube-system
|
||||
type: Opaque
|
||||
@@ -1,71 +0,0 @@
|
||||
#jinja2: trim_blocks:False
|
||||
---
|
||||
# Source: cilium helm chart: cilium/templates/hubble-relay/configmap.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: hubble-relay-config
|
||||
namespace: kube-system
|
||||
data:
|
||||
config.yaml: |
|
||||
cluster-name: "{{ cilium_cluster_name }}"
|
||||
peer-service: "hubble-peer.kube-system.svc.{{ dns_domain }}:443"
|
||||
listen-address: :4245
|
||||
metrics-listen-address: ":9966"
|
||||
dial-timeout:
|
||||
retry-timeout:
|
||||
sort-buffer-len-max:
|
||||
sort-buffer-drain-timeout:
|
||||
tls-client-cert-file: /var/lib/hubble-relay/tls/client.crt
|
||||
tls-client-key-file: /var/lib/hubble-relay/tls/client.key
|
||||
tls-server-cert-file: /var/lib/hubble-relay/tls/server.crt
|
||||
tls-server-key-file: /var/lib/hubble-relay/tls/server.key
|
||||
tls-hubble-server-ca-files: /var/lib/hubble-relay/tls/hubble-server-ca.crt
|
||||
disable-server-tls: {% if cilium_hubble_tls_generate %}false{% else %}true{% endif %}
|
||||
disable-client-tls: {% if cilium_hubble_tls_generate %}false{% else %}true{% endif %}
|
||||
---
|
||||
# Source: cilium/templates/hubble-ui/configmap.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: hubble-ui-nginx
|
||||
namespace: kube-system
|
||||
data:
|
||||
nginx.conf: |
|
||||
server {
|
||||
listen 8081;
|
||||
{% if cilium_enable_ipv6 %}
|
||||
listen [::]:8081;
|
||||
{% endif %}
|
||||
server_name localhost;
|
||||
root /app;
|
||||
index index.html;
|
||||
client_max_body_size 1G;
|
||||
|
||||
location / {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
# CORS
|
||||
add_header Access-Control-Allow-Methods "GET, POST, PUT, HEAD, DELETE, OPTIONS";
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
add_header Access-Control-Max-Age 1728000;
|
||||
add_header Access-Control-Expose-Headers content-length,grpc-status,grpc-message;
|
||||
add_header Access-Control-Allow-Headers range,keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout;
|
||||
if ($request_method = OPTIONS) {
|
||||
return 204;
|
||||
}
|
||||
# /CORS
|
||||
|
||||
location /api {
|
||||
proxy_http_version 1.1;
|
||||
proxy_pass_request_headers on;
|
||||
proxy_hide_header Access-Control-Allow-Origin;
|
||||
proxy_pass http://127.0.0.1:8090;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
{% if cilium_hubble_tls_generate %}
|
||||
---
|
||||
# Source: cilium/templates/hubble-generate-certs-clusterrole.yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: hubble-generate-certs
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- secrets
|
||||
- configmaps
|
||||
verbs:
|
||||
- create
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- secrets
|
||||
resourceNames:
|
||||
- hubble-server-certs
|
||||
- hubble-relay-client-certs
|
||||
- hubble-relay-server-certs
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- configmaps
|
||||
resourceNames:
|
||||
- hubble-ca-cert
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- secrets
|
||||
resourceNames:
|
||||
- hubble-ca-secret
|
||||
verbs:
|
||||
- get
|
||||
{% endif %}
|
||||
---
|
||||
# Source: cilium/templates/hubble-relay-clusterrole.yaml
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: hubble-relay
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- componentstatuses
|
||||
- endpoints
|
||||
- namespaces
|
||||
- nodes
|
||||
- pods
|
||||
- services
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
---
|
||||
# Source: cilium/templates/hubble-ui-clusterrole.yaml
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: hubble-ui
|
||||
rules:
|
||||
- apiGroups:
|
||||
- networking.k8s.io
|
||||
resources:
|
||||
- networkpolicies
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- componentstatuses
|
||||
- endpoints
|
||||
- namespaces
|
||||
- nodes
|
||||
- pods
|
||||
- services
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- apiextensions.k8s.io
|
||||
resources:
|
||||
- customresourcedefinitions
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- cilium.io
|
||||
resources:
|
||||
- "*"
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
@@ -1,44 +0,0 @@
|
||||
{% if cilium_hubble_tls_generate %}
|
||||
---
|
||||
# Source: cilium/templates/hubble-generate-certs-clusterrolebinding.yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: hubble-generate-certs
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: hubble-generate-certs
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: hubble-generate-certs
|
||||
namespace: kube-system
|
||||
{% endif %}
|
||||
---
|
||||
# Source: cilium/templates/hubble-relay-clusterrolebinding.yaml
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: hubble-relay
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: hubble-relay
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
namespace: kube-system
|
||||
name: hubble-relay
|
||||
---
|
||||
# Source: cilium/templates/hubble-ui-clusterrolebinding.yaml
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: hubble-ui
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: hubble-ui
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
namespace: kube-system
|
||||
name: hubble-ui
|
||||
@@ -1,38 +0,0 @@
|
||||
---
|
||||
# Source: cilium/templates/hubble-generate-certs-cronjob.yaml
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: hubble-generate-certs
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: hubble-generate-certs
|
||||
spec:
|
||||
schedule: "0 0 1 */4 *"
|
||||
concurrencyPolicy: Forbid
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
k8s-app: hubble-generate-certs
|
||||
spec:
|
||||
serviceAccount: hubble-generate-certs
|
||||
serviceAccountName: hubble-generate-certs
|
||||
containers:
|
||||
- name: certgen
|
||||
image: "{{ cilium_hubble_certgen_image_repo }}:{{ cilium_hubble_certgen_image_tag }}"
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
command:
|
||||
- "/usr/bin/cilium-certgen"
|
||||
# Because this is executed as a job, we pass the values as command
|
||||
# line args instead of via config map. This allows users to inspect
|
||||
# the values used in past runs by inspecting the completed pod.
|
||||
args:
|
||||
{% for key, value in cilium_certgen_args.items() -%}
|
||||
- "--{{ key }}={{ value }}"
|
||||
{% endfor %}
|
||||
|
||||
hostNetwork: true
|
||||
restartPolicy: OnFailure
|
||||
ttlSecondsAfterFinished: 1800
|
||||
@@ -1,197 +0,0 @@
|
||||
---
|
||||
# Source: cilium/templates/hubble-relay-deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: hubble-relay
|
||||
labels:
|
||||
k8s-app: hubble-relay
|
||||
namespace: kube-system
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: hubble-relay
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxUnavailable: 1
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
labels:
|
||||
k8s-app: hubble-relay
|
||||
spec:
|
||||
affinity:
|
||||
podAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- labelSelector:
|
||||
matchExpressions:
|
||||
- key: "k8s-app"
|
||||
operator: In
|
||||
values:
|
||||
- cilium
|
||||
topologyKey: "kubernetes.io/hostname"
|
||||
containers:
|
||||
- name: hubble-relay
|
||||
image: "{{ cilium_hubble_relay_image_repo }}:{{ cilium_hubble_relay_image_tag }}"
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
command:
|
||||
- hubble-relay
|
||||
args:
|
||||
- serve
|
||||
ports:
|
||||
- name: grpc
|
||||
containerPort: 4245
|
||||
{% if cilium_enable_prometheus %}
|
||||
- name: prometheus
|
||||
containerPort: 9966
|
||||
protocol: TCP
|
||||
{% endif %}
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: grpc
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: grpc
|
||||
volumeMounts:
|
||||
- mountPath: /var/run/cilium
|
||||
name: hubble-sock-dir
|
||||
readOnly: true
|
||||
- mountPath: /etc/hubble-relay
|
||||
name: config
|
||||
readOnly: true
|
||||
{% if cilium_hubble_tls_generate -%}
|
||||
- mountPath: /var/lib/hubble-relay/tls
|
||||
name: tls
|
||||
readOnly: true
|
||||
{%- endif %}
|
||||
|
||||
restartPolicy: Always
|
||||
serviceAccount: hubble-relay
|
||||
serviceAccountName: hubble-relay
|
||||
terminationGracePeriodSeconds: 0
|
||||
volumes:
|
||||
- configMap:
|
||||
name: hubble-relay-config
|
||||
items:
|
||||
- key: config.yaml
|
||||
path: config.yaml
|
||||
name: config
|
||||
- hostPath:
|
||||
path: /var/run/cilium
|
||||
type: Directory
|
||||
name: hubble-sock-dir
|
||||
{% if cilium_hubble_tls_generate -%}
|
||||
- projected:
|
||||
sources:
|
||||
- secret:
|
||||
name: hubble-relay-client-certs
|
||||
items:
|
||||
- key: ca.crt
|
||||
path: hubble-server-ca.crt
|
||||
- key: tls.crt
|
||||
path: client.crt
|
||||
- key: tls.key
|
||||
path: client.key
|
||||
- secret:
|
||||
name: hubble-server-certs
|
||||
items:
|
||||
- key: tls.crt
|
||||
path: server.crt
|
||||
- key: tls.key
|
||||
path: server.key
|
||||
name: tls
|
||||
{%- endif %}
|
||||
|
||||
---
|
||||
# Source: cilium/templates/hubble-ui/deployment.yaml
|
||||
kind: Deployment
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: hubble-ui
|
||||
name: hubble-ui
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: hubble-ui
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
labels:
|
||||
k8s-app: hubble-ui
|
||||
spec:
|
||||
securityContext:
|
||||
runAsUser: 1001
|
||||
serviceAccount: hubble-ui
|
||||
serviceAccountName: hubble-ui
|
||||
containers:
|
||||
- name: frontend
|
||||
image: "{{ cilium_hubble_ui_image_repo }}:{{ cilium_hubble_ui_image_tag }}"
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
ports:
|
||||
- containerPort: 8081
|
||||
name: http
|
||||
volumeMounts:
|
||||
- name: hubble-ui-nginx-conf
|
||||
mountPath: /etc/nginx/conf.d/default.conf
|
||||
subPath: nginx.conf
|
||||
- name: tmp-dir
|
||||
mountPath: /tmp
|
||||
resources:
|
||||
{}
|
||||
- name: backend
|
||||
image: "{{ cilium_hubble_ui_backend_image_repo }}:{{ cilium_hubble_ui_backend_image_tag }}"
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
env:
|
||||
- name: EVENTS_SERVER_PORT
|
||||
value: "8090"
|
||||
{% if cilium_hubble_tls_generate -%}
|
||||
- name: TLS_TO_RELAY_ENABLED
|
||||
value: "true"
|
||||
- name: FLOWS_API_ADDR
|
||||
value: "hubble-relay:443"
|
||||
- name: TLS_RELAY_SERVER_NAME
|
||||
value: ui.{{ cilium_cluster_name }}.hubble-grpc.cilium.io
|
||||
- name: TLS_RELAY_CA_CERT_FILES
|
||||
value: /var/lib/hubble-ui/certs/hubble-server-ca.crt
|
||||
- name: TLS_RELAY_CLIENT_CERT_FILE
|
||||
value: /var/lib/hubble-ui/certs/client.crt
|
||||
- name: TLS_RELAY_CLIENT_KEY_FILE
|
||||
value: /var/lib/hubble-ui/certs/client.key
|
||||
{% else -%}
|
||||
- name: FLOWS_API_ADDR
|
||||
value: "hubble-relay:80"
|
||||
{% endif %}
|
||||
|
||||
volumeMounts:
|
||||
- name: tls
|
||||
mountPath: /var/lib/hubble-ui/certs
|
||||
readOnly: true
|
||||
ports:
|
||||
- containerPort: 8090
|
||||
name: grpc
|
||||
resources:
|
||||
{}
|
||||
volumes:
|
||||
- configMap:
|
||||
defaultMode: 420
|
||||
name: hubble-ui-nginx
|
||||
name: hubble-ui-nginx-conf
|
||||
- projected:
|
||||
sources:
|
||||
- secret:
|
||||
name: hubble-relay-client-certs
|
||||
items:
|
||||
- key: ca.crt
|
||||
path: hubble-server-ca.crt
|
||||
- key: tls.crt
|
||||
path: client.crt
|
||||
- key: tls.key
|
||||
path: client.key
|
||||
name: tls
|
||||
- emptyDir: {}
|
||||
name: tmp-dir
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
# Source: cilium/templates/hubble-generate-certs-job.yaml
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: hubble-generate-certs
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: hubble-generate-certs
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
k8s-app: hubble-generate-certs
|
||||
spec:
|
||||
serviceAccount: hubble-generate-certs
|
||||
serviceAccountName: hubble-generate-certs
|
||||
containers:
|
||||
- name: certgen
|
||||
image: "{{ cilium_hubble_certgen_image_repo }}:{{ cilium_hubble_certgen_image_tag }}"
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
command:
|
||||
- "/usr/bin/cilium-certgen"
|
||||
# Because this is executed as a job, we pass the values as command
|
||||
# line args instead of via config map. This allows users to inspect
|
||||
# the values used in past runs by inspecting the completed pod.
|
||||
args:
|
||||
{% for key, value in cilium_certgen_args.items() -%}
|
||||
- "--{{ key }}={{ value }}"
|
||||
{% endfor %}
|
||||
|
||||
hostNetwork: true
|
||||
restartPolicy: OnFailure
|
||||
ttlSecondsAfterFinished: 1800
|
||||
@@ -1,23 +0,0 @@
|
||||
{% if cilium_hubble_tls_generate %}
|
||||
---
|
||||
# Source: cilium/templates/hubble-generate-certs-serviceaccount.yaml
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: hubble-generate-certs
|
||||
namespace: kube-system
|
||||
{% endif %}
|
||||
---
|
||||
# Source: cilium/templates/hubble-relay-serviceaccount.yaml
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: hubble-relay
|
||||
namespace: kube-system
|
||||
---
|
||||
# Source: cilium/templates/hubble-ui-serviceaccount.yaml
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: hubble-ui
|
||||
namespace: kube-system
|
||||
@@ -1,104 +0,0 @@
|
||||
{% if cilium_enable_prometheus or cilium_enable_hubble_metrics %}
|
||||
---
|
||||
# Source: cilium/templates/cilium-agent-service.yaml
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: hubble-metrics
|
||||
namespace: kube-system
|
||||
annotations:
|
||||
prometheus.io/scrape: 'true'
|
||||
prometheus.io/port: "{{ cilium_hubble_scrape_port }}"
|
||||
labels:
|
||||
k8s-app: hubble
|
||||
spec:
|
||||
clusterIP: None
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: hubble-metrics
|
||||
port: 9091
|
||||
protocol: TCP
|
||||
targetPort: hubble-metrics
|
||||
selector:
|
||||
k8s-app: cilium
|
||||
---
|
||||
# Source: cilium/templates/hubble-relay/metrics-service.yaml
|
||||
# We use a separate service from hubble-relay which can be exposed externally
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: hubble-relay-metrics
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: hubble-relay
|
||||
annotations:
|
||||
prometheus.io/scrape: 'true'
|
||||
prometheus.io/port: "9966"
|
||||
spec:
|
||||
clusterIP: None
|
||||
type: ClusterIP
|
||||
selector:
|
||||
k8s-app: hubble-relay
|
||||
ports:
|
||||
- name: metrics
|
||||
port: 9966
|
||||
protocol: TCP
|
||||
targetPort: prometheus
|
||||
|
||||
{% endif %}
|
||||
---
|
||||
# Source: cilium/templates/hubble-relay-service.yaml
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: hubble-relay
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: hubble-relay
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
k8s-app: hubble-relay
|
||||
ports:
|
||||
- protocol: TCP
|
||||
{% if cilium_hubble_tls_generate -%}
|
||||
port: 443
|
||||
{% else -%}
|
||||
port: 80
|
||||
{% endif -%}
|
||||
targetPort: 4245
|
||||
---
|
||||
# Source: cilium/templates/hubble-ui-service.yaml
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: hubble-ui
|
||||
labels:
|
||||
k8s-app: hubble-ui
|
||||
namespace: kube-system
|
||||
spec:
|
||||
selector:
|
||||
k8s-app: hubble-ui
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: 8081
|
||||
type: ClusterIP
|
||||
---
|
||||
# Source: cilium/templates/hubble/peer-service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: hubble-peer
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: cilium
|
||||
spec:
|
||||
selector:
|
||||
k8s-app: cilium
|
||||
ports:
|
||||
- name: peer-service
|
||||
port: 443
|
||||
protocol: TCP
|
||||
targetPort: 4244
|
||||
internalTrafficPolicy: Local
|
||||
@@ -0,0 +1,164 @@
|
||||
MTU: {{ cilium_mtu }}
|
||||
debug:
|
||||
enabled: {{ cilium_debug }}
|
||||
|
||||
image:
|
||||
repository: {{ cilium_image_repo }}
|
||||
tag: {{ cilium_image_tag }}
|
||||
|
||||
k8sServiceHost: "auto"
|
||||
k8sServicePort: "auto"
|
||||
|
||||
ipv4:
|
||||
enabled: {{ cilium_enable_ipv4 }}
|
||||
ipv6:
|
||||
enabled: {{ cilium_enable_ipv6 }}
|
||||
|
||||
l2announcements:
|
||||
enabled: {{ cilium_l2announcements }}
|
||||
|
||||
healthPort: {{ cilium_agent_health_port }}
|
||||
|
||||
identityAllocationMode: {{ cilium_identity_allocation_mode }}
|
||||
|
||||
tunnelProtocol: {{ cilium_tunnel_mode }}
|
||||
|
||||
loadbalancer:
|
||||
mode: {{ cilium_loadbalancer_mode }}
|
||||
|
||||
kubeProxyReplacement: {{ cilium_kube_proxy_replacement }}
|
||||
|
||||
{% if cilium_dns_proxy_enable_transparent_mode is defined %}
|
||||
dnsProxy:
|
||||
enableTransparentMode: {{ cilium_dns_proxy_enable_transparent_mode }}
|
||||
{% endif %}
|
||||
|
||||
extraVolumes:
|
||||
{{ cilium_agent_extra_volumes | to_nice_yaml(indent=2) | indent(2) }}
|
||||
|
||||
extraVolumeMounts:
|
||||
{{ cilium_agent_extra_volume_mounts | to_nice_yaml(indent=2) | indent(2) }}
|
||||
|
||||
extraArgs:
|
||||
{{ cilium_agent_extra_args | to_nice_yaml(indent=2) | indent(2) }}
|
||||
|
||||
bpf:
|
||||
masquerade: {{ cilium_enable_bpf_masquerade }}
|
||||
hostLegacyRouting: {{ cilium_enable_host_legacy_routing }}
|
||||
monitorAggregation: {{ cilium_monitor_aggregation }}
|
||||
preallocateMaps: {{ cilium_preallocate_bpf_maps }}
|
||||
mapDynamicSizeRatio: {{ cilium_bpf_map_dynamic_size_ratio }}
|
||||
|
||||
cni:
|
||||
exclusive: {{ cilium_cni_exclusive }}
|
||||
logFile: {{ cilium_cni_log_file }}
|
||||
|
||||
autoDirectNodeRoutes: {{ cilium_auto_direct_node_routes }}
|
||||
|
||||
ipv4NativeRoutingCIDR: {{ cilium_native_routing_cidr }}
|
||||
ipv6NativeRoutingCIDR: {{ cilium_native_routing_cidr_ipv6 }}
|
||||
|
||||
encryption:
|
||||
enabled: {{ cilium_encryption_enabled }}
|
||||
{% if cilium_encryption_enabled %}
|
||||
type: {{ cilium_encryption_type }}
|
||||
{% if cilium_encryption_type == 'wireguard' %}
|
||||
nodeEncryption: {{ cilium_encryption_node_encryption }}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
bandwidthManager:
|
||||
enabled: {{ cilium_enable_bandwidth_manager }}
|
||||
bbr: {{ cilium_enable_bandwidth_manager_bbr }}
|
||||
|
||||
ipMasqAgent:
|
||||
enabled: {{ cilium_ip_masq_agent_enable }}
|
||||
{% if cilium_ip_masq_agent_enable %}
|
||||
config:
|
||||
nonMasqueradeCIDRs: {{ cilium_non_masquerade_cidrs }}
|
||||
masqLinkLocal: {{ cilium_masq_link_local }}
|
||||
masqLinkLocalIPv6: {{ cilium_masq_link_local_ipv6 }}
|
||||
# cilium_ip_masq_resync_interval
|
||||
{% endif %}
|
||||
|
||||
hubble:
|
||||
enabled: {{ cilium_enable_hubble }}
|
||||
relay:
|
||||
enabled: {{ cilium_enable_hubble }}
|
||||
image:
|
||||
repository: {{ cilium_hubble_relay_image_repo }}
|
||||
tag: {{ cilium_hubble_relay_image_tag }}
|
||||
ui:
|
||||
enabled: {{ cilium_enable_hubble_ui }}
|
||||
backend:
|
||||
image:
|
||||
repository: {{ cilium_hubble_ui_backend_image_repo }}
|
||||
tag: {{ cilium_hubble_ui_backend_image_tag }}
|
||||
frontend:
|
||||
image:
|
||||
repository: {{ cilium_hubble_ui_image_repo }}
|
||||
tag: {{ cilium_hubble_ui_image_tag }}
|
||||
metrics:
|
||||
enabled: {{ cilium_hubble_metrics }}
|
||||
export:
|
||||
fileMaxBackups: {{ cilium_hubble_export_file_max_backups }}
|
||||
fileMaxSizeMb: {{ cilium_hubble_export_file_max_size_mb }}
|
||||
dynamic:
|
||||
enabled: {{ cilium_hubble_export_dynamic_enabled }}
|
||||
config:
|
||||
content:
|
||||
{{ cilium_hubble_export_dynamic_config_content | to_nice_yaml(indent=10) | indent(10) }}
|
||||
|
||||
gatewayAPI:
|
||||
enabled: {{ cilium_gateway_api_enabled }}
|
||||
|
||||
ipam:
|
||||
mode: {{ cilium_ipam_mode }}
|
||||
operator:
|
||||
clusterPoolIPv4PodCIDRList:
|
||||
- {{ cilium_pool_cidr | default(kube_pods_subnet) }}
|
||||
clusterPoolIPv4MaskSize: {{ cilium_pool_mask_size | default(kube_network_node_prefix) }}
|
||||
|
||||
clusterPoolIPv6PodCIDRList:
|
||||
- {{ cilium_pool_cidr_ipv6 | default(kube_pods_subnet_ipv6) }}
|
||||
clusterPoolIPv6MaskSize: {{ cilium_pool_mask_size_ipv6 | default(kube_network_node_prefix_ipv6) }}
|
||||
|
||||
cgroup:
|
||||
autoMount:
|
||||
enabled: {{ cilium_cgroup_auto_mount }}
|
||||
hostRoot: {{ cilium_cgroup_host_root }}
|
||||
|
||||
operator:
|
||||
image:
|
||||
repository: {{ cilium_operator_image_repo }}
|
||||
tag: {{ cilium_operator_image_tag }}
|
||||
replicas: {{ cilium_operator_replicas }}
|
||||
extraArgs:
|
||||
{{ cilium_operator_extra_args | to_nice_yaml(indent=2) | indent(4) }}
|
||||
extraVolumes:
|
||||
{{ cilium_operator_extra_volumes | to_nice_yaml(indent=2) | indent(4) }}
|
||||
extraVolumeMounts:
|
||||
{{ cilium_operator_extra_volume_mounts | to_nice_yaml(indent=2) | indent(4) }}
|
||||
tolerations:
|
||||
{{ cilium_operator_tolerations | to_nice_yaml(indent=2) | indent(4) }}
|
||||
|
||||
cluster:
|
||||
id: {{ cilium_cluster_id }}
|
||||
name: {{ cilium_cluster_name }}
|
||||
|
||||
enableIPv4Masquerade: {{ cilium_enable_ipv4_masquerade }}
|
||||
enableIPv6Masquerade: {{ cilium_enable_ipv6_masquerade }}
|
||||
|
||||
hostFirewall:
|
||||
enabled: {{ cilium_enable_host_firewall }}
|
||||
|
||||
certgen:
|
||||
image:
|
||||
repositry: {{ cilium_hubble_certgen_image_repo }}
|
||||
tag: {{ cilium_hubble_certgen_image_tag }}
|
||||
|
||||
envoy:
|
||||
image:
|
||||
repositry: {{ cilium_hubble_envoy_image_repo }}
|
||||
tag: {{ cilium_hubble_envoy_image_tag }}
|
||||
@@ -2,7 +2,7 @@
|
||||
# Flannel public IP
|
||||
# The address that flannel should advertise as how to access the system
|
||||
# Disabled until https://github.com/coreos/flannel/issues/712 is fixed
|
||||
# flannel_public_ip: "{{ access_ip | default(ip | default(fallback_ips[inventory_hostname])) }}"
|
||||
# flannel_public_ip: "{{ main_access_ip }}"
|
||||
|
||||
## interface that should be used for flannel operations
|
||||
## This is actually an inventory cluster-level item
|
||||
|
||||
@@ -30,12 +30,14 @@ data:
|
||||
}
|
||||
net-conf.json: |
|
||||
{
|
||||
{% if ipv4_stack %}
|
||||
"Network": "{{ kube_pods_subnet }}",
|
||||
"EnableIPv4": true,
|
||||
{% if enable_dual_stack_networks %}
|
||||
{% endif %}
|
||||
{% if ipv6_stack %}
|
||||
"EnableIPv6": true,
|
||||
"IPv6Network": "{{ kube_pods_subnet_ipv6 }}",
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
"Backend": {
|
||||
"Type": "{{ flannel_backend_type }}"{% if flannel_backend_type == "vxlan" %},
|
||||
"VNI": {{ flannel_vxlan_vni }},
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
# See the OWNERS docs at https://go.k8s.io/owners
|
||||
|
||||
emeritus_approvers:
|
||||
- oilbeater
|
||||
@@ -33,7 +33,7 @@ kube_ovn_central_replics: "{{ kube_ovn_central_hosts | length }}"
|
||||
kube_ovn_controller_replics: "{{ kube_ovn_central_hosts | length }}"
|
||||
kube_ovn_central_ips: |-
|
||||
{% for item in kube_ovn_central_hosts -%}
|
||||
{{ hostvars[item]['ip'] | default(fallback_ips[item]) }}{% if not loop.last %},{% endif %}
|
||||
{{ hostvars[item]['main_ip'] }}{% if not loop.last %},{% endif %}
|
||||
{%- endfor %}
|
||||
|
||||
kube_ovn_ic_enable: false
|
||||
@@ -62,6 +62,15 @@ kube_ovn_traffic_mirror: false
|
||||
|
||||
kube_ovn_external_address: 8.8.8.8
|
||||
kube_ovn_external_address_ipv6: 2400:3200::1
|
||||
kube_ovn_external_address_merged: >-
|
||||
{%- if ipv4_stack and ipv6_stack -%}
|
||||
{{ kube_ovn_external_address }},{{ kube_ovn_external_address_ipv6 }}
|
||||
{%- elif ipv4_stack -%}
|
||||
{{ kube_ovn_external_address }}
|
||||
{%- else -%}
|
||||
{{ kube_ovn_external_address_ipv6 }}
|
||||
{%- endif -%}
|
||||
|
||||
kube_ovn_external_dns: alauda.cn
|
||||
|
||||
# kube_ovn_default_gateway: 10.233.64.1,fd85:ee78:d8a6:8607::1:0
|
||||
@@ -74,6 +83,14 @@ kube_ovn_u2o_interconnection: false
|
||||
# kube_ovn_default_exclude_ips: 10.16.0.1
|
||||
kube_ovn_node_switch_cidr: 100.64.0.0/16
|
||||
kube_ovn_node_switch_cidr_ipv6: fd00:100:64::/64
|
||||
kube_ovn_node_switch_cidr_merged: >-
|
||||
{%- if ipv4_stack and ipv6_stack -%}
|
||||
{{ kube_ovn_node_switch_cidr }},{{ kube_ovn_node_switch_cidr_ipv6 }}
|
||||
{%- elif ipv4_stack -%}
|
||||
{{ kube_ovn_node_switch_cidr }}
|
||||
{%- else -%}
|
||||
{{ kube_ovn_node_switch_cidr_ipv6 }}
|
||||
{%- endif -%}
|
||||
|
||||
## vlan config, set default interface name and vlan id
|
||||
# kube_ovn_default_interface_name: eth0
|
||||
|
||||
@@ -240,14 +240,14 @@ spec:
|
||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||
args:
|
||||
- /kube-ovn/start-controller.sh
|
||||
- --default-cidr={{ kube_pods_subnet }}{% if enable_dual_stack_networks %},{{ kube_ovn_pool_cidr_ipv6 | default(kube_pods_subnet_ipv6) }}{% endif %}{{ '' }}
|
||||
- --default-cidr={{ kube_pods_subnets }}
|
||||
- --default-gateway={% if kube_ovn_default_gateway is defined %}{{ kube_ovn_default_gateway }}{% endif %}{{ '' }}
|
||||
- --default-gateway-check={{ kube_ovn_default_gateway_check | string }}
|
||||
- --default-logical-gateway={{ kube_ovn_default_logical_gateway | string }}
|
||||
- --default-u2o-interconnection={{ kube_ovn_u2o_interconnection }}
|
||||
- --default-exclude-ips={% if kube_ovn_default_exclude_ips is defined %}{{ kube_ovn_default_exclude_ips }}{% endif %}{{ '' }}
|
||||
- --node-switch-cidr={{ kube_ovn_node_switch_cidr }}{% if enable_dual_stack_networks %},{{ kube_ovn_node_switch_cidr_ipv6 }}{% endif %}{{ '' }}
|
||||
- --service-cluster-ip-range={{ kube_service_addresses }}{% if enable_dual_stack_networks %},{{ kube_service_addresses_ipv6 }}{% endif %}{{ '' }}
|
||||
- --node-switch-cidr={{ kube_ovn_node_switch_cidr_merged }}
|
||||
- --service-cluster-ip-range={{ kube_service_subnets }}
|
||||
- --network-type={{ kube_ovn_network_type }}
|
||||
- --default-interface-name={{ kube_ovn_default_interface_name | default('') }}
|
||||
- --default-vlan-id={{ kube_ovn_default_vlan_id }}
|
||||
@@ -403,7 +403,7 @@ spec:
|
||||
args:
|
||||
- --enable-mirror={{ kube_ovn_traffic_mirror | lower }}
|
||||
- --encap-checksum={{ kube_ovn_encap_checksum | lower }}
|
||||
- --service-cluster-ip-range={{ kube_service_addresses }}{% if enable_dual_stack_networks %},{{ kube_service_addresses_ipv6 }}{% endif %}{{ '' }}
|
||||
- --service-cluster-ip-range={{ kube_service_subnets }}
|
||||
- --iface={{ kube_ovn_iface | default('') }}
|
||||
- --dpdk-tunnel-iface={{ kube_ovn_dpdk_tunnel_iface }}
|
||||
- --network-type={{ kube_ovn_network_type }}
|
||||
@@ -588,7 +588,7 @@ spec:
|
||||
command:
|
||||
- /kube-ovn/kube-ovn-pinger
|
||||
args:
|
||||
- --external-address={{ kube_ovn_external_address }}{% if enable_dual_stack_networks %},{{ kube_ovn_external_address_ipv6 }}{% endif %}{{ '' }}
|
||||
- --external-address={{ kube_ovn_external_address_merged }}
|
||||
- --external-dns={{ kube_ovn_external_dns }}
|
||||
- --logtostderr=false
|
||||
- --alsologtostderr=true
|
||||
@@ -837,7 +837,7 @@ spec:
|
||||
- name: metrics
|
||||
port: 10661
|
||||
type: ClusterIP
|
||||
{% if enable_dual_stack_networks %}
|
||||
{% if ipv6_stack %}
|
||||
ipFamilyPolicy: PreferDualStack
|
||||
{% endif %}
|
||||
selector:
|
||||
@@ -852,7 +852,7 @@ metadata:
|
||||
labels:
|
||||
app: kube-ovn-pinger
|
||||
spec:
|
||||
{% if enable_dual_stack_networks %}
|
||||
{% if ipv6_stack %}
|
||||
ipFamilyPolicy: PreferDualStack
|
||||
{% endif %}
|
||||
selector:
|
||||
@@ -869,7 +869,7 @@ metadata:
|
||||
labels:
|
||||
app: kube-ovn-controller
|
||||
spec:
|
||||
{% if enable_dual_stack_networks %}
|
||||
{% if ipv6_stack %}
|
||||
ipFamilyPolicy: PreferDualStack
|
||||
{% endif %}
|
||||
selector:
|
||||
@@ -886,7 +886,7 @@ metadata:
|
||||
labels:
|
||||
app: kube-ovn-cni
|
||||
spec:
|
||||
{% if enable_dual_stack_networks %}
|
||||
{% if ipv6_stack %}
|
||||
ipFamilyPolicy: PreferDualStack
|
||||
{% endif %}
|
||||
selector:
|
||||
|
||||
@@ -260,7 +260,7 @@ spec:
|
||||
port: 6641
|
||||
targetPort: 6641
|
||||
type: ClusterIP
|
||||
{% if enable_dual_stack_networks %}
|
||||
{% if ipv6_stack %}
|
||||
ipFamilyPolicy: PreferDualStack
|
||||
{% endif %}
|
||||
selector:
|
||||
@@ -280,7 +280,7 @@ spec:
|
||||
port: 6642
|
||||
targetPort: 6642
|
||||
type: ClusterIP
|
||||
{% if enable_dual_stack_networks %}
|
||||
{% if ipv6_stack %}
|
||||
ipFamilyPolicy: PreferDualStack
|
||||
{% endif %}
|
||||
selector:
|
||||
@@ -300,7 +300,7 @@ spec:
|
||||
port: 6643
|
||||
targetPort: 6643
|
||||
type: ClusterIP
|
||||
{% if enable_dual_stack_networks %}
|
||||
{% if ipv6_stack %}
|
||||
ipFamilyPolicy: PreferDualStack
|
||||
{% endif %}
|
||||
selector:
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# See the OWNERS docs at https://go.k8s.io/owners
|
||||
|
||||
approvers:
|
||||
- bozzo
|
||||
reviewers:
|
||||
- bozzo
|
||||
@@ -4,18 +4,18 @@
|
||||
with_items:
|
||||
- "{{ kube_router_annotations_master }}"
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
when: kube_router_annotations_master is defined and inventory_hostname in groups['kube_control_plane']
|
||||
when: kube_router_annotations_master is defined and 'kube_control_plane' in group_names
|
||||
|
||||
- name: Kube-router | Add annotations on kube_node
|
||||
command: "{{ kubectl }} annotate --overwrite node {{ ansible_hostname }} {{ item }}"
|
||||
with_items:
|
||||
- "{{ kube_router_annotations_node }}"
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
when: kube_router_annotations_node is defined and inventory_hostname in groups['kube_node']
|
||||
when: kube_router_annotations_node is defined and 'kube_node' in group_names
|
||||
|
||||
- name: Kube-router | Add common annotations on all servers
|
||||
command: "{{ kubectl }} annotate --overwrite node {{ ansible_hostname }} {{ item }}"
|
||||
with_items:
|
||||
- "{{ kube_router_annotations_all }}"
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
when: kube_router_annotations_all is defined and inventory_hostname in groups['k8s_cluster']
|
||||
when: kube_router_annotations_all is defined and 'k8s_cluster' in group_names
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
kind: Config
|
||||
clusterCIDR: {{ kube_pods_subnet }}
|
||||
clusterCIDR: {{ kube_pods_subnets }}
|
||||
clusters:
|
||||
- name: cluster
|
||||
cluster:
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# See the OWNERS docs at https://go.k8s.io/owners
|
||||
|
||||
approvers:
|
||||
- simon
|
||||
reviewers:
|
||||
- simon
|
||||
@@ -1,9 +1,10 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: network_plugin/cni
|
||||
when: kube_network_plugin != 'none'
|
||||
|
||||
- role: network_plugin/cilium
|
||||
when: kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool
|
||||
when: kube_network_plugin == 'cilium' or cilium_deploy_additionally
|
||||
tags:
|
||||
- cilium
|
||||
|
||||
|
||||
@@ -6,5 +6,5 @@ multus_cni_run_dir_host: "/run"
|
||||
multus_cni_conf_dir: "{{ ('/host', multus_cni_conf_dir_host) | join }}"
|
||||
multus_cni_bin_dir: "{{ ('/host', multus_cni_bin_dir_host) | join }}"
|
||||
multus_cni_run_dir: "{{ ('/host', multus_cni_run_dir_host) | join }}"
|
||||
multus_cni_version: "0.4.0"
|
||||
multus_kubeconfig_file_host: "{{ (multus_cni_conf_dir_host, '/multus.d/multus.kubeconfig') | join }}"
|
||||
multus_namespace_isolation: false
|
||||
|
||||
@@ -24,6 +24,7 @@ spec:
|
||||
spec:
|
||||
hostNetwork: true
|
||||
dnsPolicy: ClusterFirstWithHostNet
|
||||
priorityClassName: system-node-critical
|
||||
nodeSelector:
|
||||
kubernetes.io/arch: {{ image_arch }}
|
||||
{% if container_manager_types | length >= 2 %}
|
||||
@@ -32,16 +33,35 @@ spec:
|
||||
tolerations:
|
||||
- operator: Exists
|
||||
serviceAccountName: multus
|
||||
initContainers:
|
||||
- name: install-multus-binary
|
||||
image: {{ multus_image_repo }}:{{ multus_image_tag }}
|
||||
command: ["/install_multus"]
|
||||
args:
|
||||
- "--type"
|
||||
- "thin"
|
||||
resources:
|
||||
requests:
|
||||
cpu: "10m"
|
||||
memory: "15Mi"
|
||||
securityContext:
|
||||
privileged: true
|
||||
terminationMessagePolicy: FallbackToLogsOnError
|
||||
volumeMounts:
|
||||
- name: cnibin
|
||||
mountPath: {{ multus_cni_bin_dir }}
|
||||
mountPropagation: Bidirectional
|
||||
containers:
|
||||
- name: kube-multus
|
||||
image: {{ multus_image_repo }}:{{ multus_image_tag }}
|
||||
command: ["/entrypoint.sh"]
|
||||
command: ["/thin_entrypoint"]
|
||||
args:
|
||||
- "--cni-conf-dir={{ multus_cni_conf_dir }}"
|
||||
- "--multus-autoconfig-dir={{ multus_cni_conf_dir }}"
|
||||
- "--cni-bin-dir={{ multus_cni_bin_dir }}"
|
||||
- "--multus-conf-file={{ multus_conf_file }}"
|
||||
- "--multus-kubeconfig-file-host={{ multus_kubeconfig_file_host }}"
|
||||
- "--cni-version={{ multus_cni_version }}"
|
||||
- "--namespace-isolation={{ multus_namespace_isolation | string | lower }}"
|
||||
resources:
|
||||
requests:
|
||||
cpu: "100m"
|
||||
@@ -55,6 +75,7 @@ spec:
|
||||
capabilities:
|
||||
add: ["SYS_ADMIN"]
|
||||
{% endif %}
|
||||
terminationMessagePolicy: FallbackToLogsOnError
|
||||
volumeMounts:
|
||||
{% if container_manager == 'crio' %}
|
||||
- name: run
|
||||
|
||||
@@ -18,7 +18,7 @@ weave_hairpin_mode: true
|
||||
|
||||
# The range of IP addresses used by Weave Net and the subnet they are placed in
|
||||
# (CIDR format; default 10.32.0.0/12)
|
||||
weave_ipalloc_range: "{{ kube_pods_subnet }}"
|
||||
weave_ipalloc_range: "{{ kube_pods_subnets }}"
|
||||
|
||||
# Set to 0 to disable Network Policy Controller (default is on)
|
||||
weave_expect_npc: "{{ enable_network_policy }}"
|
||||
|
||||
Reference in New Issue
Block a user