Crossplane provider for InfluxDB Cloud

Overview

provider-template

provider-template is a minimal Crossplane Provider that is meant to be used as a template for implementing new Providers. It comes with the following features that are meant to be refactored:

  • A ProviderConfig type that only points to a credentials Secret.
  • A MyType resource type that serves as an example managed resource.
  • A managed resource controller that reconciles MyType objects and simply prints their configuration in its Observe method.

Developing

Run against a Kubernetes cluster:

make run

Build, push, and install:

make all

Build image:

make image

Push image:

make push

Build binary:

make build
Comments
  • address issue of 0-length RetentionRule

    address issue of 0-length RetentionRule

    Signed-off-by: Steven Borrelli [email protected]

    Description of your changes

    Fixes #10

    I have:

    • [x] Read and followed Crossplane's [contribution process].
    • [x] Run make reviewable test to ensure this PR is ready for review.

    How has this code been tested

    • Created bucket with the following yaml and validated in Influxdb Azure console:
    apiVersion: influxdb.crossplane.io/v1alpha1
    kind: Bucket
    metadata:
      name: example-bucket-borrelli-issue-26
    spec:
      forProvider:
        description: borrelli-test-issue-10
        orgID: <redacted>
        retentionRules:
        - everySeconds: 0
          type: expire
      providerConfigRef:
        name: default
    
    • Deleted bucket and validated in the Influxdb Azure Console

    • Created a bucket with a 1 hour retention and confirmed in InfluxDB azure console:

    apiVersion: influxdb.crossplane.io/v1alpha1
    kind: Bucket
    metadata:
      name: example-bucket-borrelli-issue-26
    spec:
      forProvider:
        description: borrelli-test-issue-26
        orgID: <redacted>
        retentionRules:
        - everySeconds: 3600
          type: expire
      providerConfigRef:
        name: default
    
    • Changed retentionRules to everySeconds to 0 and confirmed in the InfluxDB Azure Console.
    • Deleted Bucket and confirmed deletion. Reviewed Controller logs for any Panic.
    backport release-0.1 
    opened by stevendborrelli 4
  • Fix not-found error detection

    Fix not-found error detection

    Signed-off-by: Alper Rifat Ulucinar [email protected]

    Description of your changes

    Fixes #7 It looks like we have an issue while detecting/handling not-found errors for buckets. This PR fixes the issue in a minimalist manner.

    I have:

    • [x] Read and followed Crossplane's contribution process.
    • [x] Run make reviewable test to ensure this PR is ready for review.

    How has this code been tested

    Tested with the following example manifest with a trial InfluxDB Cloud 2 account. Also tested the fix with an InfluxDB organization.

    apiVersion: influxdb.crossplane.io/v1alpha1
    kind: Bucket
    metadata:
      name: example-bucket2-alper
    spec:
      forProvider:
        description: test-description
        orgID: 4133ee0939674b36
        retentionRules:
        - everySeconds: 3600
          type: expire
      providerConfigRef:
        name: default
    
    ❯ k get bucket
    NAME                    READY   SYNCED   EXTERNAL-NAME           AGE
    example-bucket2-alper   True    True     example-bucket2-alper   43m
    
    backport release-0.1 
    opened by ulucinar 3
  • github: remove AWS cred condition for publishing

    github: remove AWS cred condition for publishing

    Description of your changes

    Because the provider does not publish Helm chart and this blocks the whole publishing.

    I have:

    • [x] Read and followed Crossplane's contribution process.
    • [x] Run make reviewable test to ensure this PR is ready for review.

    How has this code been tested

    Will be tested by Github CI.

    opened by muvaf 1
  • Add organization resource

    Add organization resource

    Description of your changes

    Adds the first resource to this provider, Organization.

    I have:

    • [x] Read and followed Crossplane's contribution process.
    • [x] Run make reviewable test to ensure this PR is ready for review.

    How has this code been tested

    Manually with example YAMLs.

    opened by muvaf 1
  • Initialize repository

    Initialize repository

    Usual ritual.

    One thing I need to do some extra work is whether it should be provider-influxdb-cloud or just provider-influxdb because it seems like InfluxDB Cloud provides the same API as OSS. For example, you can create organizations in both but cloud requires a new sign-up whereas you can just call the API and there is only a single Go client targeting both.

    opened by muvaf 1
  • Deleted the bucket object and pod/crossplane-provider-influxdb went into CrashLoopBackOff

    Deleted the bucket object and pod/crossplane-provider-influxdb went into CrashLoopBackOff

    What happened?

    I created a bucket by applying the following manifest:

    apiVersion: influxdb.crossplane.io/v1alpha1
    kind: Bucket
    metadata:
      name: example-bucket2
    spec:
      forProvider:
        description: example-bucket2
        orgID: SOME_ORG_ID
        retentionRules:
        - everySeconds: 0
          type: expire
      providerConfigRef:
        name: default
    

    The bucket got created and was visible on the InfluxDB Cloud 2.0 UI.

    Although the resource never got to the state Ready: True. See below:

    $ kubectl get buckets.influxdb.crossplane.io                
    NAME              READY   SYNCED   EXTERNAL-NAME     AGE
    example-bucket2           True     example-bucket2   5m15s
    

    Then I tried to delete with:

    $ kubectl delete buckets.influxdb.crossplane.io example-bucket2
    bucket.influxdb.crossplane.io "example-bucket2" deleted
    

    Then the crossplane-provider-influxdb pod got into CrashLoopBackOff

    NAME                                                              READY   STATUS             RESTARTS   AGE
    pod/crossplane-78bf69f4cc-f2zmz                                   1/1     Running            0          27h
    pod/crossplane-provider-azure-ddc1abaec4d0-665f9bb6c8-mplm8       1/1     Running            1          27h
    pod/crossplane-provider-influxdb-ba2ab2715129-8567c78666-pz57p    0/1     CrashLoopBackOff   50         3h59m
    pod/crossplane-provider-jet-azure-de7fdc8d3f04-84d4874476-dstzb   1/1     Running            0          27h
    pod/crossplane-provider-sql-f6f5be714a28-545b559dcb-m8kw4         1/1     Running            0          27h
    pod/crossplane-provider-tf-azure-529a2cefbfc7-5ffdf4f86b-8pdcl    1/1     Running            0          27h
    pod/crossplane-rbac-manager-86996b55b4-dn57k                      1/1     Running            1          27h
    pod/upbound-bootstrapper-65cbb55d7c-f8z54                         1/1     Running            0          27h
    pod/xgql-9bbf5d9d7-4f75j                                          1/1     Running            0          27h
    

    The following log output was seen on the pod mentioned above:

    I0112 14:01:23.925955       1 request.go:668] Waited for 1.011662735s due to client-side throttling, not priority and fairness, request: GET:https://192.168.0.1:443/apis/postgresql.azure.tf.crossplane.io/v1alpha1?timeout=32s
    panic: runtime error: index out of range [0] with length 0
    
    goroutine 444 [running]:
    github.com/crossplane-contrib/provider-influxdb/internal/controller/bucket.LateInitialize(0xc0001b2140, 0xc0000101e0, 0x1)
            /home/runner/work/provider-influxdb/provider-influxdb/internal/controller/bucket/conversions.go:129 +0x35f
    github.com/crossplane-contrib/provider-influxdb/internal/controller/bucket.(*external).Observe(0xc0008440b0, 0x1c4cdc0, 0xc000319920, 0x1c6f690, 0xc0001b2000, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
            /home/runner/work/provider-influxdb/provider-influxdb/internal/controller/bucket/controller.go:98 +0x476
    github.com/crossplane/crossplane-runtime/pkg/reconciler/managed.(*Reconciler).Reconcile(0xc0006c44d0, 0x1c4cdf8, 0xc00092e360, 0x0, 0x0, 0xc0009826e0, 0xf, 0xc00092e300, 0x0, 0x0, ...)
            /home/runner/work/provider-influxdb/provider-influxdb/vendor/github.com/crossplane/crossplane-runtime/pkg/reconciler/managed/reconciler.go:679 +0x22ab
    sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0003234a0, 0x1c4cd50, 0xc000429540, 0x1879340, 0xc00091b340)
            /home/runner/work/provider-influxdb/provider-influxdb/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:298 +0x30d
    sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0003234a0, 0x1c4cd50, 0xc000429540, 0x663a226465636100)
            /home/runner/work/provider-influxdb/provider-influxdb/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:253 +0x205
    sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2(0xc0003b2010, 0xc0003234a0, 0x1c4cd50, 0xc000429540)
            /home/runner/work/provider-influxdb/provider-influxdb/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:214 +0x6b
    created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2
            /home/runner/work/provider-influxdb/provider-influxdb/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:210 +0x425
    

    How can we reproduce it?

    The steps are described in the what happened? section.

    What environment did it happen in?

    Crossplane version: upbound/crossplane:v1.5.1-up.1 Provider InfluxDB Cloud version: v0.1.1 Azure AKS Kubernetes 1.20.13

    bug 
    opened by angelhvargas 0
  • Unable to create Bucket: cannot find bucket error

    Unable to create Bucket: cannot find bucket error

    What happened?

    I'm trying to create the following Bucket (external resource)

    apiVersion: influxdb.crossplane.io/v1alpha1
    kind: Bucket
    metadata:
      name: example-bucket2
    spec:
      forProvider:
        description: test-description
        orgID: *******4e54da6
        retentionRules:
        - everySeconds: 0
          type: expire
      providerConfigRef:
        name: default
    

    The bucket doesn't get created.

    $ > kubectl describe Bucket example-bucket
    
    
    Name:         example-bucket2
    Namespace:    
    Labels:       <none>
    Annotations:  crossplane.io/external-name: example-bucket2
    API Version:  influxdb.crossplane.io/v1alpha1
    Kind:         Bucket
    Metadata:
      Creation Timestamp:  2022-01-06T18:50:00Z
      Generation:          1
      Managed Fields:
        API Version:  influxdb.crossplane.io/v1alpha1
        Fields Type:  FieldsV1
        fieldsV1:
          f:metadata:
            f:annotations:
              .:
              f:kubectl.kubernetes.io/last-applied-configuration:
          f:spec:
            .:
            f:deletionPolicy:
            f:forProvider:
              .:
              f:description:
              f:orgID:
              f:retentionRules:
            f:providerConfigRef:
              .:
              f:name:
        Manager:      kubectl-client-side-apply
        Operation:    Update
        Time:         2022-01-06T18:50:00Z
        API Version:  influxdb.crossplane.io/v1alpha1
        Fields Type:  FieldsV1
        fieldsV1:
          f:metadata:
            f:annotations:
              f:crossplane.io/external-name:
          f:status:
            .:
            f:atProvider:
              .:
              f:links:
            f:conditions:
        Manager:         crossplane-influxdb-provider
        Operation:       Update
        Time:            2022-01-06T18:50:01Z
      Resource Version:  328220
      UID:               9d4acba6-e5fc-46ee-9d10-44423123123
    Spec:
      Deletion Policy:  Delete
      For Provider:
        Description:  test-description
        Org ID:       YOUR_ORG_ID****
        Retention Rules:
          Every Seconds:  0
          Type:           expire
      Provider Config Ref:
        Name:  default
    Status:
      At Provider:
        Links:
      Conditions:
        Last Transition Time:  2022-01-06T18:50:01Z
        Message:               observe failed: cannot find bucket: not found: bucket "example-bucket2" not found
        Reason:                ReconcileError
        Status:                False
        Type:                  Synced
    Events:
      Type     Reason                         Age              From                                   Message
      ----     ------                         ----             ----                                   -------
      Warning  CannotObserveExternalResource  4s (x4 over 5s)  managed/bucket.influxdb.crossplane.io  cannot find bucket: not found: bucket "example-bucket2" not found
    

    How can we reproduce it?

    • AKS cluster Kubernetes v1.20.13.
    • Using a InfluxDB Cloud 2.0 account, Azure:

    Install the provider:

    kubectl crossplane install provider crossplane/provider-influxdb:v0.1.0
    

    Apply the following:

    ---
    apiVersion: v1
    kind: Secret
    metadata:
      namespace: crossplane-system
      name: influxdb-token
    type: Opaque
    stringData:
      authToken: YOUR_INFLUXDBCLOUD_TOKEN_ID==
    ---
    apiVersion: influxdb.crossplane.io/v1alpha1
    kind: ProviderConfig
    metadata:
      name: default
    spec:
      endpoint: https://eastus-1.azure.cloud2.influxdata.com
      credentials:
        source: Secret
        secretRef:
          namespace: crossplane-system
          name: influxdb-token
          key: authToken
    ---
    apiVersion: influxdb.crossplane.io/v1alpha1
    kind: Bucket
    metadata:
      name: example-bucket2
    spec:
      forProvider:
        description: test-description
        orgID: YOUR_TEST_ORG
        retentionRules:
        - everySeconds: 0
          type: expire
      providerConfigRef:
        name: default
    

    What environment did it happen in?

    Crossplane version: upbound/crossplane:v1.5.1-up.1

    Provider InfluxDB Cloud version: v0.1.0

    Azure AKS

    Kubernetes 1.20.13

    bug 
    opened by angelhvargas 0
  • remove azure from package.yaml

    remove azure from package.yaml

    Description of your changes

    Looks like I forgot to remove that.

    I have:

    • [x] Read and followed Crossplane's contribution process.
    • [x] Run make reviewable test to ensure this PR is ready for review.

    How has this code been tested

    Manually

    opened by muvaf 0
  • Add DatabaseRetentionPolicyMapping resource

    Add DatabaseRetentionPolicyMapping resource

    Description of your changes

    Add DatabaseRetentionPolicyMapping resource. Depends on https://github.com/crossplane-contrib/provider-influxdb/pull/3 only the last two commits are relevant.

    I have:

    • [x] Read and followed Crossplane's contribution process.
    • [x] Run make reviewable test to ensure this PR is ready for review.

    How has this code been tested

    Manually with the given example.

    opened by muvaf 0
  • Add bucket

    Add bucket

    Description of your changes

    Adds Bucket CRD.

    Fixes #

    I have:

    • [x] Read and followed Crossplane's contribution process.
    • [x] Run make reviewable test to ensure this PR is ready for review.

    How has this code been tested

    Manually with example.

    opened by muvaf 0
