upjet-rediscloud

module
v0.0.0-...-8c5a782 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0

README

Provider RedisCloud

provider-rediscloud is a Crossplane provider that is built using Upjet code generation tools and exposes XRM-conformant managed resources for the RedisCloud API.

QuickStart (user mode)

Install UP CLI

brew install upbound/tap/up

or see link above for instructions on other platforms.

Install latest Crossplane to your current kubernetes cluster:

up uxp install

That would create upbound-system namespace and install core crossplane components.

Install Rediscloud provider:

kubectl apply -n upbound-system -f examples/install-open.yaml 

Note: in pre-released stage install-open.yaml uses public, but potentially outdataed version of provider image. To access the latest you need to use examples/install.yaml that requires credentials to the private repo.

Create secret.yaml from examples/providerconfig/secret.yaml.tmpl using your Redis Cloud key/secret. Install secret and provider config.

kubectl apply -f examples/providerconfig/secret.yaml                    
kubectl apply -n upbound-system -f examples/providerconfig/providerconfig.yaml 

Use examples/database.yaml as example to create the database. It must use pre-existing subscription id.

kubectl apply -f - << EOF  
apiVersion: database.rediscloud.upbound.io/v1alpha1
kind: Database
metadata:
  name: my-first-database
spec:
  forProvider:
    subscriptionId: 1922316
    name: "my-first-database"
    protocol: "redis"
    memoryLimitInGb: 1
    dataPersistence: "none"
    throughputMeasurementBy: "operations-per-second"
    throughputMeasurementValue: 1000
  providerConfigRef:
    name: default
EOF

Getting Started (Development out-of-cluster mode)

Build the provider:

make generate

Apply CRDs

kubectl apply -f package/crds

Create secret.yaml from examples/providerconfig/secret.yaml.tmpl using your Redis Cloud key/secred and apply it, along with the provider config.

kubectl apply -f examples/providerconfig/secret.yaml
kubectl apply -f examples/providerconfig/providerconfig.yaml

Run provider:

make run

Use examples/database.yaml as example to create the database. It must use pre-existing subscription id.

kubectl apply -f - << EOF  
apiVersion: database.rediscloud.upbound.io/v1alpha1
kind: Database
metadata:
  name: my-first-database
spec:
  forProvider:
    subscriptionId: 1889645
    name: "my-first-database"
    protocol: "redis"
    memoryLimitInGb: 1
    dataPersistence: "none"
    throughputMeasurementBy: "operations-per-second"
    throughputMeasurementValue: 1000
  providerConfigRef:
    name: default
EOF

Verify that database successfully created in RedisCloud console and by running:

kubectl describe database my-first-database

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

You can see the API reference here.

Developing

Run code-generation pipeline:

go run cmd/generator/main.go "$PWD"

Run against a Kubernetes cluster:

make run

Build, push, and install:

make all

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.
account/v1alpha1
+kubebuilder:object:generate=true +groupName=account.rediscloud.upbound.io +versionName=v1alpha1
+kubebuilder:object:generate=true +groupName=account.rediscloud.upbound.io +versionName=v1alpha1
database/v1alpha1
+kubebuilder:object:generate=true +groupName=database.rediscloud.upbound.io +versionName=v1alpha1
+kubebuilder:object:generate=true +groupName=database.rediscloud.upbound.io +versionName=v1alpha1
peering/v1alpha1
+kubebuilder:object:generate=true +groupName=peering.rediscloud.upbound.io +versionName=v1alpha1
+kubebuilder:object:generate=true +groupName=peering.rediscloud.upbound.io +versionName=v1alpha1
subscription/v1alpha1
+kubebuilder:object:generate=true +groupName=subscription.rediscloud.upbound.io +versionName=v1alpha1
+kubebuilder:object:generate=true +groupName=subscription.rediscloud.upbound.io +versionName=v1alpha1
v1alpha1
Package v1alpha1 contains the core resources of the rediscloud jet provider.
Package v1alpha1 contains the core resources of the rediscloud jet provider.
v1beta1
Package v1beta1 contains the core resources of the rediscloud upjet provider.
Package v1beta1 contains the core resources of the rediscloud upjet provider.
cmd
internal

Jump to

Keyboard shortcuts

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