Just who knew Arturia was female when she was King?
According to Garden of Avalon, only Merlin, Uther (before he died), Ector (her foster father that raised her from the age of 5), Kay (her foster brother), and Guinevere once they married. Closer to the end of Artoria's kingdom, Guinevere reveals this to Lancelot as well once they start getting closer.

In the Camelot chapter in Fate/Grand Order, Agravain reveals that he found out about it when he discovered the affair.

While not explicitly stated anywhere I'm aware of, the circumstances of Mordred's conception/raising imply Morgan must have known as well.