The Unified and Autonomous Development Platform
chore: Improve k8s helm templates
Robin Shen021630787185
diff --git a/server-product/helm/templates/NOTES.txt b/server-product/helm/templates/NOTES.txtindex 1cdad200c1..f058a88349 100644--- a/server-product/helm/templates/NOTES.txt+++ b/server-product/helm/templates/NOTES.txt@@ -35,10 +35,7 @@ Get the OneDev URL by running:{{- else if contains "LoadBalancer" .Values.service.type }}-** Please ensure an external IP is associated to the {{ .Release.Namespace }} service before proceeding **-** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ include "ods.fullname" . }} **-- export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "ods.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")+ export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "ods.fullname" . }} --template "{{ "{{ if (index .status.loadBalancer.ingress 0).ip }}{{ (index .status.loadBalancer.ingress 0).ip }}{{ else }}{{ index .status.loadBalancer.ingress 0 }}{{ end }}" }}"){{- if .Values.service.ports.http }}echo "URL: http://$SERVICE_IP:{{ .Values.service.ports.http }}"@@ -46,6 +43,9 @@ Get the OneDev URL by running:echo "URL: http://$SERVICE_IP"{{- end }}+** Please ensure an external IP is associated to the {{ .Release.Namespace }} service before proceeding **+** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ include "ods.fullname" . }} **+{{- end }}{{- end }}{{- end }}diff --git a/server-product/helm/templates/_helpers.tpl b/server-product/helm/templates/_helpers.tplindex e909661ce3..106c3ff706 100644--- a/server-product/helm/templates/_helpers.tpl+++ b/server-product/helm/templates/_helpers.tpl@@ -90,13 +90,11 @@ Generate URL string based on the database type{{- define "getConnectionURL" -}}{{- $connectionURL := "" -}}{{- if eq $.Values.database.type "mysql" }}-{{- $connectionURL = printf "jdbc:mysql://%s:%s/%s?serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false" $.Values.database.host $.Values.database.port $.Values.database.name -}}+{{- $connectionURL = printf "jdbc:mysql://%s:%s/%s?serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false" $.Values.database.host ($.Values.database.port|toString) $.Values.database.name -}}{{- else if eq $.Values.database.type "postgresql" }}-{{- $connectionURL = printf "jdbc:postgresql://%s:%s/%s" $.Values.database.host $.Values.database.port $.Values.database.name -}}+{{- $connectionURL = printf "jdbc:postgresql://%s:%s/%s" $.Values.database.host ($.Values.database.port|toString) $.Values.database.name -}}{{- else if eq $.Values.database.type "mariadb" }}-{{- $connectionURL = printf "jdbc:mariadb://%s:%s/%s" $.Values.database.host $.Values.database.port $.Values.database.name -}}-{{- else if eq $.Values.database.type "mssql" }}-{{- $connectionURL = printf "sqlserver://%s:%s;databaseName=%s" $.Values.database.host $.Values.database.port $.Values.database.name -}}+{{- $connectionURL = printf "jdbc:mariadb://%s:%s/%s" $.Values.database.host ($.Values.database.port|toString) $.Values.database.name -}}{{- else -}}Invalid database type{{- end -}}diff --git a/server-product/system/conf/hibernate.properties b/server-product/system/conf/hibernate.propertiesindex c73acbcf26..633e20228e 100644--- a/server-product/system/conf/hibernate.properties+++ b/server-product/system/conf/hibernate.properties@@ -61,24 +61,6 @@ hibernate.connection.password=#hibernate.connection.password=postgres-#-----------------------------------------------------------------------------------# To use Microsoft SQL Server, please follow below steps:-# 1. Enable tcp/ip access to SQL Server-# 2. Uncomment Microsoft SQL Server settings below and comment out settings for-# other databases-# 3. Create an empty database at SQL Server side-# 4. Change the property "hibernate.connection.url", "hibernate.connection.username",-# and "hibernate.connection.password" so that OneDev can connect and write to-# the database created in step 3-#------------------------------------------------------------------------------------#hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect-#hibernate.connection.driver_class=com.microsoft.sqlserver.jdbc.SQLServerDriver-#hibernate.connection.url=jdbc:sqlserver://localhost:1433;databaseName=onedev-#hibernate.connection.username=sa-#hibernate.connection.password=sa--hibernate.connection.provider_class=org.hibernate.hikaricp.internal.HikariCPConnectionProviderhibernate.hikari.transactionIsolation=TRANSACTION_READ_COMMITTED