Krueger had only been in charge of the struggling team for one season. MacTavish did not name a replacement.
"This was about me making a decision where I thought this was the best decision for the betterment of the club," MacTavish said in a statement.
"We're very close with a coaching candidate, but at this point we haven't formalized the deal."
Under Krueger, the Oilers went 19-22-7 this season, finishing 12th in the Western Conference.
They missed the playoffs for the seventh year in a row. Their last appearance was in 2006 when they made the Stanley Cup final.
Krueger was the Oilers' third coach since 2009 after Pat Quinn and Tom Renney both had short terms.
MacTavish had been coach for nearly a decade before then, including the year they made the Stanley Cup final.
(Reporting by Julian Linden, editing by Gene Cherry)