provider-gridscale

module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2025 License: Apache-2.0

README

Provider gridscale

CI GitHub tag Go Report Card Contributors

Overview

The provider-gridscale is a Crossplane provider that is built using Upjet code generation tools from terraform-provider-gridscale and exposes XRM-conformant managed resources for the gridscale API.

Getting Started

Install the provider by using the following command after changing the image tag to the latest tag:

up ctp provider install registry.dnation.cloud/crossplane/provider-gridscale:vX.Y.Z --name provider-gridscale

Alternatively, you can use declarative installation:

cat <<EOF | kubectl apply -f -
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
  name: provider-gridscale
spec:
  package: registry.dnation.cloud/crossplane/provider-gridscale:vX.Y.Z
  runtimeConfigRef:
    name: enable-debug
---
apiVersion: pkg.crossplane.io/v1beta1
kind: DeploymentRuntimeConfig
metadata:
  name: enable-debug
spec:
  deploymentTemplate:
    spec:
      selector: {}
      template:
        spec:
          containers:
          - name: package-runtime
            args:
            - --debug
EOF

Notice that in this example Provider resource is referencing DeploymentRuntimeConfig with debug enabled.

You can see the API reference here.

Configuration

# Providerconfig that referers to the secret
apiVersion: gridscale.crossplane.io/v1beta1
kind: ProviderConfig
metadata:
  name: default
spec:
  credentials:
    source: Secret
    secretRef:
      name: example-creds
      namespace: crossplane-system
      key: credentials
---
# Secret that stores credentials
apiVersion: v1
kind: Secret
metadata:
  name: example-creds
  namespace: crossplane-system
type: Opaque
stringData:
  credentials: |
    {
      "token": "my-token",
      "uuid": "my-uuid"
    }

The secret key must contain a json dictionary that provides the authentication data. You can create the secret via this command:

kubectl create secret generic example-creds --from-file=credentials=credentials.json --namespace crossplane-system

// credentials.json
{
  "token": "my-token",
  "uuid": "my-uuid",
}

If the URL for the gridscale API is different from https://api.gridscale.io, you can set it via api_url.

Developing

Install the required submodules to build and run:

make submodules

Apply the Current CRDs and a providerConfig:

kubectl apply -f package/crds
kubectl apply -f examples/providerconfig/

Run against a Kubernetes cluster:

make run

Run code-generation pipeline:

make generate

Prepare for code review:

make reviewable

Build binary:

make build

Report a Bug

For filing bugs, suggesting improvements, or requesting new features, please open an issue.

Directories

Path Synopsis
Package apis contains Kubernetes API for the provider.
Package apis contains Kubernetes API for the provider.
gridscale/v1alpha1
+kubebuilder:object:generate=true +groupName=gridscale.crossplane.io +versionName=v1alpha1
+kubebuilder:object:generate=true +groupName=gridscale.crossplane.io +versionName=v1alpha1
v1alpha1
Package v1alpha1 contains the core resources of the gridscale jet provider.
Package v1alpha1 contains the core resources of the gridscale jet provider.
v1beta1
Package v1beta1 contains the core resources of the gridscale upjet provider.
Package v1beta1 contains the core resources of the gridscale upjet provider.
cmd
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL