I read the whole thing and I don't see where she violated any ethics. I do think she could have worded things differently in the sentence where she's ordering testing for anabolic steroid use after his release.
She said she would follow the negotiation of probation, but she decided he did need to do jail time for what he did to THIS victim, and I see nothing wrong with that. I think a prosecutor and defendant can make whatever plea deals they want, but the judge has final discretion/authority of whether to accept it or not. If I'm wrong about that, maybe someone who knows more about the law/rule on that can share.
It's great that John was going to anger management and keeping his nose clean after getting out of jail/prison(?) in San Diego for that
particular victim, but, I agree with the judge, that is separate from this case. I do understand his shock thinking the deal was done and he would be getting straight probation w/o any jail time, but he should be thankful she sentenced him to serve in the detention center and not in prison.
I hope he makes it thru this without any problems and can get his life on track.