Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
135 changes: 135 additions & 0 deletions examples/istio-service-registry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#

# Istio Service Registry Configuration Example
# This example demonstrates how to configure Dubbo-Kubernetes to use Istio as a service registry

apiVersion: v1
kind: ConfigMap
metadata:
name: dubbo-istio-config
namespace: dubbo-system
data:
# Istio Pilot configuration
istio.pilot.address: "istiod.istio-system.svc.cluster.local:15010"
istio.namespace: "istio-system"
istio.tls.enabled: "true"
istio.sync.timeout: "30s"

# Service discovery configuration
istio.enable.discovery: "true"
istio.service.name: "dubbo-control-plane"
istio.service.version: "v1"

# TLS certificate paths (optional, for mTLS)
# istio.cert.path: "/etc/certs/cert.pem"
# istio.key.path: "/etc/certs/key.pem"
# istio.ca.path: "/etc/certs/ca.pem"

---
# Deployment example for Dubbo Sail Discovery with Istio
apiVersion: apps/v1
kind: Deployment
metadata:
name: dubbo-sail-discovery
namespace: dubbo-system
spec:
replicas: 1
selector:
matchLabels:
app: dubbo-sail-discovery
template:
metadata:
labels:
app: dubbo-sail-discovery
annotations:
sidecar.istio.io/inject: "true"
spec:
containers:
- name: discovery
image: dubbo/sail-discovery:latest
args:
- --registries=Istio
- --istio-pilot-address=istiod.istio-system.svc.cluster.local:15010
- --istio-namespace=istio-system
- --istio-tls-enabled=true
- --istio-service-name=dubbo-control-plane
- --istio-service-version=v1
ports:
- containerPort: 18000
name: grpc
- containerPort: 8080
name: http
env:
- name: PILOT_ADDRESS
value: "istiod.istio-system.svc.cluster.local:15010"
- name: ISTIO_NAMESPACE
value: "istio-system"
- name: TLS_ENABLED
value: "true"
volumeMounts:
- name: config
mountPath: /etc/dubbo
- name: certs
mountPath: /etc/certs
readOnly: true
volumes:
- name: config
configMap:
name: dubbo-istio-config
- name: certs
secret:
secretName: dubbo-istio-certs
optional: true

---
# Service for Dubbo Sail Discovery
apiVersion: v1
kind: Service
metadata:
name: dubbo-sail-discovery
namespace: dubbo-system
labels:
app: dubbo-sail-discovery
spec:
selector:
app: dubbo-sail-discovery
ports:
- name: grpc
port: 18000
targetPort: 18000
protocol: TCP
- name: http
port: 8080
targetPort: 8080
protocol: TCP

---
# Optional: ServiceMonitor for Prometheus monitoring
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: dubbo-sail-discovery
namespace: dubbo-system
spec:
selector:
matchLabels:
app: dubbo-sail-discovery
endpoints:
- port: http
path: /metrics
interval: 30s
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ require (
github.com/sashabaranov/go-openai v1.40.5
github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.7
github.com/stretchr/testify v1.10.0
github.com/tmc/langchaingo v0.1.13
go.uber.org/atomic v1.11.0
golang.org/x/crypto v0.41.0
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6
golang.org/x/net v0.43.0
golang.org/x/sys v0.35.0
golang.org/x/term v0.34.0
golang.org/x/time v0.12.0
google.golang.org/grpc v1.74.2
google.golang.org/protobuf v1.36.7
gopkg.in/yaml.v3 v3.0.1
Expand Down Expand Up @@ -206,6 +208,7 @@ require (
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkoukk/tiktoken-go v0.1.6 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240409071808-615f978279ca // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.23.0 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.65.0 // indirect
Expand Down Expand Up @@ -239,7 +242,6 @@ require (
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/text v0.28.0 // indirect
golang.org/x/time v0.12.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250811230008-5f3141c8851a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250811230008-5f3141c8851a // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
Expand All @@ -264,5 +266,4 @@ replace (
github.com/google/go-containerregistry => github.com/google/go-containerregistry v0.20.2
github.com/moby/buildkit => github.com/moby/buildkit v0.10.6
github.com/moby/dockerfile => github.com/moby/dockerfile v1.4.1

)
8 changes: 7 additions & 1 deletion manifests/charts/admin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ _internal_default_values_not_set:
memory: "512Mi"

# Support multi deploy status, see https://github.com/apache/dubbo-kubernetes/blob/master/README.md
# Available options: k8s(not supported yet), half, universal
# Available options: k8s, half, universal
deployMode: half

# Support multi-cluster
Expand All @@ -53,3 +53,9 @@ _internal_default_values_not_set:
grafanaAddress: http://grafana.dubbo-system:3000

prometheusAddress: http://prometheus.dubbo-system:9090

# k8s Service discovery configuration
k8sServiceDiscovery:
enabled: true
namespaces: ["default", "dubbo-system"]
annotationPrefix: "dubbo.apache.org"
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.

# inject grpc template
36 changes: 29 additions & 7 deletions pkg/adsc/adsc.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 adsc

import (
"context"
"crypto/tls"
"crypto/x509"
"fmt"
"math"
"net"
"os"
"strings"
"sync"
"time"

"github.com/apache/dubbo-kubernetes/pkg/backoff"
"github.com/apache/dubbo-kubernetes/pkg/config"
"github.com/apache/dubbo-kubernetes/pkg/config/schema/collections"
Expand All @@ -30,12 +54,6 @@ import (
mcp "istio.io/api/mcp/v1alpha1"
"istio.io/api/mesh/v1alpha1"
"k8s.io/klog/v2"
"math"
"net"
"os"
"strings"
"sync"
"time"
)

const (
Expand Down Expand Up @@ -756,7 +774,11 @@ func (a *ADSC) handleLDS(ll []*listener.Listener) {
routes = append(routes, fmt.Sprintf("%d", port))
}
default:
klog.Infof(protomarshal.ToJSONWithIndent(l, " "))
if jsonStr, err := protomarshal.ToJSONWithIndent(l, " "); err == nil {
klog.Infof("Listener config: %s", jsonStr)
} else {
klog.Errorf("Failed to marshal to JSON: %v", err)
}
}
}

Expand Down
17 changes: 17 additions & 0 deletions pkg/adsc/util.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 adsc

import (
Expand Down
17 changes: 17 additions & 0 deletions pkg/bootstrap/config.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 bootstrap

import (
Expand Down
Loading
Loading