Near Portrero check out UCSF Outdoor Pool in Mission Bay. M2 Revolution does a great indoor cycling class. Lots of tri clubs (SF Tri, Golden Gate Tri, etc), running clubs (SFRRC), biking groups (the mentioned tri clubs, also many of the bike shops including Sports Basement do rides). No shortage of options here.