I am using openshift v3 which uses kubernetes version 1.2. I am exploring more on autoscaling feature.
Currently it says only CPU metrics is supported.
Is there a way pods in openshift can be scaled based on memory or other metrics data collected from heapster?
From the announcements of Kubernetes 1.12, this should be now (Q4 2018) supported (albeit still in Beta).
See kubernetes feature 117 and commit 9d84a49, and the new Horizontal Pod Autoscaler Walkthrough page update.
It introduces the notion of labels.
custom metrics for horizontal pod autoscaler in OpenShift
As you mentioned: OpenShift v3 is using multiple components of Kubernetes. The official documentation of Kubernetes and openshift are talking about autoscaling on CPU. (Kubernetes 1.2 adds alpha support for scaling based on application-specific metrics like QPS).
Autoscaling on memory wasn't released in the initial version of horizontal pod autoscaling because it does not work in the right way. Memory consumption of pods usually never shrinks, so, adding a new pod will not decrease memory consumption of the old pods.
That's why Kubernetes isn't supporting autoscaling on memory usage at the moment. They are talking about it as a possible feature:
[future] Autoscale pods based on metrics different than CPU (e.g. memory, network traffic, qps). This includes scaling based on a custom/application metric.