From 9bd1d6aa8b2f2a1fe61851564e4e28bbf689c8d1 Mon Sep 17 00:00:00 2001 From: Simone Bruzzese Date: Thu, 31 Oct 2024 15:13:22 +0100 Subject: [PATCH] Feat: add property spec.distribution.common.networkPoliciesEnabled --- defaults/ekscluster-kfd-v1alpha2.yaml | 2 +- defaults/kfddistribution-kfd-v1alpha2.yaml | 2 +- defaults/onpremises-kfd-v1alpha2.yaml | 2 +- docs/schemas/ekscluster-kfd-v1alpha2.md | 44 ++++++++++++------- docs/schemas/kfddistribution-kfd-v1alpha2.md | 44 ++++++++++++------- docs/schemas/onpremises-kfd-v1alpha2.md | 44 ++++++++++++------- .../ekscluster/v1alpha2/private/schema.go | 3 ++ pkg/apis/ekscluster/v1alpha2/public/schema.go | 3 ++ .../kfddistribution/v1alpha2/public/schema.go | 3 ++ pkg/apis/onpremises/v1alpha2/public/schema.go | 3 ++ schemas/private/ekscluster-kfd-v1alpha2.json | 4 ++ schemas/public/ekscluster-kfd-v1alpha2.json | 4 ++ .../public/kfddistribution-kfd-v1alpha2.json | 4 ++ schemas/public/onpremises-kfd-v1alpha2.json | 4 ++ 14 files changed, 118 insertions(+), 48 deletions(-) diff --git a/defaults/ekscluster-kfd-v1alpha2.yaml b/defaults/ekscluster-kfd-v1alpha2.yaml index 6c708be0..3cfe3419 100644 --- a/defaults/ekscluster-kfd-v1alpha2.yaml +++ b/defaults/ekscluster-kfd-v1alpha2.yaml @@ -15,7 +15,7 @@ data: relativeVendorPath: "../../vendor" provider: type: eks - + networkPoliciesEnabled: false # the module section will be used to fine tune each module behaviour and configuration modules: # ingress module configuration diff --git a/defaults/kfddistribution-kfd-v1alpha2.yaml b/defaults/kfddistribution-kfd-v1alpha2.yaml index d0c79025..7e2f6531 100644 --- a/defaults/kfddistribution-kfd-v1alpha2.yaml +++ b/defaults/kfddistribution-kfd-v1alpha2.yaml @@ -15,7 +15,7 @@ data: relativeVendorPath: "../../vendor" provider: type: none - + networkPoliciesEnabled: false # the module section will be used to fine tune each module behaviour and configuration modules: # ingress module configuration diff --git a/defaults/onpremises-kfd-v1alpha2.yaml b/defaults/onpremises-kfd-v1alpha2.yaml index f26ad1e6..69ca84fc 100644 --- a/defaults/onpremises-kfd-v1alpha2.yaml +++ b/defaults/onpremises-kfd-v1alpha2.yaml @@ -15,7 +15,7 @@ data: relativeVendorPath: "../../vendor" provider: type: none - + networkPoliciesEnabled: false # the module section will be used to fine tune each module behaviour and configuration modules: # ingress module configuration diff --git a/docs/schemas/ekscluster-kfd-v1alpha2.md b/docs/schemas/ekscluster-kfd-v1alpha2.md index 7521e3c3..1d147f79 100644 --- a/docs/schemas/ekscluster-kfd-v1alpha2.md +++ b/docs/schemas/ekscluster-kfd-v1alpha2.md @@ -84,13 +84,20 @@ A Fury Cluster deployed through AWS's Elastic Kubernetes Service ### Properties -| Property | Type | Required | -|:----------------------------------------------------------------|:---------|:---------| -| [nodeSelector](#specdistributioncommonnodeselector) | `object` | Optional | -| [provider](#specdistributioncommonprovider) | `object` | Optional | -| [registry](#specdistributioncommonregistry) | `string` | Optional | -| [relativeVendorPath](#specdistributioncommonrelativevendorpath) | `string` | Optional | -| [tolerations](#specdistributioncommontolerations) | `array` | Optional | +| Property | Type | Required | +|:------------------------------------------------------------------------|:----------|:---------| +| [networkPoliciesEnabled](#specdistributioncommonnetworkpoliciesenabled) | `boolean` | Optional | +| [nodeSelector](#specdistributioncommonnodeselector) | `object` | Optional | +| [provider](#specdistributioncommonprovider) | `object` | Optional | +| [registry](#specdistributioncommonregistry) | `string` | Optional | +| [relativeVendorPath](#specdistributioncommonrelativevendorpath) | `string` | Optional | +| [tolerations](#specdistributioncommontolerations) | `array` | Optional | + +## .spec.distribution.common.networkPoliciesEnabled + +### Description + +This field defines whether Network Policies are provided for all modules ## .spec.distribution.common.nodeSelector @@ -5474,14 +5481,15 @@ Overrides the default IAM role name prefix for the EKS workers ### Properties -| Property | Type | Required | -|:-----------------------------------------------|:---------|:---------| -| [chart](#specpluginshelmreleaseschart) | `string` | Required | -| [name](#specpluginshelmreleasesname) | `string` | Required | -| [namespace](#specpluginshelmreleasesnamespace) | `string` | Required | -| [set](#specpluginshelmreleasesset) | `array` | Optional | -| [values](#specpluginshelmreleasesvalues) | `array` | Optional | -| [version](#specpluginshelmreleasesversion) | `string` | Optional | +| Property | Type | Required | +|:---------------------------------------------------------------------------------|:----------|:---------| +| [chart](#specpluginshelmreleaseschart) | `string` | Required | +| [disableValidationOnInstall](#specpluginshelmreleasesdisablevalidationoninstall) | `boolean` | Optional | +| [name](#specpluginshelmreleasesname) | `string` | Required | +| [namespace](#specpluginshelmreleasesnamespace) | `string` | Required | +| [set](#specpluginshelmreleasesset) | `array` | Optional | +| [values](#specpluginshelmreleasesvalues) | `array` | Optional | +| [version](#specpluginshelmreleasesversion) | `string` | Optional | ## .spec.plugins.helm.releases.chart @@ -5489,6 +5497,12 @@ Overrides the default IAM role name prefix for the EKS workers The chart of the release +## .spec.plugins.helm.releases.disableValidationOnInstall + +### Description + +Disable running `helm diff` validation when installing the plugin, it will still be done when upgrading. + ## .spec.plugins.helm.releases.name ### Description diff --git a/docs/schemas/kfddistribution-kfd-v1alpha2.md b/docs/schemas/kfddistribution-kfd-v1alpha2.md index 6118a154..a26f8239 100644 --- a/docs/schemas/kfddistribution-kfd-v1alpha2.md +++ b/docs/schemas/kfddistribution-kfd-v1alpha2.md @@ -76,13 +76,20 @@ An example file can be found [here](https://github.com/sighupio/fury-distributio ### Properties -| Property | Type | Required | -|:----------------------------------------------------------------|:---------|:---------| -| [nodeSelector](#specdistributioncommonnodeselector) | `object` | Optional | -| [provider](#specdistributioncommonprovider) | `object` | Optional | -| [registry](#specdistributioncommonregistry) | `string` | Optional | -| [relativeVendorPath](#specdistributioncommonrelativevendorpath) | `string` | Optional | -| [tolerations](#specdistributioncommontolerations) | `array` | Optional | +| Property | Type | Required | +|:------------------------------------------------------------------------|:----------|:---------| +| [networkPoliciesEnabled](#specdistributioncommonnetworkpoliciesenabled) | `boolean` | Optional | +| [nodeSelector](#specdistributioncommonnodeselector) | `object` | Optional | +| [provider](#specdistributioncommonprovider) | `object` | Optional | +| [registry](#specdistributioncommonregistry) | `string` | Optional | +| [relativeVendorPath](#specdistributioncommonrelativevendorpath) | `string` | Optional | +| [tolerations](#specdistributioncommontolerations) | `array` | Optional | + +## .spec.distribution.common.networkPoliciesEnabled + +### Description + +This field defines whether Network Policies are provided for all modules ## .spec.distribution.common.nodeSelector @@ -4102,14 +4109,15 @@ The type of tracing to use, either ***none*** or ***tempo*** ### Properties -| Property | Type | Required | -|:-----------------------------------------------|:---------|:---------| -| [chart](#specpluginshelmreleaseschart) | `string` | Required | -| [name](#specpluginshelmreleasesname) | `string` | Required | -| [namespace](#specpluginshelmreleasesnamespace) | `string` | Required | -| [set](#specpluginshelmreleasesset) | `array` | Optional | -| [values](#specpluginshelmreleasesvalues) | `array` | Optional | -| [version](#specpluginshelmreleasesversion) | `string` | Optional | +| Property | Type | Required | +|:---------------------------------------------------------------------------------|:----------|:---------| +| [chart](#specpluginshelmreleaseschart) | `string` | Required | +| [disableValidationOnInstall](#specpluginshelmreleasesdisablevalidationoninstall) | `boolean` | Optional | +| [name](#specpluginshelmreleasesname) | `string` | Required | +| [namespace](#specpluginshelmreleasesnamespace) | `string` | Required | +| [set](#specpluginshelmreleasesset) | `array` | Optional | +| [values](#specpluginshelmreleasesvalues) | `array` | Optional | +| [version](#specpluginshelmreleasesversion) | `string` | Optional | ## .spec.plugins.helm.releases.chart @@ -4117,6 +4125,12 @@ The type of tracing to use, either ***none*** or ***tempo*** The chart of the release +## .spec.plugins.helm.releases.disableValidationOnInstall + +### Description + +Disable running `helm diff` validation when installing the plugin, it will still be done when upgrading. + ## .spec.plugins.helm.releases.name ### Description diff --git a/docs/schemas/onpremises-kfd-v1alpha2.md b/docs/schemas/onpremises-kfd-v1alpha2.md index f620b066..c379b514 100644 --- a/docs/schemas/onpremises-kfd-v1alpha2.md +++ b/docs/schemas/onpremises-kfd-v1alpha2.md @@ -80,18 +80,25 @@ The name of the cluster. It will also be used as a prefix for all the other reso ### Properties -| Property | Type | Required | -|:----------------------------------------------------------------|:---------|:---------| -| [nodeSelector](#specdistributioncommonnodeselector) | `object` | Optional | -| [provider](#specdistributioncommonprovider) | `object` | Optional | -| [registry](#specdistributioncommonregistry) | `string` | Optional | -| [relativeVendorPath](#specdistributioncommonrelativevendorpath) | `string` | Optional | -| [tolerations](#specdistributioncommontolerations) | `array` | Optional | +| Property | Type | Required | +|:------------------------------------------------------------------------|:----------|:---------| +| [networkPoliciesEnabled](#specdistributioncommonnetworkpoliciesenabled) | `boolean` | Optional | +| [nodeSelector](#specdistributioncommonnodeselector) | `object` | Optional | +| [provider](#specdistributioncommonprovider) | `object` | Optional | +| [registry](#specdistributioncommonregistry) | `string` | Optional | +| [relativeVendorPath](#specdistributioncommonrelativevendorpath) | `string` | Optional | +| [tolerations](#specdistributioncommontolerations) | `array` | Optional | ### Description Common configuration for all the distribution modules. +## .spec.distribution.common.networkPoliciesEnabled + +### Description + +This field defines whether Network Policies are provided for all modules + ## .spec.distribution.common.nodeSelector ### Description @@ -5150,14 +5157,15 @@ The subnet CIDR to use for the Services network. ### Properties -| Property | Type | Required | -|:-----------------------------------------------|:---------|:---------| -| [chart](#specpluginshelmreleaseschart) | `string` | Required | -| [name](#specpluginshelmreleasesname) | `string` | Required | -| [namespace](#specpluginshelmreleasesnamespace) | `string` | Required | -| [set](#specpluginshelmreleasesset) | `array` | Optional | -| [values](#specpluginshelmreleasesvalues) | `array` | Optional | -| [version](#specpluginshelmreleasesversion) | `string` | Optional | +| Property | Type | Required | +|:---------------------------------------------------------------------------------|:----------|:---------| +| [chart](#specpluginshelmreleaseschart) | `string` | Required | +| [disableValidationOnInstall](#specpluginshelmreleasesdisablevalidationoninstall) | `boolean` | Optional | +| [name](#specpluginshelmreleasesname) | `string` | Required | +| [namespace](#specpluginshelmreleasesnamespace) | `string` | Required | +| [set](#specpluginshelmreleasesset) | `array` | Optional | +| [values](#specpluginshelmreleasesvalues) | `array` | Optional | +| [version](#specpluginshelmreleasesversion) | `string` | Optional | ## .spec.plugins.helm.releases.chart @@ -5165,6 +5173,12 @@ The subnet CIDR to use for the Services network. The chart of the release +## .spec.plugins.helm.releases.disableValidationOnInstall + +### Description + +Disable running `helm diff` validation when installing the plugin, it will still be done when upgrading. + ## .spec.plugins.helm.releases.name ### Description diff --git a/pkg/apis/ekscluster/v1alpha2/private/schema.go b/pkg/apis/ekscluster/v1alpha2/private/schema.go index 4ea50787..8387312c 100644 --- a/pkg/apis/ekscluster/v1alpha2/private/schema.go +++ b/pkg/apis/ekscluster/v1alpha2/private/schema.go @@ -89,6 +89,9 @@ type SpecDistributionCommon struct { // The tolerations that will be added to the pods for all the KFD modules Tolerations []TypesKubeToleration `json:"tolerations,omitempty" yaml:"tolerations,omitempty" mapstructure:"tolerations,omitempty"` + + // NetworkPoliciesEnabled corresponds to the JSON schema field "networkPoliciesEnabled". + NetworkPoliciesEnabled *bool `json:"networkPoliciesEnabled,omitempty" yaml:"networkPoliciesEnabled,omitempty" mapstructure:"networkPoliciesEnabled,omitempty"` } type SpecDistributionCommonProvider struct { diff --git a/pkg/apis/ekscluster/v1alpha2/public/schema.go b/pkg/apis/ekscluster/v1alpha2/public/schema.go index ff34c16a..b5f25485 100644 --- a/pkg/apis/ekscluster/v1alpha2/public/schema.go +++ b/pkg/apis/ekscluster/v1alpha2/public/schema.go @@ -89,6 +89,9 @@ type SpecDistributionCommon struct { // The tolerations that will be added to the pods for all the KFD modules Tolerations []TypesKubeToleration `json:"tolerations,omitempty" yaml:"tolerations,omitempty" mapstructure:"tolerations,omitempty"` + + // NetworkPoliciesEnabled corresponds to the JSON schema field "networkPoliciesEnabled". + NetworkPoliciesEnabled *bool `json:"networkPoliciesEnabled,omitempty" yaml:"networkPoliciesEnabled,omitempty" mapstructure:"networkPoliciesEnabled,omitempty"` } type SpecDistributionCommonProvider struct { diff --git a/pkg/apis/kfddistribution/v1alpha2/public/schema.go b/pkg/apis/kfddistribution/v1alpha2/public/schema.go index 9a4f9ca9..96d1445b 100644 --- a/pkg/apis/kfddistribution/v1alpha2/public/schema.go +++ b/pkg/apis/kfddistribution/v1alpha2/public/schema.go @@ -75,6 +75,9 @@ type SpecDistributionCommon struct { // The tolerations that will be added to the pods for all the KFD modules Tolerations []TypesKubeToleration `json:"tolerations,omitempty" yaml:"tolerations,omitempty" mapstructure:"tolerations,omitempty"` + + // NetworkPoliciesEnabled corresponds to the JSON schema field "networkPoliciesEnabled". + NetworkPoliciesEnabled *bool `json:"networkPoliciesEnabled,omitempty" yaml:"networkPoliciesEnabled,omitempty" mapstructure:"networkPoliciesEnabled,omitempty"` } type SpecDistributionCommonProvider struct { diff --git a/pkg/apis/onpremises/v1alpha2/public/schema.go b/pkg/apis/onpremises/v1alpha2/public/schema.go index 854a24a1..1724c7df 100644 --- a/pkg/apis/onpremises/v1alpha2/public/schema.go +++ b/pkg/apis/onpremises/v1alpha2/public/schema.go @@ -84,6 +84,9 @@ type SpecDistributionCommon struct { // value: infra // ``` Tolerations []TypesKubeToleration `json:"tolerations,omitempty" yaml:"tolerations,omitempty" mapstructure:"tolerations,omitempty"` + + // NetworkPoliciesEnabled corresponds to the JSON schema field "networkPoliciesEnabled". + NetworkPoliciesEnabled *bool `json:"networkPoliciesEnabled,omitempty" yaml:"networkPoliciesEnabled,omitempty" mapstructure:"networkPoliciesEnabled,omitempty"` } type SpecDistributionCommonProvider struct { diff --git a/schemas/private/ekscluster-kfd-v1alpha2.json b/schemas/private/ekscluster-kfd-v1alpha2.json index 2aa90530..11dbd1c4 100644 --- a/schemas/private/ekscluster-kfd-v1alpha2.json +++ b/schemas/private/ekscluster-kfd-v1alpha2.json @@ -209,6 +209,10 @@ "registry": { "type": "string", "description": "URL of the registry where to pull images from for the Distribution phase. (Default is registry.sighup.io/fury).\n\nNOTE: If plugins are pulling from the default registry, the registry will be replaced for these plugins too." + }, + "networkPoliciesEnabled": { + "type": "boolean", + "description": "This field defines whether Network Policies are provided for all modules" } } }, diff --git a/schemas/public/ekscluster-kfd-v1alpha2.json b/schemas/public/ekscluster-kfd-v1alpha2.json index 49e3379d..e393abeb 100644 --- a/schemas/public/ekscluster-kfd-v1alpha2.json +++ b/schemas/public/ekscluster-kfd-v1alpha2.json @@ -1026,6 +1026,10 @@ "registry": { "type": "string", "description": "URL of the registry where to pull images from for the Distribution phase. (Default is registry.sighup.io/fury).\n\nNOTE: If plugins are pulling from the default registry, the registry will be replaced for these plugins too." + }, + "networkPoliciesEnabled": { + "type": "boolean", + "description": "This field defines whether Network Policies are provided for all modules" } } }, diff --git a/schemas/public/kfddistribution-kfd-v1alpha2.json b/schemas/public/kfddistribution-kfd-v1alpha2.json index 3e4451b3..1358f70d 100644 --- a/schemas/public/kfddistribution-kfd-v1alpha2.json +++ b/schemas/public/kfddistribution-kfd-v1alpha2.json @@ -156,6 +156,10 @@ "registry": { "type": "string", "description": "URL of the registry where to pull images from for the Distribution phase. (Default is registry.sighup.io/fury).\n\nNOTE: If plugins are pulling from the default registry, the registry will be replaced for the plugin too." + }, + "networkPoliciesEnabled": { + "type": "boolean", + "description": "This field defines whether Network Policies are provided for all modules" } } }, diff --git a/schemas/public/onpremises-kfd-v1alpha2.json b/schemas/public/onpremises-kfd-v1alpha2.json index cc808f71..d5c217bb 100644 --- a/schemas/public/onpremises-kfd-v1alpha2.json +++ b/schemas/public/onpremises-kfd-v1alpha2.json @@ -727,6 +727,10 @@ "registry": { "type": "string", "description": "URL of the registry where to pull images from for the Distribution phase. (Default is `registry.sighup.io/fury`)." + }, + "networkPoliciesEnabled": { + "type": "boolean", + "description": "This field defines whether Network Policies are provided for all modules" } } },