Thanks to visit codestin.com
Credit goes to github.com

Skip to content

davidecelano/openshift-logging-efk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenShift Logging (EFK Stack)

Deploy Elasticsearch, Fluentd, and Kibana on OpenShift 4.14/4.15.

Prerequisites

Repository Contents

File Description
manifests/operators/cluster-logging-operator.yml Namespace, OperatorGroup, Subscription for Cluster Logging
manifests/operators/elasticsearch-operator.yml Subscription for Elasticsearch
manifests/logging/clusterlogging.template.yml OpenShift template for ClusterLogging CR
manifests/logging/clusterlogforwarder.yml ClusterLogForwarder CR
manifests/logging/infra-node-placement.patch.yml Patch to schedule logging on infra nodes
manifests/logging/params/single-node.example.params Parameters for single-node ES
manifests/logging/params/multi-node.example.params Parameters for multi-node (3 nodes)
manifests/logging/params/README.md Parameter documentation and usage
manifests/kibana/kibana-externallink.template.yml Kibana link in OpenShift console
manifests/elasticsearch/index_explicit_mapping_template.sh Script to apply custom index template
manifests/elasticsearch/dedalus_template.json Custom Elasticsearch index template definition

Deployment

1. Install Elasticsearch operator

oc apply -f manifests/operators/elasticsearch-operator.yml

Check:

oc get subscription -n openshift-logging

2. Install Cluster Logging operator

oc apply -f manifests/operators/cluster-logging-operator.yml

Check:

oc get subscription -n openshift-logging

3. Deploy ClusterLogging instance

Ex. Single-node (1 ES node, zero redundancy):

oc process -f manifests/logging/clusterlogging.template.yml \
  --param-file=manifests/logging/params/single-node.example.params \
  | oc apply -n openshift-logging -f -

4. Deploy ClusterLogForwarder

oc apply -f manifests/logging/clusterlogforwarder.yml

5. Add Kibana link to OpenShift console

oc process -f manifests/kibana/kibana-externallink.template.yml \
  -p KIBANA_ROUTE=$(oc get route kibana -n openshift-logging -o jsonpath='{.spec.host}') \
  | oc apply -n openshift-logging -f -

6. Apply custom Elasticsearch index template

. manifests/elasticsearch/index_explicit_mapping_template.sh

Expected output: {"acknowledged":true}

7. (Optional) Configure infra node placement

Schedule Elasticsearch and Kibana on infrastructure nodes:

oc patch ClusterLogging instance -n openshift-logging --type=merge --patch-file=manifests/logging/infra-node-placement.patch.yml

See manifests/logging/README.md for prerequisites.

Elasticsearch Commands

Get an Elasticsearch pod:

es_pod=$(oc get pods -l component=elasticsearch -n openshift-logging --no-headers | head -1 | awk '{print $1}')

Get index template:

oc exec -n openshift-logging -c elasticsearch $es_pod -- es_util --query=_template/dedalus_es_template

Delete index template:

oc exec -n openshift-logging -c elasticsearch $es_pod -- es_util --query=_template/dedalus_es_template -XDELETE

List all templates:

oc exec -n openshift-logging -c elasticsearch $es_pod -- es_util --query=_template | jq

Troubleshooting

Check pod status:

oc get pods -n openshift-logging

Check operator subscriptions:

oc get subscription -n openshift-logging

Check ClusterLogging status:

oc get ClusterLogging instance -n openshift-logging -o yaml

Check all logging components by label:

oc get all -l app=dedalus-logging -n openshift-logging

Uninstall

oc delete ClusterLogForwarder instance -n openshift-logging
oc delete ClusterLogging instance -n openshift-logging
oc delete -f manifests/operators/cluster-logging-operator.yml
oc delete -f manifests/operators/elasticsearch-operator.yml

About

This project collects the procedures on how to setup a custom EFK instance

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%