Releases(v0.1.2)
  • v0.1.2(Jan 20, 2022)

    Notable Updates

    Issue https://github.com/crossplane-contrib/provider-influxdb/issues/10 that caused controller to crash has been fixed.

    What's Changed

    • [Backport release-0.1] address issue of 0-length RetentionRule by @github-actions in https://github.com/crossplane-contrib/provider-influxdb/pull/12

    Full Changelog: https://github.com/crossplane-contrib/provider-influxdb/compare/v0.1.1...v0.1.2

    Source code(tar.gz)
    Source code(zip)
  • v0.1.1(Jan 10, 2022)

    v0.1.1 is a bugfix release for the Bucket issue reported in #7.

    What's Changed

    • [Backport release-0.1] Fix not-found error detection by @github-actions in https://github.com/crossplane-contrib/provider-influxdb/pull/9

    Full Changelog: https://github.com/crossplane-contrib/provider-influxdb/compare/v0.1.0...v0.1.1

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Nov 29, 2021)

    Welcome InfluxDB v2 to Crossplane Ecosystem!

    This is the first release of provider-influxdb that will allow users to manage InfluxDB resources within their cluster, using Crossplane.

    Give it a try!

    kubectl crossplane install provider crossplane/provider-influxdb:v0.1.0
    

    See examples YAMLs here.

    Take a look at what CRDs are supported here!

    What's Changed

    • Initialize repository by @muvaf in https://github.com/crossplane-contrib/provider-influxdb/pull/1
    • Add organization resource by @muvaf in https://github.com/crossplane-contrib/provider-influxdb/pull/2
    • Add bucket by @muvaf in https://github.com/crossplane-contrib/provider-influxdb/pull/3
    • Add DatabaseRetentionPolicyMapping resource by @muvaf in https://github.com/crossplane-contrib/provider-influxdb/pull/4
    • github: remove AWS cred condition for publishing by @muvaf in https://github.com/crossplane-contrib/provider-influxdb/pull/5
    • remove azure from package.yaml by @muvaf in https://github.com/crossplane-contrib/provider-influxdb/pull/6

    New Contributors

    • @muvaf made their first contribution in https://github.com/crossplane-contrib/provider-influxdb/pull/1

    Full Changelog: https://github.com/crossplane-contrib/provider-influxdb/commits/v0.1.0

    Source code(tar.gz)
    Source code(zip)
