We discuss the spectrum of the different components in the astrophysical neutrino flux reaching the Earth and the possible contribution of each component to the high-energy IceCube data. We show that the diffuse flux from cosmic ray interactions with gas in our galaxy implies just 2 events among the 54 event sample. We argue that the neutrino flux from cosmic ray interactions in the intergalactic (intracluster) space depends critically on the transport parameter δ describing the energy dependence in the diffusion coefficient of galactic cosmic rays. Our analysis motivates a E^{-2.1} neutrino spectrum with a drop at PeV energies that fits well the data, including the non-observation of the Glashow resonance at 6.3 PeV. We also show that a cosmic ray flux described by an unbroken power law may produce a neutrino flux with interesting spectral features (bumps and breaks) related to changes in the cosmic ray composition.