Skip to content

Commit

Permalink
refactor(examples): Update and expand ResourceGroup examples
Browse files Browse the repository at this point in the history
- Reorganize examples into Basic and Advanced sections
- Add new examples for deploying CoreDNS, controllers, AWS resources
- Rename some examples for clarity (e.g. web-app instead of deploymentservice)
- Remove outdated EKSCluster example
- Add an index page summarizing the available examples

docs(concepts): Improve ResourceGroup and schema documentation

- Rewrite ResourceGroup concepts to be more clear and approachable
- Expand schema documentation to cover markers, status fields, conditions
- Clarify Instance lifecycle, status fields, and best practices
- Fix typos and formatting issues
  • Loading branch information
a-hilaly committed Nov 11, 2024
1 parent c3cdc36 commit 6ccacc1
Show file tree
Hide file tree
Showing 21 changed files with 1,395 additions and 558 deletions.
4 changes: 2 additions & 2 deletions examples/cachecluster/cachecluster-instance.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: kro.run/v1alpha1
kind: Redis
kind: Valkey
metadata:
name: my-cache-subnetgroup
spec:
name: my-cache-subnetgroup
name: my-cache-subnetgroup
112 changes: 56 additions & 56 deletions examples/cachecluster/cachecluster.yaml
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
apiVersion: kro.run/v1alpha1
kind: ResourceGroup
metadata:
name: redis.kro.run
name: valkey.kro.run
spec:
schema:
apiVersion: v1alpha1
kind: Redis
kind: Valkey
spec:
name: string
status:
csgARN: ${cacheSubnetGroup.status.ackResourceMetadata.arn}
subnets: ${cacheSubnetGroup.status.subnets}
clusterARN: ${redis.status.ackResourceMetadata.arn}
clusterARN: ${valkey.status.ackResourceMetadata.arn}
resources:
- name: networkingStack
template:
apiVersion: kro.run/v1alpha1
kind: NetworkingStack
metadata:
name: ${schema.spec.name}-networking-stack
spec:
name: ${schema.spec.name}-networking-stack
- name: cacheSubnetGroup
template:
apiVersion: elasticache.services.k8s.aws/v1alpha1
kind: CacheSubnetGroup
metadata:
name: ${schema.spec.name}-redis-subnet-group
spec:
cacheSubnetGroupDescription: "Redis ElastiCache subnet group"
cacheSubnetGroupName: ${schema.spec.name}-redis-subnet-group
subnetIDs:
- ${networkingStack.status.networkingInfo.subnetAZA}
- ${networkingStack.status.networkingInfo.subnetAZB}
- ${networkingStack.status.networkingInfo.subnetAZC}
- name: sg
template:
apiVersion: ec2.services.k8s.aws/v1alpha1
kind: SecurityGroup
metadata:
name: ${schema.spec.name}-redis-sg
spec:
name: ${schema.spec.name}-redis-sg
description: "Redis ElastiCache security group"
vpcID: ${networkingStack.status.networkingInfo.vpcID}
ingressRules:
- fromPort: 6379
toPort: 6379
ipProtocol: tcp
ipRanges:
- cidrIP: 0.0.0.0/0
- name: redis
template:
apiVersion: elasticache.services.k8s.aws/v1alpha1
kind: CacheCluster
metadata:
name: ${schema.spec.name}-redis
spec:
cacheClusterID: vote-redis-cluster
cacheNodeType: cache.t3.micro
cacheSubnetGroupName: ${schema.spec.name}-redis-subnet-group
engine: redis
engineVersion: "7.1"
numCacheNodes: 1
port: 6379
securityGroupIDs:
- ${sg.status.id}
- name: networkingStack
template:
apiVersion: kro.run/v1alpha1
kind: NetworkingStack
metadata:
name: ${schema.spec.name}-networking-stack
spec:
name: ${schema.spec.name}-networking-stack
- name: cacheSubnetGroup
template:
apiVersion: elasticache.services.k8s.aws/v1alpha1
kind: CacheSubnetGroup
metadata:
name: ${schema.spec.name}-valkey-subnet-group
spec:
cacheSubnetGroupDescription: "Valkey ElastiCache subnet group"
cacheSubnetGroupName: ${schema.spec.name}-valkey-subnet-group
subnetIDs:
- ${networkingStack.status.networkingInfo.subnetAZA}
- ${networkingStack.status.networkingInfo.subnetAZB}
- ${networkingStack.status.networkingInfo.subnetAZC}
- name: sg
template:
apiVersion: ec2.services.k8s.aws/v1alpha1
kind: SecurityGroup
metadata:
name: ${schema.spec.name}-valkey-sg
spec:
name: ${schema.spec.name}-valkey-sg
description: "Valkey ElastiCache security group"
vpcID: ${networkingStack.status.networkingInfo.vpcID}
ingressRules:
- fromPort: 6379
toPort: 6379
ipProtocol: tcp
ipRanges:
- cidrIP: 0.0.0.0/0
- name: valkey
template:
apiVersion: elasticache.services.k8s.aws/v1alpha1
kind: CacheCluster
metadata:
name: ${schema.spec.name}-valkey
spec:
cacheClusterID: vote-valkey-cluster
cacheNodeType: cache.t3.micro
cacheSubnetGroupName: ${schema.spec.name}-valkey-subnet-group
engine: valkey
engineVersion: "8.x"
numCacheNodes: 1
port: 6379
securityGroupIDs:
- ${sg.status.id}
24 changes: 12 additions & 12 deletions examples/cachecluster/simple-cachecluster.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
apiVersion: kro.run/v1alpha1
kind: ResourceGroup
metadata:
name: redis.kro.run
name: valkey.kro.run
spec:
schema:
apiVersion: v1alpha1
kind: Redis
kind: Valkey
spec:
name: string
subnetIDs: "[]string"
status:
csgARN: ${cacheSubnetGroup.status.ackResourceMetadata.arn}
subnets: ${cacheSubnetGroup.status.subnets}
resources:
- name: cacheSubnetGroup
template:
apiVersion: elasticache.services.k8s.aws/v1alpha1
kind: CacheSubnetGroup
metadata:
name: ${schema.spec.name}-redis-subnet-group
spec:
cacheSubnetGroupDescription: "Redis ElastiCache subnet group"
cacheSubnetGroupName: ${schema.spec.name}-redis-subnet-group
subnetIDs: ${schema.spec.subnetIDs}
- name: cacheSubnetGroup
template:
apiVersion: elasticache.services.k8s.aws/v1alpha1
kind: CacheSubnetGroup
metadata:
name: ${schema.spec.name}-valkey-subnet-group
spec:
cacheSubnetGroupDescription: "Valkey ElastiCache subnet group"
cacheSubnetGroupName: ${schema.spec.name}-valkey-subnet-group
subnetIDs: ${schema.spec.subnetIDs}
Loading

0 comments on commit 6ccacc1

Please sign in to comment.