Owner
Crossplane Contrib
Crossplane Contrib
Jaeger-influxdb - The repository that contains InfluxDB Storage gRPC plugin for Jaeger

NOTICE: This repository is archived and is no longer maintained. Please use http

Rohan 0 Feb 16, 2022
provider-kubernetes is a Crossplane Provider that enables deployment and management of arbitrary Kubernetes objects on clusters

provider-kubernetes provider-kubernetes is a Crossplane Provider that enables deployment and management of arbitrary Kubernetes objects on clusters ty

International Business Machines 2 Dec 14, 2022
Provider-milvus - Milvus provider for crossplane

provider-milvus provider-milvus is a minimal Crossplane Provider that is meant t

The Milvus Project 2 Feb 9, 2022
Crossplane provider for Confluent Cloud

provider-confluent provider-confluent is a minimal Crossplane Provider that is meant to be used as a template for implementing new Providers. It comes

DFDS 1 Feb 4, 2022
An experimental crossplane provider for @zscaler zpa

provider-zpa Crossplane provider for [Zscaler ZPA] The provider built from this repository can be installed into a Crossplane control plane or run sep

null 0 Dec 7, 2021
Crossplane provider to provision and manage Kubernetes objects on (remote) Kubernetes clusters.

provider-kubernetes provider-kubernetes is a Crossplane Provider that enables deployment and management of arbitrary Kubernetes objects on clusters ty

