Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
packet worker: move getting BGP_PEER_ADDRESS inline
Browse files Browse the repository at this point in the history
To avoid duplicating the template logic and to make the configuration
more readable, as having quote (") right before the template logic is
very confusing.

Signed-off-by: Mateusz Gozdek <[email protected]>
  • Loading branch information
invidian committed Mar 30, 2020
1 parent 98fe1b9 commit f907568
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ systemd:
# makes it into Flatcar. Then we can read COREOS_PACKET_IPV4_PRIVATE_GATEWAY_0
# from /run/metadata/flatcar and disable the template conditionals below.
ExecStart=/bin/sh -c \
"%{~ if bgp_node_labels != "" ~}
BGP_PEER_ADDRESS=$(ip route | grep '10.0.0.0/8' | awk {'print $3'}); \
%{~ endif ~}
/usr/lib/coreos/kubelet-wrapper \
"/usr/lib/coreos/kubelet-wrapper \
--node-ip=$${COREOS_PACKET_IPV4_PRIVATE_0} \
--anonymous-auth=false \
--authentication-token-webhook \
Expand All @@ -102,7 +99,7 @@ systemd:
--node-labels=$${NODE_LABELS} \
--node-labels=lokomotive.alpha.kinvolk.io/public-ipv4=$${COREOS_PACKET_IPV4_PUBLIC_0} \
%{~ if bgp_node_labels != "" ~}
--node-labels=$${BGP_NODE_LABELS},metallb.universe.tf/peer-address=$BGP_PEER_ADDRESS \
--node-labels=$${BGP_NODE_LABELS},metallb.universe.tf/peer-address=$(ip route | grep '10.0.0.0/8' | awk {'print $3'}) \
%{~ endif ~}
--pod-manifest-path=/etc/kubernetes/manifests \
--read-only-port=0 \
Expand Down
Loading

0 comments on commit f907568

Please sign in to comment.