You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support kyverno-style mutation in globalization and localization
Why is this needed:
The current globalization and localization strategies are not flexible enough to modify objects based on specific conditions
story1:
on tencent cloud, use qgpu for gpu virtualization, value 100 for a gpu card:
tke.cloud.tencent.com/qgpu-core: 100
on other cloud, use vgpu for gpu virtualization, value 50 for a gpu card:
example.com/vgpu: 50
for user-friendliness, resource type conversion and value conversion are required
story2:
on different clouds, there are different node label value for the same label key;
for example:
kubernetes.io/region: sg
kubernetes.io/region: singapore
for user-friendliness, resource type conversion and value conversion are required
kyverno is the most popular open-source project to do validation and mutation, it can meet the above needs , but it is hard to use kyverno to hook all manifests and description
the simple draft I came up with:
add extra mutation logic
point 1: add extra field
const (
// HelmType applies Helm values for all matched HelmCharts.// Note: HelmType only works with HelmChart(s).HelmTypeOverrideType="Helm"// JSONPatchType applies a json patch for all matched objects.// Note: JSONPatchType does not work with HelmChart(s).JSONPatchTypeOverrideType="JSONPatch"// MergePatchType applies a json merge patch for all matched objects.// Note: MergePatchType does not work with HelmChart(s).MergePatchTypeOverrideType="MergePatch"// StrategicMergePatchType won't be supported, since `patchStrategy`// and `patchMergeKey` can not be retrieved......
KyvernoPathType="Kyverno"
)
// OverrideConfig holds information that describes a override config.typeOverrideConfigstruct {
// Name indicate the OverrideConfig name.//// +optionalNamestring`json:"name,omitempty"`// Value represents override value.//// +required// +kubebuilder:validation:Required// +kubebuilder:validation:Type=stringValuestring`json:"value"`// Type specifies the override type for override value.//// +required// +kubebuilder:validation:Required// +kubebuilder:validation:Type=string// +kubebuilder:validation:Enum=Helm;JSONPatch;MergePatchTypeOverrideType`json:"type"`// Mutation kyverno style mutation configuration// refer to https://github.com/kyverno/kyverno/blob/main/api/kyverno/v1/common_types.goMutation kyvernoapi. Mutation
}
point 2: add mutating logic in Localizer
point 3: currently the globalization only select specified Feed, for select more than one feed, the resource selector should be added to GlobalizationSpec
The text was updated successfully, but these errors were encountered:
abstractmj
changed the title
Support kyverno-style and mutation in globalization and localization
Support kyverno-style mutation in globalization and localization
Dec 7, 2022
What would you like to be added:
Support kyverno-style mutation in globalization and localization
Why is this needed:
The current globalization and localization strategies are not flexible enough to modify objects based on specific conditions
story1:
on tencent cloud, use qgpu for gpu virtualization, value 100 for a gpu card:
tke.cloud.tencent.com/qgpu-core: 100
on other cloud, use vgpu for gpu virtualization, value 50 for a gpu card:
example.com/vgpu: 50
for user-friendliness, resource type conversion and value conversion are required
story2:
on different clouds, there are different node label value for the same label key;
for example:
kubernetes.io/region: sg
kubernetes.io/region: singapore
for user-friendliness, resource type conversion and value conversion are required
kyverno is the most popular open-source project to do validation and mutation, it can meet the above needs , but it is hard to use kyverno to hook all manifests and description
the simple draft I came up with:
add extra mutation logic
point 1: add extra field
point 2: add mutating logic in Localizer
point 3: currently the globalization only select specified Feed, for select more than one feed, the resource selector should be added to GlobalizationSpec
The text was updated successfully, but these errors were encountered: