This is an automated email from the ASF dual-hosted git repository.

robocanic pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-admin.git


The following commit(s) were added to refs/heads/develop by this push:
     new 35cbd342 feat: kubernetes deployment manifests and docker file (#1410)
35cbd342 is described below

commit 35cbd342b75467cc87f0f6763f72e8752d09fe47
Author: robb <[email protected]>
AuthorDate: Sun Feb 8 19:31:19 2026 +0800

    feat: kubernetes deployment manifests and docker file (#1410)
    
    * refactor: refactor dockerfile and implement dubbo-admin deployment
    
    * fix: deploy manifests
---
 Dockerfile                                         |  43 ++++--
 .../dubbo-samples-shop/dubbo-samples-shop-all.yaml |   4 +-
 .../dubbo-system/dubbo-admin-legacy.yaml           |  71 ----------
 release/kubernetes/dubbo-system/dubbo-admin.yaml   | 145 ++++++++++++++++++---
 release/kubernetes/dubbo-system/nacos.yaml         |  48 ++++---
 5 files changed, 190 insertions(+), 121 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 9394ba31..688cef37 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -13,29 +13,46 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Build the manager binary
-FROM docker.io/golang:1.24 AS builder
+# Build frontend
+FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/node:18-alpine AS 
frontend-builder
+
+WORKDIR /ui-vue3
+
+COPY ui-vue3/package.json ui-vue3/yarn.lock ./
+RUN yarn install --frozen-lockfile
+COPY ui-vue3/ ./
+RUN yarn build
+
+
+# Build backend
+FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/golang:1.24 AS builder
 ARG TARGETOS
 ARG TARGETARCH
 
 WORKDIR /app
+ENV GOPROXY=https://goproxy.cn,direct
 
-COPY go.mod go.mod
-COPY go.sum go.sum
+COPY go.mod go.sum ./
+RUN go mod download
+
+COPY . .
+COPY --from=frontend-builder /ui-vue3/dist app/dubbo-ui/dist
 
-ENV GOPROXY=https://goproxy.cn,direct
 
-# cache deps before building and copying source so that we don't need to 
re-download as much
-# and so that source changes don't invalidate our downloaded layer
-RUN go env && go mod download
+RUN CGO_ENABLED=0 \
+    GOOS=${TARGETOS:-linux} \
+    GOARCH=${TARGETARCH:-amd64} \
+    go build -a -o dubbo-admin ./app/dubbo-admin/main.go
 
-RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o 
dubbo-admin ./app/dubbo-admin/main.go
 
 # Use distroless as minimal base image to package the manager binary
 # Refer to https://github.com/GoogleContainerTools/distroless for more details
-FROM gcr.io/distroless/static:nonroot
-WORKDIR /
-COPY --from=builder /app/dubbo-admin .
+FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/alpine:3.20
+RUN addgroup -g 65532 app \
+ && adduser -D -u 65532 -G app app
+
+WORKDIR /app
+COPY --from=builder /app/dubbo-admin /app/dubbo-admin
 USER 65532:65532
 
-ENTRYPOINT ["./dubbo-admin","run"]
\ No newline at end of file
+ENTRYPOINT ["./dubbo-admin"]
\ No newline at end of file
diff --git a/release/kubernetes/dubbo-samples-shop/dubbo-samples-shop-all.yaml 
b/release/kubernetes/dubbo-samples-shop/dubbo-samples-shop-all.yaml
index 0b4111ad..91a5961e 100644
--- a/release/kubernetes/dubbo-samples-shop/dubbo-samples-shop-all.yaml
+++ b/release/kubernetes/dubbo-samples-shop/dubbo-samples-shop-all.yaml
@@ -29,7 +29,7 @@ metadata:
   labels:
     org.apache.dubbo/service: dubbo-qos
 spec:
-  type: NodePort
+  type: ClusterIP
   sessionAffinity: None
   selector:
     app-type: dubbo
@@ -45,7 +45,7 @@ metadata:
   name: shop-frontend
   namespace: dubbo-samples-shop
 spec:
-  type: NodePort
+  type: ClusterIP
   sessionAffinity: None
   selector:
     app: shop-frontend
diff --git a/release/kubernetes/dubbo-system/dubbo-admin-legacy.yaml 
b/release/kubernetes/dubbo-system/dubbo-admin-legacy.yaml
deleted file mode 100644
index b2dbd2e0..00000000
--- a/release/kubernetes/dubbo-system/dubbo-admin-legacy.yaml
+++ /dev/null
@@ -1,71 +0,0 @@
-# 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.
-
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: dubbo-admin
-  namespace: dubbo-system
-data:
-  # Set the properties you want to override, properties not set here will be 
using the default values
-  # check application.properties inside dubbo-admin project for the keys 
supported
-  application.properties: |
-    
admin.registry.address=nacos://nacos.dubbo-system.svc:8848?username=nacos&password=nacos
-    
admin.config-center=nacos://nacos.dubbo-system.svc:8848?username=nacos&password=nacos
-    
admin.metadata-report.address=nacos://nacos.dubbo-system.svc:8848?username=nacos&password=nacos
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
-  name: dubbo-admin
-  namespace: dubbo-system
-  labels:
-    app: dubbo-admin
-spec:
-  replicas: 1
-  selector:
-    matchLabels:
-      app: dubbo-admin
-  template:
-    metadata:
-      labels:
-        app: dubbo-admin
-    spec:
-      containers:
-        - image: 
registry.cn-hangzhou.aliyuncs.com/robocanic-public/dubbo-admin:0.6.0
-          name: dubbo-admin
-          ports:
-            - containerPort: 38080
-          volumeMounts:
-            - mountPath: /config
-              name: application-properties
-      volumes:
-        - name: application-properties
-          configMap:
-            name: dubbo-admin
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: dubbo-admin
-  namespace: dubbo-system
-spec:
-  type: NodePort
-  selector:
-    app: dubbo-admin
-  ports:
-    - protocol: TCP
-      port: 38080
-      targetPort: 38080
\ No newline at end of file
diff --git a/release/kubernetes/dubbo-system/dubbo-admin.yaml 
b/release/kubernetes/dubbo-system/dubbo-admin.yaml
index 3ef5d644..18faf418 100644
--- a/release/kubernetes/dubbo-system/dubbo-admin.yaml
+++ b/release/kubernetes/dubbo-system/dubbo-admin.yaml
@@ -1,26 +1,27 @@
-# 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.
-
+# 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.
+
 apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: dubbo-admin
+  namespace: dubbo-system
   labels:
     app: dubbo-admin
 spec:
-  replicas: 2
+  replicas: 1
   selector:
     matchLabels:
       app: dubbo-admin
@@ -30,15 +31,88 @@ spec:
       labels:
         app: dubbo-admin
     spec:
+      securityContext:
+        runAsUser: 65532
+        runAsGroup: 65532
+        fsGroup: 65532
+        runAsNonRoot: true
+      serviceAccountName: dubbo-admin
       containers:
         - name: dubbo-admin
-          image:
+          image: apache/dubbo-admin:0.7.0
           imagePullPolicy: IfNotPresent
+          volumeMounts:
+            - mountPath: /etc/dubbo-admin
+              name: dubbo-admin-config
+              readOnly: true
+            - name: dubbo-admin-logs
+              mountPath: /app/logs
+          command:
+            - /app/dubbo-admin
+          args:
+            - run
+            - -c
+            - /etc/dubbo-admin/dubbo-admin.yaml
+          livenessProbe:
+            httpGet:
+              port: 5680
+              path: /healthy
+              scheme: HTTP
+            initialDelaySeconds: 20
+            periodSeconds: 10
+            timeoutSeconds: 5
+            successThreshold: 1
+            failureThreshold: 3
+          readinessProbe:
+            httpGet:
+              port: 5680
+              path: /ready
+              scheme: HTTP
+            initialDelaySeconds: 10
+            periodSeconds: 10
+            timeoutSeconds: 5
+            successThreshold: 1
+            failureThreshold: 3
           ports:
             - containerPort: 8888
               protocol: TCP
       restartPolicy: Always
+      volumes:
+        - name: dubbo-admin-config
+          configMap:
+            name: dubbo-admin-config
+        - name: dubbo-admin-logs
+          # You can replace it with hostPath or pvc to store logs.
+          emptyDir: { }
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: dubbo-admin-config
+  namespace: dubbo-system
 
+data:
+  dubbo-admin.yaml: |
+    observability:
+      grafana: http://grafana.monitoringg.svc:3000
+      prometheus: http://prometheus-k8s.monitoring.svc:9090/
+    console:
+      auth:
+        user: admin
+        password: dubbo@2025
+        expirationTime: 3600
+    discovery:
+      - type: nacos2
+        name: nacos2.5-standalone
+        id: nacos2.5
+        address:
+          registry: 
nacos://nacos.dubbo-system.svc:8848?username=nacos&password=nacos
+          configCenter: 
nacos://nacos.dubbo-system.svc:8848?username=nacos&password=nacos
+          metadataReport: 
nacos://nacos.dubbo-system.svc:8848?username=nacos&password=nacos
+    engine:
+      id: default
+      name: default
+      type: kubernetes
 ---
 apiVersion: v1
 kind: Service
@@ -46,10 +120,43 @@ metadata:
   name: dubbo-admin
   namespace: dubbo-system
 spec:
-  type: NodePort
+  type: ClusterIP
   selector:
     app: dubbo-admin
   ports:
     - protocol: TCP
       port: 8888
-      targetPort: 8888
\ No newline at end of file
+      targetPort: 8888
+
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: dubbo-admin-cluster-role
+rules:
+  - apiGroups: [""]
+    resources: ["pods", "services"]
+    verbs: ["get", "list", "watch"]
+  - apiGroups: ["apps"]
+    resources: ["deployments", "statefulsets", "replicasets"]
+    verbs: ["get", "list", "watch"]
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: dubbo-admin
+  namespace: dubbo-system
+
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+  name: dubbo-admin-cluster-binding
+subjects:
+  - kind: ServiceAccount
+    name: dubbo-admin
+    namespace: dubbo-system
+roleRef:
+  kind: ClusterRole
+  name: dubbo-admin-cluster-role
+  apiGroup: rbac.authorization.k8s.io
diff --git a/release/kubernetes/dubbo-system/nacos.yaml 
b/release/kubernetes/dubbo-system/nacos.yaml
index 15eba56e..31557942 100644
--- a/release/kubernetes/dubbo-system/nacos.yaml
+++ b/release/kubernetes/dubbo-system/nacos.yaml
@@ -1,18 +1,18 @@
-# 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.
-
+# 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.
+
 # Nacos
 apiVersion: apps/v1
 kind: Deployment
@@ -33,6 +33,22 @@ spec:
         - name: consumer
           image: 
swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/nacos/nacos-server:v2.5.2
           imagePullPolicy: IfNotPresent
+          livenessProbe:
+            tcpSocket:
+              port: 8848
+            initialDelaySeconds: 20
+            timeoutSeconds: 5
+            periodSeconds: 10
+            failureThreshold: 3
+            successThreshold: 1
+          readinessProbe:
+            tcpSocket:
+              port: 8848
+            initialDelaySeconds: 10
+            timeoutSeconds: 5
+            periodSeconds: 10
+            failureThreshold: 3
+            successThreshold: 1
           ports:
             - containerPort: 8848
               name: client
@@ -60,7 +76,7 @@ metadata:
   name: nacos
   namespace: dubbo-system
 spec:
-  type: NodePort
+  type: ClusterIP
   sessionAffinity: None
   selector:
     app: nacos

Reply via email to