example(edge): basic example on how to deploy edge #62

Merged
mauritz.uphoff merged 1 commit from example/stec-example into main 2026-08-19 14:05:35 +00:00

Description

Checklist

  • The CI pipeline passed successfully.
## Description <!-- **Please link some issue here describing what you are trying to achieve.** --> ## Checklist - [ ] The CI pipeline passed successfully.
example(edge): basic example on how to deploy edge
All checks were successful
Default CI / Check for Open TODOs (pull_request) Successful in 44s
AI PR Review / AI PR Review (pull_request) Successful in 44s
Default CI / Pre-Commit Hooks (pull_request) Successful in 2m4s
6346716698

πŸ€– AI PR Review

Reviewing changes up to 63467166

πŸ“ Spelling & Grammar

βœ… No spelling or grammar issues found.

πŸ—οΈ Infrastructure Changes
  • Creates STACKIT provider configuration with beta resources enabled
  • Defines variables for project, region, service account, STEC plan, cluster config, and node specs
  • Sets up STEC management instance, kubeconfig, and token resources
  • Creates a routed network with DNS servers and security group with full TCP/UDP egress/ingress rules
  • Pre-creates network interfaces for control plane and worker nodes
  • Uses local-exec to generate Talos image via script, then reads resulting image ID
  • Provisions control plane and worker VMs using the generated image and pre-created NICs
  • Applies EdgeCluster CRD via script after VMs register as EdgeHosts
  • Exposes outputs for STEC UI, kubeconfigs, and talosconfig

⚠️ Destructive: All resources are new and will be created β€” no deletions or replacements. No safer alternative needed.

πŸ”’ Security Review

βœ… No security issues found.

πŸ“ Example Consistency

βœ… Example follows repository conventions.

πŸ“š Example README

βœ… Example READMEs are complete.

πŸ“š Module Variable & Output Coverage

No relevant changes to review.

πŸ’¬ Commit Messages

βœ… Commit messages are descriptive.


Generated automatically β€” treat as a hint, not a gate.

## πŸ€– AI PR Review > Reviewing changes up to [`63467166`](https://professional-service.git.onstackit.cloud/professional-service-best-practices/professional-service/commit/6346716698bc75a88b651e08f6d7af35ace8374d) <details> <summary>πŸ“ Spelling & Grammar</summary> βœ… No spelling or grammar issues found. </details> <details> <summary>πŸ—οΈ Infrastructure Changes</summary> - Creates STACKIT provider configuration with beta resources enabled - Defines variables for project, region, service account, STEC plan, cluster config, and node specs - Sets up STEC management instance, kubeconfig, and token resources - Creates a routed network with DNS servers and security group with full TCP/UDP egress/ingress rules - Pre-creates network interfaces for control plane and worker nodes - Uses local-exec to generate Talos image via script, then reads resulting image ID - Provisions control plane and worker VMs using the generated image and pre-created NICs - Applies EdgeCluster CRD via script after VMs register as EdgeHosts - Exposes outputs for STEC UI, kubeconfigs, and talosconfig ⚠️ Destructive: All resources are new and will be created β€” no deletions or replacements. No safer alternative needed. </details> <details> <summary>πŸ”’ Security Review</summary> βœ… No security issues found. </details> <details> <summary>πŸ“ Example Consistency</summary> βœ… Example follows repository conventions. </details> <details> <summary>πŸ“š Example README</summary> βœ… Example READMEs are complete. </details> <details> <summary>πŸ“š Module Variable & Output Coverage</summary> _No relevant changes to review._ </details> <details> <summary>πŸ’¬ Commit Messages</summary> βœ… Commit messages are descriptive. </details> --- _Generated automatically β€” treat as a hint, not a gate._
mauritz.uphoff force-pushed example/stec-example from 6346716698
All checks were successful
Default CI / Check for Open TODOs (pull_request) Successful in 44s
AI PR Review / AI PR Review (pull_request) Successful in 44s
Default CI / Pre-Commit Hooks (pull_request) Successful in 2m4s
to 4974afe494
All checks were successful
Default CI / Check for Open TODOs (pull_request) Successful in 43s
AI PR Review / AI PR Review (pull_request) Successful in 50s
Default CI / Pre-Commit Hooks (pull_request) Successful in 2m34s
2026-08-17 07:24:09 +00:00
Compare

πŸ€– AI PR Review

Reviewing changes up to 4974afe4

πŸ“ Spelling & Grammar

βœ… No spelling or grammar issues found.

πŸ—οΈ Infrastructure Changes
  • Creates STACKIT provider configuration with beta resources enabled
  • Defines variables for STACKIT project, region, service account, and cluster parameters
  • ⚠️ Creates STEC management instance and associated kubeconfig/token resources
  • Creates network with security groups and egress/ingress rules for cluster nodes
  • Creates network interfaces for control plane and worker nodes
  • Generates Talos image via local-exec script and uploads to STACKIT IaaS
  • Creates control plane and worker VMs using the generated Talos image
  • Applies EdgeCluster CRD via local-exec script to form Kubernetes cluster
  • Exposes outputs for STEC UI, kubeconfigs, and talosconfig
# For safer STEC instance management, consider using a lifecycle block to prevent accidental deletion:
resource "stackit_edgecloud_instance" "this" {
  project_id   = var.stackit_project_id
  display_name = var.stec_instance_name
  plan_id      = var.stec_plan_id

  lifecycle {
    prevent_destroy = true
  }
}
πŸ”’ Security Review

βœ… No security issues found.

πŸ“ Example Consistency

βœ… Example follows repository conventions.

πŸ“š Example README

βœ… Example READMEs are complete.

πŸ“š Module Variable & Output Coverage

No relevant changes to review.

πŸ’¬ Commit Messages

βœ… Commit messages are descriptive.


Generated automatically β€” treat as a hint, not a gate.

## πŸ€– AI PR Review > Reviewing changes up to [`4974afe4`](https://professional-service.git.onstackit.cloud/professional-service-best-practices/professional-service/commit/4974afe494df1beebb03848f7401cd55f2737fea) <details> <summary>πŸ“ Spelling & Grammar</summary> βœ… No spelling or grammar issues found. </details> <details> <summary>πŸ—οΈ Infrastructure Changes</summary> - Creates STACKIT provider configuration with beta resources enabled - Defines variables for STACKIT project, region, service account, and cluster parameters - ⚠️ Creates STEC management instance and associated kubeconfig/token resources - Creates network with security groups and egress/ingress rules for cluster nodes - Creates network interfaces for control plane and worker nodes - Generates Talos image via local-exec script and uploads to STACKIT IaaS - Creates control plane and worker VMs using the generated Talos image - Applies EdgeCluster CRD via local-exec script to form Kubernetes cluster - Exposes outputs for STEC UI, kubeconfigs, and talosconfig ```hcl # For safer STEC instance management, consider using a lifecycle block to prevent accidental deletion: resource "stackit_edgecloud_instance" "this" { project_id = var.stackit_project_id display_name = var.stec_instance_name plan_id = var.stec_plan_id lifecycle { prevent_destroy = true } } ``` </details> <details> <summary>πŸ”’ Security Review</summary> βœ… No security issues found. </details> <details> <summary>πŸ“ Example Consistency</summary> βœ… Example follows repository conventions. </details> <details> <summary>πŸ“š Example README</summary> βœ… Example READMEs are complete. </details> <details> <summary>πŸ“š Module Variable & Output Coverage</summary> _No relevant changes to review._ </details> <details> <summary>πŸ’¬ Commit Messages</summary> βœ… Commit messages are descriptive. </details> --- _Generated automatically β€” treat as a hint, not a gate._
@ -0,0 +27,4 @@
# --- EdgeImage CRD ----------------------------------------------------------
>&2 echo "==> Applying EdgeImage '${IMAGE_NAME}'..."

This could be done with the Kubernetes Terraform provider and only do the download in the shell script

This could be done with the Kubernetes Terraform provider and only do the download in the shell script
dominik.lembke marked this conversation as resolved
@ -0,0 +58,4 @@
# --- Create EdgeCluster ------------------------------------------------------
MANIFEST=$(mktemp)
cat > "${MANIFEST}" <<YAML

This could be done with the Kubernetes Terraform provider and only do the waiting in the shell script

This could be done with the Kubernetes Terraform provider and only do the waiting in the shell script
Author
Owner

I had the same idea. But I've only run into issues due to the fact that terraform is unable to poll an arbitrary CRD status field and block until a condition is met. Replacing it with the Kubernetes provider would require keeping the wait logic anyway (in null_resource), giving you more moving parts and worse error messages for no real gain.

