Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
n-guitar opened this issue Jan 7, 2022 · 4 comments
Closed

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

n-guitar opened this issue Jan 7, 2022 · 4 comments

Comments

@n-guitar
Copy link

n-guitar commented Jan 7, 2022

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
@brandond
Copy link
Contributor

brandond commented Jan 7, 2022

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

@n-guitar
Copy link
Author

n-guitar commented Jan 8, 2022

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

@n-guitar
Copy link
Author

n-guitar commented Jan 8, 2022

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.

@brandond brandond self-assigned this Jan 14, 2022
@brandond brandond added this to the v1.23.2+rke2r1 milestone Jan 14, 2022
@brandond brandond added this to To Triage in Development [DEPRECATED] via automation Jan 14, 2022
@brandond brandond moved this from To Triage to Working in Development [DEPRECATED] Jan 14, 2022
@brandond brandond moved this from Working to To Test in Development [DEPRECATED] May 25, 2022
@rancher-max
Copy link
Contributor

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

Development [DEPRECATED] automation moved this from To Test to Done Issue / Merged PR May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development [DEPRECATED]
Done Issue / Merged PR
Development

No branches or pull requests

4 participants