From 8e5571ef3548d36620d7c57580aab1fffd4e6fbc Mon Sep 17 00:00:00 2001 From: Shashank Ram Date: Thu, 10 Jun 2021 09:22:09 -0700 Subject: [PATCH] osm-gateway: add feature flag Adds a feature flag for OSM gateway which will be used for ingress and multicluster. Part of #3501 Signed-off-by: Shashank Ram --- charts/osm/README.md | 5 +++-- charts/osm/values.schema.json | 15 +++++++++++++-- charts/osm/values.yaml | 8 +++++--- pkg/apis/config/v1alpha1/mesh_config.go | 5 ++++- .../config/v1alpha1/zz_generated.deepcopy.go | 17 +++++++++++++++++ 5 files changed, 42 insertions(+), 8 deletions(-) diff --git a/charts/osm/README.md b/charts/osm/README.md index 316a52148a..643e4acc34 100644 --- a/charts/osm/README.md +++ b/charts/osm/README.md @@ -77,8 +77,9 @@ The following table lists the configurable parameters of the osm chart and their | OpenServiceMesh.enablePrivilegedInitContainer | bool | `false` | Run init container in privileged mode | | OpenServiceMesh.enforceSingleMesh | bool | `false` | Enforce only deploying one mesh in the cluster | | OpenServiceMesh.envoyLogLevel | string | `"error"` | Log level for the Envoy proxy sidecar | -| OpenServiceMesh.featureFlags.enableEgressPolicy | bool | `true` | Enable OSM's Egress policy API. If specified, fine grained control over Egress (external) traffic is enforced | -| OpenServiceMesh.featureFlags.enableMulticlusterMode | bool | `false` | Enable Multicluster mode. If specified, multicluster mode will be enabled in OSM | +| OpenServiceMesh.featureFlags.enableEgressPolicy | bool | `true` | Enable OSM's Egress policy API If specified, fine grained control over Egress (external) traffic is enforced | +| OpenServiceMesh.featureFlags.enableMulticlusterMode | bool | `false` | Enable Multicluster mode If specified, multicluster mode will be enabled in OSM | +| OpenServiceMesh.featureFlags.enableOSMGateway | bool | `false` | Enable OSM gateway for ingress or multicluster | | OpenServiceMesh.featureFlags.enableWASMStats | bool | `true` | Enable extra Envoy statistics generated by a custom WASM extension | | OpenServiceMesh.fluentBit.enableProxySupport | bool | `false` | Enable proxy support toggle for Fluent Bit | | OpenServiceMesh.fluentBit.httpProxy | string | `""` | Optional HTTP proxy endpoint for Fluent Bit | diff --git a/charts/osm/values.schema.json b/charts/osm/values.schema.json index 9831d8bd29..7a9fc3e414 100644 --- a/charts/osm/values.schema.json +++ b/charts/osm/values.schema.json @@ -152,7 +152,8 @@ "webhookConfigNamePrefix", "osmController", "enablePrivilegedInitContainer", - "injector" + "injector", + "featureFlags" ], "properties": { "osmController": { @@ -673,7 +674,8 @@ "required": [ "enableWASMStats", "enableEgressPolicy", - "enableMulticlusterMode" + "enableMulticlusterMode", + "enableOSMGateway" ], "properties": { "enableWASMStats": { @@ -702,6 +704,15 @@ "examples": [ true ] + }, + "enableOSMGateway": { + "$id": "#/properties/OpenServiceMesh/properties/featureFlags/properties/enableOSMGateway", + "type": "boolean", + "title": "Enable OSM gateway", + "description": "Enable OSM gateway for ingress or multicluster", + "examples": [ + true + ] } }, "additionalProperties": false diff --git a/charts/osm/values.yaml b/charts/osm/values.yaml index ce98130f56..f9dfac0129 100644 --- a/charts/osm/values.yaml +++ b/charts/osm/values.yaml @@ -236,16 +236,18 @@ OpenServiceMesh: featureFlags: # -- Enable extra Envoy statistics generated by a custom WASM extension enableWASMStats: true - # -- Enable OSM's Egress policy API. + # -- Enable OSM's Egress policy API # If specified, fine grained control over Egress (external) traffic is enforced enableEgressPolicy: true - # -- Enable Multicluster mode. + # -- Enable Multicluster mode # If specified, multicluster mode will be enabled in OSM enableMulticlusterMode: false + # -- Enable OSM gateway for ingress or multicluster + enableOSMGateway: false # -- Run OSM with PodSecurityPolicy configured pspEnabled: false # -- Node tolerations applied to control plane pods. # The specified tolerations allow pods to schedule onto nodes with matching taints. - controlPlaneTolerations: [] \ No newline at end of file + controlPlaneTolerations: [] diff --git a/pkg/apis/config/v1alpha1/mesh_config.go b/pkg/apis/config/v1alpha1/mesh_config.go index 00fec3419a..3051e3b270 100644 --- a/pkg/apis/config/v1alpha1/mesh_config.go +++ b/pkg/apis/config/v1alpha1/mesh_config.go @@ -159,6 +159,9 @@ type FeatureFlags struct { // EnableMulticlusterMode defines if Multicluster mode is enabled. EnableMulticlusterMode bool `json:"enableMulticlusterMode,omitempty"` - // EnableSnapshotCacheMode defines if XDS server starts with snapshot cache + // EnableSnapshotCacheMode defines if XDS server starts with snapshot cache. EnableSnapshotCacheMode bool `json:"enableSnapshotCacheMode,omitempty"` + + // EnableOSMGateway defines if OSM gateway is enabled. + EnableOSMGateway bool `json:"enableOSMGateway,omitempty"` } diff --git a/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go index 59739906cc..c0a4dac4d1 100644 --- a/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go @@ -53,6 +53,22 @@ func (in *ExternalAuthzSpec) DeepCopy() *ExternalAuthzSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlags) DeepCopyInto(out *FeatureFlags) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlags. +func (in *FeatureFlags) DeepCopy() *FeatureFlags { + if in == nil { + return nil + } + out := new(FeatureFlags) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MeshConfig) DeepCopyInto(out *MeshConfig) { *out = *in @@ -120,6 +136,7 @@ func (in *MeshConfigSpec) DeepCopyInto(out *MeshConfigSpec) { in.Traffic.DeepCopyInto(&out.Traffic) out.Observability = in.Observability out.Certificate = in.Certificate + out.FeatureFlags = in.FeatureFlags return }