Giter Site home page Giter Site logo

provider-grafana's Introduction

provider-grafana

provider-grafana is an alternative to the official grafana provider. We encountered scalability issues with the terraform based provider and decided to create a custom provider using the grafana go api client. While we aim to be compatible with the official one, there are some differences in the resources we support:

  • ProviderConfig differs, as we don't use a json inside a secret but instead fields inside the CRD
  • Currently only Organization, DataSource, Folder, and Dashboard are supported
  • Only the oss.grafana.crossplane.io API group is supported

Use this at your own risk!

Migrating from the official provider

Make sure to follow these steps in order, as diverging from them may result in data loss.

  • Ensure you have backups of your Kubernetes resources and your Grafana database
  • kubectl delete --wait=false providerconfig.grafana.crossplane.io <name-of-your-provider-config>
  • kubectl patch providerconfig.grafana.crossplane.io <name-of-your-provider-config> -p '{"metadata":{"finalizers":[]}}' --type=merge
  • kubectl patch provider.pkg.crossplane.io <name-of-your-provider> -p '{"spec":{"package":"xpkg.upbound.io/argannor-oss/provider-grafana:v0.0.1-9.g4866768"}}' --type=merge
  • Wait until the provider is up and running before applying the new ProviderConfig (check the example)
  • Verify that the resources are still there and working as expected

Build

Initially follow these steps:

  1. Run make submodules
  2. Run make reviewable dev

For subsequent builds, just run make dev-redeploy.

Developing

  1. Use this repository as a grafana to create a new one.
  2. Run make submodules to initialize the "build" Make submodule we use for CI/CD.
  3. Rename the provider by running the following command:
      export provider_name=MyProvider # Camel case, e.g. GitHub
      make provider.prepare provider=${provider_name}
  4. Add your new type by running the following command:
      export group=sample # lower case e.g. core, cache, database, storage, etc.
      export type=MyType # Camel casee.g. Bucket, Database, CacheCluster, etc.
      make provider.addtype provider=${provider_name} group=${group} kind=${type}
  5. Replace the sample group with your new group in apis/{provider}.go
  6. Replace the mytype type with your new type in internal/controller/{provider}.go
  7. Replace the default controller and ProviderConfig implementations with your own
  8. Run make reviewable to run code generation, linters, and tests.
  9. Run make build to build the provider.

Refer to Crossplane's CONTRIBUTING.md file for more information on how the Crossplane community prefers to work. The Provider Development guide may also be of use.

provider-grafana's People

Contributors

argannor avatar

Watchers

David avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.