Quick Start¶
Get started with AMDF using either the CLI or MCP interface.
Choose Your Interface¶
Step 1: Verify Prerequisites¶
Ensure you have access to a Kubernetes cluster with CRDs:
Step 2: Discover Resources¶
# List all CRDs
amdf list-crds
# Filter CRDs by service
amdf list-crds --filter ec2
amdf list-crds --filter istio
# List native Kubernetes resources
amdf list-k8s
# Filter K8s resources
amdf list-k8s --filter pod
amdf list-k8s --filter deployment
amdf list-k8s --filter storage
# Specify Kubernetes version
amdf list-k8s --version 1.30.0 --filter networking
Expected output:
Step 3: Generate Your First Schema¶
# Generate from CRDs
amdf generate instances.ec2.aws.upbound.io
# Generate from native Kubernetes objects (case-sensitive)
amdf generate-k8s Pod
amdf generate-k8s Service
# Generate without blueprint
amdf generate instances.ec2.aws.upbound.io --no-blueprint
# Custom output directory
amdf generate-k8s Deployment --output ./my-schemas
Kubernetes Kind Names
Kind names are case-sensitive and must match exactly (e.g., Service not service, Pod not pod). Use amdf list-k8s to see the correct names.
This creates:
For CRDs:
library/
├── models/
│ └── ec2_aws_upbound_io/v1beta1/
│ └── ec2_aws_upbound_io_v1beta1_Instance.k # Complete schema
├── blueprints/
│ └── Instance.k # Simplified interface
├── policies/
│ └── InstancePolicy.k # Custom validation template
└── main.k # Usage example
For Native K8s Objects:
library/
├── models/
│ └── k8s/v1/
│ └── k8s_v1_Pod.k # Complete schema
├── blueprints/
│ └── Pod.k # Simplified interface
├── policies/
│ └── PodPolicy.k # Custom validation template
└── main.k # Usage example
Step 4: Use the Generated Blueprints¶
Create your first infrastructure configuration:
import blueprints.Instance
# EC2 Instance configuration
webServer = Instance.InstanceBlueprint {
_metadataName = "web-server"
_providerConfig = "default"
_instanceType = "t3.medium"
_region = "us-east-1"
# Security configuration
_metadataOptions = [{
httpTokens = "required"
}]
_rootBlockDevice = [{
encrypted = True
}]
_tags = {
Name = "web-server"
Environment = "production"
}
}
import blueprints.Service
import blueprints.Deployment
# Service configuration
service = Service.ServiceBlueprint {
_metadataName = "nginx"
_namespace = "demo"
_labels = {app = "nginx"}
_ports = [{name = "http", port = 80, protocol = "TCP", targetPort = 80}]
_selector = {app = "nginx"}
_type = "ClusterIP"
}
# Deployment configuration
deployment = Deployment.DeploymentBlueprint {
_metadataName = "nginx"
_namespace = "demo"
_labels = {app = "nginx", version = "v1"}
_replicas = 2
_selector = {matchLabels = {app = "nginx", version = "v1"}}
_template = {
metadata = {labels = {app = "nginx", version = "v1"}}
spec = {
containers = [{
name = "nginx"
image = "nginx:1.25"
ports = [{containerPort = 80}]
}]
}
}
}
Step 5: Deploy and Distribute¶
Once you have your KCL configuration, you have multiple deployment and distribution options:
Distribution Patterns¶
AMDF generates KCL modules that can be distributed using standard KCL package management:
- OCI Registries: Platform teams generate and publish schemas to any OCI registries
- GitOps: Commit to repositories for automatic sync
- Multi-Environment: Use different versions for dev/staging/production
KCL Package Management
For comprehensive documentation on KCL package management, distribution, and deployment patterns, see the official KCL Package Management Guide.
Key topics include:
Common Workflows¶
Multi-Service Infrastructure¶
Service Mesh Setup¶
Monitoring Stack¶
Example Conversations (MCP)¶
Scenario 1: New Infrastructure¶
User: "I need to create AWS infrastructure with Crossplane"
Assistant: [Lists AWS CRDs available]
User: "Generate schemas for EC2 and VPC"
Assistant: [Generates schemas and blueprints]
Scenario 2: Service Mesh¶
User: "Show me Istio CRDs"
Assistant: [Lists Istio-related CRDs]
User: "Generate schema for VirtualService and native Service"
Assistant: [Generates Istio VirtualService and Kubernetes Service schemas]
Scenario 3: Complete Application Stack¶
User: "I need to deploy a web application with Kubernetes"
Assistant: [Shows available native K8s objects]
User: "Generate schemas for Deployment, Service, and ConfigMap"
Assistant: [Generates native Kubernetes schemas and blueprints]
Next Steps¶
- CLI Reference - Complete CLI documentation
- MCP Integration - Advanced MCP usage
- Examples - More detailed examples
Troubleshooting¶
No CRDs Found
Make sure your cluster has operators installed: