They are allowed in CA in very limited circumstances. Never between an employer and an employee, but in sales of businesses, dissolutions of partnerships, etc.
CA B&P Code 16601:
Any person who sells the goodwill of a business, or any owner of a business entity selling or otherwise disposing of all of his or her ownership interest in the business entity, or any owner of a business entity that sells (a) all or substantially all of its operating assets together with the goodwill of the business entity, (b) all or substantially all of the operating assets of a division or a subsidiary of the business entity together with the goodwill of that division or subsidiary, or (c) all of the ownership interest of any subsidiary, may agree with the buyer to refrain from carrying on a similar business within a specified geographic area in which the business so sold, or that of the business entity, division, or subsidiary has been carried on, so long as the buyer, or any person deriving title to the goodwill or ownership interest from the buyer, carries on a like business therein.
CA B&P 16602:
(a) Any partner may, upon or in anticipation of any of the circumstances described in subdivision (b), agree that he or she will not carry on a similar business within a specified geographic area where the partnership business has been transacted, so long as any other member of the partnership, or any person deriving title to the business or its goodwill from any such other member of the partnership, carries on a like business therein.
(b) Subdivision (a) applies to either of the following circumstances:
(1) A dissolution of the partnership.
(2) Dissociation of the partner from the partnership.
CA B&P 16602.5:
Any member may, upon or in anticipation of a dissolution of, or the termination of his or her interest in, a limited liability company (including a series of a limited liability company formed under the laws of a jurisdiction recognizing such a series), agree that he or she or it will not carry on a similar business within a specified geographic area where the limited liability company business has been transacted, so long as any other member of the limited liability company, or any person deriving title to the business or its goodwill from any such other member of the limited liability company, carries on a like business therein.