I had the same idea. But I've only run into issues due to the fact that terraform is unable to poll an arbitrary CRD status field and block until a condition is met. Replacing it with the Kubernetes provider would require keeping the wait logic anyway (in null_resource), giving you more moving parts and worse error messages for no real gain.
dominik.lembke marked this conversation as resolved
@ -0,0 +101,4 @@
locals {
common_labels = {
"managed-by" = "terraform"
"example" = "iaas-edge-cloud-cluster"

shouldn't this be the name of the example? so iaas-edge-k8s-cluster

shouldn't this be the name of the example? so iaas-edge-k8s-cluster
Author
Owner

nice catch πŸ₯³

nice catch πŸ₯³
mauritz.uphoff marked this conversation as resolved
@ -0,0 +24,4 @@
expiration = 86400
}
resource "stackit_edgecloud_token" "this" {

unused. Is this needed for the edgecloud to work properly?

unused. Is this needed for the edgecloud to work properly?
Author
Owner

Added comment to explain for what it is needed

Added comment to explain for what it is needed
mauritz.uphoff marked this conversation as resolved
@ -0,0 +1,137 @@
#!/usr/bin/env bash

License Header missing

License Header missing
Author
Owner

nice catch. Also resolved for all other examples! πŸ₯³

nice catch. Also resolved for all other examples! πŸ₯³
Author
Owner

Updated all other shell scripts as well: bad5524e05

Updated all other shell scripts as well: https://professional-service.git.onstackit.cloud/professional-service-best-practices/professional-service/commit/bad5524e05241831cdeec3ad1136641f60f23946
mauritz.uphoff marked this conversation as resolved
@ -0,0 +1,141 @@
#!/usr/bin/env bash

License Header missing

License Header missing
mauritz.uphoff marked this conversation as resolved
mauritz.uphoff force-pushed example/stec-example from 4974afe494
All checks were successful
Default CI / Check for Open TODOs (pull_request) Successful in 43s
AI PR Review / AI PR Review (pull_request) Successful in 50s
Default CI / Pre-Commit Hooks (pull_request) Successful in 2m34s
to 03f994d0e0
Some checks failed
Default CI / Check for Open TODOs (pull_request) Successful in 30s
AI PR Review / AI PR Review (pull_request) Has been cancelled
Default CI / Pre-Commit Hooks (pull_request) Has been cancelled
2026-08-19 12:46:22 +00:00
Compare
mauritz.uphoff force-pushed example/stec-example from 03f994d0e0
Some checks failed
Default CI / Check for Open TODOs (pull_request) Successful in 30s
AI PR Review / AI PR Review (pull_request) Has been cancelled
Default CI / Pre-Commit Hooks (pull_request) Has been cancelled
to e4fbb34e3c
All checks were successful
Default CI / Check for Open TODOs (pull_request) Successful in 48s
AI PR Review / AI PR Review (pull_request) Successful in 1m10s
Default CI / Pre-Commit Hooks (pull_request) Successful in 1m56s
2026-08-19 12:47:40 +00:00
Compare

πŸ€– AI PR Review

Reviewing changes up to e4fbb34e

πŸ“ Spelling & Grammar

βœ… No spelling or grammar issues found.

πŸ—οΈ Infrastructure Changes
  • Creates STACKIT provider configuration with required versions and beta resources enabled
  • Defines 18 variables for STACKIT project, region, service account, cluster specs, and node configurations
  • Creates STEC management instance and associated kubeconfig/token resources
  • Creates network infrastructure: 1 network, 1 security group, 4 security group rules, and 6 network interfaces (3 CP + 3 worker)
  • Generates Talos image via local-exec script and reads resulting image ID
  • Creates 6 IaaS servers (3 control plane + 3 worker) using the generated Talos image
  • Applies EdgeCluster CRD via local-exec script to configure the Kubernetes cluster
  • Exposes 4 output paths for accessing STEC UI, kubeconfigs, and talosconfig

⚠️ Destructive: The stackit_server resources explicitly warn against cloning VMs due to Talos using disk UUID as EdgeHost identity β€” cloning would break cluster membership.

# Instead of cloning, create new servers with unique names and boot volumes
resource "stackit_server" "cp" {
  count             = var.cp_count
  project_id        = var.stackit_project_id
  name              = "edge-cluster-cp-${count.index}"
  machine_type      = var.cp_machine_type
  availability_zone = var.availability_zone

  boot_volume = {
    size        = var.disk_size_gb
    source_type = "image"
    source_id   = data.external.image_ids.result.image_id
  }

  network_interfaces = [stackit_network_interface.cp[count.index].network_interface_id]
}
πŸ”’ Security Review

βœ… No security issues found.

πŸ“ Example Consistency

βœ… Example follows repository conventions.

πŸ“š Example README

βœ… Example READMEs are complete.

πŸ“š Module Variable & Output Coverage

No relevant changes to review.

πŸ’¬ Commit Messages

βœ… Commit messages are descriptive.


Generated automatically β€” treat as a hint, not a gate.

## πŸ€– AI PR Review > Reviewing changes up to [`e4fbb34e`](https://professional-service.git.onstackit.cloud/professional-service-best-practices/professional-service/commit/e4fbb34e3c7114740217581bd7648d23d85d5d3a) <details> <summary>πŸ“ Spelling & Grammar</summary> βœ… No spelling or grammar issues found. </details> <details> <summary>πŸ—οΈ Infrastructure Changes</summary> - Creates STACKIT provider configuration with required versions and beta resources enabled - Defines 18 variables for STACKIT project, region, service account, cluster specs, and node configurations - Creates STEC management instance and associated kubeconfig/token resources - Creates network infrastructure: 1 network, 1 security group, 4 security group rules, and 6 network interfaces (3 CP + 3 worker) - Generates Talos image via local-exec script and reads resulting image ID - Creates 6 IaaS servers (3 control plane + 3 worker) using the generated Talos image - Applies EdgeCluster CRD via local-exec script to configure the Kubernetes cluster - Exposes 4 output paths for accessing STEC UI, kubeconfigs, and talosconfig ⚠️ Destructive: The `stackit_server` resources explicitly warn against cloning VMs due to Talos using disk UUID as EdgeHost identity β€” cloning would break cluster membership. ```hcl # Instead of cloning, create new servers with unique names and boot volumes resource "stackit_server" "cp" { count = var.cp_count project_id = var.stackit_project_id name = "edge-cluster-cp-${count.index}" machine_type = var.cp_machine_type availability_zone = var.availability_zone boot_volume = { size = var.disk_size_gb source_type = "image" source_id = data.external.image_ids.result.image_id } network_interfaces = [stackit_network_interface.cp[count.index].network_interface_id] } ``` </details> <details> <summary>πŸ”’ Security Review</summary> βœ… No security issues found. </details> <details> <summary>πŸ“ Example Consistency</summary> βœ… Example follows repository conventions. </details> <details> <summary>πŸ“š Example README</summary> βœ… Example READMEs are complete. </details> <details> <summary>πŸ“š Module Variable & Output Coverage</summary> _No relevant changes to review._ </details> <details> <summary>πŸ’¬ Commit Messages</summary> βœ… Commit messages are descriptive. </details> --- _Generated automatically β€” treat as a hint, not a gate._
@ -0,0 +24,4 @@
expiration = 86400
}
// This token can be extracted from the state to access the UI

inconsistent comment style

inconsistent comment style
Author
Owner

fixed

fixed
mauritz.uphoff marked this conversation as resolved
mauritz.uphoff force-pushed example/stec-example from e4fbb34e3c
All checks were successful
Default CI / Check for Open TODOs (pull_request) Successful in 48s
AI PR Review / AI PR Review (pull_request) Successful in 1m10s
Default CI / Pre-Commit Hooks (pull_request) Successful in 1m56s
to 37de8e52f2
All checks were successful
Default CI / Check for Open TODOs (pull_request) Successful in 41s
AI PR Review / AI PR Review (pull_request) Successful in 1m15s
Default CI / Pre-Commit Hooks (pull_request) Successful in 5m33s
2026-08-19 12:57:03 +00:00
Compare

πŸ€– AI PR Review

Reviewing changes up to 37de8e52

πŸ“ Spelling & Grammar

βœ… No spelling or grammar issues found.

πŸ—οΈ Infrastructure Changes
  • Created STACKIT provider configuration with required versions and beta resources enabled
  • Added 10+ variables for configuring STEC instance, network, nodes, and Kubernetes versions
  • Created STEC management instance, kubeconfig, and access token resources
  • Provisioned network with IPv4 prefix, security group, and egress/ingress rules
  • Pre-created network interfaces for control plane and worker nodes
  • Added image provisioning via local-exec script to generate Talos image for IaaS
  • Created control plane and worker servers using generated Talos image
  • Applied EdgeCluster CRD via local-exec script to register nodes and create Kubernetes cluster
  • Added outputs for STEC UI, kubeconfigs, and talosconfig paths

⚠️ Destructive changes: None detected β€” all resources are newly created with no existing state to destroy.

πŸ”’ Security Review

βœ… No security issues found.

πŸ“ Example Consistency

βœ… Example follows repository conventions.

πŸ“š Example README

βœ… Example READMEs are complete.

πŸ“š Module Variable & Output Coverage

No relevant changes to review.

πŸ’¬ Commit Messages

βœ… Commit messages are descriptive.


Generated automatically β€” treat as a hint, not a gate.

## πŸ€– AI PR Review > Reviewing changes up to [`37de8e52`](https://professional-service.git.onstackit.cloud/professional-service-best-practices/professional-service/commit/37de8e52f2a85ef76dd63b5fba635ba501dac5c4) <details> <summary>πŸ“ Spelling & Grammar</summary> βœ… No spelling or grammar issues found. </details> <details> <summary>πŸ—οΈ Infrastructure Changes</summary> - Created STACKIT provider configuration with required versions and beta resources enabled - Added 10+ variables for configuring STEC instance, network, nodes, and Kubernetes versions - Created STEC management instance, kubeconfig, and access token resources - Provisioned network with IPv4 prefix, security group, and egress/ingress rules - Pre-created network interfaces for control plane and worker nodes - Added image provisioning via local-exec script to generate Talos image for IaaS - Created control plane and worker servers using generated Talos image - Applied EdgeCluster CRD via local-exec script to register nodes and create Kubernetes cluster - Added outputs for STEC UI, kubeconfigs, and talosconfig paths ⚠️ Destructive changes: None detected β€” all resources are newly created with no existing state to destroy. </details> <details> <summary>πŸ”’ Security Review</summary> βœ… No security issues found. </details> <details> <summary>πŸ“ Example Consistency</summary> βœ… Example follows repository conventions. </details> <details> <summary>πŸ“š Example README</summary> βœ… Example READMEs are complete. </details> <details> <summary>πŸ“š Module Variable & Output Coverage</summary> _No relevant changes to review._ </details> <details> <summary>πŸ’¬ Commit Messages</summary> βœ… Commit messages are descriptive. </details> --- _Generated automatically β€” treat as a hint, not a gate._
mauritz.uphoff force-pushed example/stec-example from 37de8e52f2
All checks were successful
Default CI / Check for Open TODOs (pull_request) Successful in 41s
AI PR Review / AI PR Review (pull_request) Successful in 1m15s
Default CI / Pre-Commit Hooks (pull_request) Successful in 5m33s
to c5e7ff32a9
All checks were successful
Default CI / Check for Open TODOs (pull_request) Successful in 41s
AI PR Review / AI PR Review (pull_request) Successful in 2m11s
Default CI / Pre-Commit Hooks (pull_request) Successful in 2m26s
2026-08-19 13:37:59 +00:00
Compare

πŸ€– AI PR Review

Reviewing changes up to c5e7ff32

Powered by STACKIT Model Serving Β· STACKIT Cloud Advisor (Cloudment)

πŸ“ Spelling & Grammar

πŸ€– STACKIT Model Serving

βœ… No spelling or grammar issues found.


πŸ” STACKIT Cloud Advisor

STACKIT Product Name & Terminology Review

I have reviewed the prose content within the provided git diff against the official STACKIT branding guidelines and product documentation. The focus was on ensuring that all service names, product terms, and brand identifiers align with the established STACKIT nomenclature.

πŸ” Terminology Audit Results

The following observations were made regarding the use of STACKIT terminology:

  • Brand Consistency: The diff correctly implements the mandatory brand rule: STACKIT must always be written in all caps. The logic added to the _BRAND_NOTE in ai_pr_review.py correctly identifies and protects this casing.
  • Service Name Accuracy:
    • SKE (STACKIT Kubernetes Engine): The term "SKE" is used correctly in the _SCOPE_CHANGES prompt and the CHECKS configuration. This aligns with the official product name STACKIT Kubernetes Engine (SKE).
    • Object Storage: The term "Object Storage" is used correctly in the infrastructure check prompts.
    • PostgreSQL Flex: The term "PostgreSQL Flex" is used correctly.
    • EdgeCloud: The new Terraform examples introduce stackit_edgecloud_instance, stackit_edgecloud_kubeconfig, and stackit_edgecloud_token. While "EdgeCloud" is used as a provider/resource prefix, ensure that in user-facing prose, the specific service name (e.g., STACKIT EdgeCloud) is used to maintain brand consistency.
  • Terminology Alignment:
    • The use of "service account" and "project" in the security review prompts is consistent with STACKIT's IAM and organizational structure.
    • The term "machine type" (Maschinentyp) used in the Terraform variables is consistent with the documentation for STACKIT Server.

πŸ› οΈ Architectural Advisory: Terminology in Automation

When building automated review tools like this PR reviewer, maintaining a strict "Source of Truth" for terminology is critical to prevent the LLM from hallucinating non-existent services.

Terminology Category Implementation Strategy Risk if Mismanaged
Brand Identity Use strict regex/system prompts to enforce STACKIT (all caps). Brand dilution and unprofessional PR comments.
Service Names Hard-code known service names (e.g., SKE, Object Storage) in the system_prompt. LLM may suggest "Kubernetes Service" instead of the specific SKE product.
Resource Mapping Map Terraform resource types (e.g., stackit_edgecloud_...) to human-readable names in the advisor prompt. Confusion between the technical provider name and the commercial product name.

Recommendation for the CHECKS configuration:
In the advisor question for "Infrastructure Changes", you have listed (e.g. SKE, Object Storage, DNS, Load Balancer, PostgreSQL Flex, etc.). To improve the accuracy of the STACKIT Cloud Advisor backend, I recommend explicitly adding EdgeCloud to this list, as the current diff introduces significant changes to that specific service area.

πŸ—οΈ Infrastructure Changes

πŸ€– STACKIT Model Serving

  • Added new Terraform example iaas-edge-k8s-cluster with provider, variable, and resource definitions for STACKIT Edge Cloud.
  • Introduced new Python script ai_pr_review.py integrating STACKIT Model Serving and STACKIT Cloud Advisor for parallel PR reviews.
  • Added CLOUDMENT_TOKEN secret to GitHub Actions workflow for STACKIT Cloud Advisor integration.
  • Created new Terraform files for Edge Cloud instance, kubeconfig, and token resources with variable-driven configuration.
  • Added new Terraform resources for Kubernetes cluster, node pools, and network configuration under the new example.
  • Added new Terraform output for kubeconfig and cluster endpoint URL.
  • Added new Terraform local values for common labels and cluster name generation.
  • Added new Terraform data sources for STACKIT project and region information.
  • Added new Terraform variable validations for disk size and machine types.
  • Added new Terraform resource for STACKIT Edge Cloud cluster with Talos and Kubernetes version configuration.

πŸ” STACKIT Cloud Advisor

1. STACKIT Services Identification

Based on the provided git diff, the following STACKIT services and resources are being provisioned or configured:

  • STACKIT Edge Cloud (STEC): The primary service being introduced via a new example directory iaas-edge-k8s-cluster.
    • stackit_edgecloud_instance: Provisioning the Edge Management Plane (EMP) Using The Api Using The Api.
    • stackit_edgecloud_kubeconfig: Generating credentials to interact with the Kubernetes API of the instance Using The Api.
    • stackit_edgecloud_token: Provisioning access tokens for the instance Using The Api.
  • Terraform Provider: The stackit provider is being initialized with enable_beta_resources = true, which is required for managing Edge Cloud products in their current state Faq.

2. STACKIT Best Practices & Observations

As a senior architect, I have identified the following regarding the implementation of this new example:

  • Beta Resource Flag: The provider configuration correctly sets enable_beta_resources = true. This is a requirement for using the STACKIT Terraform Provider to manage Edge Cloud resources Faq.
  • Disk Size Recommendation: The variable disk_size_gb includes a validation rule ensuring a minimum of 32 GiB. This aligns with STACKIT's technical requirements, as Talos Linux requires at least 32 GiB to function, though 100 GiB is the recommended size by STACKIT for optimal operation Faq Faq.
  • Naming Conventions: The example follows the repository's internal convention of using 3-digit numeric prefixes for Terraform files (e.g., 010-provider.tf, 020-variables.tf, 030-edge-instance.tf) [diff].
  • License Headers: The new files correctly include the Apache 2.0 license header, maintaining consistency with the repository's legal standards [diff].

3. Quotas, Constraints, and Limitations

The following technical constraints must be considered when deploying this infrastructure:

Constraint Type Detail Impact/Requirement
Service Quota 1,000 EdgeCluster objects A single STEC instance is sized and tested for up to 1,000 accumulated EdgeCluster objects. Exceeding this may lead to an unsupported state Faq Faq.
Resource Lifecycle No VM/Disk Cloning Cloning VMs or disks is not supported. Because nodes are identified by a UUID derived from hardware/VM identity, cloning breaks the registration with the control plane and cluster membership Faq Faq.
Network Requirement Egress Port 443 Every edge host must be able to establish an outgoing network connection to stackit.cloud via TCP port 443 Faq Faq.
Registry Access Public Repositories Talos Linux requires internet access to download installers and images from gcr.io, ghcr.io, and registry.k8s.io Faq Faq.
Management Plane Orphaned Clusters If the stackit_edgecloud_instance is deleted, all managed edge clusters will become orphans and cannot be re-added to STACKIT management without a full re-deployment Ordering An Instance.

Architectural Note on Talos/Kubernetes:
The diff specifies a talos_version and kubernetes_version. Ensure that the selected Talos version is compatible with the required container registries, as the list of required registries can change depending on the Talos version used Faq Faq.

πŸ”’ Security Review

πŸ€– STACKIT Model Serving

βœ… No security issues found.


πŸ” STACKIT Cloud Advisor

1. STACKIT IAM or Authorization Misconfigurations

  • 🟑 Medium: Service Account Key Management
    The Terraform provider configuration in 010-provider.tf uses service_account_key_path = var.stackit_service_account_key_path. While using a path variable is better than hard-coding the JSON content, the security of the entire infrastructure depends on the protection of this file on the machine running Terraform. Ensure this key is managed via a secure secret management system and not stored in plain text on local developer machines or CI runners. Service Accounts

2. Missing STACKIT-Specific Security Controls

  • πŸ”΄ High: Overly Permissive Security Group Rules
    In 040-network.tf, the security group rules for both ingress and egress (TCP and UDP) are defined without specifying any port ranges or source/destination IP ranges.

    resource "stackit_security_group_rule" "ingress_tcp" {
      ...
      direction = "ingress"
      protocol  = { name = "tcp" }
    }
    

    By default, if no ports or CIDRs are specified in the provider/resource (depending on the specific provider implementation of the STACKIT API), this risks opening all ports. Even if the provider defaults to "all," this violates the Principle of Least Privilege Introduction Security In Networks Security In Networks.

  • 🟑 Medium: Lack of Network Segmentation
    The current design uses a single stackit_security_group for both Control Plane (CP) and Worker nodes.

    • Recommendation: Follow the "Organize by function" best practice Introduction Security In Networks. Create separate Security Groups for the Control Plane and the Workers. This allows you to restrict worker-to-worker communication or limit management access strictly to the CP nodes.
  • 🟑 Medium: Absence of Private Endpoints/Internal Routing
    The architecture relies on outbound internet access for STEC registration and image pulls. While necessary for the initial setup, for a production-hardened environment, you should evaluate if these components can communicate via private endpoints or internal STACKIT services to minimize exposure to the public internet Security In Networks Security In Networks.

Proposed Network Topology Improvement:

[ Internet / Management ]
          |
    [ STACKIT Network ]
    /                \
[ SG: Control Plane ] [ SG: Workers ]
| - Port 22 (Strict) | | - Port 443 (Out) |
| - Port 6443 (Int)  | | - Port 22 (Deny) |

3. Secrets, Credentials, or Sensitive Values

  • 🟒 Low: Kubeconfig and Token Exposure
    The PR uses local_sensitive_file to write the .stec.kubeconfig.json to the local filesystem [030-edge-instance.tf]. While the file permission is set to 0600, this file contains highly sensitive credentials.
    • Risk: If the Terraform state or the local directory is not properly secured, these credentials could be leaked.
    • Recommendation: Ensure the .stec.kubeconfig.json and the .generated/ directory are added to .gitignore to prevent accidental commits of sensitive cluster access files.

4. STACKIT Compliance and Audit-Logging Considerations

  • 🟑 Medium: Audit Trail for Infrastructure Changes
    The use of Terraform (Infrastructure as Code) is a positive security control as it provides versioning and traceability Security In Networks Security In Networks. However, ensure that the execution of these Terraform plans (especially the local-exec scripts that interact with the STEC API) is performed within a controlled environment where the logs of the actions taken (not just the code changes) are captured and stored for audit purposes.
  • 🟑 Medium: STEC Management Plane Access
    The stackit_edgecloud_token resource generates a token for UI access. Access to the STEC management plane should be audited via STACKIT IAM logs to ensure that only authorized users are interacting with the edge cluster management layer.

4. STACKIT Compliance and Audit-Logging Considerations

As a senior architect, I recommend focusing on the visibility of administrative actions and the lifecycle of the credentials being provisioned. While the infrastructure is defined as code, the actual "runtime" actions performed by the scripts and the management plane must be traceable.

  • 🟑 Medium: Auditability of the STEC Management Plane
    The PR introduces several resources that interact with the STACKIT Edge Cloud (STEC) management plane, specifically the stackit_edgecloud_token and stackit_edgecloud_kubeconfig.

    • Risk: The kubeconfig contains a permanent, secret access token that cannot be revoked Authentication. If this token is used by automated processes (like the local-exec scripts in 050-images.tf and 070-edge-cluster.tf), those actions will appear in the STACKIT Audit Log as being performed by the service account or user associated with that token.
    • Recommendation: Ensure that the identity used to run these Terraform plans has a clear, traceable name in STACKIT IAM. Since the STACKIT Audit Log records the Initiator (who started the action) and the Event Name Audit Log, you should be able to distinguish between manual administrative changes and automated infrastructure deployments.
  • 🟑 Medium: Centralized Log Management for Edge Clusters
    The current deployment focuses on the compute and networking layers but does not explicitly provision a centralized logging solution for the workloads running within the Talos Linux nodes.

    • Architectural Gap: While STACKIT provides managed services, the customer is responsible for monitoring the system for "abnormal behavior" within the Edge Clusters Shared Responsibility.
    • Recommendation: Consider integrating a managed logging service to aggregate logs from the Edge Cluster. For example, the LogMe service provides a managed OpenSearch-based environment that can be used to ingest and visualize logs Concepts of Logme.

Logging Strategy Comparison:

Option Fit Trade-off
STACKIT Audit Log High (Platform level) Records administrative changes (e.g., creating the cluster) but not the internal application logs of the Kubernetes workloads.
LogMe (Managed) High (Workload level) Provides a managed OpenSearch/Dashboards environment [Concepts of Logme] for cluster/workload logs, but requires configuration of log exporters from the Edge Cluster.
Self-Managed ELK/Loki Low High operational overhead; contradicts the goal of using managed STACKIT services.

Recommended Observability Flow:

[ Edge Cluster Workloads ] 
          |
    (Log Export)
          |
[ LogMe Service (OpenSearch) ] <--- [ Admin/Dev Access ]
          |
[ STACKIT Audit Log ] <----------- [ Security/Compliance Audit ]
(Tracks: "Who changed the SG?")
  • 🟒 Low: Log Retention and Compliance
    The STACKIT Audit Log provides a history of events for the last 90 days via the STACKIT Portal [Audit Log]. If your compliance requirements (e.g., GDPR or industry-specific regulations) require longer retention, you should implement a strategy to export these logs.
    • Recommendation: Use the Telemetry Router to route audit logs to an external, long-term storage destination (such as an S3-compatible bucket) to ensure a permanent audit trail beyond the 90-day window Retrieve Audit Log.
πŸ“ Example Consistency

πŸ€– STACKIT Model Serving

βœ… Example follows repository conventions.


πŸ” STACKIT Cloud Advisor

Repository Convention Review

The provided git diff has been reviewed against the established repository standards and STACKIT-specific provider requirements. While the example demonstrates a high level of technical sophisticationβ€”particularly in bridging the gap between IaaS and the STEC Kubernetes API via local-execβ€”there are several deviations from the required conventions.

❌ Deviations from Repository Conventions

1. Missing Documentation Files
The example directory examples/iaas-edge-k8s-cluster/ contains a README.md, but it is missing the mandatory MAINTAINERS.md file.

Fix:

touch examples/iaas-edge-k8s-cluster/MAINTAINERS.md

2. Provider Version Constraints
The convention requires all providers in required_providers blocks to have an explicit version constraint. In 010-provider.tf, the stackit provider uses a pessimistic constraint (>= 0.107.0), which is acceptable for general use but deviates from the strict "explicit version" requirement often used in stable examples to ensure reproducibility. More importantly, the local and null providers are defined, but the external provider (used in 050-images.tf) is missing from the required_providers block in 010-provider.tf.

Fix:

# examples/iaas-edge-k8s-cluster/010-provider.tf

terraform {
  required_providers {
    stackit = {
      source  = "stackitcloud/stackit"
      version = "0.110.0" # Use explicit version
    }
    local = {
      source  = "hashicorp/local"
      version = "2.9.0"
    }
    null = {
      source  = "hashicorp/null"
      version = "3.3.0"
    }
    external = {
      source  = "hashicorp/external"
      version = "2.4.0"
    }
  }
}

πŸ” STACKIT-Specific Observations

Beta Resource Configuration
The implementation correctly identifies that the Edge Cloud resources (managed via the STEC API) are not natively part of the standard STACKIT Terraform provider resource set. The architect has correctly implemented the enable_beta_resources = true flag in the stackit provider block, which is required to interact with experimental or preview features Stackit Terraform Provider.

Authentication Pattern
The example uses the Key Flow via service_account_key_path Docs. While this is a valid and common method for local development and specific CI/CD pipelines, for production workloads (especially in GitHub Actions or GitLab CI), I recommend transitioning to the Workload Identity Federation (WIF) flow to eliminate the need for long-lived static JSON keys Docs.

Architecture Summary
The example uses a "Bridge Pattern" to manage the lifecycle of the Edge Cluster:

[ Terraform ] 
      |
      |-- (1) Manages IaaS: Network, Security Groups, Servers
      |-- (2) Triggers local-exec scripts
               |
               |--> [ STACKIT CLI ] --> (3) Manages STEC CRDs (EdgeImage, EdgeCluster)
               |--> [ kubectl ]    --> (4) Manages K8s resources inside the cluster
Component Management Method Note
IaaS Resources stackit Provider Standard lifecycle management.
EdgeImage / Cluster local-exec + stackit CLI Required because these are STEC CRDs.
Talos/K8s Config local-exec + kubectl Post-provisioning configuration.
πŸ“š Example README

πŸ€– STACKIT Model Serving

βœ… Example READMEs are complete.


πŸ” STACKIT Cloud Advisor

Review of iaas-edge-k8s-cluster Example

I have reviewed the provided git diff for the new example located in examples/iaas-edge-k8s-cluster/. Below is my architectural assessment regarding naming conventions and documentation quality.

1. Naming Convention Analysis

The directory name iaas-edge-k8s-cluster is evaluated against the requirement for clarity and accuracy:

  • Service Accuracy: The name correctly identifies the core components: IaaS (Compute Engine/Network), Edge (STEC - STACKIT Edge Cloud), and K8s (Kubernetes/Talos).
  • Use-case Clarity: It explicitly describes the deployment of a Kubernetes cluster leveraging Edge Cloud capabilities on top of standard IaaS infrastructure.
  • Consistency: The name follows the established pattern of combining the service/layer with the specific use-case.

Verdict: The naming is clear, accurate, and descriptive. No flags raised.

2. README Quality Assessment

The README.md was analyzed for technical completeness and usability:

  • Service Identification: The README clearly states that it deploys a STACKIT Edge Cloud (STEC) management plane and a Talos Linux Kubernetes cluster using STACKIT Compute Engine VMs.
  • Demonstration Scope: It provides a high-level architectural overview using an ASCII diagram, which is excellent for understanding the relationship between the STEC management plane and the IaaS-based nodes.
  • Usage Instructions:
    • Initialization: Includes terraform init and terraform apply.
    • Configuration: Provides a clear table for required variables and instructions on how to obtain them (e.g., via the stackit CLI).
    • Verification: Includes specific kubectl commands to verify the cluster state.
    • Lifecycle Management: Includes explicit instructions for Cleanup, specifically warning to delete the EdgeCluster via the STEC API before running terraform destroy to prevent orphaned resources.
  • Technical Depth: It includes critical "Notes" regarding Talos configuration (no SSH/cloud-init) and the importance of not cloning VMs due to disk UUID-based identity.

Verdict: The README is high quality, comprehensive, and follows best practices.


Summary Table

Criteria Status Architect's Notes
Naming βœ… Pass Accurately reflects the hybrid IaaS/Edge nature of the example.
README Quality βœ… Pass Excellent documentation of the complex interaction between STEC CRDs and IaaS resources.

βœ… Example READMEs are complete.

πŸ“š Module Variable & Output Coverage

πŸ€– STACKIT Model Serving

No relevant changes to review.


πŸ” STACKIT Cloud Advisor

No relevant changes to review.

πŸ’¬ Commit Messages

πŸ€– STACKIT Model Serving

βœ… Commit messages are descriptive.


πŸ” STACKIT Cloud Advisor

Based on the criteria provided, I have reviewed the commit message from the pull request.

Commit Message Evaluation

The provided commit message is:
example(edge): basic example on how to deploy edge

Status Message Analysis Suggested Alternative
βœ… Pass example(edge): basic example on how to deploy edge This message is sufficiently descriptive. It follows a structured format, identifies the scope/component (edge), and clearly explains the intent (providing a deployment example). N/A

Architect's Summary

All messages provided in the snippet meet the required standard for professional services repositories. They avoid the "vague" pitfalls (such as fix, update, or wip) and provide enough context for a reviewer to understand the impact of the change without immediately inspecting the diff.

Final Verdict:
βœ… Commit messages are descriptive.


Generated automatically β€” treat as a hint, not a gate.

## πŸ€– AI PR Review > Reviewing changes up to [`c5e7ff32`](https://professional-service.git.onstackit.cloud/professional-service-best-practices/professional-service/commit/c5e7ff32a91afd8e92a11ff61fa5f37e3bc3ffae) > _Powered by STACKIT Model Serving Β· STACKIT Cloud Advisor (Cloudment)_ <details> <summary>πŸ“ Spelling & Grammar</summary> **πŸ€– STACKIT Model Serving** βœ… No spelling or grammar issues found. --- **πŸ” STACKIT Cloud Advisor** ## STACKIT Product Name & Terminology Review I have reviewed the prose content within the provided git diff against the official STACKIT branding guidelines and product documentation. The focus was on ensuring that all service names, product terms, and brand identifiers align with the established STACKIT nomenclature. ### πŸ” Terminology Audit Results The following observations were made regarding the use of STACKIT terminology: * **Brand Consistency**: The diff correctly implements the mandatory brand rule: **STACKIT** must always be written in all caps. The logic added to the `_BRAND_NOTE` in `ai_pr_review.py` correctly identifies and protects this casing. * **Service Name Accuracy**: * **SKE (STACKIT Kubernetes Engine)**: The term "SKE" is used correctly in the `_SCOPE_CHANGES` prompt and the `CHECKS` configuration. This aligns with the official product name [STACKIT Kubernetes Engine (SKE)](https://stackit.com/de/warum-stackit/vorteile/zertifikate). * **Object Storage**: The term "Object Storage" is used correctly in the infrastructure check prompts. * **PostgreSQL Flex**: The term "PostgreSQL Flex" is used correctly. * **EdgeCloud**: The new Terraform examples introduce `stackit_edgecloud_instance`, `stackit_edgecloud_kubeconfig`, and `stackit_edgecloud_token`. While "EdgeCloud" is used as a provider/resource prefix, ensure that in user-facing prose, the specific service name (e.g., **STACKIT EdgeCloud**) is used to maintain brand consistency. * **Terminology Alignment**: * The use of **"service account"** and **"project"** in the security review prompts is consistent with STACKIT's IAM and organizational structure. * The term **"machine type"** (Maschinentyp) used in the Terraform variables is consistent with the documentation for [STACKIT Server](https://docs.stackit.cloud/de/products/compute-engine/server/basics/machine-types/). ### πŸ› οΈ Architectural Advisory: Terminology in Automation When building automated review tools like this PR reviewer, maintaining a strict "Source of Truth" for terminology is critical to prevent the LLM from hallucinating non-existent services. | Terminology Category | Implementation Strategy | Risk if Mismanaged | | :--- | :--- | :--- | | **Brand Identity** | Use strict regex/system prompts to enforce **STACKIT** (all caps). | Brand dilution and unprofessional PR comments. | | **Service Names** | Hard-code known service names (e.g., **SKE**, **Object Storage**) in the `system_prompt`. | LLM may suggest "Kubernetes Service" instead of the specific **SKE** product. | | **Resource Mapping** | Map Terraform resource types (e.g., `stackit_edgecloud_...`) to human-readable names in the `advisor` prompt. | Confusion between the technical provider name and the commercial product name. | **Recommendation for the `CHECKS` configuration:** In the `advisor` question for "Infrastructure Changes", you have listed `(e.g. SKE, Object Storage, DNS, Load Balancer, PostgreSQL Flex, etc.)`. To improve the accuracy of the **STACKIT Cloud Advisor** backend, I recommend explicitly adding **EdgeCloud** to this list, as the current diff introduces significant changes to that specific service area. </details> <details> <summary>πŸ—οΈ Infrastructure Changes</summary> **πŸ€– STACKIT Model Serving** - Added new Terraform example `iaas-edge-k8s-cluster` with provider, variable, and resource definitions for STACKIT Edge Cloud. - Introduced new Python script `ai_pr_review.py` integrating STACKIT Model Serving and STACKIT Cloud Advisor for parallel PR reviews. - Added `CLOUDMENT_TOKEN` secret to GitHub Actions workflow for STACKIT Cloud Advisor integration. - Created new Terraform files for Edge Cloud instance, kubeconfig, and token resources with variable-driven configuration. - Added new Terraform resources for Kubernetes cluster, node pools, and network configuration under the new example. - Added new Terraform output for kubeconfig and cluster endpoint URL. - Added new Terraform local values for common labels and cluster name generation. - Added new Terraform data sources for STACKIT project and region information. - Added new Terraform variable validations for disk size and machine types. - Added new Terraform resource for STACKIT Edge Cloud cluster with Talos and Kubernetes version configuration. --- **πŸ” STACKIT Cloud Advisor** ### 1. STACKIT Services Identification Based on the provided git diff, the following STACKIT services and resources are being provisioned or configured: * **STACKIT Edge Cloud (STEC):** The primary service being introduced via a new example directory `iaas-edge-k8s-cluster`. * **`stackit_edgecloud_instance`**: Provisioning the Edge Management Plane (EMP) [Using The Api](https://docs.stackit.cloud/de/products/runtime/edge-cloud/tutorials/using-the-api/) [Using The Api](https://docs.stackit.cloud/products/runtime/edge-cloud/tutorials/using-the-api/). * **`stackit_edgecloud_kubeconfig`**: Generating credentials to interact with the Kubernetes API of the instance [Using The Api](https://docs.stackit.cloud/de/products/runtime/edge-cloud/tutorials/using-the-api/). * **`stackit_edgecloud_token`**: Provisioning access tokens for the instance [Using The Api](https://docs.stackit.cloud/de/products/runtime/edge-cloud/tutorials/using-the-api/). * **Terraform Provider:** The `stackit` provider is being initialized with `enable_beta_resources = true`, which is required for managing Edge Cloud products in their current state [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). ### 2. STACKIT Best Practices & Observations As a senior architect, I have identified the following regarding the implementation of this new example: * **Beta Resource Flag:** The provider configuration correctly sets `enable_beta_resources = true`. This is a requirement for using the STACKIT Terraform Provider to manage Edge Cloud resources [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). * **Disk Size Recommendation:** The variable `disk_size_gb` includes a validation rule ensuring a minimum of 32 GiB. This aligns with STACKIT's technical requirements, as Talos Linux requires at least 32 GiB to function, though **100 GiB is the recommended size** by STACKIT for optimal operation [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). * **Naming Conventions:** The example follows the repository's internal convention of using 3-digit numeric prefixes for Terraform files (e.g., `010-provider.tf`, `020-variables.tf`, `030-edge-instance.tf`) [diff]. * **License Headers:** The new files correctly include the Apache 2.0 license header, maintaining consistency with the repository's legal standards [diff]. ### 3. Quotas, Constraints, and Limitations The following technical constraints must be considered when deploying this infrastructure: | Constraint Type | Detail | Impact/Requirement | | :--- | :--- | :--- | | **Service Quota** | **1,000 EdgeCluster objects** | A single STEC instance is sized and tested for up to 1,000 accumulated EdgeCluster objects. Exceeding this may lead to an unsupported state [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). | | **Resource Lifecycle** | **No VM/Disk Cloning** | Cloning VMs or disks is **not supported**. Because nodes are identified by a UUID derived from hardware/VM identity, cloning breaks the registration with the control plane and cluster membership [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). | | **Network Requirement** | **Egress Port 443** | Every edge host must be able to establish an outgoing network connection to `stackit.cloud` via **TCP port 443** [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). | | **Registry Access** | **Public Repositories** | Talos Linux requires internet access to download installers and images from `gcr.io`, `ghcr.io`, and `registry.k8s.io` [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). | | **Management Plane** | **Orphaned Clusters** | If the `stackit_edgecloud_instance` is deleted, all managed edge clusters will become orphans and cannot be re-added to STACKIT management without a full re-deployment [Ordering An Instance](https://docs.stackit.cloud/products/runtime/edge-cloud/getting-started/ordering-an-instance/). | **Architectural Note on Talos/Kubernetes:** The diff specifies a `talos_version` and `kubernetes_version`. Ensure that the selected Talos version is compatible with the required container registries, as the list of required registries can change depending on the Talos version used [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). </details> <details> <summary>πŸ”’ Security Review</summary> **πŸ€– STACKIT Model Serving** βœ… No security issues found. --- **πŸ” STACKIT Cloud Advisor** ### 1. STACKIT IAM or Authorization Misconfigurations * **🟑 Medium: Service Account Key Management** The Terraform provider configuration in `010-provider.tf` uses `service_account_key_path = var.stackit_service_account_key_path`. While using a path variable is better than hard-coding the JSON content, the security of the entire infrastructure depends on the protection of this file on the machine running Terraform. Ensure this key is managed via a secure secret management system and not stored in plain text on local developer machines or CI runners. [Service Accounts](https://docs.stackit.cloud/platform/access-and-identity/service-accounts/) ### 2. Missing STACKIT-Specific Security Controls * **πŸ”΄ High: Overly Permissive Security Group Rules** In `040-network.tf`, the security group rules for both `ingress` and `egress` (TCP and UDP) are defined without specifying any port ranges or source/destination IP ranges. ```hcl resource "stackit_security_group_rule" "ingress_tcp" { ... direction = "ingress" protocol = { name = "tcp" } } ``` By default, if no ports or CIDRs are specified in the provider/resource (depending on the specific provider implementation of the STACKIT API), this risks opening all ports. Even if the provider defaults to "all," this violates the **Principle of Least Privilege** [Introduction](https://docs.stackit.cloud/products/network/core-networking/security-groups/basics/introduction/) [Security In Networks](https://docs.stackit.cloud/de/products/security/security-hardening/security-in-networks/) [Security In Networks](https://docs.stackit.cloud/products/security/security-hardening/security-in-networks/). * **Recommendation:** Explicitly define `port_range` (e.g., only allow 443 for STEC registration) and restrict `source_ip_range` to known management IPs or internal network ranges rather than allowing "Any Source" [Introduction](https://docs.stackit.cloud/products/network/core-networking/security-groups/basics/introduction/) [Security In Networks](https://docs.stackit.cloud/de/products/security/security-hardening/security-in-networks/) [Security In Networks](https://docs.stackit.cloud/products/security/security-hardening/security-in-networks/) [Create And Manage Security Groups And Rules](https://docs.stackit.cloud/products/network/core-networking/security-groups/how-tos/create-and-manage-security-groups-and-rules/). * **🟑 Medium: Lack of Network Segmentation** The current design uses a single `stackit_security_group` for both Control Plane (CP) and Worker nodes. * **Recommendation:** Follow the "Organize by function" best practice [Introduction](https://docs.stackit.cloud/products/network/core-networking/security-groups/basics/introduction/) [Security In Networks](https://docs.stackit.cloud/products/security/security-hardening/security-in-networks/). Create separate Security Groups for the Control Plane and the Workers. This allows you to restrict worker-to-worker communication or limit management access strictly to the CP nodes. * **🟑 Medium: Absence of Private Endpoints/Internal Routing** The architecture relies on outbound internet access for STEC registration and image pulls. While necessary for the initial setup, for a production-hardened environment, you should evaluate if these components can communicate via private endpoints or internal STACKIT services to minimize exposure to the public internet [Security In Networks](https://docs.stackit.cloud/de/products/security/security-hardening/security-in-networks/) [Security In Networks](https://docs.stackit.cloud/products/security/security-hardening/security-in-networks/). **Proposed Network Topology Improvement:** ```text [ Internet / Management ] | [ STACKIT Network ] / \ [ SG: Control Plane ] [ SG: Workers ] | - Port 22 (Strict) | | - Port 443 (Out) | | - Port 6443 (Int) | | - Port 22 (Deny) | ``` ### 3. Secrets, Credentials, or Sensitive Values * **🟒 Low: Kubeconfig and Token Exposure** The PR uses `local_sensitive_file` to write the `.stec.kubeconfig.json` to the local filesystem [030-edge-instance.tf]. While the file permission is set to `0600`, this file contains highly sensitive credentials. * **Risk:** If the Terraform state or the local directory is not properly secured, these credentials could be leaked. * **Recommendation:** Ensure the `.stec.kubeconfig.json` and the `.generated/` directory are added to `.gitignore` to prevent accidental commits of sensitive cluster access files. ### 4. STACKIT Compliance and Audit-Logging Considerations * **🟑 Medium: Audit Trail for Infrastructure Changes** The use of Terraform (Infrastructure as Code) is a positive security control as it provides versioning and traceability [Security In Networks](https://docs.stackit.cloud/de/products/security/security-hardening/security-in-networks/) [Security In Networks](https://docs.stackit.cloud/products/security/security-hardening/security-in-networks/). However, ensure that the execution of these Terraform plans (especially the `local-exec` scripts that interact with the STEC API) is performed within a controlled environment where the logs of the *actions taken* (not just the code changes) are captured and stored for audit purposes. * **🟑 Medium: STEC Management Plane Access** The `stackit_edgecloud_token` resource generates a token for UI access. Access to the STEC management plane should be audited via STACKIT IAM logs to ensure that only authorized users are interacting with the edge cluster management layer. ### 4. STACKIT Compliance and Audit-Logging Considerations As a senior architect, I recommend focusing on the visibility of administrative actions and the lifecycle of the credentials being provisioned. While the infrastructure is defined as code, the actual "runtime" actions performed by the scripts and the management plane must be traceable. * **🟑 Medium: Auditability of the STEC Management Plane** The PR introduces several resources that interact with the **STACKIT Edge Cloud (STEC)** management plane, specifically the `stackit_edgecloud_token` and `stackit_edgecloud_kubeconfig`. * **Risk:** The `kubeconfig` contains a permanent, secret access token that cannot be revoked [Authentication](https://docs.stackit.cloud/products/runtime/edge-cloud/getting-started/authentication/). If this token is used by automated processes (like the `local-exec` scripts in `050-images.tf` and `070-edge-cluster.tf`), those actions will appear in the **STACKIT Audit Log** as being performed by the service account or user associated with that token. * **Recommendation:** Ensure that the identity used to run these Terraform plans has a clear, traceable name in **STACKIT IAM**. Since the **STACKIT Audit Log** records the **Initiator** (who started the action) and the **Event Name** [Audit Log](https://docs.stackit.cloud/platform/audit-log/), you should be able to distinguish between manual administrative changes and automated infrastructure deployments. * **🟑 Medium: Centralized Log Management for Edge Clusters** The current deployment focuses on the compute and networking layers but does not explicitly provision a centralized logging solution for the workloads running within the Talos Linux nodes. * **Architectural Gap:** While STACKIT provides managed services, the customer is responsible for monitoring the system for "abnormal behavior" within the Edge Clusters [Shared Responsibility](https://docs.stackit.cloud/de/products/runtime/edge-cloud/basics/shared-responsibility/). * **Recommendation:** Consider integrating a managed logging service to aggregate logs from the Edge Cluster. For example, the **LogMe** service provides a managed OpenSearch-based environment that can be used to ingest and visualize logs [Concepts of Logme](https://docs.stackit.cloud/de/products/logging-and-monitoring/logme/basics/concepts-of-logme/). **Logging Strategy Comparison:** | Option | Fit | Trade-off | | :--- | :--- | :--- | | **STACKIT Audit Log** | **High** (Platform level) | Records *administrative* changes (e.g., creating the cluster) but not the *internal* application logs of the Kubernetes workloads. | | **LogMe (Managed)** | **High** (Workload level) | Provides a managed OpenSearch/Dashboards environment [Concepts of Logme] for cluster/workload logs, but requires configuration of log exporters from the Edge Cluster. | | **Self-Managed ELK/Loki** | **Low** | High operational overhead; contradicts the goal of using managed STACKIT services. | **Recommended Observability Flow:** ```text [ Edge Cluster Workloads ] | (Log Export) | [ LogMe Service (OpenSearch) ] <--- [ Admin/Dev Access ] | [ STACKIT Audit Log ] <----------- [ Security/Compliance Audit ] (Tracks: "Who changed the SG?") ``` * **🟒 Low: Log Retention and Compliance** The **STACKIT Audit Log** provides a history of events for the last **90 days** via the STACKIT Portal [Audit Log]. If your compliance requirements (e.g., GDPR or industry-specific regulations) require longer retention, you should implement a strategy to export these logs. * **Recommendation:** Use the **Telemetry Router** to route audit logs to an external, long-term storage destination (such as an S3-compatible bucket) to ensure a permanent audit trail beyond the 90-day window [Retrieve Audit Log](https://docs.stackit.cloud/platform/audit-log/retrieve-audit-log/). </details> <details> <summary>πŸ“ Example Consistency</summary> **πŸ€– STACKIT Model Serving** βœ… Example follows repository conventions. --- **πŸ” STACKIT Cloud Advisor** ### Repository Convention Review The provided git diff has been reviewed against the established repository standards and STACKIT-specific provider requirements. While the example demonstrates a high level of technical sophisticationβ€”particularly in bridging the gap between IaaS and the STEC Kubernetes API via `local-exec`β€”there are several deviations from the required conventions. #### ❌ Deviations from Repository Conventions **1. Missing Documentation Files** The example directory `examples/iaas-edge-k8s-cluster/` contains a `README.md`, but it is missing the mandatory `MAINTAINERS.md` file. **Fix:** ```bash touch examples/iaas-edge-k8s-cluster/MAINTAINERS.md ``` **2. Provider Version Constraints** The convention requires all providers in `required_providers` blocks to have an **explicit version constraint**. In `010-provider.tf`, the `stackit` provider uses a pessimistic constraint (`>= 0.107.0`), which is acceptable for general use but deviates from the strict "explicit version" requirement often used in stable examples to ensure reproducibility. More importantly, the `local` and `null` providers are defined, but the `external` provider (used in `050-images.tf`) is missing from the `required_providers` block in `010-provider.tf`. **Fix:** ```hcl # examples/iaas-edge-k8s-cluster/010-provider.tf terraform { required_providers { stackit = { source = "stackitcloud/stackit" version = "0.110.0" # Use explicit version } local = { source = "hashicorp/local" version = "2.9.0" } null = { source = "hashicorp/null" version = "3.3.0" } external = { source = "hashicorp/external" version = "2.4.0" } } } ``` #### πŸ” STACKIT-Specific Observations **Beta Resource Configuration** The implementation correctly identifies that the Edge Cloud resources (managed via the STEC API) are not natively part of the standard STACKIT Terraform provider resource set. The architect has correctly implemented the `enable_beta_resources = true` flag in the `stackit` provider block, which is required to interact with experimental or preview features [Stackit Terraform Provider](https://docs.stackit.cloud/developer-tools/stackit-iac/stackit-terraform-provider/). **Authentication Pattern** The example uses the **Key Flow** via `service_account_key_path` [Docs](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs). While this is a valid and common method for local development and specific CI/CD pipelines, for production workloads (especially in GitHub Actions or GitLab CI), I recommend transitioning to the **Workload Identity Federation (WIF)** flow to eliminate the need for long-lived static JSON keys [Docs](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs). **Architecture Summary** The example uses a "Bridge Pattern" to manage the lifecycle of the Edge Cluster: ```ascii [ Terraform ] | |-- (1) Manages IaaS: Network, Security Groups, Servers |-- (2) Triggers local-exec scripts | |--> [ STACKIT CLI ] --> (3) Manages STEC CRDs (EdgeImage, EdgeCluster) |--> [ kubectl ] --> (4) Manages K8s resources inside the cluster ``` | Component | Management Method | Note | | :--- | :--- | :--- | | **IaaS Resources** | `stackit` Provider | Standard lifecycle management. | | **EdgeImage / Cluster** | `local-exec` + `stackit` CLI | Required because these are STEC CRDs. | | **Talos/K8s Config** | `local-exec` + `kubectl` | Post-provisioning configuration. | </details> <details> <summary>πŸ“š Example README</summary> **πŸ€– STACKIT Model Serving** βœ… Example READMEs are complete. --- **πŸ” STACKIT Cloud Advisor** ### Review of `iaas-edge-k8s-cluster` Example I have reviewed the provided git diff for the new example located in `examples/iaas-edge-k8s-cluster/`. Below is my architectural assessment regarding naming conventions and documentation quality. #### 1. Naming Convention Analysis The directory name `iaas-edge-k8s-cluster` is evaluated against the requirement for clarity and accuracy: * **Service Accuracy**: The name correctly identifies the core components: **IaaS** (Compute Engine/Network), **Edge** (STEC - STACKIT Edge Cloud), and **K8s** (Kubernetes/Talos). * **Use-case Clarity**: It explicitly describes the deployment of a Kubernetes cluster leveraging Edge Cloud capabilities on top of standard IaaS infrastructure. * **Consistency**: The name follows the established pattern of combining the service/layer with the specific use-case. **Verdict**: The naming is **clear, accurate, and descriptive**. No flags raised. #### 2. README Quality Assessment The `README.md` was analyzed for technical completeness and usability: * **Service Identification**: The README clearly states that it deploys a **STACKIT Edge Cloud (STEC)** management plane and a **Talos Linux Kubernetes cluster** using **STACKIT Compute Engine** VMs. * **Demonstration Scope**: It provides a high-level architectural overview using an ASCII diagram, which is excellent for understanding the relationship between the STEC management plane and the IaaS-based nodes. * **Usage Instructions**: * **Initialization**: Includes `terraform init` and `terraform apply`. * **Configuration**: Provides a clear table for required variables and instructions on how to obtain them (e.g., via the `stackit` CLI). * **Verification**: Includes specific `kubectl` commands to verify the cluster state. * **Lifecycle Management**: Includes explicit instructions for **Cleanup**, specifically warning to delete the `EdgeCluster` via the STEC API before running `terraform destroy` to prevent orphaned resources. * **Technical Depth**: It includes critical "Notes" regarding Talos configuration (no SSH/cloud-init) and the importance of not cloning VMs due to disk UUID-based identity. **Verdict**: The README is **high quality, comprehensive, and follows best practices**. --- ### Summary Table | Criteria | Status | Architect's Notes | | :--- | :--- | :--- | | **Naming** | βœ… Pass | Accurately reflects the hybrid IaaS/Edge nature of the example. | | **README Quality** | βœ… Pass | Excellent documentation of the complex interaction between STEC CRDs and IaaS resources. | βœ… Example READMEs are complete. </details> <details> <summary>πŸ“š Module Variable & Output Coverage</summary> **πŸ€– STACKIT Model Serving** _No relevant changes to review._ --- **πŸ” STACKIT Cloud Advisor** _No relevant changes to review._ </details> <details> <summary>πŸ’¬ Commit Messages</summary> **πŸ€– STACKIT Model Serving** βœ… Commit messages are descriptive. --- **πŸ” STACKIT Cloud Advisor** Based on the criteria provided, I have reviewed the commit message from the pull request. ### Commit Message Evaluation The provided commit message is: `example(edge): basic example on how to deploy edge` | Status | Message | Analysis | Suggested Alternative | | :--- | :--- | :--- | :--- | | βœ… **Pass** | `example(edge): basic example on how to deploy edge` | This message is sufficiently descriptive. It follows a structured format, identifies the scope/component (`edge`), and clearly explains the intent (providing a deployment example). | N/A | ### Architect's Summary All messages provided in the snippet meet the required standard for professional services repositories. They avoid the "vague" pitfalls (such as `fix`, `update`, or `wip`) and provide enough context for a reviewer to understand the impact of the change without immediately inspecting the diff. **Final Verdict:** βœ… Commit messages are descriptive. </details> --- _Generated automatically β€” treat as a hint, not a gate._
mauritz.uphoff force-pushed example/stec-example from c5e7ff32a9
All checks were successful
Default CI / Check for Open TODOs (pull_request) Successful in 41s
AI PR Review / AI PR Review (pull_request) Successful in 2m11s
Default CI / Pre-Commit Hooks (pull_request) Successful in 2m26s
to 3d31be468f
All checks were successful
Default CI / Check for Open TODOs (pull_request) Successful in 37s
AI PR Review / AI PR Review (pull_request) Successful in 2m28s
Default CI / Pre-Commit Hooks (pull_request) Successful in 3m4s
2026-08-19 13:52:39 +00:00
Compare

πŸ€– AI PR Review

3d31be46 Β· STACKIT Model Serving & STACKIT Cloud Advisor

⚠️ πŸ“ Spelling & Grammar
πŸ€– STACKIT Model Serving
  • .github/scripts/ai_pr_review.py at line 13: "STACKIT Model Serving and STACKIT Cloud Advisor." β€” should be "STACKIT Model Serving and STACKIT Cloud Advisor." (no change needed; already correct)
  • .github/scripts/ai_pr_review.py at line 14: "Both backends run in parallel for every check." β€” correct grammar
  • .github/scripts/ai_pr_review.py at line 15: "Results are combined into a single consolidated comment on the Forgejo PR, with each backend's output clearly labelled." β€” correct grammar
  • .github/scripts/ai_pr_review.py at line 118: "Smart truncation: find the last newline before the cutoff limit." β€” correct grammar
  • .github/scripts/ai_pr_review.py at line 160: "Used for checks that need to understand the full scope of change (e.g. what was added AND what was removed to summarise the infrastructure delta)." β€” correct grammar
  • .github/scripts/ai_pr_review.py at line 196: "call_llm" β€” function name, not prose
  • .github/scripts/ai_pr_review.py at line 213: "call_advisor" β€” function name, not prose
  • .github/scripts/ai_pr_review.py at line 345: "## πŸ€– AI PR Review\n", f"> {short_sha} Β· STACKIT Model Serving & STACKIT Cloud Advisor\n" β€” correct usage of STACKIT
  • .github/scripts/ai_pr_review.py at line 638: "Generated automatically β€” treat as a hint, not a gate." β€” correct grammar
  • examples/iaas-edge-k8s-cluster/010-provider.tf at line 18: "source = "stackitcloud/stackit"" β€” technical string, not prose
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 14: "STACKIT project ID." β€” correct usage of STACKIT
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 20: "STACKIT region." β€” correct usage of STACKIT
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 26: "Path to the STACKIT service account key JSON file." β€” correct usage of STACKIT
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 32: "STEC plan ID. Retrieve with: stackit beta edge-cloud plans list" β€” technical command, not prose
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 38: "Display name for the STEC management plane instance." β€” correct grammar
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 44: "Talos version. Check: https://image-factory.edge.eu01.stackit.cloud/versions" β€” technical URL, not prose
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 50: "Kubernetes version for the edge cluster." β€” correct grammar
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 56: "Name of the EdgeCluster resource (RFC 1034)." β€” correct grammar
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 62: "Number of control plane nodes." β€” correct grammar
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 68: "Number of worker nodes." β€” correct grammar
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 74: "Machine type for control plane nodes." β€” correct grammar
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 80: "Machine type for worker nodes." β€” correct grammar
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 86: "Boot disk size in GiB (minimum 32)." β€” correct grammar
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 92: "Disk size must be at least 32 GiB." β€” correct grammar
  • examples/iaas-edge-k8s-cluster/020-variables.tf at line 98: "Availability zone for all nodes." β€” correct grammar
  • `examples/iaas-edge-k8s-cluster/
πŸ” STACKIT Cloud Advisor

Spelling and Grammar Review

I have reviewed the provided git diff for prose content, including Markdown files, Terraform variable descriptions, inline comments, and string literals. The review focused on identifying spelling and grammar errors while ensuring STACKIT product names and terminology adhere to the established brand guidelines.

Identified Issues

  • .github/scripts/ai_pr_review.py (Line 121): The comment # Smart truncation: Find the last newline before the cutoff limit is followed by a change that lowercase the word "find" in the actual code comment. While technically a stylistic change, the diff shows a transition from a capitalized sentence to a lowercase one: # Smart truncation: find the last newline before the cutoff limit.
  • examples/iaas-edge-k8s-cluster/020-variables.tf (Line 55): The description "Talos version. Check: https://image-factory.edge.eu01.stackit.cloud/versions" is grammatically acceptable, but ensure that the URL remains valid as it refers to an internal image factory.
  • examples/iaas-edge-k8s-cluster/020-variables.tf (Line 71): The description "Name of the EdgeCluster resource (RFC 1034)." is correct.
  • examples/iaas-edge-k8s-cluster/020-variables.tf (Line 101): The description "Availability zone for all nodes." is correct.

STACKIT Terminology Check

The following terminology was verified against the provided evidence:

  • STACKIT Model Serving: Correctly used in the docstring and system prompts.
  • STACKIT Cloud Advisor: Correctly used in the docstring and system prompts.
  • STACKIT Product Names: Terms such as SKE, Object Storage, DNS, Load Balancer, PostgreSQL Flex, and STACKIT Identity Provider (IdP) are used consistently with the provided documentation.
  • Brand Compliance: The script correctly implements the rule to maintain STACKIT in all caps and flags incorrect variants like "StackIT" or "stackit" in its internal logic.

Summary Table of Prose Quality

File Type Content Type Status Notes
Python Script Docstrings / Comments βœ… Pass Logic for brand enforcement is robust.
Terraform Variable Descriptions βœ… Pass Descriptions are concise and technically accurate.
Markdown System Prompts βœ… Pass Prompts are well-structured for LLM consumption.

βœ… No significant spelling or grammar issues found in the prose content.

⚠️ πŸ—οΈ Infrastructure Changes
πŸ€– STACKIT Model Serving
  • Added new Terraform example iaas-edge-k8s-cluster provisioning STACKIT Edge Cloud (STEC) with Talos Kubernetes.
  • New resources: STACKIT provider config, variables for project/region/service account, STEC instance, and edge cluster.
  • No deletions or destructive changes detected.
  • Infrastructure will create: STEC management plane instance + Kubernetes cluster with control plane and worker nodes.
  • Variables include validation (e.g., disk_size_gb β‰₯ 32 GiB) and default values for region, machine types, and versions.
  • No force-replacements or deletions flagged β€” all resources are new creations.
πŸ” STACKIT Cloud Advisor

1. Identified STACKIT Services & Infrastructure Components

Based on the provided Terraform files, the following STACKIT services and specific configurations are being provisioned:

  • STACKIT Edge Cloud (Beta): The primary service being introduced. The presence of stec_plan_id and stec_instance_name indicates the provisioning of the STEC management plane Faq.
  • EdgeCluster (Kubernetes): The diff defines variables for an Edge Kubernetes cluster, including control plane (cp_count) and worker node (worker_count) configurations.
  • Compute Engine (Machine Types):
    • c2i.4 for Control Plane nodes.
    • c2i.8 for Worker nodes.
  • Talos Linux: The infrastructure is specifically designed to run Talos Linux as the operating system for the edge nodes, with a specific versioning requirement (talos_version) Faq.
  • Terraform Provider: The stackit provider is being used with enable_beta_resources = true, which is required to manage Edge Cloud products currently in beta Faq.

Infrastructure Topology Overview:

[ STACKIT Cloud (eu01) ]
       |
       |-- [ STEC Management Plane ] (stec_instance_name)
       |          |
       |          |-- [ EdgeCluster ]
       |                 |-- [ Control Plane Nodes ] (c2i.4)
       |                 |-- [ Worker Nodes ] (c2i.8)
       |
[ Edge Host / Hardware ] (Talos Linux)

2. STACKIT Best Practices & Observations

  • Beta Resource Flag: The provider configuration correctly sets enable_beta_resources = true. This is a mandatory best practice when working with the current Edge Cloud feature set Faq.
  • Disk Size Validation: The variable disk_size_gb includes a validation block ensuring a minimum of 32 GiB. This aligns with STACKIT's technical requirements for Talos Linux to prevent boot failures Faq Faq.
  • Naming Conventions: The cluster_name variable documentation notes the requirement for RFC 1034 compliance, which is a critical best practice for resource naming in STACKIT environments.
  • Provider Versioning: The required_providers block uses explicit version constraints (e.g., version = ">= 0.107.0"), which is essential for infrastructure stability and reproducible deployments.

3. Quotas, Constraints, and Known Limitations

Reviewers should be aware of the following constraints inherent to the STACKIT Edge Cloud and SKE ecosystem that may impact this specific configuration:

  • EdgeCloud Scaling Limit: STACKIT Edge Cloud is sized and tested for up to 1000 accumulated EdgeCluster objects per instance. Exceeding this may lead to an unsupported state Faq Faq.
  • Disk Size Recommendation: While the code validates for a minimum of 32 GiB (to satisfy Talos requirements), STACKIT explicitly recommends using 100 GiB for optimal operation Faq Faq.
  • Node Count Restrictions (SKE/Edge): If this cluster is managed via SKE-like logic, note that the maximum number of running nodes in a cluster is limited to 1000 Quotas And Limits Quotas And Limits.
  • Availability Zone (AZ) Constraints: The configuration defaults to eu01-1. If scaling across multiple AZs is intended, ensure that maxSurge in the rollout strategy is set to at least the number of configured AZs to prevent downtime during updates Faq.
  • Cloning Prohibition: A critical limitation of Edge Cloud is that cloning VMs or VM disks is not supported. Each host is tied to a unique UUID; any operation altering this identity will break the control plane connection and cluster membership Faq Faq.
⚠️ πŸ”’ Security Review
πŸ€– STACKIT Model Serving

βœ… No security issues found.

πŸ” STACKIT Cloud Advisor

1. STACKIT IAM or Authorization Misconfigurations

  • πŸ”΄ High: Risk of credential exposure via Terraform State
    The use of local_sensitive_file.stec_kubeconfig to write the STEC kubeconfig to disk (.stec.kubeconfig.json) is a significant risk. While the file permission is set to 0600, the content of this file (which contains a permanent, secret access token that cannot be revoked Authentication Authentication) will be stored in plain text within the Terraform state file. If the state is stored in an unencrypted or insufficiently protected backend, the entire STEC management plane is compromised.
  • 🟑 Medium: Service Account Key Management
    The provider configuration relies on var.stackit_service_account_key_path [0.10-provider.tf]. While using a service account is standard, the architect must ensure that the identity associated with this key follows the principle of least privilege and that the key itself is managed via a secure vault rather than being passed as a local file path in a CI/CD environment.

2. Missing STACKIT-Specific Security Controls

  • πŸ”΄ High: Overly Permissive Security Group Rules
    The stackit_security_group_rule resources for both ingress and egress (TCP and UDP) do not specify any IP ranges or port restrictions [040-network.tf].
    • Current State: The rules effectively act as "Allow All" for all ports and all IP addresses.
    • Risk: This violates the Principle of Least Privilege Introduction Security In Networks Security In Networks. An attacker who gains access to a node could scan the entire network or communicate with any external entity.
    • Recommendation: Restrict ingress to specific management IPs or internal subnets and restrict egress to only the necessary ports for STEC registration (TCP 443) and image pulls [040-network.tf].
  • 🟑 Medium: Lack of Network Segmentation
    The architecture uses a single stackit_network and a single stackit_security_group for both Control Plane (CP) and Worker nodes [040-network.tf].
    • Recommendation: Following best practices for Tiered Architecture Introduction, you should implement separate Security Groups for the Control Plane and the Worker nodes to isolate the management layer from the workload layer.

3. Hard-coded Secrets and Sensitive Values

  • πŸ”΄ High: Kubeconfig and Token Exposure in CI/CD
    The GitHub Actions workflow adds CLOUDMENT_TOKEN: ${{ secrets.CLOUDMENT_TOKEN }} [0.github/workflows/ai-pr-review.yaml]. While stored as a secret in the repository, the Terraform code subsequently generates a stackit_edgecloud_token and a stackit_edgecloud_kubeconfig [030-edge-instance.tf].
    • The kubeconfig contains a permanent, secret access token that cannot be revoked Authentication Authentication.
    • The local_sensitive_file resource writes this to the local filesystem during the CI/CD run. If the runner is not properly cleaned or if logs capture the file content, the STEC instance is fully exposed.

4. STACKIT Compliance and Audit-Logging Considerations

  • 🟑 Medium: Auditability of Automated Changes
    The use of null_resource with local-exec to run bash scripts (01-create-edge-image.sh and 02-create-cluster.sh) [050-images.tf, 070-edge-cluster.tf] bypasses the native STACKIT Terraform provider's ability to track resource state and lifecycle.
    • Compliance Impact: From an audit perspective, these actions appear as "opaque" executions. It is difficult to verify exactly what was changed within the STEC management plane via standard STACKIT audit logs compared to resources managed directly by the stackit provider.
    • Recommendation: Ensure that the bash scripts themselves log their actions to a centralized logging system to maintain a clear audit trail for compliance.

Summary Architecture View

[ Internet / Management IP ]
      |
      | (Restricted Ingress - SHOULD BE IMPLEMENTED)
      v
[ STACKIT Security Group ] <--- Currently "Allow All" (High Risk)
      |
      +-- [ Network Interface: CP Nodes ] --> [ STEC Control Plane ]
      |
      +-- [ Network Interface: Worker Nodes ] --> [ K8s Workloads ]
⚠️ πŸ“ Example Consistency
πŸ€– STACKIT Model Serving

βœ… Example follows repository conventions.

πŸ” STACKIT Cloud Advisor

Repository Convention Review

The provided git diff has been reviewed against the specified repository conventions and STACKIT-specific provider best practices. While the example is structurally sound and follows most organizational rules, there are several deviations regarding provider versioning and STACKIT-specific resource configurations.

1. Repository Convention Deviations

Deviation: Missing explicit version constraints for all providers
The 010-provider.tf file uses >= constraints for the stackit, local, and null providers. While the required_providers block is present, the convention requires an explicit version constraint (typically a fixed version or a more restrictive range) to ensure environment reproducibility.

# Fix: Use specific versions instead of just minimums
terraform {
  required_providers {
    stackit = {
      source  = "stackitcloud/stackit"
      version = "0.110.0"
    }
    local = {
      source  = "hashicorp/local"
      version = "2.9.0"
    }
    null = {
      source  = "hashicorp/null"
      version = "3.3.0"
    }
  }
}

2. STACKIT Provider & Usage Concerns

Concern: Beta Resource Opt-in
The example utilizes stackit_edgecloud_instance, stackit_edgecloud_kubeconfig, and stackit_edgecloud_token. These are part of the Edge Cloud service, which is currently in a beta state. To ensure the provider correctly handles these resources, the enable_beta_resources flag must be explicitly set to true in the provider block.

Status: Correctly implemented in 010-provider.tf.

Concern: Security Group Rule Definition
In 040-network.tf, the security group rules are defined using a block syntax for the protocol: protocol = { name = "tcp" }. While this is functional, ensure this matches the specific provider schema requirements for the version being used.

Concern: Server Boot Volume Configuration
In 060-servers.tf, the stackit_server resource uses a boot_volume block with source_type = "image".

Approach Fit Trade-off
Image-based Boot High (for Talos/Edge) Faster provisioning; requires pre-existing image ID.
Volume-based Boot Medium More flexible for data persistence; requires separate stackit_volume management.

The current implementation correctly uses the data.external.image_ids to bridge the gap between the custom Talos image upload and the server creation.

Architectural Note on EdgeCloud Integration
The architecture uses a "bridge" pattern to manage the STEC (Stackit Edge Cloud) Kubernetes API, which is not directly managed by the STACKIT Terraform provider.

[ STACKIT IaaS ] <--- (Terraform) --- [ stackit_server ]
      |
      | (Local-exec / CLI)
      v
[ STEC API ] <------- (Bash Scripts) --- [ EdgeCluster CRD ]

This is a necessary workaround because the EdgeCluster and EdgeImage resources are CRDs on the STEC management plane rather than native STACKIT IaaS resources.

Summary of Findings

  • 3-digit prefixes: βœ… Followed.
  • README/MAINTAINERS: βœ… Present.
  • Variable naming/description: βœ… Followed (snake_case and descriptions present).
  • Provider versioning: ❌ Deviation (uses >= instead of explicit versions).
  • Lock file: βœ… Present and committed.
  • License headers: βœ… Present on all .tf files.
⚠️ πŸ“š Example README
πŸ€– STACKIT Model Serving

βœ… Example READMEs are complete.

πŸ” STACKIT Cloud Advisor

Review of examples/iaas-edge-k8s-cluster

I have reviewed the provided git diff for the new example directory. Below is my architectural assessment regarding naming conventions and documentation quality.

1. Naming Convention

The directory name iaas-edge-k8s-cluster is accurate and descriptive.

  • Service Alignment: It correctly identifies the hybrid nature of the demonstration. It utilizes STACKIT Compute Engine (IaaS) to host the nodes that will eventually be managed by the STACKIT Edge Cloud (STEC) management plane Edge Cloud Edge Cloud.
  • Use-Case Clarity: The name clearly communicates that the goal is to deploy a Kubernetes cluster (specifically using Talos Linux) within an Edge Cloud context, leveraging IaaS resources for the underlying compute.
  • Consistency: The naming follows the pattern of describing the infrastructure layer (iaas) and the specific workload/service (edge-k8s-cluster).

2. README Quality

The README.md is high quality and meets all the required criteria for a production-ready example.

  • Service Explanation: It explicitly defines the relationship between the STEC Management Plane and the IaaS layer. It provides a clear ASCII architecture diagram showing how the EdgeImage and EdgeCluster (which are CRDs on the STEC Kubernetes API) interact with the STACKIT IaaS servers Creating Clusters.
  • Demonstration Scope: The README clearly states that the example deploys a management plane and a Talos Linux Kubernetes cluster consisting of three control plane nodes and three worker nodes.
  • Usage Section: A complete lifecycle guide is provided, including:
    • Prerequisites: Lists necessary tools (terraform, kubectl, stackit CLI, etc.).
    • Configuration: Provides a clear mapping of variables and how to obtain them (e.g., using stackit beta edge-cloud plans list for the stec_plan_id Stackit Beta Edge Cloud Kubeconfig Create.Md).
    • Deployment: Includes the standard terraform init and terraform apply commands.
    • Verification: Provides kubectl commands to verify the node status.
    • Management & Cleanup: Includes critical operational instructions, such as deleting the EdgeCluster via the STEC API before destroying the IaaS resources to prevent orphaned hosts Creating Clusters.

Summary Table

Criteria Status Architect's Notes
Naming βœ… Pass Clearly distinguishes between the IaaS compute layer and the STEC management layer.
README Quality βœ… Pass Comprehensive; includes architecture, prerequisites, variable mapping, and cleanup logic.

βœ… Example READMEs are complete.

⚠️ πŸ’¬ Commit Messages
πŸ€– STACKIT Model Serving

βœ… Commit messages are descriptive.

πŸ” STACKIT Cloud Advisor

Based on my review of the provided commit messages against the professional services repository standards, here is my assessment:

Commit Message Quality Assessment

The provided commit message is sufficiently descriptive.

Commit Message Status Architect's Note
example(edge): basic example on how to deploy edge βœ… Pass This message follows a clear convention. It identifies the scope/component (edge) and provides a meaningful description of the content (a deployment example).

Summary of Findings

The single commit provided does not fall into the "vague" categories (such as 'fix', 'update', or 'wip') identified in your criteria. It provides enough context for a developer or architect to understand that the change introduces educational or boilerplate content regarding edge deployment without needing to inspect the diff immediately.

No vague messages were detected in this sample.


Generated automatically β€” treat as a hint, not a gate.

## πŸ€– AI PR Review > [`3d31be46`](https://professional-service.git.onstackit.cloud/professional-service-best-practices/professional-service/commit/3d31be468fba29fd071aa41131e4c6d4a117cc10) Β· STACKIT Model Serving & STACKIT Cloud Advisor <details> <summary>⚠️ πŸ“ Spelling & Grammar</summary> <details> <summary>πŸ€– STACKIT Model Serving</summary> - `.github/scripts/ai_pr_review.py` at line 13: "STACKIT Model Serving and STACKIT Cloud Advisor." β€” should be "STACKIT Model Serving and STACKIT Cloud Advisor." (no change needed; already correct) - `.github/scripts/ai_pr_review.py` at line 14: "Both backends run in parallel for every check." β€” correct grammar - `.github/scripts/ai_pr_review.py` at line 15: "Results are combined into a single consolidated comment on the Forgejo PR, with each backend's output clearly labelled." β€” correct grammar - `.github/scripts/ai_pr_review.py` at line 118: "Smart truncation: find the last newline before the cutoff limit." β€” correct grammar - `.github/scripts/ai_pr_review.py` at line 160: "Used for checks that need to understand the full scope of change (e.g. what was added AND what was removed to summarise the infrastructure delta)." β€” correct grammar - `.github/scripts/ai_pr_review.py` at line 196: "call_llm" β€” function name, not prose - `.github/scripts/ai_pr_review.py` at line 213: "call_advisor" β€” function name, not prose - `.github/scripts/ai_pr_review.py` at line 345: "## πŸ€– AI PR Review\n", f"> [`{short_sha}`]({commit_url}) Β· STACKIT Model Serving & STACKIT Cloud Advisor\n" β€” correct usage of STACKIT - `.github/scripts/ai_pr_review.py` at line 638: "Generated automatically β€” treat as a hint, not a gate." β€” correct grammar - `examples/iaas-edge-k8s-cluster/010-provider.tf` at line 18: "source = "stackitcloud/stackit"" β€” technical string, not prose - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 14: "STACKIT project ID." β€” correct usage of STACKIT - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 20: "STACKIT region." β€” correct usage of STACKIT - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 26: "Path to the STACKIT service account key JSON file." β€” correct usage of STACKIT - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 32: "STEC plan ID. Retrieve with: stackit beta edge-cloud plans list" β€” technical command, not prose - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 38: "Display name for the STEC management plane instance." β€” correct grammar - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 44: "Talos version. Check: https://image-factory.edge.eu01.stackit.cloud/versions" β€” technical URL, not prose - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 50: "Kubernetes version for the edge cluster." β€” correct grammar - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 56: "Name of the EdgeCluster resource (RFC 1034)." β€” correct grammar - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 62: "Number of control plane nodes." β€” correct grammar - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 68: "Number of worker nodes." β€” correct grammar - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 74: "Machine type for control plane nodes." β€” correct grammar - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 80: "Machine type for worker nodes." β€” correct grammar - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 86: "Boot disk size in GiB (minimum 32)." β€” correct grammar - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 92: "Disk size must be at least 32 GiB." β€” correct grammar - `examples/iaas-edge-k8s-cluster/020-variables.tf` at line 98: "Availability zone for all nodes." β€” correct grammar - `examples/iaas-edge-k8s-cluster/ </details> <details> <summary>πŸ” STACKIT Cloud Advisor</summary> ### Spelling and Grammar Review I have reviewed the provided git diff for prose content, including Markdown files, Terraform variable descriptions, inline comments, and string literals. The review focused on identifying spelling and grammar errors while ensuring STACKIT product names and terminology adhere to the established brand guidelines. #### Identified Issues * `.github/scripts/ai_pr_review.py` (Line 121): The comment `# Smart truncation: Find the last newline before the cutoff limit` is followed by a change that lowercase the word "find" in the actual code comment. While technically a stylistic change, the diff shows a transition from a capitalized sentence to a lowercase one: `# Smart truncation: find the last newline before the cutoff limit.` * `examples/iaas-edge-k8s-cluster/020-variables.tf` (Line 55): The description `"Talos version. Check: https://image-factory.edge.eu01.stackit.cloud/versions"` is grammatically acceptable, but ensure that the URL remains valid as it refers to an internal image factory. * `examples/iaas-edge-k8s-cluster/020-variables.tf` (Line 71): The description `"Name of the EdgeCluster resource (RFC 1034)."` is correct. * `examples/iaas-edge-k8s-cluster/020-variables.tf` (Line 101): The description `"Availability zone for all nodes."` is correct. #### STACKIT Terminology Check The following terminology was verified against the provided evidence: * **STACKIT Model Serving**: Correctly used in the docstring and system prompts. * **STACKIT Cloud Advisor**: Correctly used in the docstring and system prompts. * **STACKIT Product Names**: Terms such as **SKE**, **Object Storage**, **DNS**, **Load Balancer**, **PostgreSQL Flex**, and **STACKIT Identity Provider (IdP)** are used consistently with the provided documentation. * **Brand Compliance**: The script correctly implements the rule to maintain **STACKIT** in all caps and flags incorrect variants like "StackIT" or "stackit" in its internal logic. #### Summary Table of Prose Quality | File Type | Content Type | Status | Notes | | :--- | :--- | :--- | :--- | | Python Script | Docstrings / Comments | βœ… Pass | Logic for brand enforcement is robust. | | Terraform | Variable Descriptions | βœ… Pass | Descriptions are concise and technically accurate. | | Markdown | System Prompts | βœ… Pass | Prompts are well-structured for LLM consumption. | βœ… No significant spelling or grammar issues found in the prose content. </details> </details> <details> <summary>⚠️ πŸ—οΈ Infrastructure Changes</summary> <details> <summary>πŸ€– STACKIT Model Serving</summary> - Added new Terraform example `iaas-edge-k8s-cluster` provisioning STACKIT Edge Cloud (STEC) with Talos Kubernetes. - New resources: STACKIT provider config, variables for project/region/service account, STEC instance, and edge cluster. - No deletions or destructive changes detected. - Infrastructure will create: STEC management plane instance + Kubernetes cluster with control plane and worker nodes. - Variables include validation (e.g., disk_size_gb β‰₯ 32 GiB) and default values for region, machine types, and versions. - No force-replacements or deletions flagged β€” all resources are new creations. </details> <details> <summary>πŸ” STACKIT Cloud Advisor</summary> ### 1. Identified STACKIT Services & Infrastructure Components Based on the provided Terraform files, the following STACKIT services and specific configurations are being provisioned: * **STACKIT Edge Cloud (Beta):** The primary service being introduced. The presence of `stec_plan_id` and `stec_instance_name` indicates the provisioning of the STEC management plane [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). * **EdgeCluster (Kubernetes):** The diff defines variables for an Edge Kubernetes cluster, including control plane (`cp_count`) and worker node (`worker_count`) configurations. * **Compute Engine (Machine Types):** * `c2i.4` for Control Plane nodes. * `c2i.8` for Worker nodes. * **Talos Linux:** The infrastructure is specifically designed to run **Talos Linux** as the operating system for the edge nodes, with a specific versioning requirement (`talos_version`) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). * **Terraform Provider:** The `stackit` provider is being used with `enable_beta_resources = true`, which is required to manage Edge Cloud products currently in beta [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). **Infrastructure Topology Overview:** ```text [ STACKIT Cloud (eu01) ] | |-- [ STEC Management Plane ] (stec_instance_name) | | | |-- [ EdgeCluster ] | |-- [ Control Plane Nodes ] (c2i.4) | |-- [ Worker Nodes ] (c2i.8) | [ Edge Host / Hardware ] (Talos Linux) ``` --- ### 2. STACKIT Best Practices & Observations * **Beta Resource Flag:** The provider configuration correctly sets `enable_beta_resources = true`. This is a mandatory best practice when working with the current Edge Cloud feature set [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). * **Disk Size Validation:** The variable `disk_size_gb` includes a validation block ensuring a minimum of **32 GiB**. This aligns with STACKIT's technical requirements for Talos Linux to prevent boot failures [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). * **Naming Conventions:** The `cluster_name` variable documentation notes the requirement for **RFC 1034** compliance, which is a critical best practice for resource naming in STACKIT environments. * **Provider Versioning:** The `required_providers` block uses explicit version constraints (e.g., `version = ">= 0.107.0"`), which is essential for infrastructure stability and reproducible deployments. --- ### 3. Quotas, Constraints, and Known Limitations Reviewers should be aware of the following constraints inherent to the STACKIT Edge Cloud and SKE ecosystem that may impact this specific configuration: * **EdgeCloud Scaling Limit:** STACKIT Edge Cloud is sized and tested for up to **1000 accumulated EdgeCluster objects** per instance. Exceeding this may lead to an unsupported state [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). * **Disk Size Recommendation:** While the code validates for a minimum of **32 GiB** (to satisfy Talos requirements), STACKIT explicitly recommends using **100 GiB** for optimal operation [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). * **Node Count Restrictions (SKE/Edge):** If this cluster is managed via SKE-like logic, note that the maximum number of running nodes in a cluster is limited to **1000** [Quotas And Limits](https://docs.stackit.cloud/de/products/runtime/kubernetes-engine/basics/quotas-and-limits/) [Quotas And Limits](https://docs.stackit.cloud/products/runtime/kubernetes-engine/basics/quotas-and-limits/). * **Availability Zone (AZ) Constraints:** The configuration defaults to `eu01-1`. If scaling across multiple AZs is intended, ensure that `maxSurge` in the rollout strategy is set to at least the number of configured AZs to prevent downtime during updates [Faq](https://docs.stackit.cloud/products/runtime/kubernetes-engine/faq/). * **Cloning Prohibition:** A critical limitation of Edge Cloud is that **cloning VMs or VM disks is not supported**. Each host is tied to a unique UUID; any operation altering this identity will break the control plane connection and cluster membership [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). </details> </details> <details> <summary>⚠️ πŸ”’ Security Review</summary> <details> <summary>πŸ€– STACKIT Model Serving</summary> βœ… No security issues found. </details> <details> <summary>πŸ” STACKIT Cloud Advisor</summary> ### 1. STACKIT IAM or Authorization Misconfigurations * πŸ”΄ **High: Risk of credential exposure via Terraform State** The use of `local_sensitive_file.stec_kubeconfig` to write the STEC kubeconfig to disk (`.stec.kubeconfig.json`) is a significant risk. While the file permission is set to `0600`, the content of this file (which contains a permanent, secret access token that cannot be revoked [Authentication](https://docs.stackit.cloud/de/products/runtime/edge-cloud/getting-started/authentication/) [Authentication](https://docs.stackit.cloud/products/runtime/edge-cloud/getting-started/authentication/)) will be stored in plain text within the Terraform state file. If the state is stored in an unencrypted or insufficiently protected backend, the entire STEC management plane is compromised. * 🟑 **Medium: Service Account Key Management** The provider configuration relies on `var.stackit_service_account_key_path` [0.10-provider.tf]. While using a service account is standard, the architect must ensure that the identity associated with this key follows the principle of least privilege and that the key itself is managed via a secure vault rather than being passed as a local file path in a CI/CD environment. ### 2. Missing STACKIT-Specific Security Controls * πŸ”΄ **High: Overly Permissive Security Group Rules** The `stackit_security_group_rule` resources for both `ingress` and `egress` (TCP and UDP) do not specify any IP ranges or port restrictions [040-network.tf]. * **Current State:** The rules effectively act as "Allow All" for all ports and all IP addresses. * **Risk:** This violates the **Principle of Least Privilege** [Introduction](https://docs.stackit.cloud/products/network/core-networking/security-groups/basics/introduction/) [Security In Networks](https://docs.stackit.cloud/de/products/security/security-hardening/security-in-networks/) [Security In Networks](https://docs.stackit.cloud/products/security/security-hardening/security-in-networks/). An attacker who gains access to a node could scan the entire network or communicate with any external entity. * **Recommendation:** Restrict `ingress` to specific management IPs or internal subnets and restrict `egress` to only the necessary ports for STEC registration (TCP 443) and image pulls [040-network.tf]. * 🟑 **Medium: Lack of Network Segmentation** The architecture uses a single `stackit_network` and a single `stackit_security_group` for both Control Plane (CP) and Worker nodes [040-network.tf]. * **Recommendation:** Following best practices for **Tiered Architecture** [Introduction](https://docs.stackit.cloud/products/network/core-networking/security-groups/basics/introduction/), you should implement separate Security Groups for the Control Plane and the Worker nodes to isolate the management layer from the workload layer. ### 3. Hard-coded Secrets and Sensitive Values * πŸ”΄ **High: Kubeconfig and Token Exposure in CI/CD** The GitHub Actions workflow adds `CLOUDMENT_TOKEN: ${{ secrets.CLOUDMENT_TOKEN }}` [0.github/workflows/ai-pr-review.yaml]. While stored as a secret in the repository, the Terraform code subsequently generates a `stackit_edgecloud_token` and a `stackit_edgecloud_kubeconfig` [030-edge-instance.tf]. * The `kubeconfig` contains a **permanent, secret access token that cannot be revoked** [Authentication](https://docs.stackit.cloud/de/products/runtime/edge-cloud/getting-started/authentication/) [Authentication](https://docs.stackit.cloud/products/runtime/edge-cloud/getting-started/authentication/). * The `local_sensitive_file` resource writes this to the local filesystem during the CI/CD run. If the runner is not properly cleaned or if logs capture the file content, the STEC instance is fully exposed. ### 4. STACKIT Compliance and Audit-Logging Considerations * 🟑 **Medium: Auditability of Automated Changes** The use of `null_resource` with `local-exec` to run bash scripts (`01-create-edge-image.sh` and `02-create-cluster.sh`) [050-images.tf, 070-edge-cluster.tf] bypasses the native STACKIT Terraform provider's ability to track resource state and lifecycle. * **Compliance Impact:** From an audit perspective, these actions appear as "opaque" executions. It is difficult to verify exactly what was changed within the STEC management plane via standard STACKIT audit logs compared to resources managed directly by the `stackit` provider. * **Recommendation:** Ensure that the bash scripts themselves log their actions to a centralized logging system to maintain a clear audit trail for compliance. ### Summary Architecture View ```ascii [ Internet / Management IP ] | | (Restricted Ingress - SHOULD BE IMPLEMENTED) v [ STACKIT Security Group ] <--- Currently "Allow All" (High Risk) | +-- [ Network Interface: CP Nodes ] --> [ STEC Control Plane ] | +-- [ Network Interface: Worker Nodes ] --> [ K8s Workloads ] ``` </details> </details> <details> <summary>⚠️ πŸ“ Example Consistency</summary> <details> <summary>πŸ€– STACKIT Model Serving</summary> βœ… Example follows repository conventions. </details> <details> <summary>πŸ” STACKIT Cloud Advisor</summary> ### Repository Convention Review The provided git diff has been reviewed against the specified repository conventions and STACKIT-specific provider best practices. While the example is structurally sound and follows most organizational rules, there are several deviations regarding provider versioning and STACKIT-specific resource configurations. #### 1. Repository Convention Deviations **Deviation: Missing explicit version constraints for all providers** The `010-provider.tf` file uses `>=` constraints for the `stackit`, `local`, and `null` providers. While the `required_providers` block is present, the convention requires an explicit version constraint (typically a fixed version or a more restrictive range) to ensure environment reproducibility. ```hcl # Fix: Use specific versions instead of just minimums terraform { required_providers { stackit = { source = "stackitcloud/stackit" version = "0.110.0" } local = { source = "hashicorp/local" version = "2.9.0" } null = { source = "hashicorp/null" version = "3.3.0" } } } ``` #### 2. STACKIT Provider & Usage Concerns **Concern: Beta Resource Opt-in** The example utilizes `stackit_edgecloud_instance`, `stackit_edgecloud_kubeconfig`, and `stackit_edgecloud_token`. These are part of the Edge Cloud service, which is currently in a beta state. To ensure the provider correctly handles these resources, the `enable_beta_resources` flag must be explicitly set to `true` in the provider block. *Status: Correctly implemented in `010-provider.tf`.* **Concern: Security Group Rule Definition** In `040-network.tf`, the security group rules are defined using a block syntax for the protocol: `protocol = { name = "tcp" }`. While this is functional, ensure this matches the specific provider schema requirements for the version being used. **Concern: Server Boot Volume Configuration** In `060-servers.tf`, the `stackit_server` resource uses a `boot_volume` block with `source_type = "image"`. | Approach | Fit | Trade-off | | :--- | :--- | :--- | | **Image-based Boot** | High (for Talos/Edge) | Faster provisioning; requires pre-existing image ID. | | **Volume-based Boot** | Medium | More flexible for data persistence; requires separate `stackit_volume` management. | The current implementation correctly uses the `data.external.image_ids` to bridge the gap between the custom Talos image upload and the server creation. **Architectural Note on EdgeCloud Integration** The architecture uses a "bridge" pattern to manage the STEC (Stackit Edge Cloud) Kubernetes API, which is not directly managed by the STACKIT Terraform provider. ```ascii [ STACKIT IaaS ] <--- (Terraform) --- [ stackit_server ] | | (Local-exec / CLI) v [ STEC API ] <------- (Bash Scripts) --- [ EdgeCluster CRD ] ``` This is a necessary workaround because the `EdgeCluster` and `EdgeImage` resources are CRDs on the STEC management plane rather than native STACKIT IaaS resources. #### Summary of Findings * **3-digit prefixes:** βœ… Followed. * **README/MAINTAINERS:** βœ… Present. * **Variable naming/description:** βœ… Followed (snake_case and descriptions present). * **Provider versioning:** ❌ Deviation (uses `>=` instead of explicit versions). * **Lock file:** βœ… Present and committed. * **License headers:** βœ… Present on all `.tf` files. </details> </details> <details> <summary>⚠️ πŸ“š Example README</summary> <details> <summary>πŸ€– STACKIT Model Serving</summary> βœ… Example READMEs are complete. </details> <details> <summary>πŸ” STACKIT Cloud Advisor</summary> ### Review of `examples/iaas-edge-k8s-cluster` I have reviewed the provided git diff for the new example directory. Below is my architectural assessment regarding naming conventions and documentation quality. #### 1. Naming Convention The directory name `iaas-edge-k8s-cluster` is **accurate and descriptive**. * **Service Alignment**: It correctly identifies the hybrid nature of the demonstration. It utilizes **STACKIT Compute Engine** (IaaS) to host the nodes that will eventually be managed by the **STACKIT Edge Cloud (STEC)** management plane [Edge Cloud](https://docs.stackit.cloud/de/products/runtime/edge-cloud/) [Edge Cloud](https://docs.stackit.cloud/products/runtime/edge-cloud/). * **Use-Case Clarity**: The name clearly communicates that the goal is to deploy a Kubernetes cluster (specifically using Talos Linux) within an Edge Cloud context, leveraging IaaS resources for the underlying compute. * **Consistency**: The naming follows the pattern of describing the infrastructure layer (`iaas`) and the specific workload/service (`edge-k8s-cluster`). #### 2. README Quality The `README.md` is **high quality** and meets all the required criteria for a production-ready example. * **Service Explanation**: It explicitly defines the relationship between the **STEC Management Plane** and the **IaaS** layer. It provides a clear ASCII architecture diagram showing how the **EdgeImage** and **EdgeCluster** (which are CRDs on the STEC Kubernetes API) interact with the **STACKIT IaaS** servers [Creating Clusters](https://docs.stackit.cloud/de/products/runtime/edge-cloud/getting-started/creating-clusters/). * **Demonstration Scope**: The README clearly states that the example deploys a management plane and a Talos Linux Kubernetes cluster consisting of three control plane nodes and three worker nodes. * **Usage Section**: A complete lifecycle guide is provided, including: * **Prerequisites**: Lists necessary tools (`terraform`, `kubectl`, `stackit` CLI, etc.). * **Configuration**: Provides a clear mapping of variables and how to obtain them (e.g., using `stackit beta edge-cloud plans list` for the `stec_plan_id` [Stackit Beta Edge Cloud Kubeconfig Create.Md](https://github.com/stackitcloud/stackit-cli/blob/main/docs/stackit_beta_edge-cloud_kubeconfig_create.md)). * **Deployment**: Includes the standard `terraform init` and `terraform apply` commands. * **Verification**: Provides `kubectl` commands to verify the node status. * **Management & Cleanup**: Includes critical operational instructions, such as deleting the **EdgeCluster** via the STEC API before destroying the IaaS resources to prevent orphaned hosts [Creating Clusters](https://docs.stackit.cloud/de/products/runtime/edge-cloud/getting-started/creating-clusters/). #### Summary Table | Criteria | Status | Architect's Notes | | :--- | :--- | :--- | | **Naming** | βœ… Pass | Clearly distinguishes between the IaaS compute layer and the STEC management layer. | | **README Quality** | βœ… Pass | Comprehensive; includes architecture, prerequisites, variable mapping, and cleanup logic. | βœ… Example READMEs are complete. </details> </details> <details> <summary>⚠️ πŸ’¬ Commit Messages</summary> <details> <summary>πŸ€– STACKIT Model Serving</summary> βœ… Commit messages are descriptive. </details> <details> <summary>πŸ” STACKIT Cloud Advisor</summary> Based on my review of the provided commit messages against the professional services repository standards, here is my assessment: ### Commit Message Quality Assessment The provided commit message is **sufficiently descriptive**. | Commit Message | Status | Architect's Note | | :--- | :--- | :--- | | `example(edge): basic example on how to deploy edge` | βœ… **Pass** | This message follows a clear convention. It identifies the scope/component (`edge`) and provides a meaningful description of the content (a deployment example). | ### Summary of Findings The single commit provided does not fall into the "vague" categories (such as 'fix', 'update', or 'wip') identified in your criteria. It provides enough context for a developer or architect to understand that the change introduces educational or boilerplate content regarding **edge** deployment without needing to inspect the diff immediately. **No vague messages were detected in this sample.** </details> </details> --- _Generated automatically β€” treat as a hint, not a gate._
mauritz.uphoff force-pushed example/stec-example from 3d31be468f
All checks were successful
Default CI / Check for Open TODOs (pull_request) Successful in 37s
AI PR Review / AI PR Review (pull_request) Successful in 2m28s
Default CI / Pre-Commit Hooks (pull_request) Successful in 3m4s
to 18c68d24fd
All checks were successful
Default CI / Check for Open TODOs (pull_request) Successful in 1m6s
AI PR Review / AI PR Review (pull_request) Successful in 2m16s
Default CI / Pre-Commit Hooks (pull_request) Successful in 2m58s
2026-08-19 13:59:56 +00:00
Compare

πŸ€– AI PR Review

18c68d24 Β· STACKIT Model Serving & STACKIT Cloud Advisor

βœ… πŸ“ Spelling & Grammar
πŸ€– STACKIT Model Serving

βœ… No spelling or grammar issues found.

πŸ” STACKIT Cloud Advisor

STACKIT Terminology & Product Name Review

As a senior architect, I have reviewed the provided git diff against the official STACKIT branding guidelines and product documentation. The primary goal was to ensure that all prose content, system prompts, and variable descriptions adhere to the correct casing and nomenclature for STACKIT services.

Summary of Findings

The diff shows a significant improvement in brand consistency, particularly in the transition from generic "AI" terminology to specific STACKIT product names. However, there is one specific terminology discrepancy regarding a service name used in the Terraform variable descriptions.

Category Status Architect's Note
Core Brand βœ… Pass "STACKIT" is consistently used in all-caps as required.
Model Serving βœ… Pass Correctly identified as STACKIT Model Serving.
Cloud Advisor βœ… Pass Correctly identified as STACKIT Cloud Advisor.
Kubernetes βœ… Pass Correctly uses the abbreviation SKE (STACKIT Kubernetes Engine).
Edge Services ⚠️ Warning One instance of "STEC" requires verification against current service naming.

Detailed Error Report

The following line contains a terminology error based on the provided documentation:

  • File: examples/iaas-edge-k8s-cluster/020-variables.tf
  • Line: 43
  • Wrong Text: description = "STEC plan ID. Retrieve with: stackit beta edge-cloud plans list"
  • Correction: description = "STEC plan ID. Retrieve with: stackit beta edge-cloud plans list"
    • Architect's Note: While "STEC" is used in the diff, ensure this aligns with the specific service name for Edge Cloud plans. If the service is officially branded as STACKIT Edge Cloud, the description should ideally reflect that for clarity, though "STEC" may be an internal or CLI-specific shorthand.

Architectural Observations on Branding Implementation

The implementation of the _BRAND_NOTE in a/.github/scripts/ai_pr_review.py is a critical safeguard. By explicitly instructing the LLM to flag variants like StackIT or stackit, you are automating the enforcement of the STACKIT brand identity within the CI/CD pipeline.

Key improvements noted in the diff:

  1. Contextual Awareness: The advisor prompts now explicitly mention STACKIT services like SKE, Object Storage, DNS, Load Balancer, and PostgreSQL Flex Zertifikate. This provides the LLM with the necessary semantic context to perform high-quality infrastructure reviews.
  2. Service Specificity: The transition from [AI] to [LLM] and [Advisor] in log outputs improves observability, allowing engineers to distinguish between the raw model response and the specialized STACKIT Cloud Advisor logic.
  3. Compliance Alignment: The security review prompts now correctly reference STACKIT IAM and SKE network policies, aligning the automated review with STACKIT's security-first architecture Zertifikate.
⚠️ πŸ—οΈ Infrastructure Changes
πŸ€– STACKIT Model Serving
  • Adds new Terraform example for IaaS Edge Kubernetes Cluster (examples/iaas-edge-k8s-cluster/) with provider and variable definitions.
  • Introduces STACKIT Cloud Advisor integration via CLOUDMENT_TOKEN and parallel backend execution for PR reviews.
  • Renames call_ai() to call_llm() and adds call_advisor() for dual-AI review workflow.
  • Updates PR review comment structure to display results from both STACKIT Model Serving and STACKIT Cloud Advisor under collapsible sections.
  • Modifies GitHub Actions workflow to include CLOUDMENT_TOKEN secret for Cloud Advisor API access.
πŸ” STACKIT Cloud Advisor

1. STACKIT Services Identification

Based on the provided Terraform files and variable definitions, the following services are being provisioned or configured:

  • STACKIT Edge Cloud (STEC): The primary focus of the new example. The presence of stec_plan_id, stec_instance_name, and variables for talos_version and kubernetes_version indicates the provisioning of an Edge Kubernetes cluster Faq.
  • STACKIT Terraform Provider: The code explicitly configures the stackit provider with enable_beta_resources = true, which is required for managing Edge Cloud products in their current state Faq.
  • Compute/Edge Infrastructure: The configuration defines control plane (cp_count) and worker node (worker_count) resources, along with specific machine types (c2i.4 and c2i.8) and disk configurations Faq.

2. STACKIT Best Practices & Observations

  • Beta Resource Usage: The provider configuration uses enable_beta_resources = true. While necessary for Edge Cloud, this confirms the service is in a beta state. Users should be aware that beta services may have different support characteristics Faq.
  • Disk Sizing: The variable disk_size_gb includes a validation rule ensuring a minimum of 32 GiB. This aligns with STACKIT's technical requirement that Talos Linux requires at least 32 GiB of capacity, though 100 GiB is specifically recommended by STACKIT for optimal operation Faq Faq.
  • Provider Versioning: The required_providers block correctly implements explicit version constraints (e.g., version = ">= 0.107.0"), which is a best practice for infrastructure stability.
  • Naming Conventions: The cluster_name variable documentation correctly notes the requirement for RFC 1034 compliance, which is critical for resource naming in STACKIT.

3. Quotas, Constraints, and Limitations

As an architect, I flag the following constraints that apply to this specific configuration:

Constraint Type Detail Impact on this PR
Service Limitation EdgeCluster Scaling STACKIT Edge Cloud is sized and tested for up to 1000 accumulated EdgeCluster objects per instance. Exceeding this may lead to an unsupported state Faq Faq.
Operational Constraint No VM Cloning If this infrastructure is ever moved via VM/Disk cloning, the node will lose its registered identity (UUID) and break the control plane/cluster connection. Always provision via images Faq Faq.
Network Requirement Egress Connectivity Every edge host must be able to establish an outgoing connection to stackit.cloud via TCP port 443 Faq Faq.
Registry Access Public Repositories Talos Linux requires access to gcr.io, ghcr.io, and registry.k8s.io to download installers and images Faq Faq.

Architectural Topology Note:
The configuration describes a standard redundant Edge Kubernetes topology:

[ STACKIT Management Plane ]
           |
           | (via TCP 443)
           v
[ STACKIT Edge Cloud Instance ]
    |-- [ EdgeCluster Control Plane (3 nodes) ]
    |-- [ EdgeCluster Worker Nodes (3 nodes) ]
    |-- [ Boot Disk (min 32GB, 100GB rec.) ]
⚠️ πŸ”’ Security Review
πŸ€– STACKIT Model Serving

βœ… No security issues found.

πŸ” STACKIT Cloud Advisor

1. STACKIT IAM or Authorization Misconfigurations

  • πŸ”΄ High: Risk of Service Account Key Exposure in CI/CD
    The addition of CLOUDMENT_TOKEN: ${{ secrets.CLOUDMENT_TOKEN }} to the GitHub/Forgejo workflow suggests a high-privilege token is being passed into the runner environment. While stored as a secret, any compromise of the runner or a misconfigured logging step could expose this token.

    • Architect's Advice: Consider moving toward Workload Identity Federation (WIF) to link your CI/CD provider to a STACKIT service account, allowing you to acquire short-lived tokens without static keys Service Accounts.
  • 🟑 Medium: Terraform Provider Authentication via Static Key Path
    The provider configuration in 010-provider.tf uses service_account_key_path = var.stackit_service_account_key_path. This implies the presence of a static JSON key file on the machine executing Terraform.

    • Architect's Advice: Ensure the execution environment (e.g., the CI runner) is highly secured. If possible, use WIF to avoid managing long-lived JSON keys entirely Service Accounts.

2. Missing STACKIT-Specific Security Controls

  • πŸ”΄ High: Overly Permissive Security Group Rules (Ingress/Egress)
    In 040-network.tf, the security group rules for both ingress and egress are defined without specifying ports or IP ranges:

    resource "stackit_security_group_rule" "ingress_tcp" {
      # ...
      direction = "ingress"
      protocol  = { name = "tcp" }
    }
    

    This effectively creates an "allow-all" rule for the TCP/UDP protocols. This violates the Principle of Least Privilege Security In Networks Security In Networks Introduction.

    • Architect's Advice: You must restrict these rules to specific ports (e.g., 443 for STEC registration) and specific IP ranges. Avoid wide port ranges or 0.0.0.0/0 unless absolutely necessary Introduction.
  • 🟑 Medium: Lack of Network Segmentation for Control Plane vs. Workers
    The current configuration attaches the same stackit_security_group.cluster to both stackit_network_interface.cp and stackit_network_interface.worker.

    • Architect's Advice: Follow the Tiered Architecture best practice Introduction. Create separate Security Groups for the Control Plane and the Worker nodes to limit lateral movement within the cluster.

Current Network Topology Risk:

[ Internet ] 
     |
[ STACKIT Network (10.0.10.0/24) ]
     |
     +-- [ SG: cluster (ALLOW ALL TCP/UDP) ]
            |
            +-- [ CP Nodes ] <--- Vulnerable to lateral movement
            |
            +-- [ Worker Nodes ]

3. Secrets, Credentials, or Sensitive Values

  • 🟑 Medium: Sensitive Kubeconfig and Token Handling
    The code uses local_sensitive_file to write .stec.kubeconfig.json to the local disk [030-edge-instance.tf]. While file_permission = "0600" is correctly applied, this file contains highly sensitive credentials for the STEC management plane and the EdgeCluster.
    • Architect's Advice: Ensure that the .stec.kubeconfig.json and any files in the .generated/ directory are explicitly added to .gitignore to prevent accidental commits of cluster credentials.

4. STACKIT Compliance and Audit-Logging Considerations

  • 🟑 Medium: Absence of Explicit Audit Logging Configuration
    The PR introduces significant infrastructure changes (Networks, Security Groups, Servers, and EdgeCloud instances) but does not include configurations for centralized logging or audit monitoring.
    • Architect's Advice: While STACKIT provides underlying platform logs, ensure that your application-level and cluster-level logs are being directed to a persistent and auditable location to maintain compliance and facilitate incident response.
βœ… πŸ“ Example Consistency
πŸ€– STACKIT Model Serving

βœ… Example follows repository conventions.

πŸ” STACKIT Cloud Advisor

Repository Convention Review

The provided git diff has been reviewed against the specified repository conventions and STACKIT provider best practices. While the example is structurally sound and follows most organizational rules, there are a few deviations regarding provider versioning and resource configuration.

1. Repository Convention Deviations

Convention Status Observation
3-digit numeric prefixes βœ… Pass Files use 010-, 020-, etc.
README.md & MAINTAINERS.md βœ… Pass Both files are present.
Variable naming & description βœ… Pass All variables use snake_case and have description attributes.
Explicit provider versioning ❌ Fail The required_providers block in 010-provider.tf uses inequality constraints (>=) rather than explicit version constraints.
.terraform.lock.hcl βœ… Pass The lock file is present and committed.
Apache 2.0 license headers βœ… Pass Headers are present on all .tf files.

Fix for provider versioning:
To comply with the requirement for explicit version constraints (pinning), update the required_providers block to use exact versions or more restrictive constraints.

terraform {
  required_version = ">= 1.4.0"
  required_providers {
    stackit = {
      source  = "stackitcloud/stackit"
      version = "0.110.0"
    }
    local = {
      source  = "hashicorp/local"
      version = "2.9.0"
    }
    null = {
      source  = "hashicorp/null"
      version = "3.3.0"
    }
  }
}

2. STACKIT Provider & Usage Concerns

A. Beta Resource Opt-in
The example utilizes stackit_edgecloud_instance, stackit_edgecloud_kubeconfig, and stackit_edgecloud_token. These are part of the Edge Cloud service, which is currently in a beta state. While the provider block correctly sets enable_beta_resources = true Stackit Terraform Provider, it is important to note that beta resources may be subject to breaking changes.

B. Security Group Rule Definition
In 040-network.tf, the security group rules are defined using a block syntax for the protocol: protocol = { name = "tcp" }. While this is functional, ensure this matches the specific schema requirements for the provider version being used, as some versions of the STACKIT provider may expect a simple string for the protocol name.

C. Server Network Attachment
The example uses a "pre-creation" strategy for NICs (stackit_network_interface) and then references them in the stackit_server resource. This is a highly recommended pattern for STACKIT Compute Engine to ensure that security groups and network configurations are fully applied before the VM boots, preventing race conditions during the initial registration of the instance.

D. Authentication Best Practice
The example uses the Key Flow via service_account_key_path Docs. For production CI/CD pipelines (e.g., GitHub Actions), I recommend transitioning to the Workload Identity Federation (WIF) flow, which is more secure as it eliminates the need for long-lived static JSON keys Docs.

# Recommended for CI/CD (Workload Identity Federation)
provider "stackit" {
  default_region                  = var.stackit_region
  service_account_email           = var.stackit_service_account_email
  service_account_federated_token = var.stackit_oidc_token
  use_oidc                        = true
}
βœ… πŸ“š Example README
πŸ€– STACKIT Model Serving

βœ… Example READMEs are complete.

πŸ” STACKIT Cloud Advisor

Review of examples/iaas-edge-k8s-cluster

I have reviewed the provided git diff for the new example directory. Below is my architectural assessment regarding naming conventions and documentation quality.

1. Naming Convention

The directory name iaas-edge-k8s-cluster is accurate and descriptive.

  • Service Alignment: It correctly identifies the hybrid nature of the use case, combining STACKIT IaaS (Compute Engine/Servers, Networking, Security Groups) with STACKIT Edge Cloud (STEC) Edge Cloud Edge Cloud.
  • Use-Case Clarity: It explicitly mentions the end goalβ€”deploying a Kubernetes cluster (specifically using Talos Linux) on edge infrastructure.
  • Consistency: The name follows the pattern of describing the underlying infrastructure provider and the high-level workload.

2. README Quality

The README.md is high quality and meets all professional standards for a cloud architect's reference.

  • Service Explanation: It clearly distinguishes between resources managed by the STACKIT Terraform provider (IaaS components) and those managed via the STEC Kubernetes API (EdgeImage and EdgeCluster CRDs) Creating Clusters.
  • Architecture Visualization: It includes a clear ASCII diagram illustrating the relationship between the STEC Management Plane, the IaaS layer, and the resulting EdgeCluster.
  • Usage Instructions:
    • Configuration: Provides a clear table for required variables and instructions on how to retrieve them (e.g., using the stackit CLI) Stackit Beta Edge Cloud Kubeconfig Create.Md.
    • Deployment: Includes the standard terraform init and terraform apply workflow.
    • Verification: Provides concrete kubectl commands to verify the cluster state.
    • Lifecycle Management: Includes critical operational instructions, such as how to upgrade Talos/Kubernetes and, most importantly, the correct cleanup order (deleting the EdgeCluster before destroying VMs to prevent orphaned EdgeHosts) Creating Clusters.
  • Technical Nuances: The README includes vital "Notes" for architects, such as the warning against cloning VMs due to Talos's reliance on disk UUIDs for identity, and the 24-hour expiry of the STEC kubeconfig.

Verdict:
βœ… Example READMEs are complete.

⚠️ πŸ’¬ Commit Messages
πŸ€– STACKIT Model Serving

βœ… Commit messages are descriptive.

πŸ” STACKIT Cloud Advisor

Based on my review of the provided pull request commit messages, I have evaluated them against professional standards for traceability and clarity within a STACKIT development environment.

Review Summary

The commit message provided is not vague, but it could be improved to better align with professional documentation standards.

Commit Message Status Architect's Assessment
example(edge): basic example on how to deploy edge Acceptable It follows a structured format (scope/type) and provides context. However, "basic example" is slightly generic.

Detailed Analysis & Recommendations

While the message example(edge): basic example on how to deploy edge provides enough context to understand the intent, a senior architect looks for messages that facilitate rapid debugging and automated changelog generation. In a professional services repository, we want to know exactly which resource or configuration is being introduced.

Suggested Improvements

If you wish to elevate the quality of your commit history to ensure maximum maintainability, consider the following alternatives:

  1. More Descriptive Alternative (Focus on Resource):

    • docs(edge): add deployment guide for STACKIT Edge resources
    • Reasoning: Specifies that this is a documentation change (docs) and identifies the specific STACKIT service/resource being addressed.
  2. Action-Oriented Alternative (Focus on Implementation):

    • feat(edge): implement initial deployment template for edge nodes
    • Reasoning: If this commit contains actual configuration code (like Terraform or YAML), using feat (feature) is more accurate than example.

Architect's Pro-Tip for STACKIT Repositories

To maintain a high-quality repository, I recommend adopting a Conventional Commits pattern. This ensures that when you look back at your history via the Blame File View in STACKIT Git, you can immediately distinguish between a bug fix, a new feature, or a documentation update.

Recommended Pattern:
<type>(<scope>): <description>

  • Types: feat, fix, docs, style, refactor, test, chore.
  • Scope: The STACKIT service or module being touched (e.g., edge, workflows, notebooks, git).
  • Description: A concise imperative summary (e.g., "add...", "fix...", "update...").

Generated automatically β€” treat as a hint, not a gate.

## πŸ€– AI PR Review > [`18c68d24`](https://professional-service.git.onstackit.cloud/professional-service-best-practices/professional-service/commit/18c68d24fd02ee89f7f224fc058a2e7d737343cd) Β· STACKIT Model Serving & STACKIT Cloud Advisor <details> <summary>βœ… πŸ“ Spelling & Grammar</summary> <details> <summary>πŸ€– STACKIT Model Serving</summary> βœ… No spelling or grammar issues found. </details> <details> <summary>πŸ” STACKIT Cloud Advisor</summary> ## STACKIT Terminology & Product Name Review As a senior architect, I have reviewed the provided git diff against the official STACKIT branding guidelines and product documentation. The primary goal was to ensure that all prose content, system prompts, and variable descriptions adhere to the correct casing and nomenclature for STACKIT services. ### Summary of Findings The diff shows a significant improvement in brand consistency, particularly in the transition from generic "AI" terminology to specific STACKIT product names. However, there is one specific terminology discrepancy regarding a service name used in the Terraform variable descriptions. | Category | Status | Architect's Note | | :--- | :--- | :--- | | **Core Brand** | βœ… Pass | "STACKIT" is consistently used in all-caps as required. | | **Model Serving** | βœ… Pass | Correctly identified as **STACKIT Model Serving**. | | **Cloud Advisor** | βœ… Pass | Correctly identified as **STACKIT Cloud Advisor**. | | **Kubernetes** | βœ… Pass | Correctly uses the abbreviation **SKE** (STACKIT Kubernetes Engine). | | **Edge Services** | ⚠️ Warning | One instance of "STEC" requires verification against current service naming. | ### Detailed Error Report The following line contains a terminology error based on the provided documentation: * **File:** `examples/iaas-edge-k8s-cluster/020-variables.tf` * **Line:** 43 * **Wrong Text:** `description = "STEC plan ID. Retrieve with: stackit beta edge-cloud plans list"` * **Correction:** `description = "STEC plan ID. Retrieve with: stackit beta edge-cloud plans list"` * *Architect's Note:* While "STEC" is used in the diff, ensure this aligns with the specific service name for Edge Cloud plans. If the service is officially branded as **STACKIT Edge Cloud**, the description should ideally reflect that for clarity, though "STEC" may be an internal or CLI-specific shorthand. ### Architectural Observations on Branding Implementation The implementation of the `_BRAND_NOTE` in `a/.github/scripts/ai_pr_review.py` is a critical safeguard. By explicitly instructing the LLM to flag variants like `StackIT` or `stackit`, you are automating the enforcement of the STACKIT brand identity within the CI/CD pipeline. **Key improvements noted in the diff:** 1. **Contextual Awareness:** The `advisor` prompts now explicitly mention STACKIT services like **SKE**, **Object Storage**, **DNS**, **Load Balancer**, and **PostgreSQL Flex** [Zertifikate](https://stackit.com/de/warum-stackit/vorteile/zertifikate). This provides the LLM with the necessary semantic context to perform high-quality infrastructure reviews. 2. **Service Specificity:** The transition from `[AI]` to `[LLM]` and `[Advisor]` in log outputs improves observability, allowing engineers to distinguish between the raw model response and the specialized **STACKIT Cloud Advisor** logic. 3. **Compliance Alignment:** The security review prompts now correctly reference **STACKIT IAM** and **SKE network policies**, aligning the automated review with STACKIT's security-first architecture [Zertifikate](https://stackit.com/de/warum-stackit/vorteile/zertifikate). </details> </details> <details> <summary>⚠️ πŸ—οΈ Infrastructure Changes</summary> <details> <summary>πŸ€– STACKIT Model Serving</summary> - Adds new Terraform example for IaaS Edge Kubernetes Cluster (`examples/iaas-edge-k8s-cluster/`) with provider and variable definitions. - Introduces STACKIT Cloud Advisor integration via `CLOUDMENT_TOKEN` and parallel backend execution for PR reviews. - Renames `call_ai()` to `call_llm()` and adds `call_advisor()` for dual-AI review workflow. - Updates PR review comment structure to display results from both STACKIT Model Serving and STACKIT Cloud Advisor under collapsible sections. - Modifies GitHub Actions workflow to include `CLOUDMENT_TOKEN` secret for Cloud Advisor API access. </details> <details> <summary>πŸ” STACKIT Cloud Advisor</summary> ### 1. STACKIT Services Identification Based on the provided Terraform files and variable definitions, the following services are being provisioned or configured: * **STACKIT Edge Cloud (STEC):** The primary focus of the new example. The presence of `stec_plan_id`, `stec_instance_name`, and variables for `talos_version` and `kubernetes_version` indicates the provisioning of an Edge Kubernetes cluster [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). * **STACKIT Terraform Provider:** The code explicitly configures the `stackit` provider with `enable_beta_resources = true`, which is required for managing Edge Cloud products in their current state [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). * **Compute/Edge Infrastructure:** The configuration defines control plane (`cp_count`) and worker node (`worker_count`) resources, along with specific machine types (`c2i.4` and `c2i.8`) and disk configurations [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). ### 2. STACKIT Best Practices & Observations * **Beta Resource Usage:** The provider configuration uses `enable_beta_resources = true`. While necessary for Edge Cloud, this confirms the service is in a beta state. Users should be aware that beta services may have different support characteristics [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). * **Disk Sizing:** The variable `disk_size_gb` includes a validation rule ensuring a minimum of 32 GiB. This aligns with STACKIT's technical requirement that Talos Linux requires at least 32 GiB of capacity, though **100 GiB is specifically recommended by STACKIT** for optimal operation [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). * **Provider Versioning:** The `required_providers` block correctly implements explicit version constraints (e.g., `version = ">= 0.107.0"`), which is a best practice for infrastructure stability. * **Naming Conventions:** The `cluster_name` variable documentation correctly notes the requirement for **RFC 1034** compliance, which is critical for resource naming in STACKIT. ### 3. Quotas, Constraints, and Limitations As an architect, I flag the following constraints that apply to this specific configuration: | Constraint Type | Detail | Impact on this PR | | :--- | :--- | :--- | | **Service Limitation** | **EdgeCluster Scaling** | STACKIT Edge Cloud is sized and tested for up to **1000 accumulated EdgeCluster objects** per instance. Exceeding this may lead to an unsupported state [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). | | **Operational Constraint** | **No VM Cloning** | If this infrastructure is ever moved via VM/Disk cloning, the node will lose its registered identity (UUID) and break the control plane/cluster connection. **Always provision via images** [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). | | **Network Requirement** | **Egress Connectivity** | Every edge host must be able to establish an outgoing connection to `stackit.cloud` via **TCP port 443** [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). | | **Registry Access** | **Public Repositories** | Talos Linux requires access to `gcr.io`, `ghcr.io`, and `registry.k8s.io` to download installers and images [Faq](https://docs.stackit.cloud/de/products/runtime/edge-cloud/faq/) [Faq](https://docs.stackit.cloud/products/runtime/edge-cloud/faq/). | **Architectural Topology Note:** The configuration describes a standard redundant Edge Kubernetes topology: ```text [ STACKIT Management Plane ] | | (via TCP 443) v [ STACKIT Edge Cloud Instance ] |-- [ EdgeCluster Control Plane (3 nodes) ] |-- [ EdgeCluster Worker Nodes (3 nodes) ] |-- [ Boot Disk (min 32GB, 100GB rec.) ] ``` </details> </details> <details> <summary>⚠️ πŸ”’ Security Review</summary> <details> <summary>πŸ€– STACKIT Model Serving</summary> βœ… No security issues found. </details> <details> <summary>πŸ” STACKIT Cloud Advisor</summary> ### 1. STACKIT IAM or Authorization Misconfigurations * πŸ”΄ **High: Risk of Service Account Key Exposure in CI/CD** The addition of `CLOUDMENT_TOKEN: ${{ secrets.CLOUDMENT_TOKEN }}` to the GitHub/Forgejo workflow suggests a high-privilege token is being passed into the runner environment. While stored as a secret, any compromise of the runner or a misconfigured logging step could expose this token. * **Architect's Advice:** Consider moving toward **Workload Identity Federation (WIF)** to link your CI/CD provider to a STACKIT service account, allowing you to acquire **short-lived tokens without static keys** [Service Accounts](https://docs.stackit.cloud/platform/access-and-identity/service-accounts/). * 🟑 **Medium: Terraform Provider Authentication via Static Key Path** The provider configuration in `010-provider.tf` uses `service_account_key_path = var.stackit_service_account_key_path`. This implies the presence of a static JSON key file on the machine executing Terraform. * **Architect's Advice:** Ensure the execution environment (e.g., the CI runner) is highly secured. If possible, use WIF to avoid managing long-lived JSON keys entirely [Service Accounts](https://docs.stackit.cloud/platform/access-and-identity/service-accounts/). ### 2. Missing STACKIT-Specific Security Controls * πŸ”΄ **High: Overly Permissive Security Group Rules (Ingress/Egress)** In `040-network.tf`, the security group rules for both `ingress` and `egress` are defined without specifying ports or IP ranges: ```hcl resource "stackit_security_group_rule" "ingress_tcp" { # ... direction = "ingress" protocol = { name = "tcp" } } ``` This effectively creates an "allow-all" rule for the TCP/UDP protocols. This violates the **Principle of Least Privilege** [Security In Networks](https://docs.stackit.cloud/de/products/security/security-hardening/security-in-networks/) [Security In Networks](https://docs.stackit.cloud/products/security/security-hardening/security-in-networks/) [Introduction](https://docs.stackit.cloud/products/network/core-networking/security-groups/basics/introduction/). * **Architect's Advice:** You must restrict these rules to specific ports (e.g., 443 for STEC registration) and specific IP ranges. Avoid wide port ranges or `0.0.0.0/0` unless absolutely necessary [Introduction](https://docs.stackit.cloud/products/network/core-networking/security-groups/basics/introduction/). * 🟑 **Medium: Lack of Network Segmentation for Control Plane vs. Workers** The current configuration attaches the same `stackit_security_group.cluster` to both `stackit_network_interface.cp` and `stackit_network_interface.worker`. * **Architect's Advice:** Follow the **Tiered Architecture** best practice [Introduction](https://docs.stackit.cloud/products/network/core-networking/security-groups/basics/introduction/). Create separate Security Groups for the Control Plane and the Worker nodes to limit lateral movement within the cluster. **Current Network Topology Risk:** ```text [ Internet ] | [ STACKIT Network (10.0.10.0/24) ] | +-- [ SG: cluster (ALLOW ALL TCP/UDP) ] | +-- [ CP Nodes ] <--- Vulnerable to lateral movement | +-- [ Worker Nodes ] ``` ### 3. Secrets, Credentials, or Sensitive Values * 🟑 **Medium: Sensitive Kubeconfig and Token Handling** The code uses `local_sensitive_file` to write `.stec.kubeconfig.json` to the local disk [030-edge-instance.tf]. While `file_permission = "0600"` is correctly applied, this file contains highly sensitive credentials for the STEC management plane and the EdgeCluster. * **Architect's Advice:** Ensure that the `.stec.kubeconfig.json` and any files in the `.generated/` directory are explicitly added to `.gitignore` to prevent accidental commits of cluster credentials. ### 4. STACKIT Compliance and Audit-Logging Considerations * 🟑 **Medium: Absence of Explicit Audit Logging Configuration** The PR introduces significant infrastructure changes (Networks, Security Groups, Servers, and EdgeCloud instances) but does not include configurations for centralized logging or audit monitoring. * **Architect's Advice:** While STACKIT provides underlying platform logs, ensure that your application-level and cluster-level logs are being directed to a persistent and auditable location to maintain compliance and facilitate incident response. </details> </details> <details> <summary>βœ… πŸ“ Example Consistency</summary> <details> <summary>πŸ€– STACKIT Model Serving</summary> βœ… Example follows repository conventions. </details> <details> <summary>πŸ” STACKIT Cloud Advisor</summary> ### Repository Convention Review The provided git diff has been reviewed against the specified repository conventions and STACKIT provider best practices. While the example is structurally sound and follows most organizational rules, there are a few deviations regarding provider versioning and resource configuration. #### 1. Repository Convention Deviations | Convention | Status | Observation | | :--- | :--- | :--- | | **3-digit numeric prefixes** | βœ… Pass | Files use `010-`, `020-`, etc. | | **README.md & MAINTAINERS.md** | βœ… Pass | Both files are present. | | **Variable naming & description** | βœ… Pass | All variables use `snake_case` and have `description` attributes. | | **Explicit provider versioning** | ❌ **Fail** | The `required_providers` block in `010-provider.tf` uses inequality constraints (`>=`) rather than explicit version constraints. | | **.terraform.lock.hcl** | βœ… Pass | The lock file is present and committed. | | **Apache 2.0 license headers** | βœ… Pass | Headers are present on all `.tf` files. | **Fix for provider versioning:** To comply with the requirement for explicit version constraints (pinning), update the `required_providers` block to use exact versions or more restrictive constraints. ```hcl terraform { required_version = ">= 1.4.0" required_providers { stackit = { source = "stackitcloud/stackit" version = "0.110.0" } local = { source = "hashicorp/local" version = "2.9.0" } null = { source = "hashicorp/null" version = "3.3.0" } } } ``` #### 2. STACKIT Provider & Usage Concerns **A. Beta Resource Opt-in** The example utilizes `stackit_edgecloud_instance`, `stackit_edgecloud_kubeconfig`, and `stackit_edgecloud_token`. These are part of the Edge Cloud service, which is currently in a beta state. While the provider block correctly sets `enable_beta_resources = true` [Stackit Terraform Provider](https://docs.stackit.cloud/developer-tools/stackit-iac/stackit-terraform-provider/), it is important to note that beta resources may be subject to breaking changes. **B. Security Group Rule Definition** In `040-network.tf`, the security group rules are defined using a block syntax for the protocol: `protocol = { name = "tcp" }`. While this is functional, ensure this matches the specific schema requirements for the provider version being used, as some versions of the STACKIT provider may expect a simple string for the protocol name. **C. Server Network Attachment** The example uses a "pre-creation" strategy for NICs (`stackit_network_interface`) and then references them in the `stackit_server` resource. This is a highly recommended pattern for STACKIT Compute Engine to ensure that security groups and network configurations are fully applied before the VM boots, preventing race conditions during the initial registration of the instance. **D. Authentication Best Practice** The example uses the **Key Flow** via `service_account_key_path` [Docs](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs). For production CI/CD pipelines (e.g., GitHub Actions), I recommend transitioning to the **Workload Identity Federation (WIF)** flow, which is more secure as it eliminates the need for long-lived static JSON keys [Docs](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs). ```hcl # Recommended for CI/CD (Workload Identity Federation) provider "stackit" { default_region = var.stackit_region service_account_email = var.stackit_service_account_email service_account_federated_token = var.stackit_oidc_token use_oidc = true } ``` </details> </details> <details> <summary>βœ… πŸ“š Example README</summary> <details> <summary>πŸ€– STACKIT Model Serving</summary> βœ… Example READMEs are complete. </details> <details> <summary>πŸ” STACKIT Cloud Advisor</summary> ### Review of `examples/iaas-edge-k8s-cluster` I have reviewed the provided git diff for the new example directory. Below is my architectural assessment regarding naming conventions and documentation quality. #### 1. Naming Convention The directory name `iaas-edge-k8s-cluster` is **accurate and descriptive**. * **Service Alignment**: It correctly identifies the hybrid nature of the use case, combining **STACKIT IaaS** (Compute Engine/Servers, Networking, Security Groups) with **STACKIT Edge Cloud (STEC)** [Edge Cloud](https://docs.stackit.cloud/de/products/runtime/edge-cloud/) [Edge Cloud](https://docs.stackit.cloud/products/runtime/edge-cloud/). * **Use-Case Clarity**: It explicitly mentions the end goalβ€”deploying a **Kubernetes** cluster (specifically using Talos Linux) on edge infrastructure. * **Consistency**: The name follows the pattern of describing the underlying infrastructure provider and the high-level workload. #### 2. README Quality The `README.md` is **high quality** and meets all professional standards for a cloud architect's reference. * **Service Explanation**: It clearly distinguishes between resources managed by the **STACKIT Terraform provider** (IaaS components) and those managed via the **STEC Kubernetes API** (EdgeImage and EdgeCluster CRDs) [Creating Clusters](https://docs.stackit.cloud/de/products/runtime/edge-cloud/getting-started/creating-clusters/). * **Architecture Visualization**: It includes a clear ASCII diagram illustrating the relationship between the **STEC Management Plane**, the **IaaS layer**, and the resulting **EdgeCluster**. * **Usage Instructions**: * **Configuration**: Provides a clear table for required variables and instructions on how to retrieve them (e.g., using the `stackit` CLI) [Stackit Beta Edge Cloud Kubeconfig Create.Md](https://github.com/stackitcloud/stackit-cli/blob/main/docs/stackit_beta_edge-cloud_kubeconfig_create.md). * **Deployment**: Includes the standard `terraform init` and `terraform apply` workflow. * **Verification**: Provides concrete `kubectl` commands to verify the cluster state. * **Lifecycle Management**: Includes critical operational instructions, such as how to upgrade Talos/Kubernetes and, most importantly, the **correct cleanup order** (deleting the `EdgeCluster` before destroying VMs to prevent orphaned `EdgeHosts`) [Creating Clusters](https://docs.stackit.cloud/de/products/runtime/edge-cloud/getting-started/creating-clusters/). * **Technical Nuances**: The README includes vital "Notes" for architects, such as the warning against cloning VMs due to Talos's reliance on disk UUIDs for identity, and the 24-hour expiry of the STEC kubeconfig. **Verdict:** βœ… Example READMEs are complete. </details> </details> <details> <summary>⚠️ πŸ’¬ Commit Messages</summary> <details> <summary>πŸ€– STACKIT Model Serving</summary> βœ… Commit messages are descriptive. </details> <details> <summary>πŸ” STACKIT Cloud Advisor</summary> Based on my review of the provided pull request commit messages, I have evaluated them against professional standards for traceability and clarity within a STACKIT development environment. ### Review Summary The commit message provided is **not vague**, but it could be improved to better align with professional documentation standards. | Commit Message | Status | Architect's Assessment | | :--- | :--- | :--- | | `example(edge): basic example on how to deploy edge` | **Acceptable** | It follows a structured format (scope/type) and provides context. However, "basic example" is slightly generic. | ### Detailed Analysis & Recommendations While the message `example(edge): basic example on how to deploy edge` provides enough context to understand the intent, a senior architect looks for messages that facilitate rapid debugging and automated changelog generation. In a professional services repository, we want to know exactly which resource or configuration is being introduced. #### Suggested Improvements If you wish to elevate the quality of your commit history to ensure maximum maintainability, consider the following alternatives: 1. **More Descriptive Alternative (Focus on Resource):** * `docs(edge): add deployment guide for STACKIT Edge resources` * *Reasoning:* Specifies that this is a documentation change (`docs`) and identifies the specific STACKIT service/resource being addressed. 2. **Action-Oriented Alternative (Focus on Implementation):** * `feat(edge): implement initial deployment template for edge nodes` * *Reasoning:* If this commit contains actual configuration code (like Terraform or YAML), using `feat` (feature) is more accurate than `example`. ### Architect's Pro-Tip for STACKIT Repositories To maintain a high-quality repository, I recommend adopting a **Conventional Commits** pattern. This ensures that when you look back at your history via the **Blame File View** in STACKIT Git, you can immediately distinguish between a bug fix, a new feature, or a documentation update. **Recommended Pattern:** `<type>(<scope>): <description>` * **Types:** `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`. * **Scope:** The STACKIT service or module being touched (e.g., `edge`, `workflows`, `notebooks`, `git`). * **Description:** A concise imperative summary (e.g., "add...", "fix...", "update..."). </details> </details> --- _Generated automatically β€” treat as a hint, not a gate._
mauritz.uphoff deleted branch example/stec-example 2026-08-19 14:05:37 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
professional-service-best-practices/professional-service!62
No description provided.