From ddb4f06fcb630ac9cc3209045a03358246c64170 Mon Sep 17 00:00:00 2001 From: innerpeacez Date: Tue, 10 Dec 2019 16:01:38 +0800 Subject: [PATCH] two ways to deploy sw --- chart/skywalking/templates/_helpers.tpl | 4 +++ chart/skywalking/templates/es-init.job.yaml | 2 +- .../skywalking/templates/oap-deployment.yaml | 4 +++ chart/skywalking/values.yaml | 12 +++---- docs/how-to-deploy.md | 36 +++++++++++++++++++ 5 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 docs/how-to-deploy.md diff --git a/chart/skywalking/templates/_helpers.tpl b/chart/skywalking/templates/_helpers.tpl index 0194935..b17f2c6 100644 --- a/chart/skywalking/templates/_helpers.tpl +++ b/chart/skywalking/templates/_helpers.tpl @@ -74,5 +74,9 @@ Create the name of the service account to use for the oap cluster - name: wait-for-elasticsearch image: busybox:1.30 imagePullPolicy: IfNotPresent +{{- if .Values.elasticsearch.enabled }} command: ['sh', '-c', 'for i in $(seq 1 60); do nc -z -w3 {{ include "call-nested" (list . "elasticsearch" "elasticsearch.client.fullname") }} 9200 && exit 0 || sleep 5; done; exit 1'] +{{- else }} + command: ['sh', '-c', 'for i in $(seq 1 60); do nc -z -w3 {{ .Values.elasticsearch.config.host }} {{ .Values.elasticsearch.config.port.http }} && exit 0 || sleep 5; done; exit 1'] +{{- end }} {{- end -}} diff --git a/chart/skywalking/templates/es-init.job.yaml b/chart/skywalking/templates/es-init.job.yaml index b986d1d..5bc8640 100644 --- a/chart/skywalking/templates/es-init.job.yaml +++ b/chart/skywalking/templates/es-init.job.yaml @@ -50,7 +50,7 @@ spec: - name: SW_STORAGE value: elasticsearch - name: SW_STORAGE_ES_CLUSTER_NODES -{{- if.Values.elasticsearch.enabled }} +{{- if .Values.elasticsearch.enabled }} value: "{{ include "call-nested" (list . "elasticsearch" "elasticsearch.client.fullname") }}:9200" {{- else }} value: "{{ .Values.elasticsearch.config.host }}:{{ .Values.elasticsearch.config.port.http }}" diff --git a/chart/skywalking/templates/oap-deployment.yaml b/chart/skywalking/templates/oap-deployment.yaml index aabd7cd..cfe8d6c 100644 --- a/chart/skywalking/templates/oap-deployment.yaml +++ b/chart/skywalking/templates/oap-deployment.yaml @@ -111,7 +111,11 @@ spec: value: {{ .Values.oap.envoy.als.enabled | quote}} {{- end }} - name: SW_STORAGE_ES_CLUSTER_NODES +{{- if .Values.elasticsearch.enabled }} value: "{{ include "call-nested" (list . "elasticsearch" "elasticsearch.client.fullname") }}:9200" +{{- else }} + value: "{{ .Values.elasticsearch.config.host }}:{{ .Values.elasticsearch.config.port.http }}" +{{- end }} {{- range $key, $value := .Values.oap.env }} - name: {{ $key }} value: {{ $value | quote }} diff --git a/chart/skywalking/values.yaml b/chart/skywalking/values.yaml index c71c43c..8736fd2 100644 --- a/chart/skywalking/values.yaml +++ b/chart/skywalking/values.yaml @@ -102,10 +102,10 @@ elasticsearch: enabled: true # If elasticsearch.enabled=true values for elasticsearch. # or elasticsearch.enabled=false, Will not deploy ES pod. The following config options must be configured - config: - port: - http: 9200 - host: elasticsearch # es service on kubernetes or host +# config: +# port: +# http: 9200 +# host: elasticsearch # es service on kubernetes or host ## Define serviceAccount names for components. Defaults to component's fully qualified name. serviceAccounts: @@ -180,7 +180,7 @@ elasticsearch: heapSize: "512m" # additionalJavaOpts: "-XX:MaxRAM=512m" persistence: - enabled: true + enabled: false accessMode: ReadWriteOnce name: data size: "4Gi" @@ -227,7 +227,7 @@ elasticsearch: heapSize: "1536m" # additionalJavaOpts: "-XX:MaxRAM=1536m" persistence: - enabled: true + enabled: false accessMode: ReadWriteOnce name: data size: "30Gi" diff --git a/docs/how-to-deploy.md b/docs/how-to-deploy.md new file mode 100644 index 0000000..81b372a --- /dev/null +++ b/docs/how-to-deploy.md @@ -0,0 +1,36 @@ +### How to use the SkyWalking Chart? + +Two ways: +- deploy SkyWalking and Elasticsearch (default) +- only deploy SkyWalking ,and use existing Elasticsearch + +#### Deploy SkyWalking and Elasticsearch (default) + +```shell script +$ cd chart + +$ helm add stable https://kubernetes-charts.storage.googleapis.com/ + +$ helm dep up + +$ helm install skywalking -n +``` + +#### Only deploy SkyWalking ,and use existing Elasticsearch + +If not want to deploy a new elasticsearch cluster, this way can be solved. + +Only need to close the elasticsearch deployed by chart default and configure the existing elasticsearch connection method. + +```shell script +$ cd chart + +$ helm add stable https://kubernetes-charts.storage.googleapis.com/ + +$ helm dep up + +$ helm install skywalking -n \ + --set elasticsearch.enabled=false \ + --set elasticsearch.config.host= \ + --set elasticsearch.config.port.http= +``` \ No newline at end of file -- GitLab