Crossplane Contrib 69 Jan 3, 2023
Generate Crossplane Providers from any Terraform Provider

Terrajet - Generate Crossplane Providers from any Terraform Provider Terrajet is a code generator framework that allows developers to build code gener

Crossplane Contrib 291 Dec 29, 2022
A minimal Crossplane Provider For Golang

provider-template provider-template is a minimal Crossplane Provider that is mea

Rajendra Gosavi 0 Dec 19, 2021
A minimal Crossplane Provider that is meant to be used as a template for implementing new Providers

provider-template provider-template is a minimal Crossplane Provider that is meant to be used as a template for implementing new Providers. It comes w

Giulio Micheloni 0 Jan 16, 2022
Provider-template - Template for writing providers for crossplane

provider-template provider-template is a minimal Crossplane Provider that is mea

maros.zeleny 0 Feb 3, 2022
provide api for cloud service like aliyun, aws, google cloud, tencent cloud, huawei cloud and so on

cloud-fitter 云适配 Communicate with public and private clouds conveniently by a set of apis. 用一套接口,便捷地访问各类公有云和私有云 对接计划 内部筹备中,后续开放,有需求欢迎联系。 开发者社区 开发者社区文档

null 24 Dec 20, 2022
k6 extension for InfluxDB v2

xk6-output-influxdb k6 extension for InfluxDB v2, it adds the support for the latest v2 version and the compatibility API for v1.8+. Why is this outpu

