|
| 1 | +# |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +# contributor license agreements. See the NOTICE file distributed with |
| 4 | +# this work for additional information regarding copyright ownership. |
| 5 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | +# (the "License"); you may not use this file except in compliance with |
| 7 | +# the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | + |
| 18 | +# Istio Service Registry Configuration Example |
| 19 | +# This example demonstrates how to configure Dubbo-Kubernetes to use Istio as a service registry |
| 20 | + |
| 21 | +apiVersion: v1 |
| 22 | +kind: ConfigMap |
| 23 | +metadata: |
| 24 | + name: dubbo-istio-config |
| 25 | + namespace: dubbo-system |
| 26 | +data: |
| 27 | + # Istio Pilot configuration |
| 28 | + istio.pilot.address: "istiod.istio-system.svc.cluster.local:15010" |
| 29 | + istio.namespace: "istio-system" |
| 30 | + istio.tls.enabled: "true" |
| 31 | + istio.sync.timeout: "30s" |
| 32 | + |
| 33 | + # Service discovery configuration |
| 34 | + istio.enable.discovery: "true" |
| 35 | + istio.service.name: "dubbo-control-plane" |
| 36 | + istio.service.version: "v1" |
| 37 | + |
| 38 | + # TLS certificate paths (optional, for mTLS) |
| 39 | + # istio.cert.path: "/etc/certs/cert.pem" |
| 40 | + # istio.key.path: "/etc/certs/key.pem" |
| 41 | + # istio.ca.path: "/etc/certs/ca.pem" |
| 42 | + |
| 43 | +--- |
| 44 | +# Deployment example for Dubbo Sail Discovery with Istio |
| 45 | +apiVersion: apps/v1 |
| 46 | +kind: Deployment |
| 47 | +metadata: |
| 48 | + name: dubbo-sail-discovery |
| 49 | + namespace: dubbo-system |
| 50 | +spec: |
| 51 | + replicas: 1 |
| 52 | + selector: |
| 53 | + matchLabels: |
| 54 | + app: dubbo-sail-discovery |
| 55 | + template: |
| 56 | + metadata: |
| 57 | + labels: |
| 58 | + app: dubbo-sail-discovery |
| 59 | + annotations: |
| 60 | + sidecar.istio.io/inject: "true" |
| 61 | + spec: |
| 62 | + containers: |
| 63 | + - name: discovery |
| 64 | + image: dubbo/sail-discovery:latest |
| 65 | + args: |
| 66 | + - --registries=Istio |
| 67 | + - --istio-pilot-address=istiod.istio-system.svc.cluster.local:15010 |
| 68 | + - --istio-namespace=istio-system |
| 69 | + - --istio-tls-enabled=true |
| 70 | + - --istio-service-name=dubbo-control-plane |
| 71 | + - --istio-service-version=v1 |
| 72 | + ports: |
| 73 | + - containerPort: 18000 |
| 74 | + name: grpc |
| 75 | + - containerPort: 8080 |
| 76 | + name: http |
| 77 | + env: |
| 78 | + - name: PILOT_ADDRESS |
| 79 | + value: "istiod.istio-system.svc.cluster.local:15010" |
| 80 | + - name: ISTIO_NAMESPACE |
| 81 | + value: "istio-system" |
| 82 | + - name: TLS_ENABLED |
| 83 | + value: "true" |
| 84 | + volumeMounts: |
| 85 | + - name: config |
| 86 | + mountPath: /etc/dubbo |
| 87 | + - name: certs |
| 88 | + mountPath: /etc/certs |
| 89 | + readOnly: true |
| 90 | + volumes: |
| 91 | + - name: config |
| 92 | + configMap: |
| 93 | + name: dubbo-istio-config |
| 94 | + - name: certs |
| 95 | + secret: |
| 96 | + secretName: dubbo-istio-certs |
| 97 | + optional: true |
| 98 | + |
| 99 | +--- |
| 100 | +# Service for Dubbo Sail Discovery |
| 101 | +apiVersion: v1 |
| 102 | +kind: Service |
| 103 | +metadata: |
| 104 | + name: dubbo-sail-discovery |
| 105 | + namespace: dubbo-system |
| 106 | + labels: |
| 107 | + app: dubbo-sail-discovery |
| 108 | +spec: |
| 109 | + selector: |
| 110 | + app: dubbo-sail-discovery |
| 111 | + ports: |
| 112 | + - name: grpc |
| 113 | + port: 18000 |
| 114 | + targetPort: 18000 |
| 115 | + protocol: TCP |
| 116 | + - name: http |
| 117 | + port: 8080 |
| 118 | + targetPort: 8080 |
| 119 | + protocol: TCP |
| 120 | + |
| 121 | +--- |
| 122 | +# Optional: ServiceMonitor for Prometheus monitoring |
| 123 | +apiVersion: monitoring.coreos.com/v1 |
| 124 | +kind: ServiceMonitor |
| 125 | +metadata: |
| 126 | + name: dubbo-sail-discovery |
| 127 | + namespace: dubbo-system |
| 128 | +spec: |
| 129 | + selector: |
| 130 | + matchLabels: |
| 131 | + app: dubbo-sail-discovery |
| 132 | + endpoints: |
| 133 | + - port: http |
| 134 | + path: /metrics |
| 135 | + interval: 30s |
0 commit comments