Creates KRO ResourceGraphDefinitions using Pulumi TypeScript for custom Kubernetes APIs, AWS ACK resource integration, and platform abstractions.
Ships in tchen-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate production-ready Kubernetes Resource Orchestrator (KRO) ResourceGraphDefinitions using Pulumi TypeScript for creating custom Kubernetes APIs and composing resources with AWS ACK integration.
Use this skill when the user wants to:
KRO (Kube Resource Orchestrator) is an open-source Kubernetes-native project that allows you to:
An RGD is KRO's core custom resource that:
Using Pulumi TypeScript to deploy KRO resources provides:
# 1. Kubernetes cluster (1.25+ for CEL support)
kubectl version
# 2. KRO installed in cluster
helm install kro oci://ghcr.io/kubernetes-sigs/kro/charts/kro \
--namespace kro-system \
--create-namespace
# 3. ACK controllers (if using AWS resources)
helm install ack-s3-controller \
oci://public.ecr.aws/aws-controllers-k8s/s3-chart \
--namespace ack-system \
--create-namespace
# 4. Pulumi CLI and Node.js
pulumi version
node --version
# Create new Pulumi project
mkdir my-kro-project && cd my-kro-project
pulumi new kubernetes-typescript
# Install dependencies
npm install @pulumi/kubernetes @pulumi/pulumi
Before generating code, gather:
Define the user-facing API:
// Schema design principles:
// - Use descriptive field names
// - Provide sensible defaults
// - Group related fields in nested objects
// - Add validation rules for constraints
Use this structure for KRO RGD:
import * as k8s from "@pulumi/kubernetes";
import * as pulumi from "@pulumi/pulumi";
// Create the ResourceGraphDefinition
const rgd = new k8s.apiextensions.CustomResource("my-app-rgd", {
apiVersion: "kro.run/v1alpha1",
kind: "ResourceGraphDefinition",
metadata: {
name: "my-application",
namespace: "default",
},
spec: {
schema: {
apiVersion: "v1alpha1",
kind: "Application",
spec: {
// Define user-configurable fields
name: "string",
image: "string | default=\"nginx:latest\"",
replicas: "integer | default=3",
},
status: {
// Auto-populated status fields
ready: "${deployment.status.conditions.exists(c, c.type == 'Available' && c.status == 'True')}",
availableReplicas: "${deployment.status.availableReplicas}",
},
validation: [
{
expression: "self.replicas >= 1 && self.replicas <= 100",
message: "Replicas must be between 1 and 100",
},
],
},
resources: [
{
id: "deployment",
template: {
apiVersion: "apps/v1",
kind: "Deployment",
metadata: {
name: "${schema.spec.name}",
},
spec: {
replicas: "${schema.spec.replicas}",
selector: {
matchLabels: {
app: "${schema.spec.name}",
},
},
template: {
metadata: {
labels: {
app: "${schema.spec.name}",
},
},
spec: {
containers: [
{
name: "app",
image: "${schema.spec.image}",
},
],
},
},
},
},
readyWhen: [
"${deployment.status.conditions.exists(c, c.type == 'Available' && c.status == 'True')}",
],
},
{
id: "service",
template: {
apiVersion: "v1",
kind: "Service",
metadata: {
name: "${schema.spec.name}-service",
},
spec: {
selector: {
app: "${schema.spec.name}",
},
ports: [
{
port: 80,
targetPort: 8080,
},
],
},
},
},
],
},
});
export const rgdName = rgd.metadata.name;
For AWS resources via ACK:
const rgdWithAws = new k8s.apiextensions.CustomResource("app-with-aws-rgd", {
apiVersion: "kro.run/v1alpha1",
kind: "ResourceGraphDefinition",
metadata: {
name: "application-with-storage",
},
spec: {
schema: {
apiVersion: "v1alpha1",
kind: "AppWithStorage",
spec: {
name: "string",
image: "string",
bucketName: "string",
},
status: {
bucketArn: "${bucket.status.ackResourceMetadata.arn}",
ready: "${deployment.status.conditions.exists(c, c.type == 'Available' && c.status == 'True')}",
},
},
resources: [
// ACK S3 Bucket
{
id: "bucket",
template: {
apiVersion: "s3.services.k8s.aws/v1alpha1",
kind: "Bucket",
metadata: {
name: "${schema.spec.bucketName}",
},
spec: {
name: "${schema.spec.bucketName}",
tagging: {
tagSet: [
{
key: "ManagedBy",
value: "KRO",
},
],
},
},
},
readyWhen: [
"${bucket.status.ackResourceMetadata.?arn != null}",
],
},
// Deployment referencing bucket
{
id: "deployment",
template: {
apiVersion: "apps/v1",
kind: "Deployment",
metadata: {
name: "${schema.spec.name}",
},
spec: {
replicas: 3,
selector: {
matchLabels: {
app: "${schema.spec.name}",
},
},
template: {
metadata: {
labels: {
app: "${schema.spec.name}",
},
},
spec: {
containers: [
{
name: "app",
image: "${schema.spec.image}",
env: [
{
name: "S3_BUCKET",
value: "${schema.spec.bucketName}",
},
{
name: "S3_BUCKET_ARN",
value: "${bucket.status.ackResourceMetadata.arn}",
},
],
},
],
},
},
},
},
},
],
},
});
# Deploy the RGD
pulumi up
# Verify RGD is active
kubectl get resourcegraphdefinition
kubectl describe resourcegraphdefinition my-application
# Check generated CRD
kubectl get crd | grep kro
# Create an instance of your custom API
kubectl apply -f - <<EOF
apiVersion: v1alpha1
kind: Application
metadata:
name: my-test-app
spec:
name: my-test-app
image: nginx:1.21
replicas: 5
EOF
# Monitor instance
kubectl get application
kubectl describe application my-test-app
${schema.spec.name} // User-provided spec field
${schema.metadata.name} // Instance name
${schema.metadata.namespace} // Instance namespace
${schema.metadata.uid} // Unique ID
${deployment.metadata.name} // Resource name
${deployment.spec.replicas} // Spec field
${deployment.status.?endpoint} // Optional status field (use ? for null safety)
// Ternary conditional
${schema.spec.env == 'prod' ? 10 : 3}
// String concatenation
${"prefix-" + schema.spec.name}
// Null coalescing
${deployment.status.?ready ?? false}
// List operations
${deployment.status.conditions.exists(c, c.type == 'Available' && c.status == 'True')}
${schema.spec.containers.map(c, c.name)}
// Type conversion
${string(schema.spec.replicas)}
${int(schema.spec.replicasString)}
resources:
- id: ingress
includeWhen:
- ${schema.spec.ingress.enabled}
template:
apiVersion: networking.k8s.io/v1
kind: Ingress
# ...
// Creates: Deployment + Service + optional Ingress + optional HPA
const webAppRgd = createWebAppRgd({
name: "webapp",
supportsIngress: true,
supportsAutoscaling: true,
});
// Creates: ACK RDS Instance + Secret + ConfigMap + Deployment
const dbAppRgd = createDatabaseAppRgd({
name: "dbapp",
dbEngine: "postgres",
withBackup: true,
});
// Creates: Multiple Deployments + Services + NetworkPolicies
const microservicesRgd = createMicroservicesRgd({
name: "platform",
services: ["api", "worker", "scheduler"],
});
// Creates environment-specific resources with quotas
const envAppRgd = createEnvironmentAppRgd({
name: "envapp",
environments: ["dev", "staging", "prod"],
});
| Service | Resource Types | ACK Controller |
|---|---|---|
| S3 | Bucket | s3-controller |
| RDS | DBInstance, DBCluster, DBSubnetGroup | rds-controller |
| DynamoDB | Table, GlobalTable | dynamodb-controller |
| SQS | Queue | sqs-controller |
| SNS | Topic, Subscription | sns-controller |
| Lambda | Function | lambda-controller |
| ElastiCache | CacheCluster, ReplicationGroup | elasticache-controller |
// Common ACK status patterns
${bucket.status.ackResourceMetadata.arn} // AWS ARN
${bucket.status.ackResourceMetadata.ownerAccountID} // AWS Account
${dbinstance.status.endpoint.address} // RDS endpoint
${dbinstance.status.endpoint.port} // RDS port
${queue.status.queueURL} // SQS URL
# Good: Clear, intuitive fields with defaults
spec:
name: string
image: string | default="nginx:latest"
replicas: integer | default=3
environment: string | default="dev"
# Bad: Cryptic field names, no defaults
spec:
n: string
i: string
r: integer
validation:
- expression: "self.replicas >= 1 && self.replicas <= 100"
message: "Replicas must be between 1 and 100"
- expression: "self.environment in ['dev', 'staging', 'prod']"
message: "Environment must be dev, staging, or prod"
- expression: "self.environment == 'prod' ? self.replicas >= 3 : true"
message: "Production requires at least 3 replicas"
readyWhen:
- ${deployment.status.conditions.exists(c, c.type == 'Available' && c.status == 'True')}
- ${deployment.status.readyReplicas == deployment.spec.replicas}
status:
ready: ${deployment.status.conditions.exists(c, c.type == 'Available' && c.status == 'True')}
availableReplicas: ${deployment.status.availableReplicas}
endpoint: ${service.spec.clusterIP}
bucketArn: ${bucket.status.ackResourceMetadata.?arn ?? 'pending'}
# Consistent naming pattern
metadata:
name: ${schema.spec.name}
labels:
app.kubernetes.io/name: ${schema.spec.name}
app.kubernetes.io/managed-by: kro
KRO Status: v1alpha1 (Alpha)
Recommendation: Use in development/testing environments while awaiting v1beta1 for production readiness.
When generating KRO RGD with Pulumi, always provide:
references/ack_resources.md (opens in a new tab)references/kro_schema.md (opens in a new tab)templates/README.md (opens in a new tab)templates/database-application.ts (opens in a new tab)templates/fullstack-application.ts (opens in a new tab)templates/index.ts (opens in a new tab)templates/multi-environment.ts (opens in a new tab)templates/web-application.ts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
8 skills in this plugin
/ai-imageGenerate AI images using OpenAI's gpt-image-1 model with customizable aspect ratios and artistic themes. Use when the user wants to create images, generate artwork, or mentions image generation with specific styles like Ghibli, futuristic, Pixar, oil painting, or Chinese painting./cel-k8sWrite production-ready CEL (Common Expression Language) code for Kubernetes ValidatingAdmissionPolicies, CRD validation rules, and security policies. Use when users need to create admission policies, validate Kubernetes resources, enforce security constraints, or write CEL expressions for Kubernetes./chat-historyExtract and organize Claude Code session history into project .chats directory. Use when users want to document their Claude sessions, export conversation inputs, or maintain a log of instructions given to Claude./tchen-skills:kro-rgd-pulumifrom tchen-skills
npx claudepluginhub tyrchen/claude-skills --plugin tchen-skillsOther plugins' skills for the same job