I have come across people asking this question over Krishna, Ganapati, Rama and others as they are not mentioned in Vedas. And our Sanatan Dharma is based on these very Vedas. We have to understand just what Vedas really mean, and just who or what Rama, Krishna, Hanuman and Ganesha stand for, to understand the deep ignorance from which such questions springs.
The Veda is the expression in Shabda, the Sound, the full and total play of the vibrations of the Light of Consciousness, and its transformation, Parivartana from one State to another.
The First and One Principle of this Consciousness, that is pure Existence, is the Paramatma (called by different names as Eshwara, Shiva, Satchitananda etc). This First and One Principle of this Consciousness, that is pure expression, is Paraashakti (called by different names such as Eshwari, Parvati etc).
The Paramatma exists in, and is this whole Creation (Manifestation). In its individual reflections, it is called the Aatman/Self. It is the Cause.
The Paraashakti expresses in and is this whole Creation (Manifestation). In the individual reflections, it is called the Manas/Mind. It is the Causer.
Every part and whole of this Creation is Paraashakti as the expression of the Paramatma.
Now Rama is the Self in the individual body, The Aathman.
Krishna is the Mind in the individual body, The Cosmic Manas.
The Hanuman is the principle of Vayu that resides in the body. Vayu is the container and transporter of Praana, the life force.
Ganapati is the first comprehensible State of the transforming Light of Consciousness. That is Light as we know it. The Light, that is a wave (Vakra) and a particle (Thunda), which is all-pervading (Mahakaaya) with the glory of countless suns (Surya Koti Samaprabhaa).
The Ramayana is the story of the Self or Aatman, Rama, in the individual body, Seeta, and their existence as the two halves of a whole. The story of the Suryavansha, the Sun is the source, the nucleus, the Aatman of our inner Solar System.
The Mahabharata is the story of the Cosmic Manas, Krishna, and the descending of the Infiniteness of the Paramatma into the Finite level of Matter (the Kaurava). And the ascendance of Finite Matter back to the Infiniteness of the Paramatma (the Paandava). The Mahabharata War is the war between the descending and ascending states of energy. Each character of the Mahabhaarata is one State/ condition of the individual human mind. The story of the Chandravansha, the Moon is the visualizer, the creator, the Manas of our inner system.
In Vedas all these Gods are mentioned. Not with these name but with some Property & Nature. For Common People its not easy to understand the in-depth knowledge.
Ignorance is acceptable. Arrogance is not. There is a saying, "He who knows not is simple. Teach him. He who knows not and knows not that he knows not is a fool. Avoid him".