Closed tomassatka closed 5 days ago
@tomassatka good hint. I'll have to look into this on how to identify if running in a terminal.
Perhaps it might be suffucient to check if the process is running in an interactive terminal.
@tomassatka How does your config look like? especially how many worker threads do you use?
@tomassatka How does your config look like? especially how many worker threads do you use?
I was able to reproduce it in e2e tests.
My config looks following:
i have configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "kubexporter.name" . }}
data:
config.yaml: |
{{- toYaml .Values.kubexporter.config | nindent 4 }}
and then in values.yaml
config:
summary: true
progress: simple
archive: false
asLists: false
clearTarget: true
worker: 5
considerOwnerReferences: false
included:
kinds:
- foo.bar.com.Program
- foo.bar.com.Nexus
- foo.bar.com.Gitlab
- xrd.vault.upbound.io.ExternalGroup
- users.nexus.foo.bar.io.User
- roles.nexus.foo.bar.io.Role
- privileges.nexus.foo.bar.io.PrivilegeRepositoryContentSelector
- contentselectors.nexus.foo.bar.io.ContentSelector
- kubernetes.crossplane.io.Object
- groups.gitlab.crossplane.io.Variable
- groups.gitlab.crossplane.io.SamlGroupLink
- groups.gitlab.crossplane.io.Group
- kubernetes.vault.upbound.io.AuthBackendConfig
- kubernetes.vault.upbound.io.AuthBackendRole
- jwt.vault.upbound.io.AuthBackendRole
- jwt.vault.upbound.io.AuthBackend
- auth.vault.upbound.io.Backend
- identity.vault.upbound.io.GroupAlias
- identity.vault.upbound.io.Group
- vault.vault.upbound.io.Mount
- vault.vault.upbound.io.Policy
but i had the same behavior with 1 worker as well...
@tomassatka would you try the latest main image ghcr.io/bakito/kubexporter:main
to check if your issue is fixed?
hi @bakito
Yes it works. Here is the proof where i intentionally put bar as progress and add wrong binding that sa has no access to check the NP from previous issue:
config:
summary: true
# progress: simple
progress: bar
archive: false
asLists: false
clearTarget: true
worker: 5
considerOwnerReferences: false
included:
kinds:
- foo.bar.com.Program
- foo.bar.com.Nexus
*
*
output with some skipped/masked logs:
tomas@Tomass-MacBook-Pro kubexporter % kc -n kubexporter logs -f kubexporter-manual-001-7jg92
Switching progress to "simple" in non terminal environment
Starting export ...
kubexporter version "main"
cluster "https://10.96.0.1:443"
all namespaces
target "exports"
format "yaml"
worker 5
summary
Exporting ...
- foo.bar.Gitlab
- contentselectors.nexus.foo.bar.io.ContentSelector
*
*
GROUP VERSION KIND NAMESPACES TOTAL INSTANCES EXPORTED INSTANCES QUERY DURATION EXPORT DURATION
foo.bar.com v1alpha1 Gitlab false 0 0 22.406084ms 0s
foo.bar.com v1alpha1 Nexus false 0 0 22.441583ms 0s
foo.bar.com v1alpha1 Program false 0 0 22.067333ms 0s
contentselectors.nexus.foo.bar.io v1alpha1 ContentSelector false 0 0 22.404375ms 0s
kubernetes.crossplane.io v1alpha2 Object false 0 0 22.104916ms 0s
privileges.nexus.foo.bar.io v1alpha1 PrivilegeRepositoryContentSelector false 0 0 599.25µs 0s
roles.nexus.foo.bar.io v1alpha1 Role false 0 0 575µs 0s
users.nexus.foo.bar.io v1alpha1 User false 0 0 527.25µs 0s
CUMULATED TOTAL 0 0 113.125791ms 0s
Kinds 8
Exported Resources 0
Namespaces 0
Errors 8
Duration 65.261292ms
looks good
when i add --verbose
to my args: args: ["--config", "/etc/config.yaml", "--verbose"] i get those errors printed out:
users.nexus.foo.bar.io v1alpha1 User false 0 0 589.583µs 0s Error:users.users.nexus.foo.bar.io
is forbidden: User "system:serviceaccount:kubexporter:kubexporter"
cannot list resource "users" in API
group "users.nexus.foo.bar.io" at the cluster scope: RBAC:
clusterrole.rbac.authorization.k8s.io "cal-view" not found
so all works as expected. Waiting for new release that contains it.
And a BIG thank you for swift fix. You are helpful as always
If using binary inside container, when using progress type
bar
the application crash on deadlock. Switching tosimple
solves the issue. But it would be nice that it works out of box since there is also a code that identify that kubexport runs as InCluster() so that could also set the progress to simple.Including crash stack trace when deadlock