From 5f3b6196c84e31c76c5583b25549d50400fe63d3 Mon Sep 17 00:00:00 2001 From: BorislavG Date: Sun, 25 Mar 2018 18:12:38 +0300 Subject: [PATCH] Add standardized helm chart for log Change-Id: Ic9f0eb567716224893955d9379e9ed9308b9ea79 Issue-ID: OOM-740 Signed-off-by: BorislavG --- .../aai/resources/config/log/filebeat/filebeat.yml | 2 +- kubernetes/aai/values.yaml | 4 + .../config/log/filebeat/log4j/filebeat.yml | 2 +- kubernetes/appc/values.yaml | 2 + .../esr/resources/config/log/filebeat/filebeat.yml | 2 +- kubernetes/esr/values.yaml | 5 + kubernetes/log/.helmignore | 21 ++++ kubernetes/log/Chart.yaml | 4 +- kubernetes/log/charts/log-elasticsearch/Chart.yaml | 18 ++++ .../log/charts/log-elasticsearch/requirements.yaml | 18 ++++ .../resources/config}/elasticsearch.yml | 4 +- .../charts/log-elasticsearch/templates/NOTES.txt | 19 ++++ .../log-elasticsearch/templates/configmap.yaml | 21 ++++ .../log-elasticsearch/templates/deployment.yaml | 117 +++++++++++++++++++++ .../log/charts/log-elasticsearch/templates/pv.yaml | 21 ++++ .../charts/log-elasticsearch/templates/pvc.yaml | 25 +++++ .../log-elasticsearch/templates/service.yaml | 46 ++++++++ .../log/charts/log-elasticsearch/values.yaml | 114 ++++++++++++++++++++ kubernetes/log/charts/log-kibana/Chart.yaml | 18 ++++ kubernetes/log/charts/log-kibana/requirements.yaml | 18 ++++ .../log-kibana/resources/config}/kibana.yml | 7 +- .../log/charts/log-kibana/templates/NOTES.txt | 19 ++++ .../log/charts/log-kibana/templates/configmap.yaml | 21 ++++ .../charts/log-kibana/templates/deployment.yaml | 98 +++++++++++++++++ .../log/charts/log-kibana/templates/service.yaml | 40 +++++++ kubernetes/log/charts/log-kibana/values.yaml | 94 +++++++++++++++++ kubernetes/log/charts/log-logstash/Chart.yaml | 18 ++++ .../log/charts/log-logstash/requirements.yaml | 18 ++++ .../log-logstash/resources/config}/logstash.yml | 4 +- .../resources/config}/onap-pipeline.conf | 8 +- .../log/charts/log-logstash/templates/NOTES.txt | 19 ++++ .../charts/log-logstash/templates/configmap.yaml | 21 ++++ .../charts/log-logstash/templates/deployment.yaml | 105 ++++++++++++++++++ .../log/charts/log-logstash/templates/service.yaml | 46 ++++++++ kubernetes/log/charts/log-logstash/values.yaml | 91 ++++++++++++++++ kubernetes/log/requirements.yaml | 4 + kubernetes/log/templates/all-services.yaml | 100 ------------------ .../log/templates/elasticsearch-deployment.yaml | 101 ------------------ kubernetes/log/templates/kibana-deployment.yaml | 77 -------------- kubernetes/log/templates/log-pv-pvc.yaml | 48 --------- kubernetes/log/templates/logstash-deployment.yaml | 90 ---------------- kubernetes/log/values.yaml | 20 ++-- .../mso/resources/config/log/filebeat/filebeat.yml | 2 +- kubernetes/mso/values.yaml | 4 + .../resources/config/log/filebeat/filebeat.yml | 2 +- kubernetes/multicloud/values.yaml | 4 + kubernetes/onap/requirements.yaml | 2 +- kubernetes/onap/values.yaml | 2 +- .../resources/config/log/filebeat/filebeat.yml | 2 +- kubernetes/policy/values.yaml | 4 + .../resources/config/log/filebeat/filebeat.yml | 2 +- kubernetes/portal/values.yaml | 3 + .../sdc/resources/config/log/filebeat/filebeat.yml | 2 +- kubernetes/sdc/values.yaml | 3 + .../config/log/filebeat/log4j/filebeat.yml | 2 +- kubernetes/sdnc/values.yaml | 4 +- .../so/resources/config/log/filebeat/filebeat.yml | 2 +- kubernetes/so/values.yaml | 3 +- .../vid/resources/config/log/filebeat/filebeat.yml | 2 +- kubernetes/vid/values.yaml | 3 + 60 files changed, 1118 insertions(+), 460 deletions(-) create mode 100644 kubernetes/log/.helmignore create mode 100644 kubernetes/log/charts/log-elasticsearch/Chart.yaml create mode 100644 kubernetes/log/charts/log-elasticsearch/requirements.yaml rename kubernetes/log/{resources/elasticsearch/conf => charts/log-elasticsearch/resources/config}/elasticsearch.yml (98%) create mode 100644 kubernetes/log/charts/log-elasticsearch/templates/NOTES.txt create mode 100644 kubernetes/log/charts/log-elasticsearch/templates/configmap.yaml create mode 100644 kubernetes/log/charts/log-elasticsearch/templates/deployment.yaml create mode 100644 kubernetes/log/charts/log-elasticsearch/templates/pv.yaml create mode 100644 kubernetes/log/charts/log-elasticsearch/templates/pvc.yaml create mode 100644 kubernetes/log/charts/log-elasticsearch/templates/service.yaml create mode 100644 kubernetes/log/charts/log-elasticsearch/values.yaml create mode 100644 kubernetes/log/charts/log-kibana/Chart.yaml create mode 100644 kubernetes/log/charts/log-kibana/requirements.yaml rename kubernetes/log/{resources/kibana/conf => charts/log-kibana/resources/config}/kibana.yml (95%) create mode 100644 kubernetes/log/charts/log-kibana/templates/NOTES.txt create mode 100644 kubernetes/log/charts/log-kibana/templates/configmap.yaml create mode 100644 kubernetes/log/charts/log-kibana/templates/deployment.yaml create mode 100644 kubernetes/log/charts/log-kibana/templates/service.yaml create mode 100644 kubernetes/log/charts/log-kibana/values.yaml create mode 100644 kubernetes/log/charts/log-logstash/Chart.yaml create mode 100644 kubernetes/log/charts/log-logstash/requirements.yaml rename kubernetes/log/{resources/logstash/conf => charts/log-logstash/resources/config}/logstash.yml (99%) rename kubernetes/log/{resources/logstash/pipeline => charts/log-logstash/resources/config}/onap-pipeline.conf (95%) create mode 100644 kubernetes/log/charts/log-logstash/templates/NOTES.txt create mode 100644 kubernetes/log/charts/log-logstash/templates/configmap.yaml create mode 100644 kubernetes/log/charts/log-logstash/templates/deployment.yaml create mode 100644 kubernetes/log/charts/log-logstash/templates/service.yaml create mode 100644 kubernetes/log/charts/log-logstash/values.yaml create mode 100644 kubernetes/log/requirements.yaml delete mode 100644 kubernetes/log/templates/all-services.yaml delete mode 100644 kubernetes/log/templates/elasticsearch-deployment.yaml delete mode 100644 kubernetes/log/templates/kibana-deployment.yaml delete mode 100644 kubernetes/log/templates/log-pv-pvc.yaml delete mode 100644 kubernetes/log/templates/logstash-deployment.yaml diff --git a/kubernetes/aai/resources/config/log/filebeat/filebeat.yml b/kubernetes/aai/resources/config/log/filebeat/filebeat.yml index 89c6932577..b0d4690754 100644 --- a/kubernetes/aai/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/aai/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ output.logstash: #List of logstash server ip addresses with port number. #But, in our case, this will be the loadbalancer IP address. #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. - hosts: ["logstash.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/aai/values.yaml b/kubernetes/aai/values.yaml index e283cb6f2e..eaeaa2e71d 100644 --- a/kubernetes/aai/values.yaml +++ b/kubernetes/aai/values.yaml @@ -74,3 +74,7 @@ persistence: mountPath: /dockerdata-nfs mountSubPath: aai/data-router/logs +config: + logstashServiceName: log-ls + logstashPort: 5044 + diff --git a/kubernetes/appc/resources/config/log/filebeat/log4j/filebeat.yml b/kubernetes/appc/resources/config/log/filebeat/log4j/filebeat.yml index 52161aafad..49d818a807 100644 --- a/kubernetes/appc/resources/config/log/filebeat/log4j/filebeat.yml +++ b/kubernetes/appc/resources/config/log/filebeat/log4j/filebeat.yml @@ -29,7 +29,7 @@ output.logstash: #List of logstash server ip addresses with port number. #But, in our case, this will be the loadbalancer IP address. #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. - hosts: ["logstash.{{.Release.Namespace}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/appc/values.yaml b/kubernetes/appc/values.yaml index e31980a990..b5a13ef87c 100644 --- a/kubernetes/appc/values.yaml +++ b/kubernetes/appc/values.yaml @@ -43,6 +43,8 @@ config: enableClustering: true configDir: /opt/onap/appc/data/properties dmaapTopic: SUCCESS + logstashServiceName: log-ls + logstashPort: 5044 mysql: nameOverride: appc-db diff --git a/kubernetes/esr/resources/config/log/filebeat/filebeat.yml b/kubernetes/esr/resources/config/log/filebeat/filebeat.yml index 16c7943beb..49197d3b82 100644 --- a/kubernetes/esr/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/esr/resources/config/log/filebeat/filebeat.yml @@ -22,7 +22,7 @@ output.logstash: #List of logstash server ip addresses with port number. #But, in our case, this will be the loadbalancer IP address. #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. - hosts: ["logstash.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/esr/values.yaml b/kubernetes/esr/values.yaml index 5253d9a6f8..82aa3347bb 100644 --- a/kubernetes/esr/values.yaml +++ b/kubernetes/esr/values.yaml @@ -26,3 +26,8 @@ esrgui: replicas: 1 filebeat: image: docker.elastic.co/beats/filebeat:5.5.0 + +config: + logstashServiceName: log-ls + logstashPort: 5044 + diff --git a/kubernetes/log/.helmignore b/kubernetes/log/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/log/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/kubernetes/log/Chart.yaml b/kubernetes/log/Chart.yaml index 96124138b1..9b902e8879 100644 --- a/kubernetes/log/Chart.yaml +++ b/kubernetes/log/Chart.yaml @@ -13,6 +13,6 @@ # limitations under the License. apiVersion: v1 -description: A Helm chart for Kubernetes +description: ONAP Logging ElasticStack name: log -version: 0.1.0 +version: 2.0.0 diff --git a/kubernetes/log/charts/log-elasticsearch/Chart.yaml b/kubernetes/log/charts/log-elasticsearch/Chart.yaml new file mode 100644 index 0000000000..5d233b4645 --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/Chart.yaml @@ -0,0 +1,18 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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 +description: ONAP Logging Elasticsearch +name: log-elasticsearch +version: 2.0.0 diff --git a/kubernetes/log/charts/log-elasticsearch/requirements.yaml b/kubernetes/log/charts/log-elasticsearch/requirements.yaml new file mode 100644 index 0000000000..1e8f788318 --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/requirements.yaml @@ -0,0 +1,18 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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. + +dependencies: + - name: common + version: ~2.0.0 + repository: '@local' \ No newline at end of file diff --git a/kubernetes/log/resources/elasticsearch/conf/elasticsearch.yml b/kubernetes/log/charts/log-elasticsearch/resources/config/elasticsearch.yml similarity index 98% rename from kubernetes/log/resources/elasticsearch/conf/elasticsearch.yml rename to kubernetes/log/charts/log-elasticsearch/resources/config/elasticsearch.yml index f038a10775..e7933b8570 100644 --- a/kubernetes/log/resources/elasticsearch/conf/elasticsearch.yml +++ b/kubernetes/log/charts/log-elasticsearch/resources/config/elasticsearch.yml @@ -111,12 +111,12 @@ discovery.zen.minimum_master_nodes: 1 #action.destructive_requires_name: true # Set a custom port for HTTP: If required, default is 9200-9300 # This is used for REST APIs -http.port: 9200 +http.port: {{.Values.service.externalPort}} # Port to bind for communication between nodes. Accepts a single value or a range. # If a range is specified, the node will bind to the first available port in the range. # Defaults to 9300-9400. # More info: -transport.tcp.port: 9300 +transport.tcp.port: {{.Values.service.externalPortTcp}} xpack.graph.enabled: false #Set to false to disable X-Pack graph features. diff --git a/kubernetes/log/charts/log-elasticsearch/templates/NOTES.txt b/kubernetes/log/charts/log-elasticsearch/templates/NOTES.txt new file mode 100644 index 0000000000..0878f5c080 --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http://{{ . }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include "common.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.externalPort }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ include "common.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort }} +{{- end }} diff --git a/kubernetes/log/charts/log-elasticsearch/templates/configmap.yaml b/kubernetes/log/charts/log-elasticsearch/templates/configmap.yaml new file mode 100644 index 0000000000..4ccc7cc526 --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/templates/configmap.yaml @@ -0,0 +1,21 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} \ No newline at end of file diff --git a/kubernetes/log/charts/log-elasticsearch/templates/deployment.yaml b/kubernetes/log/charts/log-elasticsearch/templates/deployment.yaml new file mode 100644 index 0000000000..13caa7e866 --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/templates/deployment.yaml @@ -0,0 +1,117 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + initContainers: + - command: + - /bin/sh + - -c + - | + sysctl -w vm.max_map_count=262144 + mkdir -p /logroot/elasticsearch/logs + mkdir -p /logroot/elasticsearch/data + chmod -R 777 /logroot/elasticsearch + chown -R root:root /logroot + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + securityContext: + privileged: true + image: {{ .Values.global.busyboxRepository | default .Values.busyboxRepository }}/{{ .Values.busyboxImage }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: init-sysctl + volumeMounts: + - name: {{ include "common.fullname" . }}-logs + mountPath: /logroot/ + containers: + - name: {{ include "common.name" . }} + image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - containerPort: {{ .Values.service.internalPortTcp }} + name: {{ .Values.service.name }}-tcp +# disable liveness probe when breakpoints set in debugger + # so K8s doesn't restart unresponsive container + {{- if eq .Values.liveness.enabled true }} + livenessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end -}} + readinessProbe: + tcpSocket: + port: {{ .Values.service.internalPortTcp }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + env: + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml + name: {{ include "common.fullname" . }}-config + subPath: elasticsearch.yml + - mountPath: /usr/share/elasticsearch/data/ + name: {{ include "common.fullname" . }}-data + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 10 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 10 }} + {{- end }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: {{ include "common.fullname" . }}-config + configMap: + name: {{ include "common.fullname" . }}-configmap + items: + - key: elasticsearch.yml + path: elasticsearch.yml + - name: {{ include "common.fullname" . }}-data + persistentVolumeClaim: + claimName: {{ include "common.fullname" . }} + - name: {{ include "common.fullname" . }}-logs + hostPath: + path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Namespace }}/{{ .Values.persistence.mountSubPathLogs }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/log/charts/log-elasticsearch/templates/pv.yaml b/kubernetes/log/charts/log-elasticsearch/templates/pv.yaml new file mode 100644 index 0000000000..dba12d4125 --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/templates/pv.yaml @@ -0,0 +1,21 @@ +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + name: {{ include "common.fullname" . }} +spec: + capacity: + storage: {{ .Values.persistence.size}} + accessModes: + - {{ .Values.persistence.accessMode }} + persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }} + hostPath: + path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Namespace }}/{{ .Values.persistence.mountSubPath }} +{{- end -}} diff --git a/kubernetes/log/charts/log-elasticsearch/templates/pvc.yaml b/kubernetes/log/charts/log-elasticsearch/templates/pvc.yaml new file mode 100644 index 0000000000..c046f4604a --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/templates/pvc.yaml @@ -0,0 +1,25 @@ +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +{{- if .Values.persistence.annotations }} + annotations: +{{ toYaml .Values.persistence.annotations | indent 4 }} +{{- end }} +spec: + selector: + matchLabels: + name: {{ include "common.fullname" . }} + accessModes: + - {{ .Values.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.persistence.size }} +{{- end -}} diff --git a/kubernetes/log/charts/log-elasticsearch/templates/service.yaml b/kubernetes/log/charts/log-elasticsearch/templates/service.yaml new file mode 100644 index 0000000000..72dfc7e817 --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/templates/service.yaml @@ -0,0 +1,46 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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: Service +metadata: + name: {{ .Values.service.name }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.externalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.internalPortTcp }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.externalPortTcp }} + name: {{ .Values.service.name }}-tcp + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.externalPortTcp }} + targetPort: {{ .Values.service.internalPortTcp }} + name: {{ .Values.service.name }}-tcp + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/log/charts/log-elasticsearch/values.yaml b/kubernetes/log/charts/log-elasticsearch/values.yaml new file mode 100644 index 0000000000..2e6e08509e --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/values.yaml @@ -0,0 +1,114 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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. + +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + persistence: {} + +################################################################# +# Application configuration defaults. +################################################################# + +# BusyBox image +busyboxRepository: registry.hub.docker.com +busyboxImage: library/busybox:latest + +# application image +loggingRepository: docker.elastic.co +image: elasticsearch/elasticsearch:5.5.0 +pullPolicy: Always + +# flag to enable debugging - application support required +debugEnabled: false + +# application configuration +# Example: +config: {} + +# default number of instances +replicaCount: 1 + +nodeSelector: {} + +affinity: {} + +# probe configuration parameters +liveness: + initialDelaySeconds: 10 + periodSeconds: 10 + # necessary to disable liveness probe when setting breakpoints + # in debugger so K8s doesn't restart unresponsive container + enabled: true + +readiness: + initialDelaySeconds: 10 + periodSeconds: 10 + +## Persist data to a persitent volume +persistence: + enabled: true + + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + volumeReclaimPolicy: Retain + + ## database data Persistent Volume Storage Class + ## 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) + accessMode: ReadWriteMany + size: 1Gi + mountPath: /dockerdata-nfs + mountSubPath: log/elasticsearch/data + mountSubPathLogs: log + +service: + #Example service definition with external, internal and node ports. + #Services may use any combination of ports depending on the 'type' of + #service being defined. + type: ClusterIP + name: log-es + externalPort: 9200 + internalPort: 9200 + externalPortTcp: 9300 + internalPortTcp: 9300 +ingress: + enabled: false + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # + # Example: + # Configure resource requests and limits + # ref: http://kubernetes.io/docs/user-guide/compute-resources/ + # Minimum memory for development is 2 CPU cores and 4GB memory + # Minimum memory for production is 4 CPU cores and 8GB memory +#resources: +# limits: +# cpu: 2 +# memory: 4Gi +# requests: +# cpu: 2 +# memory: 4Gi diff --git a/kubernetes/log/charts/log-kibana/Chart.yaml b/kubernetes/log/charts/log-kibana/Chart.yaml new file mode 100644 index 0000000000..74f2c2b441 --- /dev/null +++ b/kubernetes/log/charts/log-kibana/Chart.yaml @@ -0,0 +1,18 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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 +description: ONAP Logging Kibana +name: log-kibana +version: 2.0.0 diff --git a/kubernetes/log/charts/log-kibana/requirements.yaml b/kubernetes/log/charts/log-kibana/requirements.yaml new file mode 100644 index 0000000000..1e8f788318 --- /dev/null +++ b/kubernetes/log/charts/log-kibana/requirements.yaml @@ -0,0 +1,18 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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. + +dependencies: + - name: common + version: ~2.0.0 + repository: '@local' \ No newline at end of file diff --git a/kubernetes/log/resources/kibana/conf/kibana.yml b/kubernetes/log/charts/log-kibana/resources/config/kibana.yml similarity index 95% rename from kubernetes/log/resources/kibana/conf/kibana.yml rename to kubernetes/log/charts/log-kibana/resources/config/kibana.yml index df0d71abab..5171ad4cdb 100644 --- a/kubernetes/log/resources/kibana/conf/kibana.yml +++ b/kubernetes/log/charts/log-kibana/resources/config/kibana.yml @@ -11,7 +11,7 @@ xpack.security.enabled: false xpack.watcher.enabled: false #Set to false to disable Watcher. # Kibana is served by a back end server. This setting specifies the port to use. -server.port: 5601 +server.port: {{.Values.service.externalPort}} # Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values. # The default is 'localhost', which usually means remote machines will not be able to connect. @@ -30,10 +30,7 @@ server.host: "0" server.name: "Kibana" # The URL of the Elasticsearch instance to use for all your queries. -# OOM-427, OOM-441 hardcoded onap workspace to avoid helm upgrade past 2.3 -elasticsearch.url: "http://elasticsearch.{{.Values.nsPrefix}}:9200" -#elasticsearch-service.{{.Values.nsPrefix}}:9200" -#elasticsearch.url: "http://10.247.47.3:9200" +elasticsearch.url: "http://{{.Values.config.elasticsearchServiceName}}.{{.Release.Namespace}}:{{.Values.config.elasticsearchPort}}" # When this setting's value is true Kibana uses the hostname specified in the server.host # setting. When the value of this setting is false, Kibana uses the hostname of the host # that connects to this Kibana instance. diff --git a/kubernetes/log/charts/log-kibana/templates/NOTES.txt b/kubernetes/log/charts/log-kibana/templates/NOTES.txt new file mode 100644 index 0000000000..0878f5c080 --- /dev/null +++ b/kubernetes/log/charts/log-kibana/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http://{{ . }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include "common.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.externalPort }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ include "common.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort }} +{{- end }} diff --git a/kubernetes/log/charts/log-kibana/templates/configmap.yaml b/kubernetes/log/charts/log-kibana/templates/configmap.yaml new file mode 100644 index 0000000000..fd8934b22c --- /dev/null +++ b/kubernetes/log/charts/log-kibana/templates/configmap.yaml @@ -0,0 +1,21 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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: ConfigMap +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} diff --git a/kubernetes/log/charts/log-kibana/templates/deployment.yaml b/kubernetes/log/charts/log-kibana/templates/deployment.yaml new file mode 100644 index 0000000000..bdd5a447be --- /dev/null +++ b/kubernetes/log/charts/log-kibana/templates/deployment.yaml @@ -0,0 +1,98 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + initContainers: + - command: + - /root/ready.py + args: + - --container-name + - log-elasticsearch + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness + containers: + - name: {{ include "common.name" . }} + image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + readinessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} +# disable liveness probe when breakpoints set in debugger + # so K8s doesn't restart unresponsive container + {{- if eq .Values.liveness.enabled true }} + livenessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end -}} + env: + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /usr/share/kibana/config/kibana.yml + name: {{ include "common.fullname" . }} + subPath: kibana.yml + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 10 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 10 }} + {{- end }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: {{ include "common.fullname" . }} + configMap: + name: {{ include "common.fullname" . }} + items: + - key: kibana.yml + path: kibana.yml + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/log/charts/log-kibana/templates/service.yaml b/kubernetes/log/charts/log-kibana/templates/service.yaml new file mode 100644 index 0000000000..d758c99d89 --- /dev/null +++ b/kubernetes/log/charts/log-kibana/templates/service.yaml @@ -0,0 +1,40 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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: Service +metadata: + name: {{ .Values.service.name }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.externalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + name: {{ .Values.service.name }} + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/log/charts/log-kibana/values.yaml b/kubernetes/log/charts/log-kibana/values.yaml new file mode 100644 index 0000000000..50c6e52ee0 --- /dev/null +++ b/kubernetes/log/charts/log-kibana/values.yaml @@ -0,0 +1,94 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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. + +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + readinessRepository: oomk8s + readinessImage: readiness-check:1.1.0 + persistence: {} + +################################################################# +# Application configuration defaults. +################################################################# + +# BusyBox image +busyboxRepository: registry.hub.docker.com +busyboxImage: library/busybox:latest + +# application image +loggingRepository: docker.elastic.co +image: kibana/kibana:5.5.0 +pullPolicy: Always + +# flag to enable debugging - application support required +debugEnabled: false + +# application configuration +config: + elasticsearchServiceName: log-es + elasticsearchPort: 9200 + +# default number of instances +replicaCount: 1 + +nodeSelector: {} + +affinity: {} + +# probe configuration parameters +liveness: + initialDelaySeconds: 120 + periodSeconds: 10 + # necessary to disable liveness probe when setting breakpoints + # in debugger so K8s doesn't restart unresponsive container + enabled: true + +readiness: + initialDelaySeconds: 10 + periodSeconds: 10 + +service: + #Example service definition with external, internal and node ports. + #Services may use any combination of ports depending on the 'type' of + #service being defined. + type: NodePort + name: log-kibana + externalPort: 5601 + internalPort: 5601 + nodePort: 53 +ingress: + enabled: false + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # + # Example: + # Configure resource requests and limits + # ref: http://kubernetes.io/docs/user-guide/compute-resources/ + # Minimum memory for development is 2 CPU cores and 4GB memory + # Minimum memory for production is 4 CPU cores and 8GB memory +#resources: +# limits: +# cpu: 2 +# memory: 4Gi +# requests: +# cpu: 2 +# memory: 4Gi diff --git a/kubernetes/log/charts/log-logstash/Chart.yaml b/kubernetes/log/charts/log-logstash/Chart.yaml new file mode 100644 index 0000000000..3aab337308 --- /dev/null +++ b/kubernetes/log/charts/log-logstash/Chart.yaml @@ -0,0 +1,18 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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 +description: ONAP Logging Logstash +name: log-logstash +version: 2.0.0 diff --git a/kubernetes/log/charts/log-logstash/requirements.yaml b/kubernetes/log/charts/log-logstash/requirements.yaml new file mode 100644 index 0000000000..1e8f788318 --- /dev/null +++ b/kubernetes/log/charts/log-logstash/requirements.yaml @@ -0,0 +1,18 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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. + +dependencies: + - name: common + version: ~2.0.0 + repository: '@local' \ No newline at end of file diff --git a/kubernetes/log/resources/logstash/conf/logstash.yml b/kubernetes/log/charts/log-logstash/resources/config/logstash.yml similarity index 99% rename from kubernetes/log/resources/logstash/conf/logstash.yml rename to kubernetes/log/charts/log-logstash/resources/config/logstash.yml index f658006503..3ddf63f9cc 100644 --- a/kubernetes/log/resources/logstash/conf/logstash.yml +++ b/kubernetes/log/charts/log-logstash/resources/config/logstash.yml @@ -1,14 +1,14 @@ http.host: "0.0.0.0" ## Path where pipeline configurations reside path.config: /usr/share/logstash/pipeline - + ## Type of queue : memeory based or file based #queue.type: persisted ## Size of queue #queue.max_bytes: 1024mb ## Setting true makes logstash check periodically for change in pipeline configurations config.reload.automatic: true - + ## xpack configurations #xpack.monitoring.elasticsearch.url: ["http://10.247.186.12:9200", "http://10.247.186.13:9200"] #xpack.monitoring.elasticsearch.username: elastic diff --git a/kubernetes/log/resources/logstash/pipeline/onap-pipeline.conf b/kubernetes/log/charts/log-logstash/resources/config/onap-pipeline.conf similarity index 95% rename from kubernetes/log/resources/logstash/pipeline/onap-pipeline.conf rename to kubernetes/log/charts/log-logstash/resources/config/onap-pipeline.conf index 8289b49f6e..3b4fd768c3 100644 --- a/kubernetes/log/resources/logstash/pipeline/onap-pipeline.conf +++ b/kubernetes/log/charts/log-logstash/resources/config/onap-pipeline.conf @@ -7,7 +7,7 @@ input { ######## Connection configurations ######## ## The port to listen on. - port => 5044 + port => {{.Values.service.externalPort}} ## Close Idle clients after the specified time in seconds. Default is 60 seconds #client_inactivity_timeout => 60 @@ -222,10 +222,8 @@ output { ######### Elasticsearchcluster and host configurations ######### -#can specify one or a list of hosts. If sniffing is set, one is enough and others will be auto-discovered -##Also protocol can be specified like ["http://10.247.186.12:9200"] -## OOM-427, OOM-441 hardcoded onap workspace to avoid helm upgrade past 2.3 - hosts => ["http://elasticsearch.{{.Values.nsPrefix}}:9200"] + ##can specify one or a list of hosts. If sniffing is set, one is enough and others will be auto-discovered + hosts => ["http://{{.Values.config.elasticsearchServiceName}}.{{.Release.Namespace}}:{{.Values.config.elasticsearchPort}}"] ## This setting asks Elasticsearch for the list of all cluster nodes and adds them to the hosts list. Default is false. diff --git a/kubernetes/log/charts/log-logstash/templates/NOTES.txt b/kubernetes/log/charts/log-logstash/templates/NOTES.txt new file mode 100644 index 0000000000..0878f5c080 --- /dev/null +++ b/kubernetes/log/charts/log-logstash/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http://{{ . }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include "common.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.externalPort }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ include "common.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort }} +{{- end }} diff --git a/kubernetes/log/charts/log-logstash/templates/configmap.yaml b/kubernetes/log/charts/log-logstash/templates/configmap.yaml new file mode 100644 index 0000000000..fd8934b22c --- /dev/null +++ b/kubernetes/log/charts/log-logstash/templates/configmap.yaml @@ -0,0 +1,21 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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: ConfigMap +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} diff --git a/kubernetes/log/charts/log-logstash/templates/deployment.yaml b/kubernetes/log/charts/log-logstash/templates/deployment.yaml new file mode 100644 index 0000000000..682c448da8 --- /dev/null +++ b/kubernetes/log/charts/log-logstash/templates/deployment.yaml @@ -0,0 +1,105 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + initContainers: + - command: + - /root/ready.py + args: + - --container-name + - log-elasticsearch + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness + containers: + - name: {{ include "common.name" . }} + image: "{{ .Values.global.loggingRepository| default .Values.loggingRepository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - containerPort: {{ .Values.service.internalPortHttp }} + name: {{ .Values.service.name }}-http + readinessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} +# disable liveness probe when breakpoints set in debugger + # so K8s doesn't restart unresponsive container + {{- if eq .Values.liveness.enabled true }} + livenessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end -}} + env: + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /usr/share/logstash/config/logstash.yml + name: {{ include "common.fullname" . }} + subPath: logstash.yml + - mountPath: /usr/share/logstash/pipeline/onap-pipeline.conf + name: {{ include "common.fullname" . }} + subPath: onap-pipeline.conf + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 10 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 10 }} + {{- end }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: {{ include "common.fullname" . }} + configMap: + name: {{ include "common.fullname" . }} + items: + - key: logstash.yml + path: logstash.yml + - key: onap-pipeline.conf + path: onap-pipeline.conf + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/log/charts/log-logstash/templates/service.yaml b/kubernetes/log/charts/log-logstash/templates/service.yaml new file mode 100644 index 0000000000..ca71aa2224 --- /dev/null +++ b/kubernetes/log/charts/log-logstash/templates/service.yaml @@ -0,0 +1,46 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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: Service +metadata: + name: {{ .Values.service.name }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.externalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.internalPortHttp }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.externalPortHttp }} + name: {{ .Values.service.name }}-http + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.externalPortHttp }} + targetPort: {{ .Values.service.internalPortHttp }} + name: {{ .Values.service.name }}-http + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/log/charts/log-logstash/values.yaml b/kubernetes/log/charts/log-logstash/values.yaml new file mode 100644 index 0000000000..bfe50b54a8 --- /dev/null +++ b/kubernetes/log/charts/log-logstash/values.yaml @@ -0,0 +1,91 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# Licensed 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. + +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + readinessRepository: oomk8s + readinessImage: readiness-check:1.1.0 + persistence: {} + +################################################################# +# Application configuration defaults. +################################################################# + +# application image +loggingRepository: docker.elastic.co +image: logstash/logstash:5.4.3 +pullPolicy: Always + +# flag to enable debugging - application support required +debugEnabled: false + +# application configuration +config: + elasticsearchServiceName: log-es + elasticsearchPort: 9200 + +# default number of instances +replicaCount: 1 + +nodeSelector: {} + +affinity: {} + +# probe configuration parameters +liveness: + initialDelaySeconds: 120 + periodSeconds: 10 + # necessary to disable liveness probe when setting breakpoints + # in debugger so K8s doesn't restart unresponsive container + enabled: true + +readiness: + initialDelaySeconds: 10 + periodSeconds: 10 + +service: + #Example service definition with external, internal and node ports. + #Services may use any combination of ports depending on the 'type' of + #service being defined. + type: ClusterIP + name: log-ls + externalPort: 5044 + internalPort: 5044 + externalPortHttp: 9600 + internalPortHttp: 9600 +ingress: + enabled: false + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # + # Example: + # Configure resource requests and limits + # ref: http://kubernetes.io/docs/user-guide/compute-resources/ + # Minimum memory for development is 2 CPU cores and 4GB memory + # Minimum memory for production is 4 CPU cores and 8GB memory +#resources: +# limits: +# cpu: 2 +# memory: 4Gi +# requests: +# cpu: 2 +# memory: 4Gi diff --git a/kubernetes/log/requirements.yaml b/kubernetes/log/requirements.yaml new file mode 100644 index 0000000000..acca8ef7e2 --- /dev/null +++ b/kubernetes/log/requirements.yaml @@ -0,0 +1,4 @@ +dependencies: + - name: common + version: ~2.0.0 + repository: '@local' \ No newline at end of file diff --git a/kubernetes/log/templates/all-services.yaml b/kubernetes/log/templates/all-services.yaml deleted file mode 100644 index 389e7e4caf..0000000000 --- a/kubernetes/log/templates/all-services.yaml +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright © 2017 Amdocs, Bell Canada -# -# Licensed 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. - -#{{ if not .Values.disableLogElasticsearch }} -apiVersion: v1 -kind: Service -metadata: - labels: - app: elasticsearch - name: elasticsearch - namespace: {{ .Values.nsPrefix }} -spec: - ports: - - name: http - port: 9200 - targetPort: 9200 - nodePort: {{ .Values.nodePortPrefix }}54 - selector: - app: elasticsearch - type: NodePort ---- -apiVersion: v1 -kind: Service -metadata: - name: elasticsearchtcp - namespace: {{ .Values.nsPrefix }} - labels: - app: elasticsearch -spec: - ports: - - name: tcp - port: 9300 - targetPort: 9300 - selector: - app: elasticsearch -#{{ end }} -#{{ if not .Values.disableLogLogstash }} ---- -apiVersion: v1 -kind: Service -metadata: - name: logstashinternal - namespace: {{ .Values.nsPrefix }} - labels: - app: logstash -spec: - ports: - - name: http - port: 9600 - targetPort: 9600 - selector: - app: logstash ---- -apiVersion: v1 -kind: Service -metadata: - name: logstash - namespace: {{ .Values.nsPrefix }} - labels: - app: logstash -spec: - ports: - - name: transport - port: 5044 - targetPort: 5044 - nodePort: {{ .Values.nodePortPrefix }}55 - selector: - app: logstash - type: NodePort -#{{ end }} -#{{ if not .Values.disableLogKibana }} ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: kibana - name: kibana - namespace: {{ .Values.nsPrefix }} -spec: - ports: - - name: tcp-ks - port: 5601 - targetPort: 5601 - nodePort: {{ .Values.nodePortPrefix }}53 - selector: - app: kibana - type: NodePort -#{{ end }} diff --git a/kubernetes/log/templates/elasticsearch-deployment.yaml b/kubernetes/log/templates/elasticsearch-deployment.yaml deleted file mode 100644 index 8c09479b43..0000000000 --- a/kubernetes/log/templates/elasticsearch-deployment.yaml +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright © 2017 Amdocs, Bell Canada -# -# Licensed 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. - -#{{ if not .Values.disableLogElasticsearch }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: elasticsearch - name: log-elasticsearch - namespace: {{ .Values.nsPrefix }} -spec: - replicas: {{ .Values.elasticsearchReplicas }} - selector: - matchLabels: - app: elasticsearch - template: - metadata: - labels: - app: elasticsearch - name: log-elasticsearch - spec: - initContainers: - - command: - - /bin/sh - - -c - - | - sysctl -w vm.max_map_count=262144 - mkdir -p /logroot/elasticsearch/logs - mkdir -p /logroot/elasticsearch/data - chmod -R 777 /logroot/elasticsearch - chown -R root:root /logroot - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - securityContext: - privileged: true - image: {{ .Values.image.es_bb }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: init-sysctl - volumeMounts: - - name: elasticsearch-logs - mountPath: /logroot/ - containers: - - name: elasticsearch - image: {{ .Values.image.elasticsearch}} - ports: - - containerPort: 9200 - name: http - protocol: TCP - - containerPort: 9300 - name: transport - protocol: TCP - readinessProbe: - tcpSocket: - port: 9300 - volumeMounts: - - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml - name: elasticsearch-conf - subPath: elasticsearch.yml - - mountPath: /usr/share/elasticsearch/data/ - name: elasticsearch-data - - mountPath: /usr/share/elasticsearch/logs/ - name: elasticsearch-logs - volumes: - - name: elasticsearch-data - persistentVolumeClaim: - claimName: elasticsearch-db - - name: elasticsearch-logs - hostPath: - path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/log/ - - name: elasticsearch-conf - configMap: - name: log-elasticsearch-configmap - items: - - key: elasticsearch.yml - path: elasticsearch.yml ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: log-elasticsearch-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ (.Files.Glob "resources/elasticsearch/conf/elasticsearch.yml").AsConfig | indent 2 }} -#{{ end }} - diff --git a/kubernetes/log/templates/kibana-deployment.yaml b/kubernetes/log/templates/kibana-deployment.yaml deleted file mode 100644 index b60011a1b3..0000000000 --- a/kubernetes/log/templates/kibana-deployment.yaml +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright © 2017 Amdocs, Bell Canada -# -# Licensed 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. - -#{{ if not .Values.disableLogKibana }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: kibana - name: log-kibana - namespace: {{ .Values.nsPrefix }} -spec: - replicas: {{ .Values.kibanaReplicas }} - selector: - matchLabels: - app: kibana - template: - metadata: - labels: - app: kibana - name: log-kibana - spec: - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - elasticsearch - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: kibana-readiness - containers: - - name: kibana - image: {{ .Values.image.kibana }} - ports: - - containerPort: 5601 - name: http - protocol: TCP - readinessProbe: - tcpSocket: - port: 5601 - volumeMounts: - - name: kibana-conf - mountPath: /usr/share/kibana/config/ - volumes: - - name: kibana-conf - configMap: - name: log-kibana-configmap - items: - - key: kibana.yml - path: kibana.yml ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: log-kibana-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/kibana/conf/kibana.yml").AsConfig . | indent 2 }} -#{{ end }} diff --git a/kubernetes/log/templates/log-pv-pvc.yaml b/kubernetes/log/templates/log-pv-pvc.yaml deleted file mode 100644 index 20bcbb15c1..0000000000 --- a/kubernetes/log/templates/log-pv-pvc.yaml +++ /dev/null @@ -1,48 +0,0 @@ -{{/* -# Copyright © 2017 Amdocs, Bell Canada -# -# Licensed 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. -*/}} - -#{{ if not .Values.disableLogElasticsearch }} -apiVersion: v1 -kind: PersistentVolume -metadata: - name: {{ .Values.nsPrefix }}-elasticsearch-db - namespace: "{{ .Values.nsPrefix }}" - labels: - name: {{ .Values.nsPrefix }}-elasticsearch-db -spec: - capacity: - storage: 2Gi - accessModes: - - ReadWriteMany - persistentVolumeReclaimPolicy: Retain - hostPath: - path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/log/elasticsearch/data ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: elasticsearch-db - namespace: "{{ .Values.nsPrefix }}" -spec: - accessModes: - - ReadWriteMany - resources: - requests: - storage: 2Gi - selector: - matchLabels: - name: {{ .Values.nsPrefix }}-elasticsearch-db -#{{ end }} diff --git a/kubernetes/log/templates/logstash-deployment.yaml b/kubernetes/log/templates/logstash-deployment.yaml deleted file mode 100644 index 33bcc2001a..0000000000 --- a/kubernetes/log/templates/logstash-deployment.yaml +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright © 2017 Amdocs, Bell Canada -# -# Licensed 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. - -#{{ if not .Values.disableLogLogstash }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: logstash - name: log-logstash - namespace: {{ .Values.nsPrefix }} -spec: - replicas: {{ .Values.logstashReplicas }} - selector: - matchLabels: - app: logstash - template: - metadata: - labels: - app: logstash - name: log-logstash - spec: - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - elasticsearch - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: logstash-readiness - containers: - - name: logstash - image: {{ .Values.image.logstash }} - ports: - - containerPort: 5044 - name: transport - protocol: TCP - - containerPort: 9600 - name: http - protocol: TCP - readinessProbe: - tcpSocket: - port: 5044 - volumeMounts: - - mountPath: /usr/share/logstash/config/ - name: logstash-conf - - mountPath: /usr/share/logstash/pipeline/ - name: logstash-pipeline - volumes: - - name: logstash-conf - configMap: - name: log-logstash-configmap - items: - - key: logstash.yml - path: logstash.yml - - name: logstash-pipeline - configMap: - name: log-logstash-configmap - items: - - key: onap-pipeline.conf - path: onap-pipeline.conf - ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: log-logstash-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/logstash/conf/logstash.yml").AsConfig . | indent 2 }} -{{ tpl (.Files.Glob "resources/logstash/pipeline/onap-pipeline.conf").AsConfig . | indent 2 }} -#{{ end }} diff --git a/kubernetes/log/values.yaml b/kubernetes/log/values.yaml index 0b8d1fe100..088ad5d0b3 100644 --- a/kubernetes/log/values.yaml +++ b/kubernetes/log/values.yaml @@ -12,16 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -nsPrefix: onap -pullPolicy: Always -nodePortPrefix: 302 -dataRootDir: /dockerdata-nfs -elasticsearchReplicas: 1 -kibanaReplicas: 1 -logstashReplicas: 1 -image: - readiness: oomk8s/readiness-check:1.1.0 - logstash: docker.elastic.co/logstash/logstash:5.4.3 - kibana: docker.elastic.co/kibana/kibana:5.5.0 - elasticsearch: docker.elastic.co/elasticsearch/elasticsearch:5.5.0 - es_bb: busybox +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + readinessRepository: oomk8s diff --git a/kubernetes/mso/resources/config/log/filebeat/filebeat.yml b/kubernetes/mso/resources/config/log/filebeat/filebeat.yml index 89c6932577..b0d4690754 100644 --- a/kubernetes/mso/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/mso/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ output.logstash: #List of logstash server ip addresses with port number. #But, in our case, this will be the loadbalancer IP address. #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. - hosts: ["logstash.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/mso/values.yaml b/kubernetes/mso/values.yaml index 8b2e18567a..410246fcbc 100644 --- a/kubernetes/mso/values.yaml +++ b/kubernetes/mso/values.yaml @@ -29,3 +29,7 @@ image: mso: nexus3.onap.org:10001/openecomp/mso:v1.1.2 mariadb: nexus3.onap.org:10001/mariadb:10.1.11 filebeat: docker.elastic.co/beats/filebeat:5.5.0 + +config: + logstashServiceName: log-ls + logstashPort: 5044 diff --git a/kubernetes/multicloud/resources/config/log/filebeat/filebeat.yml b/kubernetes/multicloud/resources/config/log/filebeat/filebeat.yml index 706f24d693..a6dd579b4b 100644 --- a/kubernetes/multicloud/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/multicloud/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ output.logstash: #List of logstash server ip addresses with port number. #But, in our case, this will be the loadbalancer IP address. #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. - hosts: ["logstash.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/multicloud/values.yaml b/kubernetes/multicloud/values.yaml index 2f76d6a688..d43ee61343 100644 --- a/kubernetes/multicloud/values.yaml +++ b/kubernetes/multicloud/values.yaml @@ -30,3 +30,7 @@ image: # domain name of msb gateway msbgateway: msb-iag.{{ .Values.nsPrefix }} msbPort: 80 + +config: + logstashServiceName: log-ls + logstashPort: 5044 diff --git a/kubernetes/onap/requirements.yaml b/kubernetes/onap/requirements.yaml index 7c814780e6..91943f46bd 100644 --- a/kubernetes/onap/requirements.yaml +++ b/kubernetes/onap/requirements.yaml @@ -53,7 +53,7 @@ dependencies: repository: '@local' condition: esr.enabled - name: log - version: ~0.1.0 + version: ~2.0.0 repository: '@local' condition: log.enabled - name: message-router diff --git a/kubernetes/onap/values.yaml b/kubernetes/onap/values.yaml index 0c3ff8526d..ee7d00b441 100644 --- a/kubernetes/onap/values.yaml +++ b/kubernetes/onap/values.yaml @@ -63,7 +63,7 @@ dcaegen2: enabled: true esr: enabled: true -log: +log: # ONAP Logging ElasticStack enabled: true message-router: enabled: true diff --git a/kubernetes/policy/resources/config/log/filebeat/filebeat.yml b/kubernetes/policy/resources/config/log/filebeat/filebeat.yml index 89c6932577..b0d4690754 100644 --- a/kubernetes/policy/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/policy/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ output.logstash: #List of logstash server ip addresses with port number. #But, in our case, this will be the loadbalancer IP address. #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. - hosts: ["logstash.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/policy/values.yaml b/kubernetes/policy/values.yaml index 5a04070da3..49ad89225d 100644 --- a/kubernetes/policy/values.yaml +++ b/kubernetes/policy/values.yaml @@ -38,3 +38,7 @@ image: policyNexusVersion: v1.1.1 ubuntu: ubuntu:16.04 filebeat: docker.elastic.co/beats/filebeat:5.5.0 + +config: + logstashServiceName: log-ls + logstashPort: 5044 diff --git a/kubernetes/portal/resources/config/log/filebeat/filebeat.yml b/kubernetes/portal/resources/config/log/filebeat/filebeat.yml index 89c6932577..b0d4690754 100644 --- a/kubernetes/portal/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/portal/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ output.logstash: #List of logstash server ip addresses with port number. #But, in our case, this will be the loadbalancer IP address. #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. - hosts: ["logstash.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/portal/values.yaml b/kubernetes/portal/values.yaml index ed520d6cf6..89c2dbcd96 100644 --- a/kubernetes/portal/values.yaml +++ b/kubernetes/portal/values.yaml @@ -31,3 +31,6 @@ image: ubuntuInit: oomk8s/ubuntu-init:1.0.0 onapPortal: webappsDir: "/opt/apache-tomcat-8.0.37/webapps" +config: + logstashServiceName: log-ls + logstashPort: 5044 diff --git a/kubernetes/sdc/resources/config/log/filebeat/filebeat.yml b/kubernetes/sdc/resources/config/log/filebeat/filebeat.yml index 89c6932577..b0d4690754 100644 --- a/kubernetes/sdc/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/sdc/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ output.logstash: #List of logstash server ip addresses with port number. #But, in our case, this will be the loadbalancer IP address. #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. - hosts: ["logstash.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/sdc/values.yaml b/kubernetes/sdc/values.yaml index 13f41aa0ea..40b3ec3f23 100644 --- a/kubernetes/sdc/values.yaml +++ b/kubernetes/sdc/values.yaml @@ -25,3 +25,6 @@ image: sdcBackend: nexus3.onap.org:10001/openecomp/sdc-backend:v1.1.0 filebeat: docker.elastic.co/beats/filebeat:5.5.0 ubuntuInit: oomk8s/ubuntu-init:1.0.0 +config: + logstashServiceName: log-ls + logstashPort: 5044 diff --git a/kubernetes/sdnc/resources/config/log/filebeat/log4j/filebeat.yml b/kubernetes/sdnc/resources/config/log/filebeat/log4j/filebeat.yml index 2cd63e1d98..49d818a807 100644 --- a/kubernetes/sdnc/resources/config/log/filebeat/log4j/filebeat.yml +++ b/kubernetes/sdnc/resources/config/log/filebeat/log4j/filebeat.yml @@ -29,7 +29,7 @@ output.logstash: #List of logstash server ip addresses with port number. #But, in our case, this will be the loadbalancer IP address. #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. - hosts: ["logstash.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/sdnc/values.yaml b/kubernetes/sdnc/values.yaml index 9c706b8310..94029179db 100644 --- a/kubernetes/sdnc/values.yaml +++ b/kubernetes/sdnc/values.yaml @@ -37,4 +37,6 @@ portalReplicas: 1 disableSdncSdncDgbuilder: false disableSdncSdncPortal: false disableNfsProvisioner: false - +config: + logstashServiceName: log-ls + logstashPort: 5044 diff --git a/kubernetes/so/resources/config/log/filebeat/filebeat.yml b/kubernetes/so/resources/config/log/filebeat/filebeat.yml index 9ad559c027..b0d4690754 100644 --- a/kubernetes/so/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/so/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ output.logstash: #List of logstash server ip addresses with port number. #But, in our case, this will be the loadbalancer IP address. #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. - hosts: ["logstash.{{ .Release.Name }}-log:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/so/values.yaml b/kubernetes/so/values.yaml index d62465d665..3ca60b0395 100644 --- a/kubernetes/so/values.yaml +++ b/kubernetes/so/values.yaml @@ -44,7 +44,8 @@ config: openStackKeyStoneUrl: "http://1.2.3.4:5000" openStackServiceTenantName: "service" openStackEncryptedPasswordHere: "c124921a3a0efbe579782cde8227681e" - + logstashServiceName: log-ls + logstashPort: 5044 # default number of instances replicaCount: 1 diff --git a/kubernetes/vid/resources/config/log/filebeat/filebeat.yml b/kubernetes/vid/resources/config/log/filebeat/filebeat.yml index 89c6932577..b0d4690754 100644 --- a/kubernetes/vid/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/vid/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ output.logstash: #List of logstash server ip addresses with port number. #But, in our case, this will be the loadbalancer IP address. #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. - hosts: ["logstash.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/vid/values.yaml b/kubernetes/vid/values.yaml index 258177b079..f177476e7d 100644 --- a/kubernetes/vid/values.yaml +++ b/kubernetes/vid/values.yaml @@ -23,3 +23,6 @@ image: mariadb: nexus3.onap.org:10001/library/mariadb:10 vid: nexus3.onap.org:10001/openecomp/vid:v1.1.1 filebeat: docker.elastic.co/beats/filebeat:5.5.0 +config: + logstashServiceName: log-ls + logstashPort: 5044 -- 2.16.6