jenkins-x, kubernetes

Jenkins-X 3 – Setup Google Pub/Sub Topics

Jenkins-X 3 – Setup Google Pub/Sub Topics

When we were using Jenkins-X 2, we employed some ugly hacks just to get the Google Pub/Sub topics setup using some pipeline override. With Jenkins-X 3, the process is a lot simpler and makes more sense.



We need to describe our Google Pub/Sub topic requirements inside our cluster repo so we need to make our changes there (ie: repo name jx3-cluster-dev). Follow the following layout: charts/pubsub-resources/templates

  - pubsub-resources
      - templates
          - staging-events-topic.yaml
      - Chart.yaml

File: staging-events-topic.yaml

kind: PubSubTopic
  name: staging-events-topic

File: Chart.yaml

apiVersion: v1
description: A Helm chart for Pub/Sub resources
name: pubsub-resources
version: 0.0.1
appVersion: 0.0.1

This is based on this template example Chart.yaml

Reference the charts/pubsub-resources directory in your helmfile.yaml file in the releases: section via…

  - chart: ./charts/pubsub-resources
    name: pubsub-resources
    namespace: config-connector

Replace config-connector namespace with your namespace you used for ConfigConnector resources.


Commit your changes then create a pull request. Wait for the pull request to verify then merge the changes. Once the deployment is done, we can verify if the Pub/Sub topic now exists in our namespace.

kubectl get PubsubTopic -n config-connector

You should get something like this:

NAME                   AGE   READY   STATUS     STATUS AGE
staging-events-topic   69s   True    UpToDate   69s

That’s a nice result!

Trivia: Above response is an actual response when I run the command at unfortunate timing.

That’s it!

Featured image: ThisIsEngineering

No Comments

Leave a reply

Your email address will not be published. Required fields are marked *