Can I use a 10/3 cable to supply a sub-panel for a tankless water heater?
The existing single cable cannot be used by itself to power the ecosmart 27. You need three separate cables each from its own 40 A breaker. Each cable must be Cu 8-2 + gnd or larger (presumably Al 6-2 + gnd would work if the terminals in the ecosmart are approved for aluminum conductor).

See https://www.youtube.com/watch?v=9lQw8Po2H04