Skip to content

(rke2-canal) Support for "IP_AUTODETECTION_METHOD" option  #2324

Closed

Description

@n-guitar

Is your feature request related to a problem? Please describe.
There is an option that is not supported by "helm chert" in "rke2-canal" provisioned from rancher.

Specifically, "IP_AUTODETECTION_METHOD" is not included in "values.yaml and daemonset.yaml" as described below.

・projectcalico
https://projectcalico.docs.tigera.io/reference/node/configuration#ip-autodetection-methods

On my Linux machine, the device name is "wlo*", so it is not auto-detected and I need to use the "IP_AUTODETECTION_METHOD" option.

You can temporarily work around this by editing the definition of "daemonset".

Describe the solution you'd like

Support for "IP_AUTODETECTION_METHOD" option

Describe alternatives you've considered
How about modifying it as follows?
Or can I submit a request for a fix?

・daemonset.yaml
https://github.com/rancher/rke2-charts/blob/main-source/packages/rke2-canal/charts/templates/daemonset.yaml#L98

# The method to use to autodetect the IPv4 address for this host.
- name: IP_AUTODETECTION_METHOD
   value: {{ .Values.calico.ipAutoDetectionMethod | quote }}
# The method to use to autodetect the IPv6 address for this host.
- name: IP6_AUTODETECTION_METHOD
   value: {{ .Values.calico.ip6AutoDetectionMethod | quote }}

・values.yaml
https://github.com/rancher/rke2-charts/blob/main-source/packages/rke2-canal/charts/values.yaml#L78

calico:
・・・
  # The method to use to autodetect the IPv4 address for this host.
  ipAutoDetectionMethod: first-found
  # The method to use to autodetect the IPv6 address for this host.
  ip6AutoDetectionMethod: first-found

Activity

  1. brandond commented on Jan 7, 2022

    @brandond
    Member

    Would you be interested in submitting a PR to rke2-charts? https://github.com/rancher/rke2-charts/tree/main-source/packages

  2. n-guitar commented on Jan 8, 2022

    @n-guitar
    Author

    Hi @brandond .
    Thanks for contacting me.
    yes. I'd like to submit a PR.

  3. n-guitar commented on Jan 8, 2022

    @n-guitar
    Author

    Hi @brandond .
    I have submitting a PR to rke2-charts.
    I have referred to other PR, but if there are any errors in the flow, please point them out.

  4. self-assigned this
    on Jan 14, 2022
  5. added this to the v1.23.2+rke2r1 milestone on Jan 14, 2022
  6. rancher-max commented on May 26, 2022

    @rancher-max
    Member

    Validated using both v1.23.7-rc1+rke2r1 and master commit aa3027502617aa492628da505111107acecde0ce

    • Able to successfully set autodetection for both ipv4 and ipv6:
    $ sudo cat /var/lib/rancher/rke2/server/manifests/canal-values.yaml 
    apiVersion: helm.cattle.io/v1
    kind: HelmChartConfig
    metadata:
      name: rke2-canal
      namespace: kube-system
    spec:
      valuesContent: |-
        calico:
          ipAutoDetectionMethod: kubernetes-internal-ip
          ip6AutoDetectionMethod: kubernetes-internal-ip
    
    $ k get ds -n kube-system rke2-canal -o yaml | grep -A 1 -i autodetection
            - name: IP_AUTODETECTION_METHOD
              value: kubernetes-internal-ip
            - name: IP6_AUTODETECTION_METHOD
              value: kubernetes-internal-ip
    
    • Confirmed both ipv4 and ipv6 (and combined) services continue to work.
    $ kubectl apply -f https://gist.githubusercontent.com/aojea/90768935ab71cb31950b6a13078a7e92/raw/99ceac308f2b2658c7313198a39fbe24b155ae68/dual-stack.yaml
    
    $ k describe svc | grep -E 'IPs|Port'
    IPs:               10.43.0.1
    Port:              https  443/TCP
    TargetPort:        6443/TCP
    IPs:               10.43.33.152,2001:cafe:42:1::1c86
    Port:              <unset>  8080/TCP
    TargetPort:        80/TCP
    IPs:               10.43.18.108,2001:cafe:42:1::8211
    Port:              <unset>  8080/TCP
    TargetPort:        80/TCP
    IPs:               10.43.35.127
    Port:              <unset>  8081/TCP
    TargetPort:        80/TCP
    IPs:               2001:cafe:42:1::feed
    Port:              <unset>  8080/TCP
    TargetPort:        80/TCP
    
    $ curl 10.43.33.152:8080
    <html><body><h1>It works!</h1></body></html>
    
    $ curl [2001:cafe:42:1::1c86]:8080
    <html><body><h1>It works!</h1></body></html>
    
    $ curl 10.43.35.127:8081
    <html><body><h1>It works!</h1></body></html>
    
    $ curl [2001:cafe:42:1::feed]:8080
    <html><body><h1>It works!</h1></body></html>
    
    • Confirmed default is still first-found:
    $ k get ds -n kube-system rke2-canal -o yaml | grep -A 1 -i autodetection
            - name: IP_AUTODETECTION_METHOD
              value: first-found
            - name: IP6_AUTODETECTION_METHOD
              value: first-found
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions