Configuration

This project uses a DotEnv file for configuring the CPU architecture the operator should be built for, as well as the container registry and cluster to connect to.

Please refer to the .env.example file to see what environment variables are available. When you are just getting started, you can copy it to a .env file and keep it as-is.

Here is the list of the environment variables available:

Variable NameDescription
KUBECONFIGPath to the kubeconfig file.
RUST_LOGLogging level (e.g., info, debug).
CPU_ARCHCPU architecture to build the operator for (e.g., amd64, arm64).
CONTAINER_REGISTRYContainer registry to push the operator image to.
CLUSTER_NAMEName of the Kubernetes cluster to connect to.
INSTALL_CRDSSet to true to automatically install CRDs.

By default, the configuration points to a local environment, and a local cluster will be created using ctlptl with k3d. Please review the Cluster.yaml file:

---
apiVersion: ctlptl.dev/v1alpha1
kind: Registry
name: ctlptl-registry
port: 5005
---
apiVersion: ctlptl.dev/v1alpha1
kind: Cluster
product: k3d
registry: ctlptl-registry

As for the operator configurations, you can configure the following using custom OpenAPI attributes:

info:
  x-kubernetes-operator-group: "example.com"
  x-kubernetes-operator-version: "v1"
  x-kubernetes-operator-resource-ref: "uuid"
  x-kubernetes-operator-example-metadata-spec-field-ref: "name"
  x-kubernetes-operator-include-tags:
    - cats
    # - dogs
    # - horses
Attribute NameDescription
x-kubernetes-operator-groupThe API group of the kubernetes custom resources definitions (CRD's).
x-kubernetes-operator-versionThe API version of the kubernetes CRD's.
x-kubernetes-operator-resource-refThe reference ID of the data model that should be tracked on the API.
x-kubernetes-operator-example-metadata-spec-field-refThe attribute name of the example in OpenAPI spec that should serve as the name of the generated example CRD.
x-kubernetes-operator-include-tagsA list of tags that should be generated from OpenAPI Spec.