stuttgart-things / deploy-configure-rke

deploy rancher kubernetes engine + configuration in version 1/2 on linux based systems
Apache License 2.0
2 stars 2 forks source link

Add support for cilium only mode #3

Closed Syntax3rror404 closed 1 month ago

Syntax3rror404 commented 3 months ago

Add support for cilium only mode:

Example of a HelmChartConfig for cilium cat /var/lib/rancher/rke2/server/manifests/rke2-cilium-config.yaml

---
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: rke2-cilium
  namespace: kube-system
spec:
  valuesContent: |-
    bgp:
      enabled: false
    hubble:
      enabled: true
      relay:
        enabled: true
      ui:
        enabled: true
    ingressController:
      enabled: true
    k8sServiceHost: 127.0.0.1
    k8sServicePort: 6443
    kubeProxyReplacement: true
    l2announcements:
      enabled: true
    externalIPs:
      enabled: true
    ingressController:
      enabled: true
      service:
        name: cilium-ingress
        labels:
          l2: active
        type: LoadBalancer
        loadBalancerIP : 192.168.35.40

We also need to apply a few manifests to add the loadbalancer pools and also the policies for the L2Announcement https://github.com/stuttgart-things/docs/blob/main/cilium.md

Syntax3rror404 commented 3 months ago

It could be that I missing something here and this usecase is automaticly possible due to modularity.

I see the options for removing kube-proxy and also the ingress and also a vars to configure the rke2 config.

I don't see a option for the custom HelmChartConfig.

patrick-hermann-sva commented 1 month ago

@Syntax3rror404 implemented!

cat <<EOF > ./play.yaml
---
- name: Converge
  hosts: all
  gather_facts: true
  become: true

  vars:
    rke_state: present #absent
    rke_version: 2
    rke2_k8s_version: 1.30.4
    rke2_airgapped_installation: true
    rke2_release_kind: rke2r1 #rke2r2
    rke2_cni: cilium
    disable_rke2_components:
      - rke2-ingress-nginx
      - rke-snapshot-controller
    cluster_setup: multinode
    rke2_cni: cilium
    values_cilium: |
      ---
      eni:
        enabled: true

    helmChartConfig:
      cilium:
        name: rke2-cilium
        namespace: kube-system
        release_values: "{{ values_cilium }}"

  roles:
    - role: deploy-configure-rke
EOF

ansible-playbook -i inv play.yaml -vv