Block Configuration
The kblock.yaml file is used to configure the block's metadata and operator settings. To learn
more about the configuration manifest, see the block configuration reference.
Let's edit the kblock.yaml file to define our queue block:
apiVersion: kblocks.io/v1kind: Blockspec:engine: tofudefinition:description: An Amazon SQS queueicon: heroicon://queue-listreadme: ./README.mdschema: src/values.schema.jsonoutputs:- queueUrlgroup: example.comversion: v1kind: Queueplural: queuessingular: queueoperator:envSecrets:AWS_DEFAULT_REGION: aws-credentialsAWS_ACCESS_KEY_ID: aws-credentialsAWS_SECRET_ACCESS_KEY: aws-credentialsmetadata:name: queues.example.com
Here is a breakdown of the configuration:
engine: The engine to use for the block. In our case we are using thetofuengine.definition: The block's metadata and schema:description: A short description of the block.icon: An icon to use for this block in UI systems and portals.readme: A reference to the README file in the block's project directory.schema: A reference to the schema file in the block'ssrcdirectory.outputs: A list of output names that will be exposed by the block.group: The Kubernetes API group to use for the block.version: The Kubernetes API version to use for the block.kind: The Kubernetes API kind to use for the block.plural: The plural form of the block's kind.singular: The singular form of the block's kind.
operator: Environment settings for the block operator.envSecrets: A map of environment variables to secrets in the cluster. The operator will read the values from the specified secrets and set the environment variables. In our example, we are using theaws-credentialssecret to set the AWS credentials for the Terraform AWS provider.
Next, let's move on to defining the schema.