שׂ֣וֹם תָּשִׂ֤ים עָלֶ֙יךָ֙ מֶ֔לֶךְ אֲשֶׁ֥ר יִבְחַ֛ר יְהוָ֥ה אֱלֹהֶ֖יךָ בּ֑וֹ מִקֶּ֣רֶב אַחֶ֗יךָ תָּשִׂ֤ים עָלֶ֙יךָ֙ מֶ֔לֶךְ לֹ֣א תוּכַ֗ל לָתֵ֤ת עָלֶ֙יךָ֙ אִ֣ישׁ נָכְרִ֔י אֲשֶׁ֥ר לֹֽא־אָחִ֖יךָ הֽוּא׃
lo farai re in ogni modo saggio su di te, che l'Eterno, il tuo DIO, sceglierà; uno fra i tuoi fratelli ti reverà su di te; non puoi mettere uno straniero su di te, che non è tuo fratello.
Shaarei Teshuvah
And a person is obligated to give himself over to danger, and not to place guilt like this upon his soul. And our Rabbis said about the matter of Agrippa (Sotah 41a-b) that when he read from the Torah [and] “arrived at [the verse], ‘You may not appoint a foreigner over you’ (Deuteronomy 17:15), tears flowed from his eyes. And they said to him, ‘You are our brother.’ [...] At that moment the enemies of the Jewish people (a euphemism for the Jewish people) were sentenced to destruction for flattering Agrippa.” Especially should one who sits in judgement not fear mortal men, as it is stated (Deuteronomy 1:17), “Fear no man.” And among the sections of the group of flatterers, there are some in which the flatterer is destroyed and lost just for the iniquity of flattery, as will be explained.
Orchot Tzadikim
A man should undergo danger rather than be guilty of this sin. And our Sages, of blessed memory, said, concerning Agrippas, that when he was reading the Torah and came to the verse, "Thou mayest not put a foreigner over thee, who is not thy brother" (Deut. 17:15), his eyes shed tears. Those who were near him said, "Do not fear Agrippas. You are our brother." In that hour the "enemies of Israel" [a euphemism for the "Chidren of Israel" where anything dire is said concerning them] became liable to destruction for they flattered Agrippas (Sotah 41a-b).
Shenei Luchot HaBerit
Still another method of interpreting these verses would be to view the words והייתם as addressed to everybody, meaning that anyone who wants to can study Torah, as we know from Avodah Zarah where Rabbi Meir states that Gentiles who study Torah are highly regarded. The words "to Me a segulah from all the other nations" on the other hand, are addressed to Israel exclusively, warning that the priesthood is reserved for members of the Jewish nation. The same applies to the Monarchy. The Torah states in Deut. 17,15: "You shall appoint a king over you whom G–d will choose, from amongst your brethren. You must not appoint as king a stranger who is not your brother."