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

albumenj pushed a commit to branch refactor-with-go
in repository https://gitbox.apache.org/repos/asf/dubbo-admin.git


The following commit(s) were added to refs/heads/refactor-with-go by this push:
     new 63429ac1 change admin configmap (#1093)
63429ac1 is described below

commit 63429ac16edb7611ec5b54c1ee46544f75c4e087
Author: Mrz <[email protected]>
AuthorDate: Thu Apr 27 17:11:34 2023 +0800

    change admin configmap (#1093)
    
    change readme
---
 deploy/charts/dubbo-admin/templates/_charts.tpl    |   4 +-
 deploy/charts/dubbo-admin/templates/configmap.yaml | 102 ++++++++
 .../charts/dubbo-admin/templates/deployment.yaml   |   4 +-
 deploy/charts/dubbo-admin/templates/secret.yaml    |  28 ---
 deploy/charts/dubbo-admin/values.yaml              | 257 +++++++++++++--------
 5 files changed, 273 insertions(+), 122 deletions(-)

diff --git a/deploy/charts/dubbo-admin/templates/_charts.tpl 
b/deploy/charts/dubbo-admin/templates/_charts.tpl
index a6388976..4d020687 100644
--- a/deploy/charts/dubbo-admin/templates/_charts.tpl
+++ b/deploy/charts/dubbo-admin/templates/_charts.tpl
@@ -145,9 +145,9 @@ Return the appropriate apiVersion for podDisruptionBudget.
 */}}
 {{- define "dubbo-admin.podDisruptionBudget.apiVersion" -}}
 {{- if $.Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }}
-{{- print "policy/v1beta1" }}
-{{- else }}
 {{- print "policy/v1" }}
+{{- else }}
+{{- print "policy/v1beta1" }}
 {{- end }}
 {{- end }}
 
