the existing infrastructure

This commit is contained in:
Platform team
2026-11-02 09:55:39 +00:00
commit b2c2460a52
21 changed files with 537 additions and 0 deletions
+68
View File
@@ -0,0 +1,68 @@
apiVersion: quai.dev/v1beta1
kind: Blueprint
metadata:
name: app-servers
title: Application servers
description: A web server and its database server in one environment, requested and approved together. Built on the designer canvas.
icon: layers
category: Applications
version: 1.0.0
owners: [team:platform]
tags: [terraform, vm]
spec:
inputs:
type: object
required: [environment, app]
additionalProperties: false
properties:
environment: { type: string, title: Environment, enum: [dev, test, prod], default: dev }
app: { type: string, title: Application, pattern: "^[a-z][a-z0-9]{1,20}$" }
webCpu: { type: integer, title: Web server vCPUs, minimum: 1, maximum: 16, default: 2 }
withDatabase: { type: boolean, title: Add a database server, default: true }
dbDiskGb: { type: integer, title: Database data disk (GB), minimum: 50, maximum: 4096, default: 200 }
ui:
order: [environment, app, webCpu, withDatabase, dbDiskGb]
fields:
dbDiskGb: { visibleIf: "inputs.withDatabase" }
resources:
- id: web
type: { name: vm }
params:
env: ${{ inputs.environment }}
name: ${{ inputs.app + '-web01' }}
values:
template: ubuntu-24.04
cpu: ${{ inputs.webCpu }}
memory_gb: ${{ inputs.webCpu * 2 }}
disks: [{ size_gb: 50 }]
network: { vlan: 110 }
dependsOn: [db]
- id: db
when: inputs.withDatabase
type: { name: vm }
params:
env: ${{ inputs.environment }}
name: ${{ inputs.app + '-db01' }}
values:
template: rhel-9
cpu: 4
memory_gb: 16
disks:
- { size_gb: 100, tier: ssd }
- { size_gb: "${{ inputs.dbDiskGb }}", tier: ssd }
network: { vlan: 130 }
backup: true
backup_policy: "${{ inputs.environment == 'prod' ? 'hourly' : 'daily' }}"
approval:
rules:
- name: production
when: inputs.environment == 'prod'
approvers: [group:platform-admins]
actions:
- name: scale-web
title: Scale the web server
icon: maximize
inputs:
- { name: cpu, title: vCPUs, type: integer, min: 1, max: 16, required: true }
apply:
web: { action: resize, inputs: { cpu: "${{ action.cpu }}", memory_gb: "${{ action.cpu * 2 }}" } }
+66
View File
@@ -0,0 +1,66 @@
apiVersion: quai.dev/v1beta1
kind: Blueprint
metadata:
name: linux-vm
title: Linux virtual machine
description: A VM in the Terraform repository, sized from t-shirt sizes. The vRA classic, now a pull request.
icon: server
category: Compute
version: 2.0.0
owners: [team:platform]
tags: [terraform, vm]
spec:
inputs:
type: object
required: [environment, name, os, size]
additionalProperties: false
properties:
environment: { type: string, title: Environment, enum: [dev, test, prod], default: dev }
name: { type: string, title: VM name, pattern: "^[a-z][a-z0-9-]{1,30}$" }
os:
type: string
title: Operating system
enum: [ubuntu-24.04, rhel-9]
default: ubuntu-24.04
size:
type: string
title: Size
description: small = 2 vCPU / 4 GB, medium = 4 / 16, large = 16 / 64
enum: [small, medium, large]
default: small
diskGb: { type: integer, title: System disk (GB), minimum: 20, maximum: 2048, default: 50 }
vlan: { type: integer, title: VLAN, enum: [110, 120, 130], default: 110 }
ui:
order: [environment, name, os, size, diskGb, vlan]
fields:
os: { immutable: true }
resources:
- id: vm
type: { name: vm } # a type in this repository
params:
env: ${{ inputs.environment }}
name: ${{ inputs.name }}
values:
template: ${{ inputs.os }}
cpu: "${{ inputs.size == 'small' ? 2 : inputs.size == 'medium' ? 4 : 16 }}"
memory_gb: "${{ inputs.size == 'small' ? 4 : inputs.size == 'medium' ? 16 : 64 }}"
disks: [{ size_gb: "${{ inputs.diskGb }}", tier: standard }]
network: { vlan: "${{ inputs.vlan }}" }
backup: ${{ inputs.environment == 'prod' }}
approval:
rules:
- name: large-vm-cost
when: inputs.size == 'large'
approvers: [group:finops]
actions:
- name: resize
title: Resize
icon: maximize
description: Change the VM size. The VM restarts to apply it.
inputs:
- { name: size, title: New size, type: enum, options: [small, medium, large], required: true }
apply:
vm:
values:
cpu: "${{ action.size == 'small' ? 2 : action.size == 'medium' ? 4 : 16 }}"
memory_gb: "${{ action.size == 'small' ? 4 : action.size == 'medium' ? 16 : 64 }}"