Skip to content

feat: add rollout api #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 6 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)
CONTROLLER_TOOLS_VERSION ?= v0.15.0
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
CODEGEN = $(LOCALBIN)/kube-codegen
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. If wrong version is installed, it will be overwritten.
$(CONTROLLER_GEN): $(LOCALBIN)
test -s $(LOCALBIN)/controller-gen && $(LOCALBIN)/controller-gen --version | grep -q $(CONTROLLER_TOOLS_VERSION) || \
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)
manifests:
@bash hack/make-rules/update-manifests.sh

manifests: controller-gen
@for dir in apps cluster; do \
mkdir -p "config/crd/$$dir"; \
$(CONTROLLER_GEN) rbac:roleName=manager-role crd:generateEmbeddedObjectMeta=true webhook paths="./$$dir/..." output:crd:artifacts:config="config/crd/$$dir"; \
done
generate:
@bash hack/make-rules/update-codegen.sh

generate: codegen controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
#@scripts/generate_client.sh
# $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
$(CODEGEN) code-gen --go-header-file=./hack/boilerplate.go.txt --code-generator-version=v0.27.16 --apis-path=./ --generators=deepcopy,register

codegen: $(CODEGEN) # Download kube-codegen locally if necessary. If wrong version is installed, it will be overwritten.
$(CODEGEN):
ifeq (, $(shell command -v $(CODEGEN)))
@cd $(shell mktemp -d) && \
git clone https://github.com/zoumo/kube-codegen.git && \
cd kube-codegen && \
GOBIN=$(LOCALBIN) go install ./cmd/kube-codegen
endif
134 changes: 33 additions & 101 deletions config/crd/apps/apps.kusionstack.io_collasets.yaml

Large diffs are not rendered by default.

918 changes: 325 additions & 593 deletions config/crd/apps/apps.kusionstack.io_poddecorations.yaml

Large diffs are not rendered by default.

2,656 changes: 2,656 additions & 0 deletions config/crd/rollout/rollout.kusionstack.io_backendroutings.yaml

Large diffs are not rendered by default.

4,990 changes: 4,990 additions & 0 deletions config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml

Large diffs are not rendered by default.

227 changes: 227 additions & 0 deletions config/crd/rollout/rollout.kusionstack.io_rollouts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
name: rollouts.rollout.kusionstack.io
spec:
group: rollout.kusionstack.io
names:
kind: Rollout
listKind: RolloutList
plural: rollouts
shortNames:
- ro
singular: rollout
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=='Available')].status
name: Available
type: string
- jsonPath: .status.phase
name: Phase
type: string
- jsonPath: .status.rolloutID
name: ID
type: string
- format: date-time
jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: Rollout is the Schema for the rollouts API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: RolloutSpec defines the desired state of Rollout
properties:
disabled:
description: |-
Disabled means that rollout will not response for new event.
Default value is false.
type: boolean
historyLimit:
default: 10
description: |-
HistoryLimit defines the maximum number of completed rolloutRun
history records to keep.
The HistoryLimit can start from 0 (no retained RolloutRun history).
When not set or set to math.MaxInt32, the Rollout will keep all RolloutRun history records.
format: int32
type: integer
strategyRef:
description: StrategyRef is the reference to the rollout strategy
type: string
trafficTopologyRefs:
description: |-
TrafficTopologyRefs defines the networking traffic relationships between
workloads, backend services, and routes.
items:
type: string
type: array
triggerPolicy:
default: Auto
description: TriggerPolicy defines when rollout will be triggered
type: string
workloadRef:
description: WorkloadRef is a reference to a kind of workloads
properties:
apiVersion:
description: |-
APIVersion is the group/version for the resource being referenced.
If APIVersion is not specified, the specified Kind must be in the core API group.
For any other third-party types, APIVersion is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
match:
description: Match indicates how to match workloads. only one
workload should be matches in one cluster
properties:
names:
description: Names is a list of workload name
items:
description: CrossClusterObjectNameReference contains cluster
and name reference to a k8s object
properties:
cluster:
description: Cluster indicates the name of cluster
type: string
name:
description: Name is the resource name
type: string
required:
- name
type: object
type: array
selector:
description: Selector is a label query over a set of resources,
in this case resource
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: |-
A label selector requirement is a selector that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: |-
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: |-
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: |-
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions, whose key field is "key", the
operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
required:
- kind
- match
type: object
type: object
status:
description: RolloutStatus defines the observed state of Rollout
properties:
conditions:
description: Conditions is the list of conditions
items:
description: |-
Condition defines the condition of a resource
See: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
properties:
lastTransitionTime:
description: Last time the condition transitioned from one status
to another.
format: date-time
type: string
lastUpdateTime:
description: The last time this condition was updated.
format: date-time
type: string
message:
description: A human-readable message indicating details about
the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of the condition.
type: string
required:
- status
- type
type: object
type: array
lastUpdateTime:
description: The last time this status was updated.
format: date-time
type: string
observedGeneration:
description: |-
ObservedGeneration is the most recent generation observed for this Rollout. It corresponds to the
Rollout's generation, which is updated on mutation by the API Server.
format: int64
type: integer
phase:
description: Phase indicates the current phase of rollout
type: string
rolloutID:
description: RolloutID is reference to rolloutRun name.
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
Loading
Loading