25:17

וְאֵלֶּה שְׁנֵי חַיֵּי יִשְׁמָעֵאל מְאַת שָׁנָה וּשְׁלֹשִׁים שָׁנָה וְשֶׁבַע שָׁנִים וַיִּגְוַע וַיָּמָת וַיֵּאָסֶף אֶל־עַמָּיו׃

And these are the years of the life of Yishmael: one hundred years, and thirty years, and seven years. And he expired and died, and was gathered to his people.

Bereshit 25:17

וְאֵלֶּה שְׁנֵי חַיֵּי

Bereshit / Genesis 25:17 · Sod

Bereshit 25:17

וְאֵלֶּה שְׁנֵי חַיֵּי יִשְׁמָעֵאל מְאַת שָׁנָה וּשְׁלֹשִׁים שָׁנָה וְשֶׁבַע שָׁנִים וַיִּגְוַע וַיָּמָת וַיֵּאָסֶף אֶל־עַמָּיו׃

And these are the years of the life of Yishmael: one hundred years, and thirty years, and seven years. And he expired and died, and was gathered to his people.

Sod סוֹד

May King David live forever

Why does the haftarah of Chayei Sara tell of King David's old age? Pri Tzadik shows that the haftarah answers not one verse about Avraham but the whole portion, and Yishmael in it is no chance guest.

Pri Tzadik says that the haftarah "and King David was old, come into days" is tied not only to the verse "and Avraham was old" but to the whole portion. The portion begins with the life of Sarah, which was completed and clarified in all ten measures, as "a hundred years" hints, a hundred being ten times ten, against the supreme crown. Then "Avraham was old, come into days", into the supernal days, as the Zohar says, and these are the first three measures. Then the servant, who merited because he was the servant of Avraham and Yitzchak (Isaac). And then "these are the years of the life of Yishmael" (Ishmael), who also merited for Avraham's sake: of him "expired" and "gathered" are said, because he repented in Avraham's lifetime. The haftarah ends with the words "may my lord King David live forever". If this is about life in this world, it goes against the deed, for Shlomo (Solomon) was at once set on the throne in his place. If about the world to come, why bless him with it, all Israel has a share in it. It is a blessing in the sense of "David, king of Israel, lives and endures": he was clarified in all the measures and did not die at all, but only sleeps for a while. The midrash says that three were crowned with old age and days, and all three were a beginning: Avraham the beginning of the patriarchs, Yehoshua (Joshua) the beginning of kingship from the tribe of Ephraim, David the beginning of kingship from the tribe of Yehuda. Yehoshua began to blot out Amalek, but Mashiach son of Yosef, who will finish it, is not of his seed, while Mashiach son of David is of David's seed, and therefore the haftarah is about David.

How Pri Tzadik explain it

Pri Tzadik The haftarah read is "and King David was old, come into days"

