55 and older communities are popping up everywhere. Isn't this age discrimination?

If "they" can develop communities of 55 and older, then it seems to me that one could develop a community for people "only between the ages of 25 and 45" or worse, "Only Black" or "Only White" communities. What about an all "Gay only" community. Would those be legal?

Just curious...