You can install the Google Cloud Pub/Sub connector using its helm chart.
The values.yaml file can be customised to suit your needs.
Configure the connector for your needs by defining a values.yaml file
# Google cloud project IDprojectID:"openfaas-381517"# List if Pub/Sub subscriptions the connector should subscribe to.subscriptions:-my-sub
Use the subscriptions parameter to configure a list of Pub/Sub subscriptions to which the connector should subscribe. When the subscriber receives a message, the connector will attempt to invoke any function that has the subscription name listed in its topic annotation.
Additional headers are made available to the request. These headers contain any message attributes along with some metadata about the Pub/Sub message.
X-PubSub-Msg-ID - the Pub/Sub message identifier.
X-PubSub-Publish-Time - the time at which the message was published.
X-PubSub-Delivery-Attempt - the number of times a message has been delivered.
X-PubSub-Ordering-Key - identifies related messages for which publish order should be respected.
X-PubSub-Attr-<key> - value of Pub/Sub message attribute.
So for example, if you added an attributed called Foo with a value of Y, you'd get the following extra header: X-PubSub-Attr-Foo: Y
The default content-type is configured as text/plain, but can be changed to another content-type such as application/json or application/octet-stream by the values.yaml file for the connector.