Skip to content

Mega Feature: Implement collections (for loops) in ResourceGroups #17

@a-hilaly

Description

@a-hilaly

Add support for collections in ResourceGroups to allow dynamic creation of multiple similar resources.. This will probably need a design and a review. It also needs the garbage collection mechanisms to be in place.

  • Implement iteration based on a range or list
  • Add current iteration index reference within resource definitions
  • Support specifying "deployment strategies" for collection types

Example:

apiVersion: x.symphony.k8s.aws/v1alpha1
kind: ResourceGraphDefinition
metadata:
  name: replicaset.x.symphony.k8s.aws
spec:
  apiVersion: v1alpha1
  kind: ReplicaSet
  definition:
    spec:
      image: string
      replicas: integer
  resources:
  - name: podsCollection
    collection:
      index: ${range(0, spec.replicas)}
      deploymentStrategy: RollingUpdates
      definition:
        apiVersion: v1alpha1
        kind: Pod
        metadata:
          name: pod-unit-${index}
        spec:
          containers:
          - image: ${spec.image}
            replicas: ${spec.replicas}

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/designkind/featureCategorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions