Enabling centralized logging on OpenShift How There's an Ansible playbook in openshift-ansible repository that takes enables logging. https://github.com/openshift/openshift-ansible Minishift It is not possible to enable it on a cluster setup using Minishift.
- Running Ansible locally and targeting Minishift cluster is very problematic (needs RHEL on local machine, mising tools, assumptions about the local machine don't work)
- Running Ansible within the Minishift VM is also not possible because that VM lacks lots of tools (Ansible, Pythong, Git etc.) and it is super hard to install them
oc cluster up Not possible either. Targeting the local cluster with Ansible sounds good, but it ends up in similar problems to Minishift one. .h4 Remote cluster that's created using cluster_create pipeline I was able to enable logging on "apb-testing" cluster Pavel gave me. Access to this cluster requires Red Hat VPN. Steps: 1. SSH into master node:
ssh hadmin@apb-testing.skunkhenry.com
|
Your key should be already in authorized keys for hadmin user. OpenShift console for this cluster is at https://apb-testing.skunkhenry.com:8443/console 2. Clone openshift-ansible
git clone https://github.com/openshift/openshift-ansible.git
|
3. Checkout the relevant tag of that repo:
# find the correct one from https://github.com/openshift/openshift-ansible/releases |
# that matches the OpenShift version you get using 'oc version' command |
git checkout openshift-ansible-3.9.33-1
|
4. There was a bug in that version of the Ansible role. It is fixed in master. Make that update manually according to https://github.com/openshift/openshift-ansible/blob/1cb319e8030961f77d751f4be115fe5ddba89bda/roles/openshift_logging_elasticsearch/handlers/main.yml#L8 5. Login with system admin
6. Enable logging
ansible-playbook -i /home/hadmin/.config/openshift/hosts ./playbooks/openshift-logging/config.yml -e openshift_logging_install_logging=true -e openshift_logging_es_allow_external=True -e openshift_logging_es_hostname=elasticsearch.example.com
|
The cluster is created initially with cluster_create pipeline and that pipeline stores Ansible inventory in the master node at /home/hadmin/.config/openshift/hosts 7. Wait until Ansible playbook completes and all pods are up on OpenShift's logging project 8. Update the route in logging project for ElasticSearch. Change it using the UI from elasticsearch.example.com to something you like such as es.apb-testing.skunkhenry.com Disabling OpenShift Centralized logging
ansible-playbook -i /home/hadmin/.config/openshift/hosts ./playbooks/openshift-logging/config.yml -e openshift_logging_install_logging=false
|
|