From 94ae1039343ba5d5d4da2082dd892949beb361d1 Mon Sep 17 00:00:00 2001 From: esurlak Date: Mon, 12 Apr 2021 12:24:41 -0500 Subject: [PATCH] Ethtool support for HCO Change-Id: Ied5c05776e68625951b130b817966fb0777a6892 --- airship-host-config/scripts/ethtool.sh | 6 ++++++ demo_examples/example_ethtool.yaml | 19 +++++++++++++++++++ tools/deployment/50_test_hostconfig_cr.sh | 4 ++++ 3 files changed, 29 insertions(+) create mode 100644 airship-host-config/scripts/ethtool.sh create mode 100644 demo_examples/example_ethtool.yaml diff --git a/airship-host-config/scripts/ethtool.sh b/airship-host-config/scripts/ethtool.sh new file mode 100644 index 0000000..e71b304 --- /dev/null +++ b/airship-host-config/scripts/ethtool.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +echo script name: ${BASH_SOURCE[0]} +eth=`which ethtool` +echo command: $eth $@ +$eth $@ diff --git a/demo_examples/example_ethtool.yaml b/demo_examples/example_ethtool.yaml new file mode 100644 index 0000000..c9a1883 --- /dev/null +++ b/demo_examples/example_ethtool.yaml @@ -0,0 +1,19 @@ +# In this example we are executing sample ethtool +# script on kubernetes host using exec config. + +apiVersion: hostconfig.airshipit.org/v1alpha1 +kind: HostConfig +metadata: + name: example-exec-ethtool +spec: + host_groups: + - name: "kubernetes.io/role" + values: + - "master" + - "worker" + config: + exec: + - name: ethtool.sh + args: "-h" + - name: ethtool.sh + args: "--version" diff --git a/tools/deployment/50_test_hostconfig_cr.sh b/tools/deployment/50_test_hostconfig_cr.sh index d8a636c..aaeae41 100755 --- a/tools/deployment/50_test_hostconfig_cr.sh +++ b/tools/deployment/50_test_hostconfig_cr.sh @@ -127,3 +127,7 @@ check_status example7 '[ "hostconfig-control-plane", "hostconfig-control-plane2" # Executing sample sysctl and ulimit configuration on the kubernetes nodes kubectl apply -f $AIRSHIP_HOSTCONFIG/demo_examples/example_sysctl_ulimit.yaml check_status example8 '[ "hostconfig-control-plane", "hostconfig-control-plane2", "hostconfig-control-plane3" ]' false + +# Executing sample ethtool commands on the kubernetes nodes +kubectl apply -f $AIRSHIP_HOSTCONFIG/demo_examples/example_ethtool.yaml +check_status example-exec-ethtool '[ "hostconfig-control-plane", "hostconfig-control-plane2", "hostconfig-control-plane3", "hostconfig-worker", "hostconfig-worker2" ]' false