This Google Cloud Platform
official documentation has included all the Pub/Sub code samples. You can select the one that is required for you.
At the Terraform offical documents
[1][2], this has described how to create topic and subscription using Terraform.
This
tutorial has discussed about integrating microservices with Pub/Sub and GKE which may give some idea on your queries.
As your queries are more related to GKE, I would encourage you to post at the GKE group for the GKE related queries.
In case If you have any technical queries or think your issue is related to code, you can post at the
Stack Overflow or
Server Fault and a community of developers will assist you.
In case there are any technical issues or you would like to request any feature regarding Google Cloud Platform you can report it at the Public Issues by selecting the right component here. If you need to select any project specific information please select the private component of the Public Issue so that the information is not visible to the public. After that a Google Cloud Platform support agent would assist you.
Please also note that Google Groups forum is meant for general discussion of the platform, not specific technical issues. You can find more info about Community Support Overview on Google Groups here.