The electronic structures of cerium-based ternary 122 compounds CeM2Si2, where M= Ru, Rh, Pd, and Ag, are investigated systematically by using the density functional theory in combination with the single-site dynamical mean-field theory. The momentum-resolved spectral functions, total and 4f partial density of states, self-energy functions, and valence state fluctuations are calculated. The obtained results are in good accord with the available experimental data. It is suggested that, upon increasing atomic number from Ru to Ag, the 4f electrons should become increasingly localized. An itinerant-localized crossover for 4f electrons driven by chemical pressure may emerge when M changes from Pd to Ag. Particularly, according to the low-frequency behaviors of 4f self-energy functions, we identify an orbital selective 4f insulating state in CeAg2Si2, which is totally unexpected.