Closed Cellebyte closed 1 year ago
This will be added as part of #35. We'll just need to use it for this as well.
@schrej do we want to add this fix in #35 or should it be different PR?
Considering it should only be a small change I'd say just add it to #35 to avoid more PRs that need to be rebased constantly.
Just pushed changes. Changed that here and here
However I need to ask as I am not sure - should k8s node's name be also used in frr package instead of os.Hostname() call??
However I need to ask as I am not sure - should k8s node's name be also used in frr package instead of os.Hostname() call??
I think using the nodename env variable here would make it consistant.
FRR Docs also states it is not written to disk.
It should also not harm from the perspective of our specific setup as we already set it to the nodename everywhere.
joinConfiguration:
discovery: {}
nodeRegistration:
criSocket: /var/run/containerd/containerd.sock
kubeletExtraArgs:
container-log-max-files: '5'
container-log-max-size: 10Mi
event-qps: '0'
node-ip: '{{ ds.meta_data.cluster_ip_0 }}'
node-labels: "metal3.io/uuid={{ ds.meta_data.uuid }},schiff.telekom.de/bmh={{ ds.meta_data.bmh_name }},schiff.telekom.de/metal3machine={{ ds.meta_data.metal3machine_name }}"
protect-kernel-defaults: 'true'
tls-cipher-suites: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_GCM_SHA256
name: '{{ ds.meta_data.machine_name }}' # <- we set the nodename here
files:
# and also here.
- owner: root:root
path: /etc/frr/frr.conf
permissions: '0644'
content: |
frr version 8.0.1
frr defaults traditional
hostname {{ ds.meta_data.machine_name }}
@Cellebyte changed os.Hostname()
to os.Getenv()
to get the node name in pkg/frr/configure.go
Description
Error from the operator log.
Findings
Currently the operator discovers the node it is running on via the
HOSTNAME
environment variable. This becomes problematic, when the hostname differs from the nodename in kubernetes.Calico is using a spec field ref into their environment Variables called
NODENAME
.Suggestion
Use something like this in the deployment of network operators daemonset to ensure the environment variable is always correctly set for reconciliation loops.