loft-sh / vcluster

vCluster - Create fully functional virtual Kubernetes clusters - Each vcluster runs inside a namespace of the underlying k8s cluster. It's cheaper than creating separate full-blown clusters and it offers better multi-tenancy and isolation than regular namespaces.
https://www.vcluster.com
Apache License 2.0
6.28k stars 399 forks source link

ELK does not work as expected in host cluster #594

Closed vumdao closed 2 years ago

vumdao commented 2 years ago

What happened?

I installed Elasticsearch on the host and what I got from search is following and it shows nothing related to kubernetes labels/namespace image

Here is labels and annotations of a pod

Labels:       vcluster.loft.sh/label-dev7-x-a172cedcae=app                         
              vcluster.loft.sh/label-dev7-x-fdcdfa3fd8=58fbbd664          
              vcluster.loft.sh/managed-by=dev7                                                           
              vcluster.loft.sh/namespace=default                                                         
              vcluster.loft.sh/ns-label-dev7-x-cf1227b7b2=default          
Annotations:  cluster-autoscaler.kubernetes.io/safe-to-evict: true         
              kubectl.kubernetes.io/restartedAt: 2022-07-05T17:28:31+07:00 
              kubernetes.io/psp: eks.privileged                                                          
              vcluster.loft.sh/labels:                                                                   
                app="app"                                                                                
                pod-template-hash="58fbbd664"                                                            
              vcluster.loft.sh/managed-annotations: kubectl.kubernetes.io/restartedAt                    
              vcluster.loft.sh/name: app-58fbbd664-4rll8                                         
              vcluster.loft.sh/namespace: default                                                                                                                                                                  
              vcluster.loft.sh/object-name: app-58fbbd664-4rll8                                                                                                                                                    
              vcluster.loft.sh/object-namespace: default                                                 
              vcluster.loft.sh/owner-set-kind: ReplicaSet                                                
              vcluster.loft.sh/service-account-name: default                                             

but the search result is nothing image

What did you expect to happen?

Using ELK can search filter based on app labels and namespace

How can we reproduce it (as minimally and precisely as possible)?

Install Elasticsearch on host cluster

Anything else we need to know?

No response

Host cluster Kubernetes version

EKS cluster v1.21

Host cluster Kubernetes distribution

v1.21

vlcuster version

vcluster version 0.8.1

Vcluster Kubernetes distribution(k3s(default)), k8s, k0s)

k8s

OS and Arch

EKS/EC2

matskiv commented 2 years ago

Closing since this is about the ELK instance installed in the host cluster. We can reopen if some evidence of vcluster being the root cause is provided.