From 2de43e34346d98f5d092fcfa5e1ec68430c4de2a Mon Sep 17 00:00:00 2001 From: Alexey Kazakov Date: Tue, 18 Jun 2024 16:03:55 -0700 Subject: [PATCH 1/3] CRDs for feature toggles API --- ...in.dev.openshift.com_toolchainconfigs.yaml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml index beed984ff..ee117b096 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml @@ -428,6 +428,54 @@ spec: description: DurationBeforeChangeTierRequestDeletion specifies the duration before a ChangeTierRequest resource is deleted type: string + featureToggles: + description: FeatureToggles specifies the list of feature + toggles/flags + items: + description: 'FeatureToggle defines a feature toggle/flag. + Each feature is supposed to have a unique name. Features + are represented by kube object manifests in space and + user templates. Such manifests must have an annotation + which refers to the corresponding feature name. For example + a manifest for a RoleBinding object in a space tier template + with the following annotation: "toolchain.dev.openshift.com/feature: + os-lightspeed" would refer to a feature with "os-lightspeed" + name. When that template is applied for a new space then + that RoleBinding object would be applied conditionally, + according to its weight.' + properties: + name: + description: A unique name of the feature + type: string + weight: + description: 'Rollout weight of the feature. An integer + between 0-100. Any number lower than 0 will be treated + as 0. Any number higher than 100 will be treated as + 100. If not set then 100 is used by default. 0 means + the corresponding feature should not be enabled at + all, which means that corresponding template objects + should not be applied at all. 100 means the feature + should be always enabled (the template is always applied). + The features are weighted independently of each other. + For example if there are two features: - feature1, + weight=5 - feature2, weight=90 And tiers (one or many) + contain the following object manifests: - RoleBinding + with "toolchain.dev.openshift.com/feature: feature1" + annotation - ConfigMap with "toolchain.dev.openshift.com/feature: + feature2" annotation Then the RoleBinding will be + created for the corresponding tiers with probability + of 0.05 (around 5 out of every 100 spaces would have + it) And the ConfigMap will be created with probability + of 0.9 (around 90 out of every 100 spaces would have + it)' + type: integer + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map templateUpdateRequestMaxPoolSize: description: TemplateUpdateRequestMaxPoolSize specifies the maximum number of concurrent TemplateUpdateRequests when From 1ab80a472ceae1650f58a7641d0ba96e511b08e1 Mon Sep 17 00:00:00 2001 From: Alexey Kazakov Date: Wed, 19 Jun 2024 10:24:56 -0700 Subject: [PATCH 2/3] regenerate --- .../toolchain.dev.openshift.com_toolchainconfigs.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml index ee117b096..3f05d2f53 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml @@ -449,11 +449,9 @@ spec: type: string weight: description: 'Rollout weight of the feature. An integer - between 0-100. Any number lower than 0 will be treated - as 0. Any number higher than 100 will be treated as - 100. If not set then 100 is used by default. 0 means - the corresponding feature should not be enabled at - all, which means that corresponding template objects + between 0-100. If not set then 100 is used by default. + 0 means the corresponding feature should not be enabled + at all, which means that corresponding template objects should not be applied at all. 100 means the feature should be always enabled (the template is always applied). The features are weighted independently of each other. @@ -468,6 +466,8 @@ spec: it) And the ConfigMap will be created with probability of 0.9 (around 90 out of every 100 spaces would have it)' + maximum: 100 + minimum: 0 type: integer required: - name From 4379d162034aa5827dd5e1853bec3aa64b6db635 Mon Sep 17 00:00:00 2001 From: Alexey Kazakov Date: Thu, 20 Jun 2024 10:54:45 -0700 Subject: [PATCH 3/3] regeneate --- .../crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml index 3f05d2f53..8d9f1c304 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml @@ -448,6 +448,7 @@ spec: description: A unique name of the feature type: string weight: + default: 100 description: 'Rollout weight of the feature. An integer between 0-100. If not set then 100 is used by default. 0 means the corresponding feature should not be enabled