feat(ansible): Calico bits 47/43947/1 master
authorPeter Mikus <[email protected]>
Mon, 27 Oct 2025 13:27:26 +0000 (14:27 +0100)
committerPeter Mikus <[email protected]>
Mon, 27 Oct 2025 13:27:26 +0000 (14:27 +0100)
Signed-off-by: Peter Mikus <[email protected]>
Change-Id: I30520f967d0261000842862b1bc09c153b943abd

fdio.infra.ansible/inventories/lf_inventory/host_vars/10.30.51.40.yaml
fdio.infra.ansible/roles/calico/defaults/main.yaml
fdio.infra.ansible/roles/calico/tasks/cleanup.yaml [new file with mode: 0644]
fdio.infra.ansible/roles/calico/tasks/deploy.yaml [new file with mode: 0644]
fdio.infra.ansible/roles/calico/tasks/execute.yaml [new file with mode: 0644]
fdio.infra.ansible/roles/calico/tasks/main.yaml
fdio.infra.ansible/roles/calico/tasks/pre-set.yaml [new file with mode: 0644]
fdio.infra.ansible/roles/calico/templates/calico-vpp.yaml.j2

index 83ba4aa..59d5651 100644 (file)
@@ -64,4 +64,20 @@ docker_volumes:
   - source: "/etc/4xxx_dev0.conf"
     target: "/etc/4xxx_dev0.conf"
   - source: "/etc/4xxx_dev1.conf"
-    target: "/etc/4xxx_dev1.conf"
\ No newline at end of file
+    target: "/etc/4xxx_dev1.conf"
+
+# Calico
+calico_corelist_workers: "2,3,4,5,98,99,100,101"
+calico_uplink_interfaces:
+  - interfaceName: "enp56s0np0"
+    vppDriver: "avf"
+    rx: 8
+    rxMode: "polling"
+    pci: "0000:38:00.0"
+    ip_addr: "192.168.1.2/24"
+  - interfaceName: "enp58s0np0"
+    vppDriver: "avf"
+    rx: 8
+    rxMode: "polling"
+    pci: "0000:3a:00.0"
+    ip_addr: "192.168.2.2/24"
\ No newline at end of file
index 4efbe63..c51a09e 100644 (file)
@@ -11,18 +11,3 @@ kubernetes_calico_resources:
   operator-crds.yaml: https://raw.githubusercontent.com/projectcalico/calico/v{{ kubernetes_calico_version }}/manifests/operator-crds.yaml
 
 calico_vpp_state: "present"
