Skip to content

Instantly share code, notes, and snippets.

@wrkode
Forked from dgiebert/README.md
Created July 5, 2024 13:06
Show Gist options
  • Select an option

  • Save wrkode/b207dabba65ee741ae709897a70c1107 to your computer and use it in GitHub Desktop.

Select an option

Save wrkode/b207dabba65ee741ae709897a70c1107 to your computer and use it in GitHub Desktop.

Revisions

  1. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -84,7 +84,7 @@ cilium connectivity test --context $CLUSTER3 --multi-cluster $CLUSTER1

    Based on: https://docs.cilium.io/en/stable/network/clustermesh/clustermesh/

    #### Test
    ### Test
    Configure the Ingress Controller to use ClusterIP and add the correct annotations
    ```yaml
    apiVersion: helm.cattle.io/v1
  2. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -103,4 +103,5 @@ spec:
    annotations:
    service.cilium.io/affinity: remote
    service.cilium.io/global: 'true'
    ```
    ```
    Execute into the cattle-cluster-agent Pod and run `curl http://rke2-ingress-nginx-controller.kube-system.svc` watch the magic in Hubble :)
  3. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@ spec:
    ```
    ### Use the CLI to connect 2 clusters
    Download and combine the KUBECONFIG files with a tool of your choice andnstall the CLI [(docs)](https://docs.cilium.io/en/stable/network/clustermesh/clustermesh/#install-the-cilium-cli)
    Download and combine the KUBECONFIG files with a tool of your choice and install the CLI [(docs)](https://docs.cilium.io/en/stable/network/clustermesh/clustermesh/#install-the-cilium-cli)
    ```sh
    export CLUSTER1=cilium01 CLUSTER2=cilium02
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER1 --service-type LoadBalancer
  4. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -24,8 +24,7 @@ spec:
    ```
    ### Use the CLI to connect 2 clusters
    Download and combine the KUBECONFIG files with a tool of your choice
    Install the CLI [docs](https://docs.cilium.io/en/stable/network/clustermesh/clustermesh/#install-the-cilium-cli)
    Download and combine the KUBECONFIG files with a tool of your choice andnstall the CLI [(docs)](https://docs.cilium.io/en/stable/network/clustermesh/clustermesh/#install-the-cilium-cli)
    ```sh
    export CLUSTER1=cilium01 CLUSTER2=cilium02
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER1 --service-type LoadBalancer
  5. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -25,6 +25,7 @@ spec:
    ### Use the CLI to connect 2 clusters
    Download and combine the KUBECONFIG files with a tool of your choice
    Install the CLI [docs](https://docs.cilium.io/en/stable/network/clustermesh/clustermesh/#install-the-cilium-cli)
    ```sh
    export CLUSTER1=cilium01 CLUSTER2=cilium02
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER1 --service-type LoadBalancer
  6. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### HelmChartConfig
    ### Prepare the Cluster
    Deploy this config to all clusters that you want to form a mesh with
    ```yaml
    apiVersion: helm.cattle.io/v1
  7. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 22 additions and 1 deletion.
    23 changes: 22 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -82,4 +82,25 @@ cilium connectivity test --context $CLUSTER3 --multi-cluster $CLUSTER1

    **!! Persist all settings in the HelmChartConfig (helm get values -n kube-system rke2-cilium)!!**

    Based on: https://docs.cilium.io/en/stable/network/clustermesh/clustermesh/
    Based on: https://docs.cilium.io/en/stable/network/clustermesh/clustermesh/

    #### Test
    Configure the Ingress Controller to use ClusterIP and add the correct annotations
    ```yaml
    apiVersion: helm.cattle.io/v1
    kind: HelmChartConfig
    metadata:
    name: rke2-ingress-nginx
    namespace: kube-system
    spec:
    valuesContent: |-
    controller:
    hostPort:
    enabled: false
    service:
    enabled: true
    type: ClusterIP
    annotations:
    service.cilium.io/affinity: remote
    service.cilium.io/global: 'true'
    ```
  8. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 20 additions and 18 deletions.
    38 changes: 20 additions & 18 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -24,46 +24,48 @@ spec:
    ```
    ### Use the CLI to connect 2 clusters
    Download and combine the KUBECONFIG files with a tool of your choice
    ```sh
    export CLUSTER1=cilium01 CLUSTER2=cilium02
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER1 --service-type LoadBalancer
    # Fix LoadBalancer in CLUSTER1
    kubectl annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    kubectl --context=$CLUSTER1 annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    # Fix cilium-ca for Hubble
    kubectl label secret -n kube-system cilium-ca app.kubernetes.io/managed-by="Helm"
    kubectl annotate secret -n kube-system cilium-ca meta.helm.sh/release-name="rke2-cilium"
    kubectl annotate secret -n kube-system meta.helm.sh/release-namespace="kube-system"
    kubectl --context=$CLUSTER1 label secret -n kube-system cilium-ca app.kubernetes.io/managed-by="Helm"
    kubectl --context=$CLUSTER1 annotate secret -n kube-system cilium-ca meta.helm.sh/release-name="rke2-cilium"
    kubectl --context=$CLUSTER1 annotate secret -n kube-system meta.helm.sh/release-namespace="kube-system"
    kubectl --context=$CLUSTER1 get secret -n kube-system cilium-ca -o yaml | kubectl --context $CLUSTER2 create -f -
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER2 --service-type LoadBalancer
    # Fix LoadBalancer in CLUSTER2
    kubectl annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER2 --service-type LoadBalancer
    kubectl --context=$CLUSTER2 annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'

    # Check Status of the Cluster Mesh Components in each cluster
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium clustermesh status --context $CLUSTER2 --wait
    # Start connecting
    cilium --helm-release-name rke2-cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
    cilium connectivity test --context $CLUSTER1 --multi-cluster $CLUSTER2
    helm get values -n kube-system rke2-cilium
    ```

    **!! Persist all settings in the HelmChartConfig (helm get values -n kube-system rke2-cilium)!!**

    ### Use the CLI to connect 3 clusters
    Download and combine the KUBECONFIG files with a tool of your choice
    ```sh
    export CLUSTER1=cilium01 CLUSTER2=cilium02 CLUSTER3=cilium03
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER1 --service-type LoadBalancer
    # Fix LoadBalancer in CLUSTER1
    kubectl annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    kubectl --context=$CLUSTER1 annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    # Fix cilium-ca for Hubble
    kubectl label secret -n kube-system cilium-ca app.kubernetes.io/managed-by="Helm"
    kubectl annotate secret -n kube-system cilium-ca meta.helm.sh/release-name="rke2-cilium"
    kubectl annotate secret -n kube-system meta.helm.sh/release-namespace="kube-system"
    kubectl --context=$CLUSTER1 label secret -n kube-system cilium-ca app.kubernetes.io/managed-by="Helm"
    kubectl --context=$CLUSTER1 annotate secret -n kube-system cilium-ca meta.helm.sh/release-name="rke2-cilium"
    kubectl --context=$CLUSTER1 annotate secret -n kube-system meta.helm.sh/release-namespace="kube-system"
    kubectl --context=$CLUSTER1 get secret -n kube-system cilium-ca -o yaml | kubectl --context $CLUSTER2 create -f -
    kubectl --context=$CLUSTER1 get secret -n kube-system cilium-ca -o yaml | kubectl --context $CLUSTER3 create -f -
    # Deploy API Server and fix LoadBalancer in CLUSTER2
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER2 --service-type LoadBalancer
    # Fix LoadBalancer in CLUSTER2
    kubectl --context=$CLUSTER2 annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    # Deploy API Server and fix LoadBalancer in CLUSTER2
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER3 --service-type LoadBalancer
    # Fix LoadBalancer in CLUSTER3
    kubectl annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    kubectl --context=$CLUSTER3 annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'

    # Check Status of the Cluster Mesh Components in each cluster
    cilium clustermesh status --context $CLUSTER1 --wait
    @@ -76,8 +78,8 @@ cilium --helm-release-name rke2-cilium clustermesh connect --context $CLUSTER3 -
    cilium connectivity test --context $CLUSTER1 --multi-cluster $CLUSTER2
    cilium connectivity test --context $CLUSTER2 --multi-cluster $CLUSTER3
    cilium connectivity test --context $CLUSTER3 --multi-cluster $CLUSTER1
    # Persist all settings in the HelmChartConfig
    helm get values -n kube-system rke2-cilium
    ```

    **!! Persist all settings in the HelmChartConfig (helm get values -n kube-system rke2-cilium)!!**

    Based on: https://docs.cilium.io/en/stable/network/clustermesh/clustermesh/
  9. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    ### HelmChartConfig
    Deploy this config to all clusters that you want to form a mesh with
    ```yaml
    apiVersion: helm.cattle.io/v1
    kind: HelmChartConfig
    @@ -17,9 +18,9 @@ spec:
    type: wireguard
    # Cluster-mesh
    # This needs to be unique for all nodes
    cluster:
    name: cilium01
    id: 1
    # cluster:
    # name: cilium01
    # id: 1
    ```
    ### Use the CLI to connect 2 clusters
  10. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -16,9 +16,10 @@ spec:
    enabled: true
    type: wireguard
    # Cluster-mesh
    # cluster:
    # name: cilium01
    # id: 1
    # This needs to be unique for all nodes
    cluster:
    name: cilium01
    id: 1
    ```
    ### Use the CLI to connect 2 clusters
    @@ -45,7 +46,7 @@ cilium connectivity test --context $CLUSTER1 --multi-cluster $CLUSTER2
    helm get values -n kube-system rke2-cilium
    ```

    ### Use the CLI to connect 2 clusters
    ### Use the CLI to connect 3 clusters
    ```sh
    export CLUSTER1=cilium01 CLUSTER2=cilium02 CLUSTER3=cilium03
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER1 --service-type LoadBalancer
  11. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -41,7 +41,6 @@ cilium clustermesh status --context $CLUSTER1 --wait
    cilium clustermesh status --context $CLUSTER2 --wait
    # Start connecting
    cilium --helm-release-name rke2-cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium connectivity test --context $CLUSTER1 --multi-cluster $CLUSTER2
    helm get values -n kube-system rke2-cilium
    ```
    @@ -72,8 +71,9 @@ cilium clustermesh status --context $CLUSTER3 --wait
    cilium --helm-release-name rke2-cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
    cilium --helm-release-name rke2-cilium clustermesh connect --context $CLUSTER2 --destination-context $CLUSTER3
    cilium --helm-release-name rke2-cilium clustermesh connect --context $CLUSTER3 --destination-context $CLUSTER1
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium connectivity test --context $CLUSTER1 --multi-cluster $CLUSTER2
    cilium connectivity test --context $CLUSTER2 --multi-cluster $CLUSTER3
    cilium connectivity test --context $CLUSTER3 --multi-cluster $CLUSTER1
    # Persist all settings in the HelmChartConfig
    helm get values -n kube-system rke2-cilium
    ```
  12. @dgiebert dgiebert revised this gist Jun 27, 2024. No changes.
  13. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 29 additions and 1 deletion.
    30 changes: 29 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,32 @@ spec:
    # id: 1
    ```
    ### Use the CLI
    ### Use the CLI to connect 2 clusters
    ```sh
    export CLUSTER1=cilium01 CLUSTER2=cilium02
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER1 --service-type LoadBalancer
    # Fix LoadBalancer in CLUSTER1
    kubectl annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    # Fix cilium-ca for Hubble
    kubectl label secret -n kube-system cilium-ca app.kubernetes.io/managed-by="Helm"
    kubectl annotate secret -n kube-system cilium-ca meta.helm.sh/release-name="rke2-cilium"
    kubectl annotate secret -n kube-system meta.helm.sh/release-namespace="kube-system"
    kubectl --context=$CLUSTER1 get secret -n kube-system cilium-ca -o yaml | kubectl --context $CLUSTER2 create -f -
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER2 --service-type LoadBalancer
    # Fix LoadBalancer in CLUSTER2
    kubectl annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'

    # Check Status of the Cluster Mesh Components in each cluster
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium clustermesh status --context $CLUSTER2 --wait
    # Start connecting
    cilium --helm-release-name rke2-cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium connectivity test --context $CLUSTER1 --multi-cluster $CLUSTER2
    helm get values -n kube-system rke2-cilium
    ```

    ### Use the CLI to connect 2 clusters
    ```sh
    export CLUSTER1=cilium01 CLUSTER2=cilium02 CLUSTER3=cilium03
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER1 --service-type LoadBalancer
    @@ -45,8 +70,11 @@ cilium clustermesh status --context $CLUSTER2 --wait
    cilium clustermesh status --context $CLUSTER3 --wait
    # Start connecting
    cilium --helm-release-name rke2-cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
    cilium --helm-release-name rke2-cilium clustermesh connect --context $CLUSTER2 --destination-context $CLUSTER3
    cilium --helm-release-name rke2-cilium clustermesh connect --context $CLUSTER3 --destination-context $CLUSTER1
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium connectivity test --context $CLUSTER1 --multi-cluster $CLUSTER2
    # Persist all settings in the HelmChartConfig
    helm get values -n kube-system rke2-cilium
    ```

  14. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -47,7 +47,7 @@ cilium clustermesh status --context $CLUSTER3 --wait
    cilium --helm-release-name rke2-cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium connectivity test --context $CLUSTER1 --multi-cluster $CLUSTER2
    helm get values -n kube-system rke2-
    helm get values -n kube-system rke2-cilium
    ```

    Based on: https://docs.cilium.io/en/stable/network/clustermesh/clustermesh/
  15. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 12 additions and 4 deletions.
    16 changes: 12 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -23,19 +23,27 @@ spec:
    ### Use the CLI
    ```sh
    export CLUSTER1=cilium01 CLUSTER2=cilium02
    export CLUSTER1=cilium01 CLUSTER2=cilium02 CLUSTER3=cilium03
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER1 --service-type LoadBalancer
    kubectl --context=$CLUSTER1 get secret -n kube-system cilium-ca -o yaml | kubectl --context $CLUSTER2 create -f -
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER2 --service-type LoadBalancer
    # Fix LoadBalancer
    # Fix LoadBalancer in CLUSTER1
    kubectl annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    # Fix cilium-ca for Hubble
    kubectl label secret -n kube-system cilium-ca app.kubernetes.io/managed-by="Helm"
    kubectl annotate secret -n kube-system cilium-ca meta.helm.sh/release-name="rke2-cilium"
    kubectl annotate secret -n kube-system meta.helm.sh/release-namespace="kube-system"
    kubectl --context=$CLUSTER1 get secret -n kube-system cilium-ca -o yaml | kubectl --context $CLUSTER2 create -f -
    kubectl --context=$CLUSTER1 get secret -n kube-system cilium-ca -o yaml | kubectl --context $CLUSTER3 create -f -
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER2 --service-type LoadBalancer
    # Fix LoadBalancer in CLUSTER2
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER3 --service-type LoadBalancer
    # Fix LoadBalancer in CLUSTER3
    kubectl annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'

    # Check Status of the Cluster Mesh Components in each cluster
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium clustermesh status --context $CLUSTER2 --wait
    cilium clustermesh status --context $CLUSTER3 --wait
    # Start connecting
    cilium --helm-release-name rke2-cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium connectivity test --context $CLUSTER1 --multi-cluster $CLUSTER2
  16. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -24,10 +24,16 @@ spec:
    ### Use the CLI
    ```sh
    export CLUSTER1=cilium01 CLUSTER2=cilium02
    kubectl --context=$CLUSTER1 get secret -n kube-system cilium-ca -o yaml | kubectl --context $CLUSTER2 create -f -
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER1 --service-type LoadBalancer
    kubectl --context=$CLUSTER1 get secret -n kube-system cilium-ca -o yaml | kubectl --context $CLUSTER2 create -f -
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER2 --service-type LoadBalancer
    kubectl annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    # Fix LoadBalancer
    kubectl annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    # Fix cilium-ca for Hubble
    kubectl label secret -n kube-system cilium-ca app.kubernetes.io/managed-by="Helm"
    kubectl annotate secret -n kube-system cilium-ca meta.helm.sh/release-name="rke2-cilium"
    kubectl annotate secret -n kube-system meta.helm.sh/release-namespace="kube-system"

    cilium clustermesh status --context $CLUSTER1 --wait
    cilium clustermesh status --context $CLUSTER2 --wait
    cilium --helm-release-name rke2-cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
  17. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER2 --
    kubectl annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium clustermesh status --context $CLUSTER2 --wait
    cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
    cilium --helm-release-name rke2-cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium connectivity test --context $CLUSTER1 --multi-cluster $CLUSTER2
    helm get values -n kube-system rke2-
  18. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@ export CLUSTER1=cilium01 CLUSTER2=cilium02
    kubectl --context=$CLUSTER1 get secret -n kube-system cilium-ca -o yaml | kubectl --context $CLUSTER2 create -f -
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER1 --service-type LoadBalancer
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER2 --service-type LoadBalancer
    kubectl annotate svc clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    kubectl annotate svc -n kube-system clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium clustermesh status --context $CLUSTER2 --wait
    cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
  19. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@ export CLUSTER1=cilium01 CLUSTER2=cilium02
    kubectl --context=$CLUSTER1 get secret -n kube-system cilium-ca -o yaml | kubectl --context $CLUSTER2 create -f -
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER1 --service-type LoadBalancer
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER2 --service-type LoadBalancer
    kubectl annotate svc foo cloudprovider.harvesterhci.io/ipam='dhcp'
    kubectl annotate svc clustermesh-apiserver cloudprovider.harvesterhci.io/ipam='dhcp'
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium clustermesh status --context $CLUSTER2 --wait
    cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
  20. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@ export CLUSTER1=cilium01 CLUSTER2=cilium02
    kubectl --context=$CLUSTER1 get secret -n kube-system cilium-ca -o yaml | kubectl --context $CLUSTER2 create -f -
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER1 --service-type LoadBalancer
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER2 --service-type LoadBalancer
    kubectl patch ...
    kubectl annotate svc foo cloudprovider.harvesterhci.io/ipam='dhcp'
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium clustermesh status --context $CLUSTER2 --wait
    cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
  21. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -33,6 +33,7 @@ cilium clustermesh status --context $CLUSTER2 --wait
    cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium connectivity test --context $CLUSTER1 --multi-cluster $CLUSTER2
    helm get values -n kube-system rke2-
    ```

    Based on: https://docs.cilium.io/en/stable/network/clustermesh/clustermesh/
  22. @dgiebert dgiebert revised this gist Jun 27, 2024. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -34,3 +34,5 @@ cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium connectivity test --context $CLUSTER1 --multi-cluster $CLUSTER2
    ```

    Based on: https://docs.cilium.io/en/stable/network/clustermesh/clustermesh/
  23. @dgiebert dgiebert created this gist Jun 27, 2024.
    36 changes: 36 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    ### HelmChartConfig
    ```yaml
    apiVersion: helm.cattle.io/v1
    kind: HelmChartConfig
    metadata:
    name: rke2-cilium
    namespace: kube-system
    spec:
    valuesContent: |-
    kubeProxyReplacement: strict
    k8sServiceHost: 127.0.0.1
    k8sServicePort: 6443
    ipv4NativeRoutingCIDR: 10.0.0.0/8
    # Transparent Encryption
    encryption:
    enabled: true
    type: wireguard
    # Cluster-mesh
    # cluster:
    # name: cilium01
    # id: 1
    ```
    ### Use the CLI
    ```sh
    export CLUSTER1=cilium01 CLUSTER2=cilium02
    kubectl --context=$CLUSTER1 get secret -n kube-system cilium-ca -o yaml | kubectl --context $CLUSTER2 create -f -
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER1 --service-type LoadBalancer
    cilium --helm-release-name rke2-cilium clustermesh enable --context $CLUSTER2 --service-type LoadBalancer
    kubectl patch ...
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium clustermesh status --context $CLUSTER2 --wait
    cilium clustermesh connect --context $CLUSTER1 --destination-context $CLUSTER2
    cilium clustermesh status --context $CLUSTER1 --wait
    cilium connectivity test --context $CLUSTER1 --multi-cluster $CLUSTER2
    ```