This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
forked from poblin-orange/k3s-boshrelease
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from poblin-orange/feature-disable-tcp-checksum
feature-disable-tcp-checksum
- Loading branch information
Showing
4 changed files
with
135 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,54 @@ | ||
#!/bin/sh | ||
export JOB_DIR=/var/vcap/jobs/k3s-agent | ||
#!/bin/bash | ||
|
||
|
||
export JOB_DIR="/var/vcap/jobs/k3s-agent" | ||
/var/vcap/packages/k3s/k3s check-config | ||
|
||
# Setup ssh env vars | ||
${JOB_DIR}/bin/setup-user-env | ||
|
||
|
||
#prepare a persistent directory so /etc/rancher/node paswword file is kept on bosh recreate | ||
# Prepare a persistent directory so /etc/rancher/node paswword file is kept on bosh recreate | ||
mkdir -p /etc | ||
mkdir -p /var/vcap/store/k3s-node/etc/rancher | ||
ln -sf /var/vcap/store/k3s-node/etc/rancher /etc/rancher | ||
ln -sf /var/vcap/store/k3s-node/etc/rancher /etc/rancher | ||
|
||
set -e | ||
# Set overlay IP | ||
OVERLAY_IP="<%= spec.ip %>" | ||
<% if spec.ip != spec.networks.marshal_dump.values.first.ip %> | ||
OVERLAY_IP="<%= spec.networks.marshal_dump.values.last.ip %>" | ||
<% end %> | ||
<% if spec.ip != spec.networks.marshal_dump.values.last.ip %> | ||
OVERLAY_IP="<%= spec.networks.marshal_dump.values.first.ip %>" | ||
<% end %> | ||
|
||
# Disable VxLAN harware options on private interface | ||
# (see: https://github.com/orange-cloudfoundry/paas-templates/issues/2062) | ||
INTERFACE="$(ip --brief address show | grep "${OVERLAY_IP}" | awk '{print $1}')" | ||
|
||
#clean previous patch services | ||
! rm -f /etc/systemd/system/ethtool-patch-*.service | ||
|
||
<% p('k3s.disable-vxlan-hardware-options').each do |option| %> | ||
#--- Disable hardware option on private interface | ||
OPTION="<%= option %>" | ||
if [ "${OPTION}" != "" ] ; then | ||
serviceFile="ethtool-patch-${INTERFACE}-${OPTION}.service" | ||
cat > /etc/systemd/system/${serviceFile} << EOF | ||
[Unit] | ||
Description=Turn off ${OPTION} on ${INTERFACE} | ||
After=sys-subsystem-net-devices-${INTERFACE}.device | ||
[Install] | ||
WantedBy=sys-subsystem-net-devices-${INTERFACE}.device | ||
[Service] | ||
Type=oneshot | ||
ExecStart=/sbin/ethtool -K ${INTERFACE} ${OPTION} off | ||
EOF | ||
|
||
#--- Start service | ||
/usr/bin/systemctl enable ${serviceFile} | ||
/usr/bin/systemctl start ${serviceFile} | ||
fi | ||
<% end %> | ||
|
||
exit 0 | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.