diff --git a/deploy/charts/dubbo-admin/templates/configmap.yaml 
b/deploy/charts/dubbo-admin/templates/configmap.yaml
new file mode 100644
index 00000000..4c124804
--- /dev/null
+++ b/deploy/charts/dubbo-admin/templates/configmap.yaml
@@ -0,0 +1,102 @@
+# 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.
+
+{{- $defaultsessionTimeoutMilli := 3600000 -}}
+{{- $defaulttokenTimeoutMilli := 3600000 -}}
+{{- $defaultsignSecret := "86295dd0c4ef69a1036b0b0c15158d77" -}}
+{{- $defaulttoken := "e16e5cd903fd0c97a116c873b448544b9d086de9" -}}
+{{- $defaultname := "dubbo-admin" -}}
+{{- $defaultdriverclassname := "com.mysql.jdbc.Driver" -}}
+{{- $apollotoken := (coalesce .Values.apollo.token $defaulttoken ) -}}
+{{- $dubboname := (coalesce .Values.dubbo.application.name $defaultname ) -}}
+{{- $springdriverclassname := (coalesce 
.Values.spring.datasource.driverclassname $defaultdriverclassname) -}}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ include "dubbo-admin.fullname" . }}-config
+  namespace: {{ include "dubbo-admin.namespace" . }}
+  labels:
+    {{- include "dubbo-admin.labels" . | nindent 4 }}
+  {{- with .Values.labels }}
+  {{- toYaml . | nindent 4 }}
+  {{- end }}
+data:
+  application.properties: |-
+    {{- with .Values.admin }}
+    {{- if .zookeeper.enabled }}
+    admin.registry.address: {{ .zookeeper.address }}
+    admin.metadata-report.address: {{ .report.zookeeper.address }}
+    admin.config-center: {{ .zookeeper.center }}
+    {{- end }}
+    {{- if .nacos.enabled }}
+    admin.registry.address: {{ .nacos.address }}
+    admin.registry.group: {{ .nacos.group }}
+    admin.registry.namespace: {{ .nacos.namespace }}
+    admin.config-center: {{ .nacos.center }}
+    admin.config-center.group: {{ .nacos.group }}
+    admin.config-center.namespace: {{ .nacos.namespace }}
+    admin.metadata-report.address: {{ .report.nacos.address }}
+    admin.metadata-report.group: {{ .report.nacos.group }}
+    admin.metadata-report.namespace: {{ .report.nacos.namespace }}
+    {{- end }}
+    {{- end }}
+    {{- with .Values.root.user }}
+    admin.root.user.name: {{ .name }}
+    admin.root.user.password: {{ .password }}
+    {{- end }}
+    {{- if .Values.check.enabled }}
+    {{- if $defaultsessionTimeoutMilli }}
+    admin.check.sessionTimeoutMilli: {{ $defaultsessionTimeoutMilli }}
+    {{- end }}
+    {{- if $defaulttokenTimeoutMilli }}
+    admin.check.tokenTimeoutMilli: {{ $defaulttokenTimeoutMilli }}
+    {{- end }}
+    {{- if $defaultsignSecret }}
+    admin.check.signSecret: {{ $defaultsignSecret }}
+    {{- end }}
+    {{- end }}
+    {{- with .Values.apollo }}
+    {{- if .enabled }}
+    {{- if $apollotoken }}
+    admin.apollo.token: {{ $apollotoken }}
+    {{- end }}
+    admin.apollo.appId: {{ .appid }}
+    admin.apollo.env: {{ .env }}
+    admin.apollo.cluster: {{ .cluster }}
+    admin.config-center: {{ .center }}
+    {{- end }}
+    {{- end }}
+    {{- with .Values.server.compression }}
+    server.compression.enabled: {{ .enabled }}
+    server.compression.mime-types: {{ .types }}
+    server.compression.min-response-size: {{ .size }}
+    {{- end }}
+    {{- with .Values.dubbo }}
+    {{- if $dubboname }}
+    dubbo.application.name: {{ $dubboname }}
+    {{- end }}
+    dubbo.application.logger: {{ .application.logger }}
+    dubbo.registry.address: {{ .registry.address }}
+    {{- end }}
+    {{- with .Values.spring.datasource }}
+    spring.datasource.driver-class-name: {{ $springdriverclassname }}
+    spring.datasource.url: {{ .url }}
+    spring.datasource.username: {{ .username }}
+    spring.datasource.password: {{ .password }}
+    {{- end }}
+    {{- with .Values.mybatis }}
+    mybatis-plus.global-config.db-config.id-type: {{ .type }}
+    {{- end }}
\ No newline at end of file
diff --git a/deploy/charts/dubbo-admin/templates/deployment.yaml 
b/deploy/charts/dubbo-admin/templates/deployment.yaml
index 034f5d39..f98a9dc5 100644
--- a/deploy/charts/dubbo-admin/templates/deployment.yaml
+++ b/deploy/charts/dubbo-admin/templates/deployment.yaml
@@ -106,8 +106,8 @@ spec:
             {{- toYaml .Values.resources | nindent 12 }}
       volumes:
         - name: application-properties
-          secret:
-            secretName: {{ include "dubbo-admin.fullname" . }}-secret
+          configMap:
+            name: {{ include "dubbo-admin.fullname" . }}-config
         - name: storage
              {{- if .Values.persistence.enabled }}
           persistentVolumeClaim:
diff --git a/deploy/charts/dubbo-admin/templates/secret.yaml 
b/deploy/charts/dubbo-admin/templates/secret.yaml
deleted file mode 100644
index ef6bcebe..00000000
--- a/deploy/charts/dubbo-admin/templates/secret.yaml
+++ /dev/null
@@ -1,28 +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: Secret
-metadata:
-  name: {{ include "dubbo-admin.fullname" . }}-secret
-  namespace: {{ include "dubbo-admin.namespace" . }}
-  labels:
-    {{- include "dubbo-admin.labels" . | nindent 4 }}
-  {{- with .Values.labels }}
-  {{- toYaml . | nindent 4 }}
-  {{- end }}
-type: Opaque
-data:
-  application.properties: {{ tpl (toYaml .Values.properties) . | b64enc }}
diff --git a/deploy/charts/dubbo-admin/values.yaml 
b/deploy/charts/dubbo-admin/values.yaml
index 7668d1b4..ac2a9a5c 100644
--- a/deploy/charts/dubbo-admin/values.yaml
+++ b/deploy/charts/dubbo-admin/values.yaml
@@ -13,34 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-image:
-  registry: docker.io
-  ##  E.g registry.k8s.io
-  ##
-  repository: apache/dubbo-admin
-  ##
-  ##
-  tag: "0.5.0"
-  ##
-  ##
-  debug: false
-  ##
-  ## Specify a imagePullPolicy
-  ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
-  ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
-  ##
-  pullPolicy: IfNotPresent
-  ##
-  ## Optionally specify an array of imagePullSecrets.
-  ## Secrets must be manually created in the namespace.
-  ## ref: 
https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
-  ## Can be templated.
-  ##
-  pullSecrets: []
-  #   - RegisterKeySecretName
-
-replicas: 1
-
 ## global.imageRegistry Global Docker image registry
 ## global.imagePullSecrets Global Docker registry secret names as an array
 ## global.storageClass Global StorageClass for Persistent Volume(s)
