Skip to main content

Simplifying Vidra Operator Resource Provisioning with a CLI

Context and Problem Statement

We noticed it was increasingly difficult to provide the Vidra Operator with the correct Secrets and configuration resources, specifically:

  • Infrahub login credentials (as a Secret)
  • Multi-cluster kubeConfig Secret
  • Operator ConfigMap

Creating and managing these resources over kubectl can be error-prone and cumbersome (Secret data needs to be correctly base64 encoded), especially as the number of clusters and environments grows. New users do not know how to create these resources, and not every developer reads the documentation before starting to work with the operator.

Note

This was not considered during planning. If there had been no time to implement it, we would have left it out.

Considered Options

  • Manual kubectl resource creation

    • Pros: No additional tooling required.
    • Cons: Tedious, error-prone, and hard to automate or document.
  • Automated resource creation via a CLI tool

    • Pros: Consistent, repeatable, and easy to use; simplifies onboarding and automation.

Decision Outcome

Chosen option: Automated resource creation via a CLI tool, because it significantly simplifies the process of setting up the Vidra Operator, reduces manual errors, and enhances the developer's initial experience.

We created a CLI tool written in Go, using github.com/spf13/cobra, to wrap the creation of all required resources:

  • Infrahub login Secret
  • Multi-cluster kubeConfig Secret
  • Operator ConfigMap
  • InfrahubSync custom resources

This CLI streamlines the setup process, reduces manual errors, and makes it easier to integrate with CI/CD pipelines.

Consequences

  • Good, because it improves reliability, developer experience, and automation potential.
  • Bad, because it introduces an additional tool to maintain and document.