Signed-off-by: hongming <coder.scala@gmail.com>
This commit is contained in:
@@ -103,6 +103,19 @@ Create the name of the secret of sa token.
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "telemetry.enabled" -}}
|
||||
{{- $config := lookup "v1" "Secret" (printf "%s" .Release.Namespace) "io.kubesphere.config.platformconfig.telemetry" }}
|
||||
{{- if $config }}
|
||||
{{- with $config }}
|
||||
{{- with (fromYaml ((index .data "configuration.yaml") | b64dec)) }}
|
||||
{{- .enabled }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- true }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "role" -}}
|
||||
{{- if eq .Values.role "" }}
|
||||
{{- with lookup "v1" "ConfigMap" (printf "%s" .Release.Namespace) "kubesphere-config" }}
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
{{ if eq (include "role" .) "host" }}
|
||||
{{- if eq (include "role" .) "host" }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: io.kubesphere.config.platformconfig.telemetry
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
type: config.kubesphere.io/platformconfig
|
||||
type: config.kubesphere.io/generic-platform-config
|
||||
stringData:
|
||||
configuration.yaml: |
|
||||
enabled: true
|
||||
ksCloudURL: "https://kubesphere.cloud"
|
||||
enabled: {{ include "telemetry.enabled" . }}
|
||||
{{- if eq .Values.cloud.env "clouddev.kubesphere.io" }}
|
||||
endpoint: "https://clouddev.kubesphere.io"
|
||||
{{- else if eq .Values.cloud.env "kubesphere.cloud" }}
|
||||
endpoint: "https://kubesphere.cloud"
|
||||
{{- else if and .Values.cloud.customEnv .Values.cloud.customEnv.url }}
|
||||
endpoint: {{ $.Values.cloud.customEnv.url | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user