-
-calico_corelist_workers: "2,3,4,5,98,99,100,101"
-calico_uplink_interfaces:
-  - interfaceName: "enp56s0np0"
-    vppDriver: "avf"
-    rx: 8
-    rxMode: "polling"
-    pci: "0000:38:00.0"
-    ip_addr: "192.168.1.2/24"
-  - interfaceName: "enp58s0np0"
-    vppDriver: "avf"
-    rx: 8
-    rxMode: "polling"
-    pci: "0000:3a:00.0"
-    ip_addr: "192.168.2.2/24"
\ No newline at end of file
diff --git a/fdio.infra.ansible/roles/calico/tasks/cleanup.yaml b/fdio.infra.ansible/roles/calico/tasks/cleanup.yaml
new file mode 100644 (file)
index 0000000..536b694
--- /dev/null
@@ -0,0 +1,13 @@
+---
+# file: tasks/cleanup.yaml
+
+- name: reset network interface
+  ansible.builtin.shell: |
+    python3 /opt/dpdk/usertools/dpdk-devbind.py -b none {{ item.pci }} --force
+    python3 /opt/dpdk/usertools/dpdk-devbind.py -b ice {{ item.pci }}
+  loop: "{{ calico_uplink_interfaces }}"
+  when:
+    - calico_sut is defined
+    - calico_vpp_state == "absent"
+  tags:
+    - calico-cleanup
\ No newline at end of file
diff --git a/fdio.infra.ansible/roles/calico/tasks/deploy.yaml b/fdio.infra.ansible/roles/calico/tasks/deploy.yaml
new file mode 100644 (file)
index 0000000..9f5acc9
--- /dev/null
@@ -0,0 +1,68 @@
+---
+# file: tasks/deploy.yaml
+
+- name: download calico manifest to the cluster
+  ansible.builtin.get_url:
+    url: "{{ item.value }}"
+    dest: "/tmp/{{ item.key }}"
+    mode: "0664"
+  loop: "{{ kubernetes_calico_resources | dict2items }}"
+  when:
+    - calico_sut is defined
+  tags:
+    - calico-deploy
+
+- name: apply calico manifest to the cluster
+  kubernetes.core.k8s:
+    state: present
+    src: "/tmp/{{ item.key }}"
+  loop: "{{ kubernetes_calico_resources | dict2items }}"
+  when:
+    - calico_sut is defined
+  tags:
+    - calico-deploy
+
+- name: upload calico vpp manifest to the cluster
+  ansible.builtin.template:
+    dest: "/tmp/{{ item }}"
+    src: "{{ item }}.j2"
+  loop:
+    - "calico-vpp.yaml"
+  when:
+    - calico_sut is defined
+  tags:
+    - calico-deploy
+
+- name: apply calico vpp manifest to the cluster
+  kubernetes.core.k8s:
+    state: "{{ calico_vpp_state }}"
+    src: "/tmp/{{ item }}"
+  loop:
+    - "calico-vpp.yaml"
+  when:
+    - calico_sut is defined
+  tags:
+    - calico-deploy
+
+- name: get a list of all pods from any namespace
+  kubernetes.core.k8s_info:
+    kind: Pod
+    field_selectors:
+      - status.phase=Running
+    label_selectors:
+      - k8s-app=calico-vpp-node
+  register: pod_list
+  when: calico_sut is defined
+  tags:
+    - calico-info
+
+- name: register vpp pod name
+  ansible.builtin.set_fact:
+    calico_pod_name: "{{ item[0]['metadata']['name'] }}"
+  loop:
+    - "{{ pod_list['resources'] }}"
+  when:
+    - calico_sut is defined
+    - pod_list['resources'] | length > 0
+  tags:
+    - calico-info
\ No newline at end of file
diff --git a/fdio.infra.ansible/roles/calico/tasks/execute.yaml b/fdio.infra.ansible/roles/calico/tasks/execute.yaml
new file mode 100644 (file)
index 0000000..94c2817
--- /dev/null
@@ -0,0 +1,26 @@
+---
+# file: tasks/execute.yaml
+
+- name: execute command on calico-vpp-pod
+  kubernetes.core.k8s_exec:
+    namespace: calico-vpp-dataplane
+    pod: "{{ calico_pod_name }}"
+    container: vpp
+    command: vppctl sh version
+  register: command_status
+  when:
+    - calico_pod_name is defined
+    - calico_sut is defined
+    - calico_vpp_state == "present"
+  tags:
+    - calico-execute
+
+- name: check last command status
+  ansible.builtin.debug:
+    msg: "{{ command_status.stdout }}"
+  when:
+    - calico_pod_name is defined
+    - calico_sut is defined
+    - calico_vpp_state == "present"
+  tags:
+    - calico-execute
\ No newline at end of file
index ebbc2a0..61c042a 100644 (file)
 ---
 # file: tasks/main.yaml
 
-- name: pre-setup network interface
-  ansible.builtin.shell: |
-    ip l set dev {{ item.interfaceName }} up
-    ip a add {{ item.ip_addr }} dev {{ item.interfaceName }}
-  loop: "{{ calico_uplink_interfaces }}"
-  ignore_errors: True
-  when:
-    - calico_sut is defined
-    - calico_vpp_state == "present"
+- import_tasks: pre-set.yaml
   tags:
-    - kubernetes-reset
+    - calico-pre-set
 
-- name: download calico manifest to the cluster
-  ansible.builtin.get_url:
-    url: "{{ item.value }}"
-    dest: "/tmp/{{ item.key }}"
-    mode: "0664"
-  loop: "{{ kubernetes_calico_resources | dict2items }}"
-  when:
-    - calico_sut is defined
+- import_tasks: deploy.yaml
   tags:
-    - kubernetes-calico
+    - calico-deploy
 
