He began walking away but then turned around, yelling and swearing at staff, puffing out his chest in intimidatory fashion towards the store supervisor.
A male staff member tried to divert Wharekawa's attention.
The ranting continued and he threatened the worker with violence before preparing to leave.
On his way out, the court heard, Wharekawa pulled out a flick knife, which he pointed at staff.
After slamming the blade into a perspex shield he threatened to return to the supermarket and stab people.
Police were called and an officer saw the defendant walking through Mosgiel.
Wharekawa refused to stop and told the senior constable he would need back-up.
As the officer unclipped his Taser, the defendant reached behind his back, claiming he had a firearm and would shoot. The officer retreated to his vehicle and called for back-up.
The armed offenders squad soon apprehended Wharekawa, after he had stolen a bike from Taieri College.
At Wakari Hospital for an assessment the next day, the defendant damaged bedding and later lost control when visiting hours ended and his family had to leave.
Wharekawa charged at a nurse, who needed help from a colleague to haul him back.
However, Wharekawa broke free and three more staff members had to restrain him, one of whom he bit on the leg.
While Wharekawa was held in a seclusion room, he issued a slew of threats to the nurse on duty.
He could not wait to kill her, he said, he knew which car she drove and would follow her home.
It was not a threat, it was a promise, Wharekawa said.
He also told the woman he would rape and stab her in front of her daughter, words that left her feeling "sick and unsafe", Judge Large said.
The offending, he said, was "very very serious".
"[The sentence has] to be a deterrent to those who wander around supermarkets, or anywhere else for that matter, with knives," the judge said.
Wharekawa pleaded guilty to eight charges and was sentenced to 10 months' home detention and ordered to pay $640 reparation.
Judge Large refused an Otago Daily Times application to photograph the defendant because of "mental health issues".