Skip to content

feat(infrastructure): add scaffolding for the infrastructure kind#154

Open
Nageshbansal wants to merge 23 commits into
mainfrom
feat/infrastructure/scaffolding
Open

feat(infrastructure): add scaffolding for the infrastructure kind#154
Nageshbansal wants to merge 23 commits into
mainfrom
feat/infrastructure/scaffolding

Conversation

@Nageshbansal

@Nageshbansal Nageshbansal commented Jul 14, 2026

Copy link
Copy Markdown
Member

Adds scaffolding for the third casting kind, Infrastructure: schema, types, pipeline wiring, and a first casting. The installation migration follows separately.

Features

  • Adds KindInfrastructure with its own api package and per-kind schema. Spec is deployment, resource and patches.
  • spec.resource declares which kind the infrastructure serves (Installation or CollectionAgent). Nothing else: the installation owns the binding and declares it on its own casting, so no name or apiVersion here, and nothing is read from the other casting.
  • Adds resourcemolding: writes what the declared kind needs into resource.status (ports as addresses; storage and node sizing in the resource.yaml config).
  • Adds awskubernetesterraformcasting: forges an EKS setup under pours/infrastructure/ (VPC, cluster, one node group, EBS CSI addon when the kind needs storage). Node sizes are written as vcpus and memory and resolved to an instance type by terraform at plan time; a variable pins an exact type.
  • Wires the kind through the loader, lock, planner registry and schema generation.
  • Re-types installation's spec.infrastructure to the binding: {name} of the infrastructure casting it runs on. The consumer owns the reference; the infrastructure declares only the kind it serves. Breaking for any casting that set the old enabled/status fields; the ledger shows zero ever did.
  • Removes the inline terraform generation path it replaces (internal/infrastructure, the forge special case, the per-component aws/gcp/azure templates).
  • Adds docs/examples/aws/kubernetes/terraform/.

Out of scope

  • Cast(): logs the terraform steps instead of running them.

Example

# casting.yaml
apiVersion: v1alpha1
kind: Infrastructure
metadata:
  name: signoz
spec:
  deployment:
    platform: aws
    mode: kubernetes
    flavor: terraform
  resource:
    kind: Installation
# casting.yaml.lock
apiVersion: v1alpha1
kind: Infrastructure
metadata:
  name: signoz
spec:
  deployment:
    flavor: terraform
    mode: kubernetes
    platform: aws
  resource:
    kind: Installation
    status:
      addresses:
        apiserver:
        - tcp://0.0.0.0:8080
        otlp:
        - tcp://0.0.0.0:4317
        - tcp://0.0.0.0:4318
      config:
        data:
          resource.yaml: |
            nodeGroups:
            - count: 2
              disk: 50
              memory: 8
              name: default
              vcpus: 2
            storage:
              persistent: true

Tests

  • Schema validation for the resource declaration.
  • Molding dispatch per resource kind and merge of enricher contributions.
  • Loader dispatch for the new kind, including absent resource and self-reference.
  • Template rendering per resource kind; the generated terraform passes terraform validate.

@Nageshbansal
Nageshbansal marked this pull request as draft July 14, 2026 13:27
@Nageshbansal
Nageshbansal marked this pull request as ready for review July 15, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant