Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e0f1307
feat: init xds
123liuziming Dec 3, 2022
d8410bb
调整samples
panxiaojun233 Dec 7, 2022
b0bf334
feat: weighted cluster
123liuziming Dec 9, 2022
4c1ec49
feat: add route_fallback.pb.go
123liuziming Dec 9, 2022
6a6e045
feat: multiple match methods, including prefix, regix and exact match
123liuziming Dec 9, 2022
44ec056
fix: fix appending match
123liuziming Dec 12, 2022
83dec72
修复header match为空
panxiaojun233 Dec 12, 2022
f4d8e14
Merge remote-tracking branch 'origin/feature-xds' into feature-xds
panxiaojun233 Dec 12, 2022
e6899c1
fix: polish .gitignore
123liuziming Dec 12, 2022
243b0f2
refactor: refactor package name
123liuziming Dec 12, 2022
1b37a53
修改流量路由spec名字为trafficrouter
panxiaojun233 Dec 12, 2022
4f189c1
Merge remote-tracking branch 'origin/feature-xds' into feature-xds
panxiaojun233 Dec 12, 2022
6b44e27
refactor: rename shortnames
123liuziming Dec 12, 2022
9a9d9b9
增加trafficrouter crd序列化对象
panxiaojun233 Dec 13, 2022
5715910
Merge remote-tracking branch 'origin/feature-xds' into feature-xds
panxiaojun233 Dec 13, 2022
afc4186
refactor: extract the transform logic to crd_transform.go
123liuziming Dec 13, 2022
8d65f57
refactor: rename crd to trafficrouter
123liuziming Dec 13, 2022
97bf585
refactor: rename crd to trafficrouter
123liuziming Dec 13, 2022
7600dc4
Merge remote-tracking branch 'origin/feature-xds' into feature-xds
panxiaojun233 Dec 13, 2022
4e6ec4c
refactor: ignore all files in idea directory
123liuziming Dec 13, 2022
b5185da
refactor: rename samples & use go imports
123liuziming Dec 17, 2022
8a1d4d1
feat: support istio environment
123liuziming Dec 17, 2022
9fa46e0
refactor: polish code
123liuziming Dec 20, 2022
534c518
fix: fix crd typo filename
123liuziming Dec 20, 2022
8c76389
merge: merge feature-xds
123liuziming Dec 21, 2022
7115ab8
新增virtualworkload spec
panxiaojun233 Dec 28, 2022
09f69d1
新增virtual workload samples
panxiaojun233 Dec 28, 2022
ab81fbd
feat: Add active watcher
123liuziming Jan 3, 2023
460bb4e
Merge branch 'main' into feature/k8s-client
123liuziming Jan 4, 2023
a9089b0
merge: merge xds-feature branch
123liuziming Jan 16, 2023
f0f06f3
feature: Watch DestinationRule actively
123liuziming Jan 19, 2023
33b09d5
feature: Return lb info and subset name in VirtualWorkload
123liuziming Jan 19, 2023
b7f19a8
remove virtualworkload oneof lb_policy
panxiaojun233 Jan 20, 2023
08d2c77
修改virtual workload transform逻辑
panxiaojun233 Jan 20, 2023
46deca8
feature: fix traffic policy select logic
123liuziming Jan 20, 2023
7cf4db8
feature: fix env_checker.go
123liuziming Jan 20, 2023
b161f03
fix: Polish VirtualWorkload sample
123liuziming Feb 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,433 changes: 1,433 additions & 0 deletions config/crd/bases/traffic.opensergo.io_virtualworkloads.yaml

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions config/samples/opensergo_virtual_workload_samples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: traffic.opensergo.io/v1alpha1
kind: VirtualWorkload
metadata:
name: service-provider-virtual-workload
namespace: default
labels:
app: service-provider
spec:
host: service-provider
subsets:
- labels:
version: v1
name: v1
- labels:
version: v2
name: v2
31 changes: 31 additions & 0 deletions constant/istio_constant.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package constant

const (
EXTENSION_ROUTE_FALL_BACK = "envoy.router.cluster_specifier_plugin.cluster_fallback"
CRD_API_VERSION = "apiVersion"
CRD_KIND = "kind"
CRD_METADATA = "metadata"
CRD_SPEC = "spec"
CRD_NAME = "name"

META_RESOURCE_VERSION = "resourceVersion"
META_UID = "uid"

VERSION_V1_ALPHA3 = "networking.istio.io/v1alpha3"

VIRTUAL_SERVICE_KIND = "VirtualService"
VIRTUAL_SERVICE_HOST = "hosts"
VIRTUAL_SERVICE_HTTP_MATCH = "http"

DESTINATION_RULE_KIND = "DestinationRule"
DESTINATION_RULE_EXPORT_TO = "exportTo"
DESTINATION_RULE_HOST = "host"
DESTINATION_RULE_SUBSETS = "subsets"
DESTINATION_RULE_TRAFFIC_POLICY = "trafficPolicy"
DESTINATION_RULE_WORKLOAD_SELECTOR = "workloadSelector"

CDS_URL = "type.googleapis.com/envoy.config.cluster.v3.Cluster"
EDS_URL = "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment"
LDS_URL = "type.googleapis.com/envoy.config.listener.v3.Listener"
RDS_URL = "type.googleapis.com/envoy.config.route.v3.RouteConfiguration"
)
26 changes: 19 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,34 @@ module github.com/opensergo/opensergo-control-plane
go 1.14

require (
github.com/alibaba/sentinel-golang v1.0.3
github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/Azure/go-autorest/autorest v0.11.12 // indirect
github.com/alibaba/sentinel-golang v1.0.4
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
github.com/envoyproxy/go-control-plane v0.10.3-0.20221109183938-2935a23e638f
github.com/envoyproxy/protoc-gen-validate v0.6.7
github.com/go-logr/logr v0.4.0
github.com/go-logr/logr v1.2.3
github.com/go-openapi/spec v0.19.5 // indirect
github.com/golang/protobuf v1.5.2
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/kr/pty v1.1.5 // indirect
github.com/pkg/errors v0.9.1
github.com/rogpeppe/go-internal v1.8.0 // indirect
go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489 // indirect
go.uber.org/atomic v1.7.0
google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7
golang.org/x/oauth2 v0.4.0 // indirect
google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd
google.golang.org/grpc v1.51.0
google.golang.org/protobuf v1.28.1
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
k8s.io/apimachinery v0.21.4
k8s.io/client-go v0.21.4
sigs.k8s.io/controller-runtime v0.9.7
istio.io/api v0.0.0-20230113171715-aef7f00818fc // indirect
k8s.io/api v0.26.0
k8s.io/apimachinery v0.26.0
k8s.io/client-go v0.26.0
sigs.k8s.io/controller-runtime v0.14.1
)
836 changes: 835 additions & 1 deletion go.sum

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions pkg/api/v1alpha1/traffic/virtual_workload.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright 2022, OpenSergo Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package traffic

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +kubebuilder:object:root=true
type VirtualWorkload struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec VirtualWorkloadSpec `json:"spec,omitempty"`

Status VirtualWorkloadStatus `json:"status,omitempty"`
}

// HttpRequestMatchRuleList contains a list of HttpRequestMatchRule.
// +kubebuilder:object:root=true
type VirtualWorkloadList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []VirtualWorkload `json:"items"`
}

// HttpRequestMatchRuleStatus defines the observed state of HttpRequestMatchRule.
type VirtualWorkloadStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}

func init() {
SchemeBuilder.Register(&VirtualWorkload{}, &VirtualWorkloadList{})
}
Loading