The connection of this haftarah to this portion is not only to what is said "and Avraham was old, and so on", but to the whole portion, which speaks of this matter. First it speaks of the life of Sarah, which was completed and clarified in all ten measures, as it is written "a hundred years" and as said in the holy Zohar. And a hundred is against the supreme crown, which includes ten times ten. And afterwards it is written "and Avraham was old, come into days", into the supernal days, that is, in the first three. And afterwards Scripture says "and Avraham said to his servant, the elder of his house, and so on", that is, the servant too merited, because he was the servant of the patriarchs Avraham and Yitzchak. And afterwards it is written "and these are the years of the life of Yishmael, and so on", who also merited for Avraham's sake, for of him "expired" and "gathered" are said, because he repented in Avraham's lifetime, as said (Bava Batra 16b). And therefore comes the haftarah "and King David was old, come into days". And the haftarah ends: "may my lord King David live forever" (Melachim I / 1 Kings 1:31). If this referred to the life of this world, it would be against the deed, for they made Shlomo king to sit on the throne in his place. And if it refers to the world to come, why did they need to bless him with it, for all Israel has a share in the world to come. But the blessing is in the sense of what is said (Rosh Hashanah 25a): "David, king of Israel, lives and endures." That he was clarified in all the measures and did not die at all, but only sleeps for a while. And it is said in Midrash Rabbah: "old", this is one who acquired two worlds. Three were crowned with old age and days, and the three were the beginning of a line: Avraham the beginning of the patriarchs, Yehoshua the beginning of kingship from the tribe of Ephraim, as it is said "from Ephraim, whose root is in Amalek" (Shoftim / Judges 5:14), David the beginning of kingship from the tribe of Yehuda, see there. And one must understand why it was necessary to bring proof for Yehoshua that he is the beginning of kingship from the tribe of Ephraim, for it is written "whoever rebels against your word, and so on" (Yehoshua / Joshua 1:18), that he is judged as one who rebels against the kingship, and Yehoshua conquered all the Land of Israel. And why should they bring proof from his fighting Amalek, which was in the lifetime of Moshe our teacher, and afterwards Yehoshua did not fight Amalek. And it would have been better to bring that he conquered all the Land of Israel. And it appears that the main proof they brought is that he is the beginning of a line. For the word "beginning" shows that he was clarified as bound to the beginning of thought. And of Avraham it is written "come into days", that after the tenth trial he was clarified in the measure of the supreme crown, as said in the holy Zohar "come into days", into the supernal days, and in Bereshit Rabbah "come into days", into a passage open to the life of the world to come. And of David too it is written "may my lord King David live forever", which shows "David, king of Israel, lives and endures", as we said, and he too is a beginning bound to the beginning. And "come into days", which shows clarification in the supernal days, is written of Yehoshua too. But that he is a beginning and bound to the beginning of thought they proved from his being chosen by Moshe our teacher to fight Amalek, and Amalek in the husk is "the beginning of nations" (Bamidbar / Numbers 24:20). And Amalek falls only by the hand of Rachel's sons, as said (Bereshit Rabbah 73), and from this is the proof that Yehoshua in holiness stands against the husk of Amalek. And that is because Yehoshua is bound to the root of the beginning of thought in holiness. And this is what is said, that he too is the beginning of kingship from the tribe of Ephraim. And still the haftarah is not read from the portion "and Yehoshua was old, and so on", that is (chapter 23) "and it was after many days, and so on, and Yehoshua was old, come into days", for that whole portion speaks of the fear of the Eternal. And the haftarah is read from the portion "and King David was old, and so on", because the two are equal. Avraham the beginning of the patriarchs, and from him the nation of Israel descended. And so David the beginning of kingship from the tribe of Yehuda, and from his seed will be Mashiach son of David, who will repair everything. Not so Yehoshua, who was the beginning of kingship from the tribe of Ephraim, who began the blotting out of Amalek, while Mashiach son of Yosef, who will finish the blotting out of Amalek completely, is not of his seed. And therefore the haftarah is read from the portion of King David.

Takeaway

Ten measures and "a hundred years": in kabbalah there are ten sefirot, ten measures through which God acts in the world, and each of them includes all ten, a hundred in all. Sarah's "a hundred years, and twenty years, and seven years" (Bereshit / Genesis 23:1) Pri Tzadik reads as fullness: a hundred against the supreme crown, keter, the first of the sefirot. So the portion opens with a clarified life, not with death.
"Into the supernal days" (בְּיוֹמִין עִלָּאִין): the Zohar explains "come into days" of Avraham as an entry into the supernal days, into the sefirot, which are called days. Pri Tzadik specifies: the first three, wisdom, understanding and knowledge, or the crown. On the level of sod to verse 24:1 in this portion Degel Machaneh Ephraim says the same, reading "days" as "measures".
"David, king of Israel, lives and endures" (דָּוִד מֶלֶךְ יִשְׂרָאֵל חַי וְקַיָּם): so Rabbi Yehuda HaNasi told Rabbi Chiya to pass on the sign that the new month was sanctified (Rosh Hashanah 25a), and these words are still sung at the sanctification of the moon. For Pri Tzadik they answer the riddle of the haftarah: Bat-Sheva wishes David to live forever in the hour Shlomo sits on his throne, and this is not court politeness but the truth about David, whose life is not cut off by death.
Yehoshua and Amalek: Moshe set Yehoshua to lead the war against Amalek at Refidim (Shemot / Exodus 17:9-13). The midrash Pri Tzadik brings says that Amalek falls only by the sons of Rachel (Bereshit Rabbah 73:7), Yosef and Binyamin, and Yehoshua is of the tribe of Ephraim, son of Yosef. Mashiach son of Yosef, by tradition, precedes Mashiach son of David and perishes in war, and the son of David completes everything. Hence the choice of haftarah: not Yehoshua but David.
"Expired" and "gathered" of Yishmael: Pri Tzadik takes the same argument as Rashi on the level of pshat, Bava Batra 16b, and sets Yishmael in a row with Avraham's servant. Both merited not by their own merit but through their bond with Avraham. So the portion called "the Life of Sarah", which tells of two deaths, becomes for him a portion about those who were "clarified", that is, lived life to the end and did not die.