Generate meta in controller I'm creating a custom module. This module displays public custom content without node and views . For this content custom page , I would like to add dynamic meta keyword and meta description . 

I have read this excellent answer
How do I add a meta tag in &lt;head&gt;...&lt;/head&gt; section?
and it said we can use 

mymodulename_page_attachments(&amp;$page) 


and update variable

$page


But the meta contents are getting in a controller's method. For this raison, I would like to 
pass the meta contents to mymodulename_page_attachments hook.

How can I call and update $page in my controller module to do this ? Or how can I generate meta in my controller ?
hook_page_attachments() is only needed so you can attach it to any possible route/url. You should be to just add it directly to the response that you re returning, and it should bubble up and be added.