Bug 1752853

Summary: There should be more index pattern in kibana
Product: OpenShift Container Platform Reporter: Jeff Cantrill <jcantril>
Component: LoggingAssignee: Jeff Cantrill <jcantril>
Status: CLOSED ERRATA QA Contact: Anping Li <anli>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 3.11.0CC: agawand, anli, aos-bugs, dcaldwel, jnordell, ljenkin, maupadhy, msweiker, nnosenzo, rmeggins, ssadhale, vlaad
Target Milestone: ---   
Target Release: 3.11.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-24 08:08:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1746377    
Bug Blocks:    
Attachments:
Description Flags
No default Pattern for cluster-admin
none
Snapshot for no-cluster-admin users
none
The kibana and ES logs none

Description Jeff Cantrill 2019-09-17 12:16:29 UTC
This bug was initially created as a copy of Bug #1746377

I am copying this bug because: 



Description of problem:
The user 'anli1' own two projects 'logjson1' and 'loggen1'. But the user only show index project.loggen1.**** in kibana. (See the snapshot)


Version-Release number of selected component (if applicable):
openshift3/ose-logging-kibana5:v3.11.141
openshift3/oauth-proxy:v3.11.141

How reproducible:
Always

1. Deploy logging 
openshift_logging_install_eventrouter=true
openshift_logging_es_allow_external=True
openshift_logging_elasticsearch_storage_type=pvc
openshift_logging_es_pvc_storage_class_name=bogus-glusterfs
openshift_logging_es_pvc_dynamic=true
openshift_logging_es_number_of_shards=1
openshift_logging_es_number_of_replicas=1
openshift_logging_es_memory_limit=2Gi
openshift_logging_es_cluster_size=2
openshift_logging_es_nodeselector={"role":"node"}
openshift_logging_namespace=openshift-logging
openshift_logging_install_logging=true

2. user 'anli1' create two projects
oc new-project loggen1
oc new-app https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/logging/loggen/container_log_template.json
oc new-project logjson1
oc new-app https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/logging/loggen/container_log_template.json

3. $ oc get projects
NAME       DISPLAY NAME   STATUS
loggen1                   Active
logjson1                  Active

4. check the indices and alias
+ oc exec -c elasticsearch logging-es-data-master-67u8p4ld-1-k95hm -- es_util '--query=_aliases?pretty'

5. View indices on kibana using 'anli1'.  
See the snapshot


Actual results:
The user 'anli1' can only view project.loggen1.******

Expected results: 
The user 'anli1' can view patten '.all', 'project.loggen1.*****' and 'project.logjson1.****'

Comment 6 Jeff Cantrill 2019-09-19 20:37:10 UTC
Workarounds:

* User's should be able to manually create the index patterns using the management tab or retrieve logs directly from Elastic by exposing it as a route and submitting the appropriate query.  
* 'oc logs' available to them though this will be limited to whats available on the node.
* It MAY be possible to downgrade to 3.11.98 but this does not include the caching fix which introduced the current issue and is subject to its own issues.  I would avoid downgrading if possible.

Comment 7 Anping Li 2019-09-20 03:04:57 UTC
I can see the pattern on the kibana, but we couldn't assign any of them to be the default pattern.

openshift3/ose-logging-elasticsearch5:v3.11.146
openshift3/oauth-proxy:v3.11.146
openshift3/ose-logging-kibana5:v3.11.146

Comment 8 Anping Li 2019-09-20 03:07:00 UTC
Created attachment 1616989 [details]
No default Pattern for cluster-admin

No default Pattern for cluster-admin,  the cluster-admin can set default pattern.

Comment 9 Anping Li 2019-09-20 03:09:27 UTC
Created attachment 1616990 [details]
Snapshot for no-cluster-admin users

No default pattern and user is unable to set default pattern.

Comment 10 Anping Li 2019-09-20 03:13:59 UTC
Created attachment 1617004 [details]
The kibana and ES logs

Comment 12 Jeff Cantrill 2019-09-20 13:50:30 UTC
(In reply to Anping Li from comment #9)
> Created attachment 1616990 [details]
> Snapshot for no-cluster-admin users
> 
> No default pattern and user is unable to set default pattern.

I am unable to reproduce.

Using brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/openshift3/ose-logging-elasticsearch5:v3.11.146-2 

I have a user that is only able to see:

  * myproject
    test-a
    test-b

Using an 'incognito' browser to Kibana to ensure no caching:

I see index patterns:

Default: project.test-b.404a9f7c-d59a...
         project.test-a.42a7b97d-d59a....

Set project.test-a as the default.  No errors
Log out. Log back in.  Go to discover tab.  Note project.test-a.42a7b97d-d59a... is now the default

Comment 13 Jeff Cantrill 2019-09-20 13:53:19 UTC
Looking at the snapshot for noncluster admin.  It also looks like you are missing versions of Kibana and Elastic as noticed by the error.  It appears you are using an earlier image that has an earlier version of Kibana (5.6.13) then the what the server expects (5.6.16)

Comment 14 Jeff Cantrill 2019-09-20 14:16:22 UTC
Reran test confirming I have the following images:

brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/openshift3/ose-logging-kibana5          v3.11.146-4           67e3c2bd0a4f        19 hours ago        1.08 GB
brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/openshift3/ose-logging-elasticsearch5   v3.11.146-2           9c3dc9e56e6d        42 hours ago        545 MB

Same result as #c12

Comment 16 Anping Li 2019-09-23 05:48:56 UTC
The kibana works well in openshift3/ose-logging-kibana5/images/v3.11.146-6

Comment 18 errata-xmlrpc 2019-09-24 08:08:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:2816