Grafana Labs 22 Dec 26, 2022
Download your Fitbit weight history and connect to InfluxDB and Grafana

WemonFit Weight monitoring for Fitbit, using InfluxDB and Grafana Generating a new certificate openssl req -new -newkey rsa:2048 -nodes -keyout lo

Eduardo Argollo 1 Oct 22, 2022
Scrapes tibber API and write to influxdb.

tibber-influxdb This will write data points to influxdb based on consumption and currentPrice. The points are written to influxdb with the timestamp f

Fabian Heib 2 Apr 28, 2022
Cloud-Z gathers information and perform benchmarks on cloud instances in multiple cloud providers.

Cloud-Z Cloud-Z gathers information and perform benchmarks on cloud instances in multiple cloud providers. Cloud type, instance id, and type CPU infor

CloudSnorkel 16 Jun 8, 2022
OpenAPI Terraform Provider that configures itself at runtime with the resources exposed by the service provider (defined in a swagger file)

Terraform Provider OpenAPI This terraform provider aims to minimise as much as possible the efforts needed from service providers to create and mainta

Daniel I. Khan Ramiro 228 Dec 26, 2022
Terraform provider to help with various AWS automation tasks (mostly all that stuff we cannot accomplish with the official AWS terraform provider)

terraform-provider-awsutils Terraform provider for performing various tasks that cannot be performed with the official AWS Terraform Provider from Has

Cloud Posse 25 Dec 8, 2022
Terraform Provider for Azure (Resource Manager)Terraform Provider for Azure (Resource Manager)

Terraform Provider for Azure (Resource Manager) Version 2.x of the AzureRM Provider requires Terraform 0.12.x and later, but 1.0 is recommended. Terra

null 0 Oct 16, 2021
Terraform-provider-mailcow - Terraform provider for Mailcow

Terraform Provider Scaffolding (Terraform Plugin SDK) This template repository i

Owen Valentine 0 Dec 31, 2021