David James McConnell, who is 35 and of Victoria Road, Sydenham, pleaded guilty to possession of herbal cannabis with intent to supply and producing the Class B drug.
Also in the dock with McConnell were 25-year-old Philip William Pinkerton, of Windmill Court, Crossgar Road in Saintfield, Co Down, and 52-year-old Stewart Thomas Worthingon, of Flush Road, Belfast.
Pinkerton pleaded guilty to possessing cannabis with intent to supply and producing cannabis. He further pleaded guilty to having counterfeit cash.
Worthington pleaded guilty to allowing Class B drugs to be produced on his premises.
Belfast Crown Court heard that during a surveillance operation by the PSNI's Organised Crime Branch on 17 July 2012, officers found the cannabis factory in a disused bakery in Flush Park, east Belfast.
A prosecuting lawyer said police officers observed two males going into the disused bakery.
The lawyer said: "Officers went inside and there was a strong smell of cannabis. Two male persons were observed and when the officers identified themselves as police, the two males tried to escape from the premises."
Belfast Recorder Judge David McFarland was told that officers found a herbal cannabis factory in operation in the premises with eight baker tray loads of herbal cannabis along with herbal cannabis stalks and flowers.
"Police say that the total street value of the drugs uncovered was £21,000. Officers recovered around 3kg of herbal cannabis."
McConnell was arrested on the premises and when police questioned him, he said that he was "only there to purchase a small amount of cannabis".
In a follow up search at an address linked to Pinkerton on the Clarawood Estate, detectives found £275 in counterfeit sterling notes.
Judge McFarland was told that the disused premises was owned by Worthington and he was later arrested for questioning but denied allowing his premises to be used for producing cannabis.
The prosecution lawyer said that McConnell and Pinkerton should be dealt with differently from Worthington as they fell under the "wholesale" category in sentencing guidelines.
The court heard that while Pinkerton and Worthington had no previous convictions, McConnell was fined in 2000 following his conviction for possession of cannabis.
A defence barrister for McConnell handed into court a number of references, including one from east Belfast Ulster Unionist MLA Michael Copeland.
The lawyer said the community worker, a father of a six-year-old child, had been suffering from "poor mental health linked to his problem with cannabis he has been taking from the ages of 15 or 16".
He added: "Since his arrest for this offences he has not used cannabis and is trying to address that problem. He says that he was at the premises to buy only a small of drugs for his own use and to sell among his friends. His instructions are emphatic to me that he denies the Crown assertion that he was involved in the wholesaling of this drug.
"He has not been accused of cultivating drugs. There is no trappings in this case of a luxurious lifestyle from the wholesale of drugs. There is no history of this type of behaviour, just an antecedent of simple possession.
"He rejects that he was involved in the wholesale of these drugs and there is no evidence to support this assertion by the prosecution," he added.
A defence barrister from Pinkerton said he got himself "massively into debt" and was approached about this cannabis factory.
"He gave into temptation. He became involved for financial gain to pay off the debts he had accrued."
The lawyer said an independent forensic expert disputed the police's value of the drugs uncovered.
He said that in the opinion of the expert, 900 grams of herbal leaves found by police were not of significant value.
Judge David McFarland sentenced Worthington to 240 hours community service for his role in allowing the premises to be used in cultivating the cannabis. The judge sentenced Pinkerton to 20 months, with eight months in custody and 12 on licence following his release.
McConnell was sentenced to 18 months, with six months in custody and the remaining 12 months on licence.
Judge McFarland also granted a destruction order on materials seized during the police raid.
Police had requested that the £275 in cash seized should be handed over to the Danielle McCrystal Bone Marrow Trust, a charity the PSNI was raising funds for.
However, the Belfast Recorder said he could not accede to that request and the money would now go to the Treasury.