@@ -59,6 +31,7 @@ rbac:
   enabled: true
   pspEnabled: true
 
+replicas: 1
 
 ## serviceAccount
 serviceAccount:
@@ -79,6 +52,171 @@ imagePullSecrets: []
 # - name: secretName
 
 
+##  @param Admin Default Enable Configuration
+dubbo:
+  ## dubbo enabled
+  enabled: true
+
+  ## dubbo application
+  application:
+    ## dubbo application name
+    name: ~
+
+    ## dubbo application logger
+    logger: slf4j
+
+  registry:
+    ## dubbo registry address
+    address: ${admin.registry.address}
+
+## admin configuration
+admin:
+  ## zookeeper configuration
+  zookeeper:
+    ## zookeeper enabled
+    enabled: true
+
+    ## zookeeper address
+    address: zookeeper://zookeeper:2181
+
+    ## zookeeper config-center
+    center: zookeeper://zookeeper:2181
+
+  ## nacos configuration
+  nacos:
+    ## nacos.enabled
+    enabled: false
+
+    ## nacos.address
+    address: nacos://nacos:8848?group=DEFAULT_GROUP&namespace=public
+
+    ## group (Deprecated it is recommended to use URL to add parameters,will 
be removed in the future)
+    group: dubbo
+
+    ## nacos namespace
+    namespace: public
+
+    ## nacos config-center
+    center: nacos://nacos:8848?group=dubbo
+
+  report:
+    ## zookeeper metadata-report address
+    zookeeper:
+      address: zookeeper://zookeeper:2181
+
+    ## nacos metadata-report address
+    nacos:
+      address: nacos://nacos:8848?group=dubbo
+
+      ## group (Deprecated it is recommended to use URL to add parameters,will 
be removed in the future)
+      group: dubbo
+
+      ## nacos namespace
+      namespace: public
+
+
+
+## apollo configuration
+apollo:
+  ## apollo enabled
+  enabled: false
+
+  ## apollo token
+  token: ~
+
+  ## apollo appId
+  appid: test
+
+  ## apollo env
+  env: dev
+
+  ## apollo cluster
+  cluster: default
+
+  ## apollo config-center
+  center: 
apollo://localhost:8070?token=e16e5cd903fd0c97a116c873b448544b9d086de9&app.id=test&env=dev&cluster=default&namespace=dubbo
+
+
+  ## Login Configuration
+root:
+  user:
+    # default user=root
+    name: root
+    # default password=root
+    password: root
+
+  ## check configuration
+check:
+  ## check enabled
+  enabled: true
+
+  ## check sessionTimeoutMilli
+  sessionTimeoutMilli: ~
+
+  ## check tokenTimeoutMilli
+  tokenTimeoutMilli: ~
+
+  ## check signSecret
+  signSecret: ~
+
+## server.compression configuration
+server:
+  compression:
+    ## server compression enabled
+    enabled: true
+
+    ## server compression mime-types
+    types: text/css,text/javascript,application/javascript
+
+    ## server compression min-response-size
+    size: 10240
+
+## Spring datasource configuration
+spring:
+  ## spring enabled
+  enabled: true
+
+  ## spring datasource
+  datasource:
+    driverclassname: ~
+    # url: 
jdbc:mysql://localhost:3306/dubbo-admin?characterEncoding=utf8&connectTimeout=1000&socketTimeout=10000&autoReconnect=true
+    url: jdbc:h2:mem:~/dubbo-admin;MODE=MYSQL;
+    # username: root
+    username: sa
+    # password: mysql
+    password: ~
+
+## mybatis-plus configuration
+mybatis:
+  type: none
+
+image:
+  registry: docker.io
+  ##  E.g registry.k8s.io
+  ##
+  repository: apache/dubbo-admin
+  ##
+  ##
+  tag: "0.5.0"
+  ##
+  ##
+  debug: false
+  ##
+  ## Specify a imagePullPolicy
+  ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
+  ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
+  ##
+  pullPolicy: IfNotPresent
+  ##
+  ## Optionally specify an array of imagePullSecrets.
+  ## Secrets must be manually created in the namespace.
+  ## ref: 
https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
+  ## Can be templated.
+  ##
+  pullSecrets: []
+  #   - RegisterKeySecretName
+
+
 ## Create HorizontalPodAutoscaler object for deployment type
 autoscaling:
   enabled: false
