The sale of the stake, which has been on the cards since last year, will raise $2.5bn and will be used to reduce Glencore's debt.
The company has been hit by falling commodity prices.
As a result, it is undertaking a restructuring programme in order to reduce its $30bn debt pile.
Glencore's chief executive, Ivan Glasenberg, said: "CPPIB have a proven track record in the sector and share our vision for the future growth of the business through value-creating organic and inorganic growth opportunities.
"We welcome them aboard and look forward to continuing our good relationship as we work together."
Glencore trades in commodities including grains, oilseeds, rice, sugar and cotton.
Earlier this year, Glencore reported that profits in 2015 had fallen by almost a third as a result of the drop in commodity prices.
At the time the company also said it was aiming for $4bn-$5bn of asset disposals in 2016, plus a further $400m in savings.
Glencore accumulated much of its debts through its ambitious takeover of Xstrata in 2013.
That deal added dozens of mines in numerous countries to the commodity trader's business leaving it as one of the world's biggest miners and traders of the products of those mines.
In September last year, Glencore's shares dived after a note from analysts at Investec said its equity value could be "eliminated", although the mining giant responded by saying it was "operationally and financially robust".
When Glencore listed on the London market in 2011 it priced its shares at 530p, but the shares are currently trading at about 140p.
Mining and commodity trader Glencore  says it has agreed to sell a 40% stake in its agricultural business to Canada Pension Plan Investment Board (CPPID).