-- name: apply calico manifest to the cluster
-  kubernetes.core.k8s:
-    state: present
-    src: "/tmp/{{ item.key }}"
-  loop: "{{ kubernetes_calico_resources | dict2items }}"
-  when:
-    - calico_sut is defined
+- import_tasks: execute.yaml
   tags:
-    - kubernetes-calico
+    - calico-execute
 
-- name: upload calico vpp manifest to the cluster
-  ansible.builtin.template:
-    dest: "/tmp/{{ item }}"
-    src: "{{ item }}.j2"
-  loop:
-    - "calico-vpp.yaml"
-  when:
-    - calico_sut is defined
+- import_tasks: cleanup.yaml
   tags:
-    - kubernetes-calico
-
-- name: apply calico vpp manifest to the cluster
-  kubernetes.core.k8s:
-    state: "{{ calico_vpp_state }}"
-    src: "/tmp/{{ item }}"
-  loop:
-    - "calico-vpp.yaml"
-  when:
-    - calico_sut is defined
-  tags:
-    - kubernetes-calico
-
-- name: get a list of all pods from any namespace
-  kubernetes.core.k8s_info:
-    kind: Pod
-    field_selectors:
-      - status.phase=Running
-    label_selectors:
-      - k8s-app=calico-vpp-node
-  register: pod_list
-  when: calico_sut is defined
-  tags:
-    - kubernetes-info
-
-- name: register vpp pod name
-  ansible.builtin.set_fact:
-    calico_pod_name: "{{ item[0]['metadata']['name'] }}"
-  loop:
-    - "{{ pod_list['resources'] }}"
-  when:
-    - calico_sut is defined
-    - pod_list['resources'] | length > 0
-  tags:
-    - kubernetes-info
-
-- name: execute command on calico-vpp-pod
-  kubernetes.core.k8s_exec:
-    namespace: calico-vpp-dataplane
-    pod: "{{ calico_pod_name }}"
-    container: vpp
-    command: vppctl sh version
-  register: command_status
-  when:
-    - calico_pod_name is defined
-    - calico_sut is defined
-    - calico_vpp_state == "present"
-  tags:
-    - kubernetes-info
-
-- name: check last command status
-  ansible.builtin.debug:
-    msg: "{{ command_status.stdout }}"
-  when:
-    - calico_pod_name is defined
-    - calico_sut is defined
-    - calico_vpp_state == "present"
-  tags:
-    - kubernetes-info
-
-- name: reset network interface
-  ansible.builtin.shell: |
-    python3 /opt/dpdk/usertools/dpdk-devbind.py -b none {{ item.pci }} --force
-    python3 /opt/dpdk/usertools/dpdk-devbind.py -b ice {{ item.pci }}
-  loop: "{{ calico_uplink_interfaces }}"
-  when:
-    - calico_sut is defined
-    - calico_vpp_state == "absent"
-  tags:
-    - kubernetes-reset
\ No newline at end of file
+    - calico-cleanup
\ No newline at end of file
diff --git a/fdio.infra.ansible/roles/calico/tasks/pre-set.yaml b/fdio.infra.ansible/roles/calico/tasks/pre-set.yaml
new file mode 100644 (file)
index 0000000..c89252b
--- /dev/null
@@ -0,0 +1,14 @@
+---
+# file: tasks/pre-set.yaml
+
+- name: pre-setup network interface
+  ansible.builtin.shell: |
+    ip l set dev {{ item.interfaceName }} up
+    ip a add {{ item.ip_addr }} dev {{ item.interfaceName }}
+  loop: "{{ calico_uplink_interfaces }}"
+  ignore_errors: True
+  when:
+    - calico_sut is defined
+    - calico_vpp_state == "present"
+  tags:
+    - calico-reset
\ No newline at end of file
index f5c7d78..7e724c9 100644 (file)
@@ -162,6 +162,10 @@ data:
     buffers {
         buffers-per-numa 131072
     }
+  CALICOVPP_FEATURE_GATES: |-
+    {
+      "memifEnabled": true
+    }
   CALICOVPP_INITIAL_CONFIG: |-
     {
       "vppStartupSleepSeconds": 1,