Shiva Purana
ततो गुरुनियोगाद्वै कृष्णः परमशक्तिमान् ॥ तपश्चकार पुत्रार्थं सांबमुद्दिश्य शंकरम् ॥ २१ ॥
Then at the behest of his preceptor, Kṛṣṇa of great prowess performed penance for the attainment of a son with Śiva and Pārvatī as the deity aimed at.
english translation
tato guruniyogAdvai kRSNaH paramazaktimAn ॥ tapazcakAra putrArthaM sAMbamuddizya zaMkaram ॥ 21 ॥
hk transliteration by Sanscript