Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
fix issues (#194)
Browse files Browse the repository at this point in the history
* update version to 1.3.9

* add HTTP1PerRequestLoadBalancing and HTTP2PerRequestLoadBalancing to mesh config.

* Changed implementation of outbound per-request load balancing.

* [fix] Explicitly release _session in onEnd event

* upgrade pipy to 0.90.3-30.

* upgrade pipy to 0.90.3-38.

---------

Co-authored-by: wanpf <[email protected]>
  • Loading branch information
2 people authored and reaver-flomesh committed Sep 26, 2023
1 parent 37fe08d commit f0c7a18
Show file tree
Hide file tree
Showing 14 changed files with 107 additions and 16 deletions.
4 changes: 2 additions & 2 deletions charts/osm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 1.3.8
version: 1.3.9

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: v1.3.8
appVersion: v1.3.9

# This specifies the minimum Kubernetes version OSM is compatible with.
kubeVersion: ">= 1.19.0-0"
Expand Down
14 changes: 8 additions & 6 deletions charts/osm/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Open Service Mesh Edge Helm Chart

![Version: 1.3.8](https://img.shields.io/badge/Version-1.3.8-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.3.8](https://img.shields.io/badge/AppVersion-v1.3.8-informational?style=flat-square)
![Version: 1.3.9](https://img.shields.io/badge/Version-1.3.9-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.3.9](https://img.shields.io/badge/AppVersion-v1.3.9-informational?style=flat-square)

A Helm chart to install the [osm-edge](https://github.com/flomesh-io/osm-edge) control plane on Kubernetes.

Expand Down Expand Up @@ -130,6 +130,8 @@ The following table lists the configurable parameters of the osm chart and their
| osm.grafana.port | int | `3000` | Grafana service's port |
| osm.grafana.rendererImage | string | `"grafana/grafana-image-renderer:3.2.1"` | Image used for Grafana Renderer |
| osm.grafana.tolerations | list | `[]` | Node tolerations applied to control plane pods. The specified tolerations allow pods to schedule onto nodes with matching taints. |
| osm.http1PerRequestLoadBalancing | bool | `false` | Specifies a boolean indicating if load balancing based on request is enabled for http1. |
| osm.http2PerRequestLoadBalancing | bool | `true` | Specifies a boolean indicating if load balancing based on request is enabled for http2. |
| osm.image.digest | object | `{"osmBootstrap":"","osmCRDs":"","osmController":"","osmHealthcheck":"","osmInjector":"","osmInterceptor":"","osmPreinstall":"","osmSidecarInit":""}` | Image digest (defaults to latest compatible tag) |
| osm.image.digest.osmBootstrap | string | `""` | osm-boostrap's image digest |
| osm.image.digest.osmCRDs | string | `""` | osm-crds' image digest |
Expand All @@ -150,7 +152,7 @@ The following table lists the configurable parameters of the osm chart and their
| osm.image.name.osmSidecarInit | string | `"osm-edge-sidecar-init"` | Sidecar init container's image name |
| osm.image.pullPolicy | string | `"IfNotPresent"` | Container image pull policy for control plane containers |
| osm.image.registry | string | `"flomesh"` | Container image registry for control plane images |
| osm.image.tag | string | `"1.3.8"` | Container image tag for control plane images |
| osm.image.tag | string | `"1.3.9"` | Container image tag for control plane images |
| osm.imagePullSecrets | list | `[]` | `osm-controller` image pull secret |
| osm.inboundPortExclusionList | list | `[]` | Specifies a global list of ports to exclude from inbound traffic interception by the sidecar proxy. If specified, must be a list of positive integers. |
| osm.injector.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key | string | `"kubernetes.io/os"` | |
Expand Down Expand Up @@ -330,15 +332,15 @@ The following table lists the configurable parameters of the osm chart and their
| osm.remoteLogging.level | int | `2` | Level of the remote logging service |
| osm.remoteLogging.port | int | `30514` | Port of the remote logging service |
| osm.remoteLogging.sampledFraction | string | `"1.0"` | Sampled Fraction |
| osm.repoServer | object | `{"codebase":"","image":"flomesh/pipy-repo:0.90.2-14","ipaddr":"127.0.0.1","standalone":false}` | Pipy RepoServer |
| osm.repoServer | object | `{"codebase":"","image":"flomesh/pipy-repo:0.90.3-38","ipaddr":"127.0.0.1","standalone":false}` | Pipy RepoServer |
| osm.repoServer.codebase | string | `""` | codebase is the folder used by osmController. |
| osm.repoServer.image | string | `"flomesh/pipy-repo:0.90.2-14"` | Image used for Pipy RepoServer |
| osm.repoServer.image | string | `"flomesh/pipy-repo:0.90.3-38"` | Image used for Pipy RepoServer |
| osm.repoServer.ipaddr | string | `"127.0.0.1"` | ipaddr of host/service where Pipy RepoServer is installed |
| osm.repoServer.standalone | bool | `false` | if false , Pipy RepoServer is installed within osmController pod. |
| osm.sidecarClass | string | `"pipy"` | The class of the OSM Sidecar Driver |
| osm.sidecarDrivers | list | `[{"proxyServerPort":6060,"sidecarImage":"flomesh/pipy:0.90.2-14","sidecarName":"pipy"},{"proxyServerPort":15128,"sidecarImage":"envoyproxy/envoy:v1.19.3","sidecarName":"envoy","sidecarWindowsImage":"envoyproxy/envoy-windows:latest"}]` | Sidecar drivers supported by osm-edge |
| osm.sidecarDrivers | list | `[{"proxyServerPort":6060,"sidecarImage":"flomesh/pipy:0.90.3-38","sidecarName":"pipy"},{"proxyServerPort":15128,"sidecarImage":"envoyproxy/envoy:v1.19.3","sidecarName":"envoy","sidecarWindowsImage":"envoyproxy/envoy-windows:latest"}]` | Sidecar drivers supported by osm-edge |
| osm.sidecarDrivers[0].proxyServerPort | int | `6060` | Remote destination port on which the Discovery Service listens for new connections from Sidecars. |
| osm.sidecarDrivers[0].sidecarImage | string | `"flomesh/pipy:0.90.2-14"` | Sidecar image for Linux workloads |
| osm.sidecarDrivers[0].sidecarImage | string | `"flomesh/pipy:0.90.3-38"` | Sidecar image for Linux workloads |
| osm.sidecarDrivers[1].proxyServerPort | int | `15128` | Remote destination port on which the Discovery Service listens for new connections from Sidecars. |
| osm.sidecarDrivers[1].sidecarImage | string | `"envoyproxy/envoy:v1.19.3"` | Sidecar image for Linux workloads |
| osm.sidecarDrivers[1].sidecarWindowsImage | string | `"envoyproxy/envoy-windows:latest"` | Sidecar image for Windows workloads |
Expand Down
2 changes: 2 additions & 0 deletions charts/osm/templates/preset-mesh-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ data:
"interceptionMode": {{.Values.osm.trafficInterceptionMode | mustToJson}},
"enableEgress": {{.Values.osm.enableEgress | mustToJson}},
"enablePermissiveTrafficPolicyMode": {{.Values.osm.enablePermissiveTrafficPolicy | mustToJson}},
"http1PerRequestLoadBalancing": {{.Values.osm.http1PerRequestLoadBalancing | mustToJson}},
"http2PerRequestLoadBalancing": {{.Values.osm.http2PerRequestLoadBalancing | mustToJson}},
"outboundPortExclusionList": {{.Values.osm.outboundPortExclusionList | mustToJson}},
"inboundPortExclusionList": {{.Values.osm.inboundPortExclusionList | mustToJson}},
"outboundIPRangeExclusionList": {{.Values.osm.outboundIPRangeExclusionList | mustToJson}},
Expand Down
20 changes: 20 additions & 0 deletions charts/osm/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@
"caBundleSecretName",
"enableDebugServer",
"enablePermissiveTrafficPolicy",
"http1PerRequestLoadBalancing",
"http2PerRequestLoadBalancing",
"trafficInterceptionMode",
"enableEgress",
"enableReconciler",
Expand Down Expand Up @@ -786,6 +788,24 @@
false
]
},
"http1PerRequestLoadBalancing": {
"$id": "#/properties/osm/properties/http1PerRequestLoadBalancing",
"type": "boolean",
"title": "The http1PerRequestLoadBalancing schema",
"description": "Indicating if load balancing based on request is enabled for http1.",
"examples": [
false
]
},
"http2PerRequestLoadBalancing": {
"$id": "#/properties/osm/properties/http2PerRequestLoadBalancing",
"type": "boolean",
"title": "The http2PerRequestLoadBalancing schema",
"description": "Indicating if load balancing based on request is enabled for http2.",
"examples": [
true
]
},
"trafficInterceptionMode": {
"$id": "#/properties/osm/properties/trafficInterceptionMode",
"type": "string",
Expand Down
12 changes: 9 additions & 3 deletions charts/osm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ osm:
# -- Container image pull policy for control plane containers
pullPolicy: IfNotPresent
# -- Container image tag for control plane images
tag: "1.3.8"
tag: "1.3.9"
# -- Image name defaults
name:
# -- osm-controller's image name
Expand Down Expand Up @@ -60,7 +60,7 @@ osm:
sidecarDrivers:
- sidecarName: pipy
# -- Sidecar image for Linux workloads
sidecarImage: flomesh/pipy:0.90.2-14
sidecarImage: flomesh/pipy:0.90.3-38
# -- Remote destination port on which the Discovery Service listens for new connections from Sidecars.
proxyServerPort: 6060
- sidecarName: envoy
Expand All @@ -76,7 +76,7 @@ osm:
# -- Pipy RepoServer
repoServer:
# -- Image used for Pipy RepoServer
image: flomesh/pipy-repo:0.90.2-14
image: flomesh/pipy-repo:0.90.3-38
# -- if false , Pipy RepoServer is installed within osmController pod.
standalone: false
# -- ipaddr of host/service where Pipy RepoServer is installed
Expand Down Expand Up @@ -385,6 +385,12 @@ osm:
# -- Enable permissive traffic policy mode
enablePermissiveTrafficPolicy: true

# -- Specifies a boolean indicating if load balancing based on request is enabled for http1.
http1PerRequestLoadBalancing: false

# -- Specifies a boolean indicating if load balancing based on request is enabled for http2.
http2PerRequestLoadBalancing: true

# -- Traffic interception mode in the mesh
trafficInterceptionMode: iptables

Expand Down
12 changes: 12 additions & 0 deletions cmd/osm-bootstrap/crds/config_meshconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ spec:
type: array
items:
type: string
http1PerRequestLoadBalancing:
description: True for load balancing based on request is enabled for http1.
type: boolean
http2PerRequestLoadBalancing:
description: True for load balancing based on request is enabled for http1.
type: boolean
enablePermissiveTrafficPolicyMode:
description: True for allowing traffic to flow between client and service pods within the mesh without SMI traffic policies, i.e. no traffic policy enforcement in the mesh. If set to false, enables deny-all traffic policy in mesh i.e. an SMI Traffic Target is necessary for services to communicate.
type: boolean
Expand Down Expand Up @@ -622,6 +628,12 @@ spec:
type: integer
minimum: 1
maximum: 65535
http1PerRequestLoadBalancing:
description: True for load balancing based on request is enabled for http1.
type: boolean
http2PerRequestLoadBalancing:
description: True for load balancing based on request is enabled for http1.
type: boolean
enablePermissiveTrafficPolicyMode:
description: True for allowing traffic to flow between client and service pods within the mesh without SMI traffic policies, i.e. no traffic policy enforcement in the mesh. If set to false, enables deny-all traffic policy in mesh i.e. an SMI Traffic Target is necessary for services to communicate.
type: boolean
Expand Down
6 changes: 6 additions & 0 deletions pkg/apis/config/v1alpha1/mesh_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ type TrafficSpec struct {
// InboundExternalAuthorization defines a ruleset that, if enabled, will configure a remote external authorization endpoint
// for all inbound and ingress traffic in the mesh.
InboundExternalAuthorization ExternalAuthzSpec `json:"inboundExternalAuthorization,omitempty"`

// HTTP1PerRequestLoadBalancing defines a boolean indicating if load balancing based on request is enabled for http1.
HTTP1PerRequestLoadBalancing bool `json:"http1PerRequestLoadBalancing"`

// HTTP1PerRequestLoadBalancing defines a boolean indicating if load balancing based on request is enabled for http2.
HTTP2PerRequestLoadBalancing bool `json:"http2PerRequestLoadBalancing"`
}

// ObservabilitySpec is the type to represent OSM's observability configurations.
Expand Down
6 changes: 6 additions & 0 deletions pkg/apis/config/v1alpha2/mesh_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ type TrafficSpec struct {
// names to exclude from inbound and outbound traffic interception by the
// sidecar proxy.
NetworkInterfaceExclusionList []string `json:"networkInterfaceExclusionList"`

// HTTP1PerRequestLoadBalancing defines a boolean indicating if load balancing based on request is enabled for http1.
HTTP1PerRequestLoadBalancing bool `json:"http1PerRequestLoadBalancing"`

// HTTP1PerRequestLoadBalancing defines a boolean indicating if load balancing based on request is enabled for http2.
HTTP2PerRequestLoadBalancing bool `json:"http2PerRequestLoadBalancing"`
}

// ObservabilitySpec is the type to represent OSM's observability configurations.
Expand Down
2 changes: 2 additions & 0 deletions pkg/messaging/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ func getProxyUpdateEvent(msg events.PubSubMessage) *proxyUpdateEvent {
// changes.
if prevSpec.Traffic.EnableEgress != newSpec.Traffic.EnableEgress ||
prevSpec.Traffic.EnablePermissiveTrafficPolicyMode != newSpec.Traffic.EnablePermissiveTrafficPolicyMode ||
prevSpec.Traffic.HTTP1PerRequestLoadBalancing != newSpec.Traffic.HTTP1PerRequestLoadBalancing ||
prevSpec.Traffic.HTTP2PerRequestLoadBalancing != newSpec.Traffic.HTTP2PerRequestLoadBalancing ||
prevSpec.Observability.Tracing != newSpec.Observability.Tracing ||
prevSpec.Observability.RemoteLogging != newSpec.Observability.RemoteLogging ||
prevSpec.Sidecar.LogLevel != newSpec.Sidecar.LogLevel ||
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
((
config = pipy.solve('config.js'),
http1PerRequestLoadBalancing = Boolean(config?.Spec?.Traffic?.HTTP1PerRequestLoadBalancing),
http2PerRequestLoadBalancing = Boolean(config?.Spec?.Traffic?.HTTP2PerRequestLoadBalancing),
certChain = config?.Certificate?.CertChain,
privateKey = config?.Certificate?.PrivateKey,
isDebugEnabled = config?.Spec?.SidecarLogLevel === 'debug',
Expand Down Expand Up @@ -86,6 +88,7 @@
_failoverObject: null,
_targetObject: null,
_muxHttpOptions: null,
_session: null,
})

.import({
Expand All @@ -103,6 +106,7 @@
.pipeline()
.onStart(
() => void (
_session = {},
(_clusterConfig = clusterConfigs.get(__cluster)) && (
_muxHttpOptions = _clusterConfig.muxHttpOptions,
_clusterConfig.failoverBalancer && (
Expand All @@ -111,10 +115,23 @@
)
)
)
.onEnd(() => void ( _session = null))
.handleMessageStart(
msg => (
_clusterConfig && (
_targetObject = _clusterConfig.targetBalancer?.next?.({}),
__isHTTP2 ? (
http2PerRequestLoadBalancing ? (
_targetObject = _clusterConfig.targetBalancer?.next?.({})
) : (
_targetObject = _clusterConfig.targetBalancer?.next?.()
)
) : (
http1PerRequestLoadBalancing ? (
_targetObject = _clusterConfig.targetBalancer?.next?.(_session)
) : (
_targetObject = _clusterConfig.targetBalancer?.next?.()
)
),
__target = _targetObject?.id
) && (
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@
(path, headers) => matchPath(path) && headerRules.every(([k, v]) => v.test(headers[k] || '')) && (
__route = config,
__service = service,
__cluster = clusterCache.get(balancer.next({})?.id),
__cluster = clusterCache.get(balancer.next()?.id),
failoverBalancer && (
_failoverCluster = clusterCache.get(failoverBalancer.next({})?.id)
_failoverCluster = clusterCache.get(failoverBalancer.next()?.id)
),
true
)
) : (
(path) => matchPath(path) && (
__route = config,
__service = service,
__cluster = clusterCache.get(balancer.next({})?.id),
__cluster = clusterCache.get(balancer.next()?.id),
failoverBalancer && (
_failoverCluster = clusterCache.get(failoverBalancer.next({})?.id)
_failoverCluster = clusterCache.get(failoverBalancer.next()?.id)
),
true
)
Expand Down
2 changes: 2 additions & 0 deletions pkg/sidecar/providers/pipy/repo/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ func features(s *Server, proxy *pipy.Proxy, pipyConf *PipyConf) {
pipyConf.setRemoteLoggingLevel((*meshConf).GetMeshConfig().Spec.Observability.RemoteLogging.Level)
pipyConf.setEnableSidecarActiveHealthChecks((*meshConf).GetFeatureFlags().EnableSidecarActiveHealthChecks)
pipyConf.setEnableEgress((*meshConf).IsEgressEnabled())
pipyConf.setHTTP1PerRequestLoadBalancing((*meshConf).GetMeshConfig().Spec.Traffic.HTTP1PerRequestLoadBalancing)
pipyConf.setHTTP2PerRequestLoadBalancing((*meshConf).GetMeshConfig().Spec.Traffic.HTTP2PerRequestLoadBalancing)
pipyConf.setEnablePermissiveTrafficPolicyMode((*meshConf).IsPermissiveTrafficPolicyMode())
pipyConf.setLocalDNSProxy((*meshConf).IsLocalDNSProxyEnabled(), (*meshConf).GetLocalDNSProxyPrimaryUpstream(), (*meshConf).GetLocalDNSProxySecondaryUpstream())
clusterProps := (*meshConf).GetMeshConfig().Spec.ClusterSet.Properties
Expand Down
14 changes: 14 additions & 0 deletions pkg/sidecar/providers/pipy/repo/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ func (p *PipyConf) setEnableEgress(enableEgress bool) (update bool) {
return
}

func (p *PipyConf) setHTTP1PerRequestLoadBalancing(http1PerRequestLoadBalancing bool) (update bool) {
if update = p.Spec.Traffic.HTTP1PerRequestLoadBalancing != http1PerRequestLoadBalancing; update {
p.Spec.Traffic.HTTP1PerRequestLoadBalancing = http1PerRequestLoadBalancing
}
return
}

func (p *PipyConf) setHTTP2PerRequestLoadBalancing(http2PerRequestLoadBalancing bool) (update bool) {
if update = p.Spec.Traffic.HTTP2PerRequestLoadBalancing != http2PerRequestLoadBalancing; update {
p.Spec.Traffic.HTTP2PerRequestLoadBalancing = http2PerRequestLoadBalancing
}
return
}

func (p *PipyConf) setEnablePermissiveTrafficPolicyMode(enablePermissiveTrafficPolicyMode bool) (update bool) {
if update = p.Spec.Traffic.enablePermissiveTrafficPolicyMode != enablePermissiveTrafficPolicyMode; update {
p.Spec.Traffic.enablePermissiveTrafficPolicyMode = enablePermissiveTrafficPolicyMode
Expand Down
2 changes: 2 additions & 0 deletions pkg/sidecar/providers/pipy/repo/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ type FeatureFlags struct {
type TrafficSpec struct {
EnableEgress bool
enablePermissiveTrafficPolicyMode bool
HTTP1PerRequestLoadBalancing bool
HTTP2PerRequestLoadBalancing bool
}

// UpstreamDNSServers defines upstream DNS servers for local DNS Proxy.
Expand Down

0 comments on commit f0c7a18

Please sign in to comment.