Skip to content

OrganizationProject

Prerequisites

  • A Kubernetes cluster with the operator installed using helm, kubectl or kind (for local development).
  • A Kubernetes Secret with an Aiven authentication token.

Required permissions

To create and manage this resource, you must have the appropriate roles or permissions. See the Aiven documentation for details on managing permissions.

This resource uses the following API operations, and for each operation, any of the listed permissions is sufficient:

Operation Permissions
OrganizationProjectsDelete organization:projects:write
OrganizationProjectsGet project:services:read
OrganizationProjectsUpdate organization:projects:write
ProjectKmsGetCA organization:projects:write

Usage example

apiVersion: aiven.io/v1alpha1
kind: OrganizationProject
metadata:
  name: my-organization-project
spec:
  authSecretRef:
    name: aiven-token
    key: token

  connInfoSecretTarget:
    name: my-organization-project-ca-cert

  organizationId: org123456789a
  projectId: my-organization-project
  billingGroupId: bg123456789a
  parentId: org123456789a

  basePort: 12000

  technicalEmails:
    - tech@example.com

  tags:
    env: prod

Apply the resource with:

kubectl apply -f example.yaml

Verify the newly created OrganizationProject:

kubectl get organizationprojects my-organization-project

The output is similar to the following:

Name                       Organization     Project                    Parent           
my-organization-project    org123456789a    my-organization-project    org123456789a    

To view the details of the Secret, use the following command:

kubectl describe secret my-organization-project-ca-cert

You can use the jq to quickly decode the Secret:

kubectl get secret my-organization-project-ca-cert -o json | jq '.data | map_values(@base64d)'

The output is similar to the following:

{
    "ORGANIZATIONPROJECT_CA_CERT": "<secret>",
}

OrganizationProject

OrganizationProject is the Schema for the organizationprojects API.

Adoption of existing projects

If projectId refers to a project that already exists in the organization, the operator adopts it: the remote state is overwritten to match the spec (billing group, parent, tags, technical emails, base port), and deleting the resource deletes the project in Aiven.

Exposes secret keys

ORGANIZATIONPROJECT_CA_CERT.

Required

  • apiVersion (string). Value aiven.io/v1alpha1.
  • kind (string). Value OrganizationProject.
  • metadata (object). Data that identifies the object, including a name string and optional namespace.
  • spec (object). OrganizationProjectSpec defines the desired state of OrganizationProject. See below for nested schema.

spec

Appears on OrganizationProject.

OrganizationProjectSpec defines the desired state of OrganizationProject.

Required

  • billingGroupId (string, MinLength: 1). BillingGroupID is the ID of the billing group the project is assigned to.
  • organizationId (string, Immutable, MinLength: 1). OrganizationID is the Aiven organization ID that owns the project. It is the addressing key for the project and cannot be changed (moving a project between organizations is not supported).
  • parentId (string, MinLength: 1). ParentID is the ID of the organization or organizational unit the project belongs to. Moving a project between organizational units within the same organization is supported.
  • projectId (string, Immutable, Pattern: ^[a-zA-Z0-9_-]+$, MinLength: 1, MaxLength: 63). ProjectID is the name of the project. It is immutable once set.

Optional

  • authSecretRef (object). Authentication reference to Aiven token in a secret. See below for nested schema.
  • basePort (integer, Minimum: 10000, Maximum: 30000). BasePort is the valid port number range for the project, from 10000 to 30000. When omitted, the field is unmanaged: Aiven assigns the value and changes made outside Kubernetes are left as is.
  • connInfoSecretTarget (object). Secret configuration. See below for nested schema.
  • connInfoSecretTargetDisabled (boolean, Immutable). When true, the secret containing connection information will not be created, defaults to false. This field cannot be changed after resource creation.
  • tags (object, AdditionalProperties: string). Tags are key-value pairs that allow you to categorize projects. This map is authoritative: when omitted, tags added outside Kubernetes are removed.
  • technicalEmails (array of strings, MaxItems: 10). TechnicalEmails are the technical contact emails of the project. This list is authoritative: when omitted, emails added outside Kubernetes are removed. Duplicates are rejected.

authSecretRef

Appears on spec.

Authentication reference to Aiven token in a secret.

Required

  • key (string, MinLength: 1).
  • name (string, MinLength: 1).

connInfoSecretTarget

Appears on spec.

Secret configuration.

Required

  • name (string, Immutable). Name of the secret resource to be created. By default, it is equal to the resource name.

Optional

  • annotations (object, AdditionalProperties: string). Annotations added to the secret.
  • labels (object, AdditionalProperties: string). Labels added to the secret.
  • prefix (string). Prefix for the secret's keys. Added "as is" without any transformations. By default, is equal to the kind name in uppercase + underscore, e.g. KAFKA_, REDIS_, etc.