From b7ac9240441224b575bba29425c46d58746b1a31 Mon Sep 17 00:00:00 2001 From: huanggze Date: Mon, 20 Jul 2020 20:43:37 +0800 Subject: [PATCH 1/3] refactor observability components Signed-off-by: huanggze --- deploy/cluster-configuration.yaml | 13 +- kubesphere-complete-setup.yaml | 15 +- kubesphere-minimal.yaml | 15 +- roles/common/defaults/main.yaml | 9 + .../elasticsearch}/elasticsearch-1.22.1.tgz | Bin .../elasticsearch-curator-1.3.3.tgz | Bin .../fluentbitconfig-fluentBitConfig.yaml | 0 .../init/fluentbit-operator-clusterRole.yaml | 0 ...fluentbit-operator-clusterRoleBinding.yaml | 0 ...erator-filterCustomResourceDefinition.yaml | 0 ...tor-fluentbitCustomResourceDefinition.yaml | 0 ...uentbitconfigCustomResourceDefinition.yaml | 0 ...perator-inputCustomResourceDefinition.yaml | 0 ...erator-outputCustomResourceDefinition.yaml | 0 .../fluentbit-operator-serviceAccount.yaml | 0 .../migrator/migrator-rbac.yaml | 0 roles/common/tasks/common-install.yaml | 12 +- roles/common/tasks/es-install.yaml | 125 ++++++++++ roles/common/tasks/fluentbit-install.yaml | 76 ++++++ roles/common/tasks/get_old_config.yaml | 28 +++ .../custom-fluentbit-fluentBit.yaml.j2 | 0 ...stom-fluentbit-operator-deployment.yaml.j2 | 0 .../templates/custom-migrator-job.yaml.j2 | 0 ...ustom-values-elasticsearch-curator.yaml.j2 | 6 +- .../custom-values-elasticsearch.yaml.j2 | 8 +- .../fluentbit-operator}/filter-auditing.yaml | 0 .../fluentbit-operator/input-auditing.yaml} | 0 .../ks-auditing/tasks/fluentbit-operator.yaml | 16 ++ roles/ks-auditing/tasks/main.yaml | 3 + ...stom-output-elasticsearch-auditing.yaml.j2 | 16 ++ .../templates/kubesphere-config.yaml.j2 | 18 +- .../fluentbit-operator}/filter-events.yaml | 0 .../fluentbit-operator/input-events.yaml} | 0 roles/ks-events/tasks/fluentbit-operator.yaml | 16 ++ roles/ks-events/tasks/main.yaml | 3 + ...custom-output-elasticsearch-events.yaml.j2 | 15 ++ .../templates/jaeger-production.yaml.j2 | 6 +- roles/ks-logging/defaults/main.yaml | 9 - .../filter-logging.yaml} | 0 .../input-logging.yaml} | 0 .../fluent-bit/fluentbit-fluentBit.yaml | 14 -- .../output-elasticsearch-auditing.yaml | 16 -- .../output-elasticsearch-events.yaml | 15 -- .../fluent-bit/output-elasticsearch.yaml | 16 -- .../init/fluentbit-operator-deployment.yaml | 53 ---- .../migrator/migrator-job.yaml | 13 - .../ks-logging/files/logging/kibana-2.2.1.tgz | Bin 11760 -> 0 bytes .../ks-logging/files/logging/nginx-1.0.0.tgz | Bin 7984 -> 0 bytes roles/ks-logging/tasks/elasticsearch.yaml | 53 ---- roles/ks-logging/tasks/get_old_config.yaml | 28 --- roles/ks-logging/tasks/main.yaml | 178 +------------- roles/ks-logging/tasks/pre-install.yaml | 37 --- ...stom-output-elasticsearch-auditing.yaml.j2 | 16 -- ...custom-output-elasticsearch-events.yaml.j2 | 15 -- ...ustom-output-elasticsearch-logging.yaml.j2 | 17 ++ .../custom-output-elasticsearch.yaml.j2 | 17 -- .../templates/custom-values-kibana.yaml.j2 | 227 ------------------ 57 files changed, 380 insertions(+), 744 deletions(-) rename roles/{ks-logging/files/logging => common/files/elasticsearch}/elasticsearch-1.22.1.tgz (100%) rename roles/{ks-logging/files/logging => common/files/elasticsearch}/elasticsearch-curator-1.3.3.tgz (100%) rename roles/{ks-logging/files/logging/fluentbit-operator/fluent-bit => common/files/fluentbit-operator/fluentbit}/fluentbitconfig-fluentBitConfig.yaml (100%) rename roles/{ks-logging/files/logging => common/files}/fluentbit-operator/init/fluentbit-operator-clusterRole.yaml (100%) rename roles/{ks-logging/files/logging => common/files}/fluentbit-operator/init/fluentbit-operator-clusterRoleBinding.yaml (100%) rename roles/{ks-logging/files/logging => common/files}/fluentbit-operator/init/fluentbit-operator-filterCustomResourceDefinition.yaml (100%) rename roles/{ks-logging/files/logging => common/files}/fluentbit-operator/init/fluentbit-operator-fluentbitCustomResourceDefinition.yaml (100%) rename roles/{ks-logging/files/logging => common/files}/fluentbit-operator/init/fluentbit-operator-fluentbitconfigCustomResourceDefinition.yaml (100%) rename roles/{ks-logging/files/logging => common/files}/fluentbit-operator/init/fluentbit-operator-inputCustomResourceDefinition.yaml (100%) rename roles/{ks-logging/files/logging => common/files}/fluentbit-operator/init/fluentbit-operator-outputCustomResourceDefinition.yaml (100%) rename roles/{ks-logging/files/logging => common/files}/fluentbit-operator/init/fluentbit-operator-serviceAccount.yaml (100%) rename roles/{ks-logging/files/logging => common/files}/fluentbit-operator/migrator/migrator-rbac.yaml (100%) create mode 100644 roles/common/tasks/es-install.yaml create mode 100644 roles/common/tasks/fluentbit-install.yaml rename roles/{ks-logging => common}/templates/custom-fluentbit-fluentBit.yaml.j2 (100%) rename roles/{ks-logging => common}/templates/custom-fluentbit-operator-deployment.yaml.j2 (100%) rename roles/{ks-logging => common}/templates/custom-migrator-job.yaml.j2 (100%) rename roles/{ks-logging => common}/templates/custom-values-elasticsearch-curator.yaml.j2 (87%) rename roles/{ks-logging => common}/templates/custom-values-elasticsearch.yaml.j2 (95%) rename roles/{ks-logging/files/logging/fluentbit-operator/fluent-bit => ks-auditing/files/fluentbit-operator}/filter-auditing.yaml (100%) rename roles/{ks-logging/files/logging/fluentbit-operator/fluent-bit/input-tail-auditing.yaml => ks-auditing/files/fluentbit-operator/input-auditing.yaml} (100%) create mode 100644 roles/ks-auditing/tasks/fluentbit-operator.yaml create mode 100644 roles/ks-auditing/templates/custom-output-elasticsearch-auditing.yaml.j2 rename roles/{ks-logging/files/logging/fluentbit-operator/fluent-bit => ks-events/files/fluentbit-operator}/filter-events.yaml (100%) rename roles/{ks-logging/files/logging/fluentbit-operator/fluent-bit/input-tail-events.yaml => ks-events/files/fluentbit-operator/input-events.yaml} (100%) create mode 100644 roles/ks-events/tasks/fluentbit-operator.yaml create mode 100644 roles/ks-events/templates/custom-output-elasticsearch-events.yaml.j2 rename roles/ks-logging/files/{logging/fluentbit-operator/fluent-bit/filter-kubernetes.yaml => fluentbit-operator/filter-logging.yaml} (100%) rename roles/ks-logging/files/{logging/fluentbit-operator/fluent-bit/input-tail.yaml => fluentbit-operator/input-logging.yaml} (100%) delete mode 100644 roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/fluentbit-fluentBit.yaml delete mode 100644 roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/output-elasticsearch-auditing.yaml delete mode 100644 roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/output-elasticsearch-events.yaml delete mode 100644 roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/output-elasticsearch.yaml delete mode 100644 roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-deployment.yaml delete mode 100644 roles/ks-logging/files/logging/fluentbit-operator/migrator/migrator-job.yaml delete mode 100644 roles/ks-logging/files/logging/kibana-2.2.1.tgz delete mode 100644 roles/ks-logging/files/logging/nginx-1.0.0.tgz delete mode 100644 roles/ks-logging/tasks/elasticsearch.yaml delete mode 100644 roles/ks-logging/tasks/get_old_config.yaml delete mode 100644 roles/ks-logging/tasks/pre-install.yaml delete mode 100644 roles/ks-logging/templates/custom-output-elasticsearch-auditing.yaml.j2 delete mode 100644 roles/ks-logging/templates/custom-output-elasticsearch-events.yaml.j2 create mode 100644 roles/ks-logging/templates/custom-output-elasticsearch-logging.yaml.j2 delete mode 100644 roles/ks-logging/templates/custom-output-elasticsearch.yaml.j2 delete mode 100644 roles/ks-logging/templates/custom-values-kibana.yaml.j2 diff --git a/deploy/cluster-configuration.yaml b/deploy/cluster-configuration.yaml index 30062d8f9..cf41faf02 100644 --- a/deploy/cluster-configuration.yaml +++ b/deploy/cluster-configuration.yaml @@ -22,6 +22,13 @@ spec: etcdVolumeSize: 20Gi # etcd PVC size. openldapVolumeSize: 2Gi # openldap PVC size. redisVolumSize: 2Gi # Redis PVC size. + es: # Storage backend for logging, events and auditing. + elasticsearchMasterReplicas: 1 # total number of master nodes, it's not allowed to use even number + elasticsearchDataReplicas: 1 # total number of data nodes. + elasticsearchMasterVolumeSize: 4Gi # Volume size of Elasticsearch master nodes. + elasticsearchDataVolumeSize: 20Gi # Volume size of Elasticsearch data nodes. + logMaxAge: 7 # Log retention time in built-in Elasticsearch, it is 7 days by default. + elkPrefix: logstash # The string making up index names. The index name will be formatted as ks--log. console: enableMultiLogin: false # enable/disable multiple sing on, it allows an account can be used by different users at the same time. port: 30880 @@ -44,13 +51,7 @@ spec: replicas: 2 logging: # (CPU: 57 m, Memory: 2.76 G) Whether to install KubeSphere logging system. Flexible logging functions are provided for log query, collection and management in a unified console. Additional log collectors can be added, such as Elasticsearch, Kafka and Fluentd. enabled: false - elasticsearchMasterReplicas: 1 # total number of master nodes, it's not allowed to use even number - elasticsearchDataReplicas: 1 # total number of data nodes. logsidecarReplicas: 2 - elasticsearchMasterVolumeSize: 4Gi # Volume size of Elasticsearch master nodes. - elasticsearchDataVolumeSize: 20Gi # Volume size of Elasticsearch data nodes. - logMaxAge: 7 # Log retention time in built-in Elasticsearch, it is 7 days by default. - elkPrefix: logstash # The string making up index names. The index name will be formatted as ks--log. metrics_server: # (CPU: 56 m, Memory: 44.35 MiB) Whether to install metrics-server. IT enables HPA (Horizontal Pod Autoscaler). enabled: false monitoring: diff --git a/kubesphere-complete-setup.yaml b/kubesphere-complete-setup.yaml index 3daf43fa6..0bcd57537 100644 --- a/kubesphere-complete-setup.yaml +++ b/kubesphere-complete-setup.yaml @@ -25,6 +25,13 @@ data: etcdVolumeSize: 20Gi openldapVolumeSize: 2Gi redisVolumSize: 2Gi + es: + elasticsearchMasterReplicas: 1 + elasticsearchDataReplicas: 1 + elasticsearchMasterVolumeSize: 4Gi + elasticsearchDataVolumeSize: 20Gi + logMaxAge: 7 + elkPrefix: logstash metrics_server: enabled: True @@ -42,16 +49,8 @@ data: logging: enabled: True - elasticsearchMasterReplicas: 1 - elasticsearchDataReplicas: 1 logsidecarReplicas: 2 - elasticsearchMasterVolumeSize: 4Gi - elasticsearchDataVolumeSize: 20Gi - logMaxAge: 7 - elkPrefix: logstash containersLogMountedPath: "" - kibana: - enabled: False openpitrix: enabled: True diff --git a/kubesphere-minimal.yaml b/kubesphere-minimal.yaml index c7a4593dd..e160459ab 100644 --- a/kubesphere-minimal.yaml +++ b/kubesphere-minimal.yaml @@ -25,6 +25,13 @@ data: etcdVolumeSize: 20Gi openldapVolumeSize: 2Gi redisVolumSize: 2Gi + es: + elasticsearchMasterReplicas: 1 + elasticsearchDataReplicas: 1 + elasticsearchMasterVolumeSize: 4Gi + elasticsearchDataVolumeSize: 20Gi + logMaxAge: 7 + elkPrefix: logstash metrics_server: enabled: True @@ -42,16 +49,8 @@ data: logging: enabled: False - elasticsearchMasterReplicas: 1 - elasticsearchDataReplicas: 1 logsidecarReplicas: 2 - elasticsearchMasterVolumeSize: 4Gi - elasticsearchDataVolumeSize: 20Gi - logMaxAge: 7 - elkPrefix: logstash containersLogMountedPath: "" - kibana: - enabled: False openpitrix: enabled: False diff --git a/roles/common/defaults/main.yaml b/roles/common/defaults/main.yaml index 9c91cf156..c9fd4dabc 100644 --- a/roles/common/defaults/main.yaml +++ b/roles/common/defaults/main.yaml @@ -6,6 +6,15 @@ common: etcdVolumeSize: 20Gi openldapVolumeSize: 2Gi redisVolumSize: 2Gi + es: + elasticsearchMasterReplicas: 1 + elasticsearchDataReplicas: 1 + elasticsearchMasterVolumeSize: 4Gi + elasticsearchDataVolumeSize: 20Gi + logMaxAge: 7 + elkPrefix: logstash + # externalElasticsearchUrl: + # externalElasticsearchPort: op_minio_accesskey: openpitrixminioaccesskey diff --git a/roles/ks-logging/files/logging/elasticsearch-1.22.1.tgz b/roles/common/files/elasticsearch/elasticsearch-1.22.1.tgz similarity index 100% rename from roles/ks-logging/files/logging/elasticsearch-1.22.1.tgz rename to roles/common/files/elasticsearch/elasticsearch-1.22.1.tgz diff --git a/roles/ks-logging/files/logging/elasticsearch-curator-1.3.3.tgz b/roles/common/files/elasticsearch/elasticsearch-curator-1.3.3.tgz similarity index 100% rename from roles/ks-logging/files/logging/elasticsearch-curator-1.3.3.tgz rename to roles/common/files/elasticsearch/elasticsearch-curator-1.3.3.tgz diff --git a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/fluentbitconfig-fluentBitConfig.yaml b/roles/common/files/fluentbit-operator/fluentbit/fluentbitconfig-fluentBitConfig.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/fluentbitconfig-fluentBitConfig.yaml rename to roles/common/files/fluentbit-operator/fluentbit/fluentbitconfig-fluentBitConfig.yaml diff --git a/roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-clusterRole.yaml b/roles/common/files/fluentbit-operator/init/fluentbit-operator-clusterRole.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-clusterRole.yaml rename to roles/common/files/fluentbit-operator/init/fluentbit-operator-clusterRole.yaml diff --git a/roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-clusterRoleBinding.yaml b/roles/common/files/fluentbit-operator/init/fluentbit-operator-clusterRoleBinding.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-clusterRoleBinding.yaml rename to roles/common/files/fluentbit-operator/init/fluentbit-operator-clusterRoleBinding.yaml diff --git a/roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-filterCustomResourceDefinition.yaml b/roles/common/files/fluentbit-operator/init/fluentbit-operator-filterCustomResourceDefinition.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-filterCustomResourceDefinition.yaml rename to roles/common/files/fluentbit-operator/init/fluentbit-operator-filterCustomResourceDefinition.yaml diff --git a/roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-fluentbitCustomResourceDefinition.yaml b/roles/common/files/fluentbit-operator/init/fluentbit-operator-fluentbitCustomResourceDefinition.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-fluentbitCustomResourceDefinition.yaml rename to roles/common/files/fluentbit-operator/init/fluentbit-operator-fluentbitCustomResourceDefinition.yaml diff --git a/roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-fluentbitconfigCustomResourceDefinition.yaml b/roles/common/files/fluentbit-operator/init/fluentbit-operator-fluentbitconfigCustomResourceDefinition.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-fluentbitconfigCustomResourceDefinition.yaml rename to roles/common/files/fluentbit-operator/init/fluentbit-operator-fluentbitconfigCustomResourceDefinition.yaml diff --git a/roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-inputCustomResourceDefinition.yaml b/roles/common/files/fluentbit-operator/init/fluentbit-operator-inputCustomResourceDefinition.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-inputCustomResourceDefinition.yaml rename to roles/common/files/fluentbit-operator/init/fluentbit-operator-inputCustomResourceDefinition.yaml diff --git a/roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-outputCustomResourceDefinition.yaml b/roles/common/files/fluentbit-operator/init/fluentbit-operator-outputCustomResourceDefinition.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-outputCustomResourceDefinition.yaml rename to roles/common/files/fluentbit-operator/init/fluentbit-operator-outputCustomResourceDefinition.yaml diff --git a/roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-serviceAccount.yaml b/roles/common/files/fluentbit-operator/init/fluentbit-operator-serviceAccount.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-serviceAccount.yaml rename to roles/common/files/fluentbit-operator/init/fluentbit-operator-serviceAccount.yaml diff --git a/roles/ks-logging/files/logging/fluentbit-operator/migrator/migrator-rbac.yaml b/roles/common/files/fluentbit-operator/migrator/migrator-rbac.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/migrator/migrator-rbac.yaml rename to roles/common/files/fluentbit-operator/migrator/migrator-rbac.yaml diff --git a/roles/common/tasks/common-install.yaml b/roles/common/tasks/common-install.yaml index ad5900760..ee4bf9762 100644 --- a/roles/common/tasks/common-install.yaml +++ b/roles/common/tasks/common-install.yaml @@ -27,4 +27,14 @@ - "import.stderr and 'is forbidden' not in import.stderr" when: - openpitrix.enabled or notification.enabled or alerting.enabled - - "status.etcd is not defined or status.etcd.status is not defined or status.etcd.status != 'enabled'" \ No newline at end of file + - "status.etcd is not defined or status.etcd.status is not defined or status.etcd.status != 'enabled'" + +- import_tasks: es-install.yaml + when: + - logging.enabled or events.enabled or auditing.enabled or servicemesh.enabled + - "status.es is not defined or status.es.status is not defined or status.es.status != 'enabled'" + +- import_tasks: fluentbit-install.yaml + when: + - logging.enabled or events.enabled or auditing.enabled + - "status.fluentbit is not defined or status.fluentbit.status is not defined or status.fluentbit.status != 'enabled'" \ No newline at end of file diff --git a/roles/common/tasks/es-install.yaml b/roles/common/tasks/es-install.yaml new file mode 100644 index 000000000..4928192e4 --- /dev/null +++ b/roles/common/tasks/es-install.yaml @@ -0,0 +1,125 @@ +- name: Kubesphere | Getting elasticsearch and curator installation files + copy: + src: "elasticsearch" + dest: "{{ kubesphere_dir }}/" + + +- name: Kubesphere | Creating custom manifests + template: + src: "{{ item.file }}.j2" + dest: "{{ kubesphere_dir }}/elasticsearch/{{ item.file }}" + with_items: + - { name: custom-values-elasticsearch, file: custom-values-elasticsearch.yaml } + - { name: custom-values-elasticsearch-curator, file: custom-values-elasticsearch-curator.yaml } + + +# Update check +- block: + - name: Kubesphere | Check elasticsearch data StatefulSet + shell: > + {{ bin_dir }}/kubectl get sts -n kubesphere-logging-system | grep "elasticsearch-logging-data" | wc -l + register: sts_number + + - name: Kubesphere | Check elasticsearch storageclass + shell: > + {{ bin_dir }}/kubectl get sts -n kubesphere-logging-system elasticsearch-logging-data -o yaml | grep "storageClassName" | wc -l + register: sc_number + + - name: Kubesphere | Comment elasticsearch storageclass parameter + shell: > + sed -i 's/\(^.*storageClass:.*$\)/#\1/' {{ kubesphere_dir }}/custom-values-elasticsearch.yaml + when: + - sts_number.stdout != "0" + - sc_number.stdout == "0" + + +# Deploy elasticsearch +- block: + - name: Kubesphere | Deploy elasticsearch-logging + shell: > + {{ bin_dir }}/helm upgrade --install elasticsearch-logging + {{ kubesphere_dir }}/elasticsearch/elasticsearch-1.22.1.tgz + -f {{ kubesphere_dir }}/elasticsearch/custom-values-elasticsearch.yaml + --namespace kubesphere-logging-system + register: es_result + ignore_errors: True + + - name: Kubesphere | Get PersistentVolume Name + shell: > + kubectl get pv | grep "kubesphere-logging-system/data-elasticsearch-logging" | awk '{print $1}' + register: es_pv_name + when: + - "es_result.stderr and 'no matches for kind' in es_result.stderr" + + - name: Kubesphere | Patch PersistentVolume (persistentVolumeReclaimPolicy) + shell: > + kubectl patch pv {{ item }} + -p '{"spec":{"persistentVolumeReclaimPolicy": "Retain"}}' + loop: "{{ es_pv_name.stdout_lines }}" + when: + - "es_result.stderr and 'no matches for kind' in es_result.stderr" + + - name: Kubesphere | Delete elasticsearch + shell: > + {{ bin_dir }}/helm del --purge elasticsearch-logging + when: + - "es_result.stderr and 'no matches for kind' in es_result.stderr" + + - name: Kubesphere | Waiting for seconds + wait_for: timeout=20 + when: + - "es_result.stderr and 'no matches for kind' in es_result.stderr" + + - name: Kubesphere | Deploy elasticsearch-logging + shell: > + {{ bin_dir }}/helm upgrade --install elasticsearch-logging + {{ kubesphere_dir }}/elasticsearch/elasticsearch-1.22.1.tgz + -f {{ kubesphere_dir }}/elasticsearch/custom-values-elasticsearch.yaml + --namespace kubesphere-logging-system + register: es_result + when: + - "es_result.stderr and 'no matches for kind' in es_result.stderr" + + - fail: + msg: "{{ es_result.stderr }}" + when: + - es_result.stderr is defined + - es_result.stderr != "" + - es_result.stderr.find("no matches for kind") == -1 + + when: + - common.es.externalElasticsearchUrl is not defined + - common.es.externalElasticsearchPort is not defined + + +# Deploy elasticsearch curator +- block: + - name: Kubesphere | Check elasticsearch-logging-curator + shell: > + {{ bin_dir }}/helm list elasticsearch-logging-curator + register: curator_check + ignore_errors: True + + + - name: Kubesphere | Deploy elasticsearch-logging-curator + shell: > + {{ bin_dir }}/helm upgrade --install elasticsearch-logging-curator + {{ kubesphere_dir }}/elasticsearch/elasticsearch-curator-1.3.3.tgz + -f {{ kubesphere_dir }}/elasticsearch/custom-values-elasticsearch-curator.yaml + --namespace kubesphere-logging-system + when: + - (curator_check.stdout.find("DEPLOYED") == -1) or (curator_check.stdout.find("5.5.4-0217") == -1) + + +# Update clusterconfig (cc) status +- name: Kubesphere | import es status + shell: > + {{ bin_dir }}/kubectl patch cc ks-installer + --type merge + -p '{"status": {"es": {"status": "enabled", "enabledTime": "{{ lookup('pipe','date +%Y-%m-%dT%H:%M:%S%Z') }}"}}}' + -n kubesphere-system + register: import + failed_when: "import.stderr and 'Warning' not in import.stderr" + until: import is succeeded + retries: 5 + delay: 3 \ No newline at end of file diff --git a/roles/common/tasks/fluentbit-install.yaml b/roles/common/tasks/fluentbit-install.yaml new file mode 100644 index 000000000..51e3f83cb --- /dev/null +++ b/roles/common/tasks/fluentbit-install.yaml @@ -0,0 +1,76 @@ +- name: Kubesphere | Getting elasticsearch and curator installation files + copy: + src: "fluentbit-operator" + dest: "{{ kubesphere_dir }}/" + + +- name: Kubesphere | Creating custom manifests + template: + src: "{{ item.file }}.j2" + dest: "{{ kubesphere_dir }}/fluentbit-operator/{{ item.path }}/{{ item.file }}" + with_items: + - { path: fluentbit, file: custom-fluentbit-fluentBit.yaml } + - { path: init, file: custom-fluentbit-operator-deployment.yaml } + - { path: migrator, file: custom-migrator-job.yaml } + + +# Upgrade or install fluent bit operator +- name: Kubesphere | Checking kubesphere-version + shell: > + {{ bin_dir }}/kubectl describe configmap -n kubesphere-system ks-console-ae-config | grep "kubesphere:" | awk '{print $2}' + register: kubesphere_version + ignore_errors: True + + +- name: Kubesphere | Backup old fluentbit crd + shell: > + {{ bin_dir }}/kubectl get fluentbits.logging.kubesphere.io -n kubesphere-logging-system fluent-bit -o yaml > {{ kubesphere_dir }}/fluentbit-crd.yaml.bak + when: + - kubesphere_version.stdout.split('.')[0] == "2" + + +- name: Kubesphere | Deleting old fluentbit operator + shell: > + {{ bin_dir }}/kubectl delete {{ item.type }} -n kubesphere-logging-system {{ item.name }} + loop: + - { type: deploy, name: logging-fluentbit-operator } + - { type: fluentbits.logging.kubesphere.io, name: fluent-bit } + - { type: ds, name: fluent-bit } + - { type: crd, name: fluentbits.logging.kubesphere.io } + when: + - kubesphere_version.stdout.split('.')[0] == "2" + + +- name: Kubesphere | Prepare fluentbit operator setup + shell: > + {{ bin_dir }}/kubectl apply -f {{ kubesphere_dir }}/fluentbit-operator/init + + +- name: Kubesphere | Migrate fluentbit operator old config + shell: > + {{ bin_dir }}/kubectl apply -f {{ kubesphere_dir }}/fluentbit-operator/migrator + when: + - kubesphere_version.stdout.split('.')[0] == "2" + + +- name: Kubesphere | Deploy new fluentbit operator + shell: > + {{ bin_dir }}/kubectl apply -f {{ kubesphere_dir }}/fluentbit-operator/fluentbit + register: import + until: import is succeeded + retries: 5 + delay: 3 + + +# Update clusterconfig (cc) status +- name: Kubesphere | import fluentbit status + shell: > + {{ bin_dir }}/kubectl patch cc ks-installer + --type merge + -p '{"status": {"fluentbit": {"status": "enabled", "enabledTime": "{{ lookup('pipe','date +%Y-%m-%dT%H:%M:%S%Z') }}"}}}' + -n kubesphere-system + register: import + failed_when: "import.stderr and 'Warning' not in import.stderr" + until: import is succeeded + retries: 5 + delay: 3 \ No newline at end of file diff --git a/roles/common/tasks/get_old_config.yaml b/roles/common/tasks/get_old_config.yaml index e3dee7da9..b2161864a 100644 --- a/roles/common/tasks/get_old_config.yaml +++ b/roles/common/tasks/get_old_config.yaml @@ -82,4 +82,32 @@ when: - redis_ha_pvc.rc == 0 - redis_ha_pvc.stdout != "" + ignore_errors: True + +- name: Kubesphere | Check es-master PersistentVolumeClaim + shell: > + {{ bin_dir }}/kubectl get pvc -n kubesphere-logging-system data-elasticsearch-logging-discovery-0 -o jsonpath='{.status.capacity.storage}' + register: es_master_pvc + ignore_errors: True + +- name: Kubesphere | Setting es master pv size + set_fact: + es_master_pv_size: "{{ es_master_pvc.stdout }}" + when: + - es_master_pvc.rc == 0 + - es_master_pvc.stdout != "" + ignore_errors: True + +- name: Kubesphere | Check es data PersistentVolumeClaim + shell: > + {{ bin_dir }}/kubectl get pvc -n kubesphere-logging-system data-elasticsearch-logging-data-0 -o jsonpath='{.status.capacity.storage}' + register: es_data_pvc + ignore_errors: True + +- name: Kubesphere | Setting es data pv size + set_fact: + es_data_pv_size: "{{ es_data_pvc.stdout }}" + when: + - es_data_pvc.rc == 0 + - es_data_pvc.stdout != "" ignore_errors: True \ No newline at end of file diff --git a/roles/ks-logging/templates/custom-fluentbit-fluentBit.yaml.j2 b/roles/common/templates/custom-fluentbit-fluentBit.yaml.j2 similarity index 100% rename from roles/ks-logging/templates/custom-fluentbit-fluentBit.yaml.j2 rename to roles/common/templates/custom-fluentbit-fluentBit.yaml.j2 diff --git a/roles/ks-logging/templates/custom-fluentbit-operator-deployment.yaml.j2 b/roles/common/templates/custom-fluentbit-operator-deployment.yaml.j2 similarity index 100% rename from roles/ks-logging/templates/custom-fluentbit-operator-deployment.yaml.j2 rename to roles/common/templates/custom-fluentbit-operator-deployment.yaml.j2 diff --git a/roles/ks-logging/templates/custom-migrator-job.yaml.j2 b/roles/common/templates/custom-migrator-job.yaml.j2 similarity index 100% rename from roles/ks-logging/templates/custom-migrator-job.yaml.j2 rename to roles/common/templates/custom-migrator-job.yaml.j2 diff --git a/roles/ks-logging/templates/custom-values-elasticsearch-curator.yaml.j2 b/roles/common/templates/custom-values-elasticsearch-curator.yaml.j2 similarity index 87% rename from roles/ks-logging/templates/custom-values-elasticsearch-curator.yaml.j2 rename to roles/common/templates/custom-values-elasticsearch-curator.yaml.j2 index 4fb780ba2..88ee60f1e 100644 --- a/roles/ks-logging/templates/custom-values-elasticsearch-curator.yaml.j2 +++ b/roles/common/templates/custom-values-elasticsearch-curator.yaml.j2 @@ -48,7 +48,7 @@ configMaps: direction: older timestring: '%Y.%m.%d' unit: days - unit_count: {{ logging.logMaxAge }} + unit_count: {{ common.es.logMaxAge }} field: stats_result: epoch: @@ -58,9 +58,9 @@ configMaps: --- client: hosts: - - {% if logging.externalElasticsearchUrl is defined %}{{ logging.externalElasticsearchUrl }}{% else %}elasticsearch-logging-data.kubesphere-logging-system.svc{% endif %} + - {% if common.es.externalElasticsearchUrl is defined %}{{ common.es.externalElasticsearchUrl }}{% else %}elasticsearch-logging-data.kubesphere-logging-system.svc{% endif %} - port: {% if logging.externalElasticsearchPort is defined %}{{ logging.externalElasticsearchPort }}{% else %}9200{% endif %} + port: {% if common.es.externalElasticsearchPort is defined %}{{ common.es.externalElasticsearchPort }}{% else %}9200{% endif %} # url_prefix: # use_ssl: True diff --git a/roles/ks-logging/templates/custom-values-elasticsearch.yaml.j2 b/roles/common/templates/custom-values-elasticsearch.yaml.j2 similarity index 95% rename from roles/ks-logging/templates/custom-values-elasticsearch.yaml.j2 rename to roles/common/templates/custom-values-elasticsearch.yaml.j2 index 35f16e162..cb0830c9e 100644 --- a/roles/ks-logging/templates/custom-values-elasticsearch.yaml.j2 +++ b/roles/common/templates/custom-values-elasticsearch.yaml.j2 @@ -72,14 +72,14 @@ cluster: master: name: master exposeHttp: false - replicas: {{ logging.elasticsearchMasterReplicas }} + replicas: {{ common.es.elasticsearchMasterReplicas }} heapSize: "512m" # additionalJavaOpts: "-XX:MaxRAM=512m" persistence: enabled: true accessMode: ReadWriteOnce name: data - size: {% if es_master_pv_size is defined %}{{ es_master_pv_size }}{% else %}{{ logging.elasticsearchMasterVolumeSize }}{% endif %} + size: {% if es_master_pv_size is defined %}{{ es_master_pv_size }}{% else %}{{ common.es.elasticsearchMasterVolumeSize }}{% endif %} {% if persistence.storageClass is defined and persistence.storageClass != "" %} storageClass: "{{ persistence.storageClass }}" @@ -124,14 +124,14 @@ data: serviceType: ClusterIP loadBalancerIP: {} loadBalancerSourceRanges: {} - replicas: {{ logging.elasticsearchDataReplicas }} + replicas: {{ common.es.elasticsearchDataReplicas }} heapSize: "1536m" # additionalJavaOpts: "-XX:MaxRAM=1536m" persistence: enabled: true accessMode: ReadWriteOnce name: data - size: {% if es_data_pv_size is defined %}{{ es_data_pv_size }}{% else %}{{ logging.elasticsearchDataVolumeSize }}{% endif %} + size: {% if es_data_pv_size is defined %}{{ es_data_pv_size }}{% else %}{{ common.es.elasticsearchDataVolumeSize }}{% endif %} {% if persistence.storageClass is defined and persistence.storageClass != "" %} storageClass: "{{ persistence.storageClass }}" diff --git a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/filter-auditing.yaml b/roles/ks-auditing/files/fluentbit-operator/filter-auditing.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/filter-auditing.yaml rename to roles/ks-auditing/files/fluentbit-operator/filter-auditing.yaml diff --git a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/input-tail-auditing.yaml b/roles/ks-auditing/files/fluentbit-operator/input-auditing.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/input-tail-auditing.yaml rename to roles/ks-auditing/files/fluentbit-operator/input-auditing.yaml diff --git a/roles/ks-auditing/tasks/fluentbit-operator.yaml b/roles/ks-auditing/tasks/fluentbit-operator.yaml new file mode 100644 index 000000000..a39196085 --- /dev/null +++ b/roles/ks-auditing/tasks/fluentbit-operator.yaml @@ -0,0 +1,16 @@ +- name: ks-auditing | Getting logging installation files + copy: + src: "fluentbit-operator" + dest: "{{ kubesphere_dir }}/" + + +- name: ks-auditing | Creating manifests + template: + src: "{{ item.file }}.j2" + dest: "{{ kubesphere_dir }}/fluentbit-operator/{{ item.file }}" + with_items: + - { name: custom-output-elasticsearch-auditing, file: custom-output-elasticsearch-auditing.yaml } + +- name: ks-auditing | Apply fluentbit operator custom resources + shell: > + {{ bin_dir }}/kubectl apply -f {{ kubesphere_dir }}/fluentbit-operator \ No newline at end of file diff --git a/roles/ks-auditing/tasks/main.yaml b/roles/ks-auditing/tasks/main.yaml index a02959ddc..7eacc160e 100644 --- a/roles/ks-auditing/tasks/main.yaml +++ b/roles/ks-auditing/tasks/main.yaml @@ -35,6 +35,9 @@ - (auditing_check.stdout.find("DEPLOYED") == -1) or (auditing_check.stdout.find("v0.1.0") == -1) +- import_tasks: fluentbit-operator.yaml + + - name: ks-auditing | import ks-auditing status shell: > {{ bin_dir }}/kubectl patch cc ks-installer diff --git a/roles/ks-auditing/templates/custom-output-elasticsearch-auditing.yaml.j2 b/roles/ks-auditing/templates/custom-output-elasticsearch-auditing.yaml.j2 new file mode 100644 index 000000000..61a7d0732 --- /dev/null +++ b/roles/ks-auditing/templates/custom-output-elasticsearch-auditing.yaml.j2 @@ -0,0 +1,16 @@ +apiVersion: logging.kubesphere.io/v1alpha2 +kind: Output +metadata: + name: es-auditing + namespace: kubesphere-logging-system + labels: + logging.kubesphere.io/enabled: "true" + logging.kubesphere.io/component: "auditing" +spec: + match: kube_auditing + es: + logstashFormat: true + host: "{% if common.es.externalElasticsearchUrl is defined %}{{ common.es.externalElasticsearchUrl }}{% else %}elasticsearch-logging-data.kubesphere-logging-system.svc{% endif %}" + logstashPrefix: "ks-{{ common.es.elkPrefix }}-auditing" + port: {% if common.es.externalElasticsearchPort is defined %}{{ common.es.externalElasticsearchPort }}{% else %}9200{% endif %} + diff --git a/roles/ks-core/config/templates/kubesphere-config.yaml.j2 b/roles/ks-core/config/templates/kubesphere-config.yaml.j2 index c2ace7df9..4c3de7d82 100644 --- a/roles/ks-core/config/templates/kubesphere-config.yaml.j2 +++ b/roles/ks-core/config/templates/kubesphere-config.yaml.j2 @@ -96,33 +96,33 @@ data: {% if logging.enabled is defined and logging.enabled == true %} logging: -{% if logging.externalElasticsearchUrl is defined and logging.externalElasticsearchPort is defined %} - host: http://{{ logging.externalElasticsearchUrl }}:{{ logging.externalElasticsearchPort }} +{% if common.es.externalElasticsearchUrl is defined and common.es.externalElasticsearchPort is defined %} + host: http://{{ common.es.externalElasticsearchUrl }}:{{ common.es.externalElasticsearchPort }} {% else %} host: http://elasticsearch-logging-data.kubesphere-logging-system.svc:9200 {% endif %} - indexPrefix: ks-{{ logging.elkPrefix }}-log + indexPrefix: ks-{{ common.es.elkPrefix }}-log {% endif %} {% if events.enabled is defined and events.enabled == true %} events: -{% if logging.externalElasticsearchUrl is defined and logging.externalElasticsearchPort is defined %} - host: http://{{ logging.externalElasticsearchUrl }}:{{ logging.externalElasticsearchPort }} +{% if common.es.externalElasticsearchUrl is defined and common.es.externalElasticsearchPort is defined %} + host: http://{{ common.es.externalElasticsearchUrl }}:{{ common.es.externalElasticsearchPort }} {% else %} host: http://elasticsearch-logging-data.kubesphere-logging-system.svc:9200 {% endif %} - indexPrefix: ks-{{ logging.elkPrefix }}-events + indexPrefix: ks-{{ common.es.elkPrefix }}-events {% endif %} {% if auditing.enabled is defined and auditing.enabled == true %} auditing: enable: true -{% if logging.externalElasticsearchUrl is defined and logging.externalElasticsearchPort is defined %} - host: http://{{ logging.externalElasticsearchUrl }}:{{ logging.externalElasticsearchPort }} +{% if common.es.externalElasticsearchUrl is defined and common.es.externalElasticsearchPort is defined %} + host: http://{{ common.es.externalElasticsearchUrl }}:{{ common.es.externalElasticsearchPort }} {% else %} host: http://elasticsearch-logging-data.kubesphere-logging-system.svc:9200 {% endif %} - indexPrefix: ks-{{ logging.elkPrefix }}-auditing + indexPrefix: ks-{{ common.es.elkPrefix }}-auditing {% endif %} {% if alerting.enabled is defined and alerting.enabled == true %} diff --git a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/filter-events.yaml b/roles/ks-events/files/fluentbit-operator/filter-events.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/filter-events.yaml rename to roles/ks-events/files/fluentbit-operator/filter-events.yaml diff --git a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/input-tail-events.yaml b/roles/ks-events/files/fluentbit-operator/input-events.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/input-tail-events.yaml rename to roles/ks-events/files/fluentbit-operator/input-events.yaml diff --git a/roles/ks-events/tasks/fluentbit-operator.yaml b/roles/ks-events/tasks/fluentbit-operator.yaml new file mode 100644 index 000000000..6854728a6 --- /dev/null +++ b/roles/ks-events/tasks/fluentbit-operator.yaml @@ -0,0 +1,16 @@ +- name: ks-events | Getting logging installation files + copy: + src: "fluentbit-operator" + dest: "{{ kubesphere_dir }}/" + + +- name: ks-events | Creating manifests + template: + src: "{{ item.file }}.j2" + dest: "{{ kubesphere_dir }}/fluentbit-operator/{{ item.file }}" + with_items: + - { name: custom-output-elasticsearch-events, file: custom-output-elasticsearch-events.yaml } + +- name: ks-events | Apply fluentbit operator custom resources + shell: > + {{ bin_dir }}/kubectl apply -f {{ kubesphere_dir }}/fluentbit-operator \ No newline at end of file diff --git a/roles/ks-events/tasks/main.yaml b/roles/ks-events/tasks/main.yaml index 210dec6bd..4a808afe4 100644 --- a/roles/ks-events/tasks/main.yaml +++ b/roles/ks-events/tasks/main.yaml @@ -35,6 +35,9 @@ - (events_check.stdout.find("DEPLOYED") == -1) or (events_check.stdout.find("v0.1.0") == -1) +- import_tasks: fluentbit-operator.yaml + + - name: ks-events | import ks-events status shell: > {{ bin_dir }}/kubectl patch cc ks-installer diff --git a/roles/ks-events/templates/custom-output-elasticsearch-events.yaml.j2 b/roles/ks-events/templates/custom-output-elasticsearch-events.yaml.j2 new file mode 100644 index 000000000..97a03538d --- /dev/null +++ b/roles/ks-events/templates/custom-output-elasticsearch-events.yaml.j2 @@ -0,0 +1,15 @@ +apiVersion: logging.kubesphere.io/v1alpha2 +kind: Output +metadata: + name: es-events + namespace: kubesphere-logging-system + labels: + logging.kubesphere.io/enabled: "true" + logging.kubesphere.io/component: "events" +spec: + match: kube_events + es: + logstashFormat: true + host: "{% if common.es.externalElasticsearchUrl is defined %}{{ common.es.externalElasticsearchUrl }}{% else %}elasticsearch-logging-data.kubesphere-logging-system.svc{% endif %}" + logstashPrefix: "ks-{{ common.es.elkPrefix }}-events" + port: {% if common.es.externalElasticsearchPort is defined %}{{ common.es.externalElasticsearchPort }}{% else %}9200{% endif %} diff --git a/roles/ks-istio/templates/jaeger-production.yaml.j2 b/roles/ks-istio/templates/jaeger-production.yaml.j2 index 466dd4872..be339b648 100644 --- a/roles/ks-istio/templates/jaeger-production.yaml.j2 +++ b/roles/ks-istio/templates/jaeger-production.yaml.j2 @@ -17,9 +17,9 @@ spec: enabled: true options: es: - index-prefix: {{ logging.elkPrefix }} -{% if logging.externalElasticsearchUrl is defined and logging.externalElasticsearchPort is defined %} - server-urls: http://{{ logging.externalElasticsearchUrl }}:{{ logging.externalElasticsearchPort }} + index-prefix: {{ common.es.elkPrefix }} +{% if common.es.externalElasticsearchUrl is defined and common.es.externalElasticsearchPort is defined %} + server-urls: http://{{ common.es.externalElasticsearchUrl }}:{{ common.es.externalElasticsearchPort }} {% else %} server-urls: http://elasticsearch-logging-data.kubesphere-logging-system.svc:9200 {% endif %} diff --git a/roles/ks-logging/defaults/main.yaml b/roles/ks-logging/defaults/main.yaml index e75615d88..cf7d7549c 100644 --- a/roles/ks-logging/defaults/main.yaml +++ b/roles/ks-logging/defaults/main.yaml @@ -1,14 +1,5 @@ --- logging: - elasticsearchMasterReplicas: 1 - elasticsearchDataReplicas: 2 logsidecarReplicas: 2 - elasticsearchVolumeSize: 20Gi - logMaxAge: 7 - elkPrefix: logstash - kibana: - enable: false -# externalElasticsearchUrl: -# externalElasticsearchPort: diff --git a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/filter-kubernetes.yaml b/roles/ks-logging/files/fluentbit-operator/filter-logging.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/filter-kubernetes.yaml rename to roles/ks-logging/files/fluentbit-operator/filter-logging.yaml diff --git a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/input-tail.yaml b/roles/ks-logging/files/fluentbit-operator/input-logging.yaml similarity index 100% rename from roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/input-tail.yaml rename to roles/ks-logging/files/fluentbit-operator/input-logging.yaml diff --git a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/fluentbit-fluentBit.yaml b/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/fluentbit-fluentBit.yaml deleted file mode 100644 index f8a22830e..000000000 --- a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/fluentbit-fluentBit.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: logging.kubesphere.io/v1alpha2 -kind: FluentBit -metadata: - name: fluent-bit - namespace: kubesphere-logging-system - labels: - app.kubernetes.io/name: fluent-bit -spec: - image: kubespheredev/fluent-bit:v1.5.0 - positionDB: - emptyDir: {} - fluentBitConfigName: fluent-bit-config - tolerations: - - operator: Exists diff --git a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/output-elasticsearch-auditing.yaml b/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/output-elasticsearch-auditing.yaml deleted file mode 100644 index 5c0cccd03..000000000 --- a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/output-elasticsearch-auditing.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: logging.kubesphere.io/v1alpha2 -kind: Output -metadata: - labels: - logging.kubesphere.io/enabled: 'true' - logging.kubesphere.io/component: "auditing" - name: es-auditing - namespace: kubesphere-logging-system -spec: - es: - host: elasticsearch-logging-data.kubesphere-logging-system.svc - logstashFormat: true - logstashPrefix: ks-logstash-auditing - port: 9200 - match: kube_auditing - diff --git a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/output-elasticsearch-events.yaml b/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/output-elasticsearch-events.yaml deleted file mode 100644 index 79674b9a5..000000000 --- a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/output-elasticsearch-events.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: logging.kubesphere.io/v1alpha2 -kind: Output -metadata: - name: es-events - namespace: kubesphere-logging-system - labels: - logging.kubesphere.io/enabled: "true" - logging.kubesphere.io/component: "events" -spec: - match: kube_events - es: - host: elasticsearch-logging-data.kubesphere-logging-system.svc - port: 9200 - logstashPrefix: ks-logstash-events - logstashFormat: true \ No newline at end of file diff --git a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/output-elasticsearch.yaml b/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/output-elasticsearch.yaml deleted file mode 100644 index a2bf21790..000000000 --- a/roles/ks-logging/files/logging/fluentbit-operator/fluent-bit/output-elasticsearch.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: logging.kubesphere.io/v1alpha2 -kind: Output -metadata: - name: es - namespace: kubesphere-logging-system - labels: - logging.kubesphere.io/enabled: "true" - logging.kubesphere.io/component: "logging" -spec: - match: kube.* - es: - host: elasticsearch-logging-data.kubesphere-logging-system.svc - port: 9200 - logstashPrefix: ks-logstash-log - logstashFormat: true - timeKey: "@timestamp" \ No newline at end of file diff --git a/roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-deployment.yaml b/roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-deployment.yaml deleted file mode 100644 index 41158797e..000000000 --- a/roles/ks-logging/files/logging/fluentbit-operator/init/fluentbit-operator-deployment.yaml +++ /dev/null @@ -1,53 +0,0 @@ -kind: Deployment -apiVersion: apps/v1 -metadata: - name: fluentbit-operator - namespace: kubesphere-logging-system - labels: - app.kubernetes.io/component: operator - app.kubernetes.io/name: fluentbit-operator -spec: - selector: - matchLabels: - app.kubernetes.io/component: operator - app.kubernetes.io/name: fluentbit-operator - template: - metadata: - labels: - app.kubernetes.io/component: operator - app.kubernetes.io/name: fluentbit-operator - spec: - volumes: - - name: env - emptyDir: {} - - name: dockersock - hostPath: - path: /var/run/docker.sock - initContainers: - - name: setenv - image: 'docker:19.03' - command: - - /bin/sh - - '-c' - - set -ex; - echo DOCKER_ROOT_DIR=$(docker info -f '{{.DockerRootDir}}') > /fluentbit-operator/fluent-bit.env - volumeMounts: - - name: env - mountPath: /fluentbit-operator - - name: dockersock - readOnly: true - mountPath: /var/run/docker.sock - containers: - - name: fluentbit-operator - image: 'kubespheredev/fluentbit-operator:v0.2.0' - resources: - limits: - cpu: 100m - memory: 30Mi - requests: - cpu: 100m - memory: 20Mi - volumeMounts: - - name: env - mountPath: /fluentbit-operator - serviceAccountName: fluentbit-operator diff --git a/roles/ks-logging/files/logging/fluentbit-operator/migrator/migrator-job.yaml b/roles/ks-logging/files/logging/fluentbit-operator/migrator/migrator-job.yaml deleted file mode 100644 index d6e4f9f50..000000000 --- a/roles/ks-logging/files/logging/fluentbit-operator/migrator/migrator-job.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: fluentbit-operator-migrator - namespace: kubesphere-logging-system -spec: - template: - spec: - containers: - - name: migrator - image: kubespheredev/fluentbit-operator:migrator - restartPolicy: Never - serviceAccountName: fluentbit-operator-migrator \ No newline at end of file diff --git a/roles/ks-logging/files/logging/kibana-2.2.1.tgz b/roles/ks-logging/files/logging/kibana-2.2.1.tgz deleted file mode 100644 index 114a206135576fccb0b1c16bc7754196ea755d6b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11760 zcmVDc zVQyr3R8em|NM&qo0PKBva~n6Z`2Ni*eTUwWUMyubLsF;1MA>L%C9C%wTP4ZKZrLsi zoB>Hh!@&f=kYXhLKKrk5&CN@etJNz1+uGl5|E;~fx7FI+ZnyTf{?=-5?QFIF2CYv3OC=>-AojP`NB318 z+#e*NIQ|JUPH5DDJ#XJ@xvj1Cej~u#XCxLX|Nqn)0m1=AKw}&MrwQ{h1V|tl5uTus z{Dx#D$06c^_#7kV4;nb?lL&X9PemLy26Tu!Fc2c?BY~oRR(41uD)80T_IG`mAz@A{m~RdJ%XF#Hth%$K*CVePZewJpam(BC z+KmP0-{5M5!UXeA!~kZ~e|u+t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;IKd4WIiIQ|>dRjQ=ZpQ}*VItG%foVi%Yv|84D6 z-+$VBivRW~N%8+WQ)3})bV&PxArhM9QHdaJ%nGh8r@!ZeRVSP^`2aDi`ZmpBaMM;v z|L}g{)I6KPldi5_`u4ez_9sdi{hM2cuDS;4s+W}?C;oG*wO@|^xVyLiME{SH%&aSF zS2Lf6)>jezWtOM@3g{4#D2B& zQ3eD^1Z(RY{|aqrw>G|pfaXom`ax5YWd$_C`r*^R7=Ov=-!N@^(d7XZzb z?(Dap^uI?*)$_k6`R2joo6kMD3#1(VkNgL<`ebPy{cpF+^uM*c^A!L8QIewn+FMl} zO{L0nmFg=DCJIVC@@q-Fw(x`|O0>6?^4A4(>>&RXpL#m9`bM0l_rh&9^|l)MO>WJ* zKM?10Bl8cKGWxd{B3yHU<Hh}+0RR8%#VcX}5CH(f>*`Mc diff --git a/roles/ks-logging/files/logging/nginx-1.0.0.tgz b/roles/ks-logging/files/logging/nginx-1.0.0.tgz deleted file mode 100644 index 8d526909f191d4151e87634ee800614a50316321..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7984 zcmV-0AJ5<)iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PKB#bKADEX#duy*sJtT;y#Iz^Rri-&b%DkJ;(2+w#Rnc*XeX> zh=e2@lK=~VwsoDn&;Di?00~l*oiuGar^oywu}EOCSnO{sLAez2X0o?p+9qpO5FH()0eM4o9;e+_VnpzF#RKt>0XtwOn)~0 z=&`z!`xm)bDZc002qkB5wL4&CS^wNkc3&pb@$~8Lt3k$1szqt(!4dKdq{uU{P#XTb znsY6=fg z|B|bvO3c-A@?ttIZ^rGLNhz0uf(dDvkX)PDU<|xqBA>xZ$z?8>TwXJ|{NL+Jip4rf zRWSgNtl%^FM`!>)Fu5GKnzU3cIT22w-wq&ABO8T=U6_=f#*NZze{k zlV62grn#!Ji34=i&~KVd2Y>bg-*Y+nzhZ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^TAujF5-4F2Eta`pe3 zv#j7rk^LcK-1Gj=vzN~{-v8Ns`TU{&|5IF#+}GR(gGZ0x{LNSUr(X>Q7Z(@kGOC;p zRy;3gI~n7s?w8IlE-t9wp?i-0z~Eff&6`i%)SA2XF{F!PJ@z*)X4^+~-++UraX%g| zF;8ztf;+_A8A=&_tlk;d_|s0Q`%qnQ2EwJTlgn@{VsKR0f(|74xztm#(M6>mpG^d>xBKL7PGq3d<> z->n}EPC`d`3;U6mg}viRc%=^nD&UMIEanfV3vxoAV^ zpS|nsV7-Nl)|cly0N!h&9eDBA#V-aI@$nl0NJw|%y;0B|7xiZ}FGg??&gsA|(US&V z=^w`M=+*9s4NH}^iS*?(f*_+I4j0hDRG0{fk@MC`0NdZM3kw&Yl!*Wj@OL=+wB3r% zP~B)s=eqWHXrKMvbU{gq-mR}YZ5)+~UG``fpyw?Q%G!jl)?M_T!h6xiXY+j1I|m?s mFDqNicK68K0RGSR4j!(D>*4w - {{ bin_dir }}/helm upgrade --install elasticsearch-logging - {{ kubesphere_dir }}/logging/elasticsearch-1.22.1.tgz - -f {{ kubesphere_dir }}/logging/custom-values-elasticsearch.yaml - --namespace kubesphere-logging-system - register: es_result - ignore_errors: True - - -- name: ks-logging | Get PersistentVolume Name - shell: > - kubectl get pv | grep "kubesphere-logging-system/data-elasticsearch-logging" | awk '{print $1}' - register: es_pv_name - when: - - "es_result.stderr and 'no matches for kind' in es_result.stderr" - -- name: ks-logging | Patch PersistentVolume (persistentVolumeReclaimPolicy) - shell: > - kubectl patch pv {{ item }} - -p '{"spec":{"persistentVolumeReclaimPolicy": "Retain"}}' - loop: "{{ es_pv_name.stdout_lines }}" - when: - - "es_result.stderr and 'no matches for kind' in es_result.stderr" - -- name: ks-logging | Delete elasticsearch - shell: > - {{ bin_dir }}/helm del --purge elasticsearch-logging - when: - - "es_result.stderr and 'no matches for kind' in es_result.stderr" - -- name: ks-logging | Waiting for seconds - wait_for: timeout=20 - when: - - "es_result.stderr and 'no matches for kind' in es_result.stderr" - -- name: ks-logging | Deploy elasticsearch-logging - shell: > - {{ bin_dir }}/helm upgrade --install elasticsearch-logging - {{ kubesphere_dir }}/logging/elasticsearch-1.22.1.tgz - -f {{ kubesphere_dir }}/logging/custom-values-elasticsearch.yaml - --namespace kubesphere-logging-system - register: es_result - when: - - "es_result.stderr and 'no matches for kind' in es_result.stderr" - -- fail: - msg: "{{ es_result.stderr }}" - when: - - es_result.stderr is defined - - es_result.stderr != "" - - es_result.stderr.find("no matches for kind") == -1 diff --git a/roles/ks-logging/tasks/get_old_config.yaml b/roles/ks-logging/tasks/get_old_config.yaml deleted file mode 100644 index fe9d34936..000000000 --- a/roles/ks-logging/tasks/get_old_config.yaml +++ /dev/null @@ -1,28 +0,0 @@ ---- -- name: Logging | Check es-master PersistentVolumeClaim - shell: > - {{ bin_dir }}/kubectl get pvc -n kubesphere-logging-system data-elasticsearch-logging-discovery-0 -o jsonpath='{.status.capacity.storage}' - register: es_master_pvc - ignore_errors: True - -- name: Logging | Setting es master pv size - set_fact: - es_master_pv_size: "{{ es_master_pvc.stdout }}" - when: - - es_master_pvc.rc == 0 - - es_master_pvc.stdout != "" - ignore_errors: True - -- name: Logging | Check es data PersistentVolumeClaim - shell: > - {{ bin_dir }}/kubectl get pvc -n kubesphere-logging-system data-elasticsearch-logging-data-0 -o jsonpath='{.status.capacity.storage}' - register: es_data_pvc - ignore_errors: True - -- name: Logging | Setting es data pv size - set_fact: - es_data_pv_size: "{{ es_data_pvc.stdout }}" - when: - - es_data_pvc.rc == 0 - - es_data_pvc.stdout != "" - ignore_errors: True \ No newline at end of file diff --git a/roles/ks-logging/tasks/main.yaml b/roles/ks-logging/tasks/main.yaml index 89e4179e4..3659484c5 100644 --- a/roles/ks-logging/tasks/main.yaml +++ b/roles/ks-logging/tasks/main.yaml @@ -1,188 +1,20 @@ --- -- import_tasks: pre-install.yaml - - name: ks-logging | Getting logging installation files copy: - src: "logging" + src: "fluentbit-operator" dest: "{{ kubesphere_dir }}/" -- import_tasks: get_old_config.yaml - name: ks-logging | Creating manifests template: src: "{{ item.file }}.j2" - dest: "{{ kubesphere_dir }}/logging/{{ item.file }}" + dest: "{{ kubesphere_dir }}/fluentbit-operator/{{ item.file }}" with_items: - - { path: logging, file: custom-fluentbit-fluentBit.yaml } - - { path: logging, file: custom-fluentbit-operator-deployment.yaml } - - { path: logging, file: custom-migrator-job.yaml } - - { path: logging, file: custom-output-elasticsearch.yaml } - - { path: logging, file: custom-values-elasticsearch.yaml } - - { path: logging, file: custom-values-elasticsearch-curator.yaml } - - { path: logging, file: custom-values-kibana.yaml } - - { path: logging, file: custom-output-elasticsearch-events.yaml } - - { path: logging, file: custom-output-elasticsearch-auditing.yaml } - - -- name: ks-logging | comment elasticsearch storageclass parameter - shell: > - sed -i 's/\(^.*storageClass:.*$\)/#\1/' {{ kubesphere_dir }}/logging/custom-values-elasticsearch.yaml - when: - - sts_number.stdout != "0" - - sc_number.stdout == "0" - - -- name: ks-logging | Checking elasticsearch-logging-data-svc - shell: > - {{ bin_dir }}/kubectl get svc -n kubesphere-logging-system - register: elasticsearch_logging_data_svc - ignore_errors: True - - -- name: ks-logging | Checking kubesphere-version - shell: > - {{ bin_dir }}/kubectl describe configmap -n kubesphere-system ks-console-ae-config | grep "kubesphere:" | awk '{print $2}' - register: kubesphere_version - ignore_errors: True - - -- name: ks-logging | Changing logging index - shell: > - index_name=logstash-$(date +"%Y.%m.%d" -d "-{{ item }} days"); - index_alias=ks-logstash-log-$(date +"%Y.%m.%d" -d "-{{ item }} days"); - curl -X POST "$({{ bin_dir }}/kubectl get svc elasticsearch-logging-data -n kubesphere-logging-system -o=jsonpath='{.spec.clusterIP}'):9200/_aliases" - -H 'Content-Type: application/json' - -d '{ "actions" : [ { "add" : { "index" : "'"$index_name"'", "alias" : "'"$index_alias"'" } } ] }' - with_sequence: start=0 end=6 stride=1 - when: - - elasticsearch_logging_data_svc.stdout.find("elasticsearch-logging-data") != -1 - - kubesphere_version.stdout == "2.0.0" - ignore_errors: True - - -- name: ks-logging | Backup old fluentbit crd - shell: > - {{ bin_dir }}/kubectl get fluentbits.logging.kubesphere.io -n kubesphere-logging-system fluent-bit -o yaml > {{ kubesphere_dir }}/logging/fluentbit-crd.yaml.bak - when: - - kubesphere_version.stdout.split('.')[0] == "2" - - -- name: ks-logging | Deleting old fluentbit operator - shell: > - {{ bin_dir }}/kubectl delete {{ item.type }} -n kubesphere-logging-system {{ item.name }} - loop: - - { type: deploy, name: logging-fluentbit-operator } - - { type: fluentbits.logging.kubesphere.io, name: fluent-bit } - - { type: ds, name: fluent-bit } - - { type: crd, name: fluentbits.logging.kubesphere.io } - when: - - kubesphere_version.stdout.split('.')[0] == "2" - - -- name: ks-logging | Prepare fluentbit operator setup - shell: > - {{ bin_dir }}/kubectl apply -f {{ kubesphere_dir }}/logging/fluentbit-operator/init - + - { name: custom-output-elasticsearch-logging, file: custom-output-elasticsearch-logging.yaml } -- name: ks-logging | Migrate fluentbit operator old config +- name: ks-logging | Apply fluentbit operator custom resources shell: > - {{ bin_dir }}/kubectl apply -f {{ kubesphere_dir }}/{{ item.path }}/{{ item.file }} - loop: - - {path: logging/fluentbit-operator/migrator, file: migrator-rbac.yaml} - - {path: logging, file: custom-migrator-job.yaml} - when: - - kubesphere_version.stdout.split('.')[0] == "2" - - -- name: ks-logging | Deploy new fluentbit operator - shell: > - {{ bin_dir }}/kubectl apply -f {{ kubesphere_dir }}/{{ item.path }}/{{ item.file }} - loop: - - {path: logging/fluentbit-operator, file: fluent-bit} - - {path: logging, file: custom-output-elasticsearch.yaml} - - {path: logging, file: custom-output-elasticsearch-events.yaml} - - {path: logging, file: custom-output-elasticsearch-auditing.yaml} - register: import - until: import is succeeded - retries: 5 - delay: 3 - -- name: ks-logging | Check elasticsearch - shell: > - {{ bin_dir }}/helm list elasticsearch-logging - register: es_check - ignore_errors: True - - -- import_tasks: elasticsearch.yaml - when: - - logging.externalElasticsearchUrl is not defined - - logging.externalElasticsearchPort is not defined - - (es_check.stdout.find("DEPLOYED") == -1) or (es_check.stdout.find("6.7.0-0217") == -1) - - -- name: ks-logging | Check elasticsearch-logging-curator - shell: > - {{ bin_dir }}/helm list elasticsearch-logging-curator - register: curator_check - ignore_errors: True - - -- name: ks-logging | Deploy elasticsearch-logging-curator - shell: > - {{ bin_dir }}/helm upgrade --install elasticsearch-logging-curator - {{ kubesphere_dir }}/logging/elasticsearch-curator-1.3.3.tgz - -f {{ kubesphere_dir }}/logging/custom-values-elasticsearch-curator.yaml - --namespace kubesphere-logging-system - when: - - (curator_check.stdout.find("DEPLOYED") == -1) or (curator_check.stdout.find("5.5.4-0217") == -1) - - -- block: - - name: ks-logging | Check elasticsearch-logging-kibana - shell: > - {{ bin_dir }}/helm list elasticsearch-logging-kibana - register: kibana_check - ignore_errors: True - - - name: ks-logging | Deploy elasticsearch-logging-kibana - shell: > - {{ bin_dir }}/helm upgrade --install elasticsearch-logging-kibana - {{ kubesphere_dir }}/logging/kibana-2.2.1.tgz - -f {{ kubesphere_dir }}/logging/custom-values-kibana.yaml - --namespace kubesphere-logging-system - register: kibana_result - ignore_errors: True - when: - - (kibana_check.stdout.find("DEPLOYED") == -1) or (kibana_check.stdout.find("6.7.0-0217") == -1) - - - name: ks-logging | Delete elasticsearch-logging-kibana - shell: > - {{ bin_dir }}/helm del --purge elasticsearch-logging-kibana - ignore_errors: True - when: - - (kibana_check.stdout.find("DEPLOYED") == -1) or (kibana_check.stdout.find("6.7.0-0217") == -1) - - "kibana_result.stderr and 'no matches for kind' in kibana_result.stderr" - - - name: ks-logging | Waiting for seconds - wait_for: timeout=15 - when: - - (kibana_check.stdout.find("DEPLOYED") == -1) or (kibana_check.stdout.find("6.7.0-0217") == -1) - - "kibana_result.stderr and 'no matches for kind' in kibana_result.stderr" - - - name: ks-logging | Deploy elasticsearch-logging-kibana - shell: > - {{ bin_dir }}/helm upgrade --install elasticsearch-logging-kibana - {{ kubesphere_dir }}/logging/kibana-2.2.1.tgz - -f {{ kubesphere_dir }}/logging/custom-values-kibana.yaml - --namespace kubesphere-logging-system - when: - - (kibana_check.stdout.find("deployed") == -1) or (kibana_check.stdout.find("6.7.0-0217") == -1) - - "kibana_result.stderr and 'no matches for kind' in kibana_result.stderr" - when: - - logging.kibana is defined - - logging.kibana.enabled is defined - - logging.kibana.enabled == true + {{ bin_dir }}/kubectl apply -f {{ kubesphere_dir }}/fluentbit-operator - import_tasks: logsidecar.yaml diff --git a/roles/ks-logging/tasks/pre-install.yaml b/roles/ks-logging/tasks/pre-install.yaml deleted file mode 100644 index 2b754bb70..000000000 --- a/roles/ks-logging/tasks/pre-install.yaml +++ /dev/null @@ -1,37 +0,0 @@ ---- - -- name: ks-logging | Checking elasticsearch-logging - shell: > - {{ bin_dir }}/helm list | grep "elasticsearch-logging" | grep "elasticsearch-1.10.2" - register: check_es_result - ignore_errors: True - tags: - - elasticsearch - - -- name: ks-logging | Remove old elasticsearch - shell: "{{ bin_dir }}/helm del --purge elasticsearch-logging" - when: - - check_es_result.stdout.find("kubesphere-logging-system") != -1 - ignore_errors: True - tags: - - elasticsearch - -- name: ks-logging | check elasticsearch data StatefulSet - shell: > - {{ bin_dir }}/kubectl get sts -n kubesphere-logging-system | grep "elasticsearch-logging-data" | wc -l - register: sts_number - -- name: ks-logging | check elasticsearch storageclass - shell: > - {{ bin_dir }}/kubectl get sts -n kubesphere-logging-system - elasticsearch-logging-data -o yaml | grep "storageClassName" | wc -l - register: sc_number - -- name: ks-logging | set elasticsearch storageclass parameter - set_fact: - persistence: - storageClass: "" - when: - - sts_number.stdout != "0" - - sc_number.stdout == "0" diff --git a/roles/ks-logging/templates/custom-output-elasticsearch-auditing.yaml.j2 b/roles/ks-logging/templates/custom-output-elasticsearch-auditing.yaml.j2 deleted file mode 100644 index a6be70016..000000000 --- a/roles/ks-logging/templates/custom-output-elasticsearch-auditing.yaml.j2 +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: logging.kubesphere.io/v1alpha2 -kind: Output -metadata: - name: es-auditing - namespace: kubesphere-logging-system - labels: - logging.kubesphere.io/enabled: "true" - logging.kubesphere.io/component: "auditing" -spec: - match: kube_auditing - es: - logstashFormat: true - host: "{% if logging.externalElasticsearchUrl is defined %}{{ logging.externalElasticsearchUrl }}{% else %}elasticsearch-logging-data.kubesphere-logging-system.svc{% endif %}" - logstashPrefix: "ks-{{ logging.elkPrefix }}-auditing" - port: {% if logging.externalElasticsearchPort is defined %}{{ logging.externalElasticsearchPort }}{% else %}9200{% endif %} - diff --git a/roles/ks-logging/templates/custom-output-elasticsearch-events.yaml.j2 b/roles/ks-logging/templates/custom-output-elasticsearch-events.yaml.j2 deleted file mode 100644 index 603d33ebf..000000000 --- a/roles/ks-logging/templates/custom-output-elasticsearch-events.yaml.j2 +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: logging.kubesphere.io/v1alpha2 -kind: Output -metadata: - name: es-events - namespace: kubesphere-logging-system - labels: - logging.kubesphere.io/enabled: "true" - logging.kubesphere.io/component: "events" -spec: - match: kube_events - es: - logstashFormat: true - host: "{% if logging.externalElasticsearchUrl is defined %}{{ logging.externalElasticsearchUrl }}{% else %}elasticsearch-logging-data.kubesphere-logging-system.svc{% endif %}" - logstashPrefix: "ks-{{ logging.elkPrefix }}-events" - port: {% if logging.externalElasticsearchPort is defined %}{{ logging.externalElasticsearchPort }}{% else %}9200{% endif %} diff --git a/roles/ks-logging/templates/custom-output-elasticsearch-logging.yaml.j2 b/roles/ks-logging/templates/custom-output-elasticsearch-logging.yaml.j2 new file mode 100644 index 000000000..f9fe95228 --- /dev/null +++ b/roles/ks-logging/templates/custom-output-elasticsearch-logging.yaml.j2 @@ -0,0 +1,17 @@ +apiVersion: logging.kubesphere.io/v1alpha2 +kind: Output +metadata: + name: es + namespace: kubesphere-logging-system + labels: + logging.kubesphere.io/enabled: "true" + logging.kubesphere.io/component: "logging" +spec: + match: kube.* + es: + host: "{% if common.es.externalElasticsearchUrl is defined %}{{ common.es.externalElasticsearchUrl }}{% else %}elasticsearch-logging-data.kubesphere-logging-system.svc{% endif %}" + port: {% if common.es.externalElasticsearchPort is defined %}{{ common.es.externalElasticsearchPort }}{% else %}9200{% endif %} + + logstashPrefix: "ks-{{ common.es.elkPrefix }}-log" + logstashFormat: true + timeKey: "@timestamp" diff --git a/roles/ks-logging/templates/custom-output-elasticsearch.yaml.j2 b/roles/ks-logging/templates/custom-output-elasticsearch.yaml.j2 deleted file mode 100644 index 8905091fa..000000000 --- a/roles/ks-logging/templates/custom-output-elasticsearch.yaml.j2 +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: logging.kubesphere.io/v1alpha2 -kind: Output -metadata: - name: es - namespace: kubesphere-logging-system - labels: - logging.kubesphere.io/enabled: "true" - logging.kubesphere.io/component: "logging" -spec: - match: kube.* - es: - host: "{% if logging.externalElasticsearchUrl is defined %}{{ logging.externalElasticsearchUrl }}{% else %}elasticsearch-logging-data.kubesphere-logging-system.svc{% endif %}" - port: {% if logging.externalElasticsearchPort is defined %}{{ logging.externalElasticsearchPort }}{% else %}9200{% endif %} - - logstashPrefix: "ks-{{ logging.elkPrefix }}-log" - logstashFormat: true - timeKey: "@timestamp" diff --git a/roles/ks-logging/templates/custom-values-kibana.yaml.j2 b/roles/ks-logging/templates/custom-values-kibana.yaml.j2 deleted file mode 100644 index 345e4c0ad..000000000 --- a/roles/ks-logging/templates/custom-values-kibana.yaml.j2 +++ /dev/null @@ -1,227 +0,0 @@ -image: - repository: {{ kibana_oss_repo }} - tag: {{ kibana_oss_tag }} - pullPolicy: "IfNotPresent" - -testFramework: - image: {{ testFramework_repo }} - tag: {{ testFramework_tag }} - -commandline: - args: [] - -env: {} - # All Kibana configuration options are adjustable via env vars. - # To adjust a config option to an env var uppercase + replace `.` with `_` - # Ref: https://www.elastic.co/guide/en/kibana/current/settings.html - # - # ELASTICSEARCH_URL: http://elasticsearch-client:9200 - # SERVER_PORT: 5601 - # LOGGING_VERBOSE: "true" - # SERVER_DEFAULTROUTE: "/app/kibana" - -files: - kibana.yml: - ## Default Kibana configuration from kibana-docker. - server.name: kibana - server.host: "0" - elasticsearch.url: http://elasticsearch-logging-data.kubesphere-logging-system.svc:9200 - - ## Custom config properties below - ## Ref: https://www.elastic.co/guide/en/kibana/current/settings.html - # server.port: 5601 - # logging.verbose: "true" - # server.defaultRoute: "/app/kibana" - -deployment: - annotations: {} - -service: - type: ClusterIP - # clusterIP: None - # portName: kibana-svc - externalPort: 443 - internalPort: 5601 - # authProxyPort: 5602 To be used with authProxyEnabled and a proxy extraContainer - ## External IP addresses of service - ## Default: nil - ## - # externalIPs: - # - 192.168.0.1 - # - ## LoadBalancer IP if service.type is LoadBalancer - ## Default: nil - ## - # loadBalancerIP: 10.2.2.2 - annotations: {} - # Annotation example: setup ssl with aws cert when service.type is LoadBalancer - # service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:us-east-1:EXAMPLE_CERT - labels: {} - ## Label example: show service URL in `kubectl cluster-info` - # kubernetes.io/cluster-service: "true" - ## Limit load balancer source ips to list of CIDRs (where available) - # loadBalancerSourceRanges: [] - selector: {} - -ingress: - enabled: false - # hosts: - # - kibana.localhost.localdomain - # - localhost.localdomain/kibana - # annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - # tls: - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -serviceAccount: - # Specifies whether a service account should be created - create: false - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - # If set and create is false, the service account must be existing - name: - -livenessProbe: - enabled: false - path: /status - initialDelaySeconds: 30 - timeoutSeconds: 10 - -readinessProbe: - enabled: false - path: /status - initialDelaySeconds: 30 - timeoutSeconds: 10 - periodSeconds: 10 - successThreshold: 5 - -# Enable an authproxy. Specify container in extraContainers -authProxyEnabled: false - -extraContainers: | -# - name: proxy -# image: quay.io/gambol99/keycloak-proxy:latest -# args: -# - --resource=uri=/* -# - --discovery-url=https://discovery-url -# - --client-id=client -# - --client-secret=secret -# - --listen=0.0.0.0:5602 -# - --upstream-url=http://127.0.0.1:5601 -# ports: -# - name: web -# containerPort: 9090 - -extraVolumeMounts: [] - -extraVolumes: [] - -resources: {} - # limits: - # cpu: 100m - # memory: 300Mi - # requests: - # cpu: 100m - # memory: 300Mi - -priorityClassName: "" - -# Affinity for pod assignment -# Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity -# affinity: {} - -# Tolerations for pod assignment -# Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ -tolerations: [{key: "CriticalAddonsOnly", operator: "Exists"}, {key: "dedicated", value: "log", effect: "NoSchedule"}] - -# Node labels for pod assignment -# Ref: https://kubernetes.io/docs/user-guide/node-selection/ -nodeSelector: {} - -podAnnotations: {} -replicaCount: 1 -revisionHistoryLimit: 3 - -# Custom labels for pod assignment -podLabels: {} - -# To export a dashboard from a running Kibana 6.3.x use: -# curl --user : -XGET https://kibana.yourdomain.com:5601/api/kibana/dashboards/export?dashboard= > my-dashboard.json -# A dashboard is defined by a name and a string with the json payload or the download url -dashboardImport: - enabled: false - timeout: 60 - xpackauth: - enabled: false - username: myuser - password: mypass - dashboards: {} - # k8s: https://raw.githubusercontent.com/monotek/kibana-dashboards/master/k8s-fluentd-elasticsearch.json - -# List of plugins to install using initContainer -# NOTE : We notice that lower resource constraints given to the chart + plugins are likely not going to work well. -plugins: - # set to true to enable plugins installation - enabled: false - # set to true to remove all kibana plugins before installation - reset: false - # Use to add/upgrade plugin - values: - # - elastalert-kibana-plugin,1.0.1,https://github.com/bitsensor/elastalert-kibana-plugin/releases/download/1.0.1/elastalert-kibana-plugin-1.0.1-6.4.2.zip - # - logtrail,0.1.31,https://github.com/sivasamyk/logtrail/releases/download/v0.1.31/logtrail-6.6.0-0.1.31.zip - # - other_plugin - -persistentVolumeClaim: - # set to true to use pvc - enabled: false - # set to true to use you own pvc - existingClaim: false - annotations: {} - - accessModes: - - ReadWriteOnce - size: "5Gi" - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - -# default security context -securityContext: - enabled: false - allowPrivilegeEscalation: false - runAsUser: 1000 - fsGroup: 2000 - -extraConfigMapMounts: [] - # - name: logtrail-configs - # configMap: kibana-logtrail - # mountPath: /usr/share/kibana/plugins/logtrail/logtrail.json - # subPath: logtrail.json - -# Add your own init container or uncomment and modify the given example. -initContainers: {} - ## Don't start kibana till Elasticsearch is reachable. - ## Ensure that it is available at http://elasticsearch:9200 - ## - # es-check: # <- will be used as container name - # image: "appropriate/curl:latest" - # imagePullPolicy: "IfNotPresent" - # command: - # - "/bin/sh" - # - "-c" - # - | - # is_down=true - # while "$is_down"; do - # if curl -sSf --fail-early --connect-timeout 5 http://elasticsearch:9200; then - # is_down=false - # else - # sleep 5 - # fi - # done From a736a5f769e713459ab255168dc886d9a575c6d8 Mon Sep 17 00:00:00 2001 From: pixiake Date: Wed, 22 Jul 2020 22:24:42 +0800 Subject: [PATCH 2/3] Update kubesphere-complete-setup.yaml --- kubesphere-complete-setup.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/kubesphere-complete-setup.yaml b/kubesphere-complete-setup.yaml index 0bcd57537..3daf43fa6 100644 --- a/kubesphere-complete-setup.yaml +++ b/kubesphere-complete-setup.yaml @@ -25,13 +25,6 @@ data: etcdVolumeSize: 20Gi openldapVolumeSize: 2Gi redisVolumSize: 2Gi - es: - elasticsearchMasterReplicas: 1 - elasticsearchDataReplicas: 1 - elasticsearchMasterVolumeSize: 4Gi - elasticsearchDataVolumeSize: 20Gi - logMaxAge: 7 - elkPrefix: logstash metrics_server: enabled: True @@ -49,8 +42,16 @@ data: logging: enabled: True + elasticsearchMasterReplicas: 1 + elasticsearchDataReplicas: 1 logsidecarReplicas: 2 + elasticsearchMasterVolumeSize: 4Gi + elasticsearchDataVolumeSize: 20Gi + logMaxAge: 7 + elkPrefix: logstash containersLogMountedPath: "" + kibana: + enabled: False openpitrix: enabled: True From 6ad3934141804a35cc5c29c46c26f0485a63e681 Mon Sep 17 00:00:00 2001 From: pixiake Date: Wed, 22 Jul 2020 22:26:06 +0800 Subject: [PATCH 3/3] Update kubesphere-minimal.yaml --- kubesphere-minimal.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/kubesphere-minimal.yaml b/kubesphere-minimal.yaml index e160459ab..c7a4593dd 100644 --- a/kubesphere-minimal.yaml +++ b/kubesphere-minimal.yaml @@ -25,13 +25,6 @@ data: etcdVolumeSize: 20Gi openldapVolumeSize: 2Gi redisVolumSize: 2Gi - es: - elasticsearchMasterReplicas: 1 - elasticsearchDataReplicas: 1 - elasticsearchMasterVolumeSize: 4Gi - elasticsearchDataVolumeSize: 20Gi - logMaxAge: 7 - elkPrefix: logstash metrics_server: enabled: True @@ -49,8 +42,16 @@ data: logging: enabled: False + elasticsearchMasterReplicas: 1 + elasticsearchDataReplicas: 1 logsidecarReplicas: 2 + elasticsearchMasterVolumeSize: 4Gi + elasticsearchDataVolumeSize: 20Gi + logMaxAge: 7 + elkPrefix: logstash containersLogMountedPath: "" + kibana: + enabled: False openpitrix: enabled: False