This repository was archived by the owner on Oct 31, 2019. It is now read-only.
File tree 8 files changed +55
-2
lines changed
8 files changed +55
-2
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ write_files:
79
79
content : |
80
80
${kubelet_service_content}
81
81
82
+ -
path :
" /root/services/[email protected] "
83
+ permissions : " 0600"
84
+ encoding : " gzip+base64"
85
+ content : |
86
+ ${ethtool_service_content}
87
+
82
88
# Kube certs, tokens
83
89
- path : " /etc/kubernetes/ssl/ca.pem"
84
90
permissions : " 0600"
Original file line number Diff line number Diff line change @@ -57,6 +57,10 @@ data "template_file" "kubelet-service" {
57
57
}
58
58
}
59
59
60
+ data "template_file" "ethtool-offload-service" {
61
+ template = " ${ file (" ${ path . module } /scripts/ethtool-disable-offload.service" )} "
62
+ }
63
+
60
64
data "template_file" "kube-controller-manager" {
61
65
template = " ${ file (" ${ path . module } /manifests/kube-controller-manager.yaml" )} "
62
66
@@ -132,6 +136,7 @@ data "template_file" "kube_master_cloud_init_file" {
132
136
master_kubeconfig_template_content = " ${ base64gzip (data. template_file . master-kubeconfig . rendered )} "
133
137
kube_scheduler_template_content = " ${ base64gzip (data. template_file . kube-scheduler . rendered )} "
134
138
kubelet_service_content = " ${ base64gzip (data. template_file . kubelet-service . rendered )} "
139
+ ethtool_service_content = " ${ base64gzip (data. template_file . ethtool-offload-service . rendered )} "
135
140
ca-pem-content = " ${ base64gzip (var. root_ca_pem )} "
136
141
ca-key-content = " ${ base64gzip (var. root_ca_key )} "
137
142
api-server-key-content = " ${ base64gzip (var. api_server_private_key_pem )} "
Original file line number Diff line number Diff line change
1
+ [Unit]
2
+ Description =ethtool-disable-offload
3
+ Requires =network.target
4
+ After =network.target
5
+
6
+ [Service]
7
+ ExecStart =/sbin/ethtool -K %i tx off
8
+ Type =oneshot
9
+
10
+ [Install]
11
+ WantedBy =multi-user.target
Original file line number Diff line number Diff line change 32
32
BROADCOM_DRIVER=$( lsmod | grep bnxt_en | awk ' {print $1}' )
33
33
if [[ -n " $$ {BROADCOM_DRIVER}" ]]; then
34
34
echo " Disabling hardware TX checksum offloading"
35
- ethtool --offload $( ip -o -4 route show to default | awk ' {print $5}' ) tx off
35
+ # ethtool --offload $(ip -o -4 route show to default | awk '{print $5}') tx off
36
+ mv /root/services/
[email protected] /etc/systemd/system
37
+ systemctl daemon-reload
38
+ DEV=$( ip -o -4 route show to default | awk ' {print $5}' )
39
+ systemctl enable ethtool-disable-offload@$DEV
40
+ systemctl start ethtool-disable-offload@$DEV
36
41
fi
37
42
38
43
# Download etcdctl client
Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ write_files:
36
36
content : |
37
37
${kubelet_service_content}
38
38
39
+ -
path :
" /root/services/[email protected] "
40
+ permissions : " 0600"
41
+ encoding : " gzip+base64"
42
+ content : |
43
+ ${ethtool_service_content}
44
+
39
45
# Kube certs
40
46
- path : " /etc/kubernetes/ssl/ca.pem"
41
47
permissions : " 0600"
Original file line number Diff line number Diff line change @@ -66,6 +66,10 @@ data "template_file" "kubelet-service" {
66
66
}
67
67
}
68
68
69
+ data "template_file" "ethtool-offload-service" {
70
+ template = " ${ file (" ${ path . module } /scripts/ethtool-disable-offload.service" )} "
71
+ }
72
+
69
73
data "template_file" "kube_worker_cloud_init_file" {
70
74
template = " ${ file (" ${ path . module } /cloud_init/bootstrap.template.yaml" )} "
71
75
@@ -76,6 +80,7 @@ data "template_file" "kube_worker_cloud_init_file" {
76
80
kube_proxy_template_content = " ${ base64gzip (data. template_file . kube-proxy . rendered )} "
77
81
worker_kubeconfig_template_content = " ${ base64gzip (data. template_file . worker-kubeconfig . rendered )} "
78
82
kubelet_service_content = " ${ base64gzip (data. template_file . kubelet-service . rendered )} "
83
+ ethtool_service_content = " ${ base64gzip (data. template_file . ethtool-offload-service . rendered )} "
79
84
ca-pem-content = " ${ base64gzip (var. root_ca_pem )} "
80
85
ca-key-content = " ${ base64gzip (var. root_ca_key )} "
81
86
api-server-key-content = " ${ base64gzip (var. api_server_private_key_pem )} "
Original file line number Diff line number Diff line change
1
+ [Unit]
2
+ Description =ethtool-disable-offload
3
+ Requires =network.target
4
+ After =network.target
5
+
6
+ [Service]
7
+ ExecStart =/sbin/ethtool -K %i tx off
8
+ Type =oneshot
9
+
10
+ [Install]
11
+ WantedBy =multi-user.target
Original file line number Diff line number Diff line change 33
33
BROADCOM_DRIVER=$( lsmod | grep bnxt_en | awk ' {print $1}' )
34
34
if [[ -n " $$ {BROADCOM_DRIVER}" ]]; then
35
35
echo " Disabling hardware TX checksum offloading"
36
- ethtool --offload $( ip -o -4 route show to default | awk ' {print $5}' ) tx off
36
+ mv /root/services/
[email protected] /etc/systemd/system
37
+ systemctl daemon-reload
38
+ DEV=$( ip -o -4 route show to default | awk ' {print $5}' )
39
+ systemctl enable ethtool-disable-offload@$DEV
40
+ systemctl start ethtool-disable-offload@$DEV
37
41
fi
38
42
39
43
# # Setup NVMe drives and mount at /var/lib/docker
You can’t perform that action at this time.
0 commit comments