Skip to content

Commit bf381e6

Browse files
adding rollingStepSize to helm chart proxy spec
Signed-off-by: Chaitanya Kolluru <[email protected]>
1 parent 9d44995 commit bf381e6

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

api/v1alpha1/condition_consts.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,20 @@ const (
4242
// ClusterSelectionFailedReason indicates that the HelmChartProxy controller failed to select the workload Clusters.
4343
ClusterSelectionFailedReason = "ClusterSelectionFailed"
4444

45+
// HelmReleaseProxiesRolloutNotReady indicates that the initial rollout
46+
// of HelmReleaseProxies has not been completed.
47+
HelmReleaseProxiesRolloutNotReady = "HelmReleaseProxiesRolloutNotReady"
48+
49+
// HelmReleaseProxiesRolloutUndefined indicates that HelmChartProxy doesn't
50+
// use Rollout Step Size to reconcile HelmReleaseProxies.
51+
HelmReleaseProxiesRolloutUndefined = "HelmReleaseProxiesRolloutUndefined"
52+
4553
// HelmReleaseProxiesReadyCondition indicates that the HelmReleaseProxies are ready, meaning that the Helm installation, upgrade
4654
// or deletion is complete.
4755
HelmReleaseProxiesReadyCondition clusterv1.ConditionType = "HelmReleaseProxiesReady"
56+
57+
// HelmReleaseProxiesRolloutCompletedCondition indicates if the initial rollout of HelmReleaseProxies is complete.
58+
HelmReleaseProxiesRolloutCompletedCondition clusterv1.ConditionType = "HelmReleaseProxiesRolloutCompleted"
4859
)
4960

5061
// HelmReleaseProxy Conditions and Reasons.

api/v1alpha1/helmchartproxy_types.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package v1alpha1
1919
import (
2020
corev1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
"k8s.io/apimachinery/pkg/util/intstr"
2223
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
2324
)
2425

@@ -84,6 +85,14 @@ type HelmChartProxySpec struct {
8485
// +optional
8586
ReconcileStrategy string `json:"reconcileStrategy,omitempty"`
8687

88+
// RolloutStepSize is an opt-in feature that defines the step size during
89+
// initial rollout of HelmReleaseProxy resources on matching clusters.
90+
// Once all existing HelmReleaseProxy resources are ready=true, the next
91+
// batch of HelmReleaseProxy resources are reconciled.
92+
// If undefined, will default to creating HelmReleaseProxy resources for all
93+
// matching clusters.
94+
RolloutStepSize *intstr.IntOrString `json:"rolloutStepSize,omitempty"`
95+
8796
// Options represents CLI flags passed to Helm operations (i.e. install, upgrade, delete) and
8897
// include options such as wait, skipCRDs, timeout, waitForJobs, etc.
8998
// +optional
@@ -288,6 +297,17 @@ func (c *HelmChartProxy) SetConditions(conditions clusterv1.Conditions) {
288297
c.Status.Conditions = conditions
289298
}
290299

300+
func (c *HelmChartProxy) GetHelmReleaseProxyReadyCondition() *clusterv1.Condition {
301+
cnds := c.GetConditions()
302+
for _, cnd := range cnds {
303+
if cnd.Type == HelmReleaseProxiesReadyCondition {
304+
return &cnd
305+
}
306+
}
307+
308+
return nil
309+
}
310+
291311
// SetMatchingClusters will set the given list of matching clusters on an HelmChartProxy object.
292312
func (c *HelmChartProxy) SetMatchingClusters(clusterList []clusterv1.Cluster) {
293313
matchingClusters := make([]corev1.ObjectReference, 0, len(clusterList))

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/addons.cluster.x-k8s.io_helmchartproxies.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,18 @@ spec:
279279
RepoURL is the URL of the Helm chart repository.
280280
e.g. chart-path oci://repo-url/chart-name as repoURL: oci://repo-url and https://repo-url/chart-name as repoURL: https://repo-url
281281
type: string
282+
rolloutStepSize:
283+
anyOf:
284+
- type: integer
285+
- type: string
286+
description: |-
287+
RolloutStepSize is an opt-in feature that defines the step size during
288+
initial rollout of HelmReleaseProxy resources on matching clusters.
289+
Once all existing HelmReleaseProxy resources are ready=true, the next
290+
batch of HelmReleaseProxy resources are reconciled.
291+
If undefined, will default to creating HelmReleaseProxy resources for all
292+
matching clusters.
293+
x-kubernetes-int-or-string: true
282294
tlsConfig:
283295
description: TLSConfig contains the TLS configuration for a HelmChartProxy.
284296
properties:

0 commit comments

Comments
 (0)