In this paper, we specify a set of optimal subspaces for L2 approximation of three classes of functions in the Sobolev spaces W (r)2, defined on a segment and subject to certain boundary conditions. A subspace X of dimension not exceeding n is called optimal for a function class A if the best approximation of A by X equals the Kolmogorov n-width of A. These boundary conditions correspond to subspaces of periodically extended functions with symmetry properties. All of the approximating subspaces are generated by equidistant shifts of a single function. The conditions of optimality are given in terms of Fourier coefficients of a generating function. In particular, we indicate optimal spline spaces of all degrees d ≥ r - 1 with equidistant knots of several different types.