@@ -150,14 +288,6 @@ startupProbe:
   failureThreshold: 3
 
 
-tests:
-  enabled: true
-  image: busybox
-  tag: ""
-  imagePullPolicy: IfNotPresent
-  securityContext: {}
-
-
 ## configmap mounts
 ConfigmapMounts: []
   # - name: configMap-file
@@ -372,57 +502,4 @@ networkPolicy:
       ## E.X.
       ## ports:
       ## - port: 80
-      ## - port: 443
-
-
-
-
-##  @param Dubbo-admin Default Enable Configuration
-properties:
-  admin.registry.address: zookeeper://zookeeper:2181
-  admin.config-center: zookeeper://zookeeper:2181
-  admin.metadata-report.address: zookeeper://zookeeper:2181
-  admin.root.user.name: root
-  admin.root.user.password: root
-  admin.check.sessionTimeoutMilli: 3600000
-  server.compression.enabled: true
-  server.compression.mime-types: 
text/css,text/javascript,application/javascript
-  server.compression.min-response-size: 10240
-  admin.check.tokenTimeoutMilli: 3600000
-  admin.check.signSecret: 86295dd0c4ef69a1036b0b0c15158d77
-  dubbo.application.name: dubbo-admin
-  dubbo.registry.address: ${admin.registry.address}
-  spring.datasource.url: jdbc:h2:mem:~/dubbo-admin;MODE=MYSQL;
-  spring.datasource.username: sa
-  spring.datasource.password:
-  mybatis-plus.global-config.db-config.id-type: none
-  dubbo.application.logger: slf4j
-
-  # nacos config, add parameters to url like username=nacos&password=nacos
-  # admin.registry.address: 
nacos://nacos:8848?group=DEFAULT_GROUP&namespace=public
-  # admin.config-center: nacos://nacos:8848?group=dubbo
-  # admin.metadata-report.address: nacos://nacos:8848?group=dubbo
-
-
-  # group (Deprecated it is recommended to use URL to add parameters,will be 
removed in the future)
-  # admin.registry.group: dubbo
-  # admin.config-center.group: dubbo
-  # admin.metadata-report.group: dubbo
-
-  # namespace used by nacos.(Deprecated it is recommended to use URL to add 
parameters,will be removed in the future)
-  # admin.registry.namespace: public
-  # admin.config-center.namespace: public
-  # admin.metadata-report.namespace: public
-
-  # apollo config
-  # admin.config-center: 
apollo://localhost:8070?token=e16e5cd903fd0c97a116c873b448544b9d086de9&app.id=test&env=dev&cluster=default&namespace=dubbo
-  # admin.apollo.token: e16e5cd903fd0c97a116c873b448544b9d086de9
-  # admin.apollo.appId: test
-  # admin.apollo.env: dev
-  # admin.apollo.cluster: default
-
-  # mysql
-  # spring.datasource.driver-class-name: com.mysql.jdbc.Driver
-  # spring.datasource.url: 
jdbc:mysql://localhost:3306/dubbo-admin?characterEncoding=utf8&connectTimeout=1000&socketTimeout=10000&autoReconnect=true
-  # spring.datasource.username: root
-  # spring.datasource.password: mysql
\ No newline at end of file
+      ## - port: 443
\ No newline at end of file

Reply via email to