Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysdump: don't hardcode custom resource api versions #2485

Open
michi-covalent opened this issue Apr 17, 2024 · 0 comments
Open

sysdump: don't hardcode custom resource api versions #2485

michi-covalent opened this issue Apr 17, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@michi-covalent
Copy link
Contributor

currently sysdump hardcodes some custom resource api versions in

var (
awsENIConfigsGVR = schema.GroupVersionResource{
Group: "crd.k8s.amazonaws.com",
Resource: "eniconfigs",
Version: "v1alpha1",
}
awsSecurityGroupPoliciesGVR = schema.GroupVersionResource{
Group: "vpcresources.k8s.aws",
Resource: "securitygrouppolicies",
Version: "v1beta1",
}
k8sLeases = schema.GroupVersionResource{
Group: "coordination.k8s.io",
Resource: "leases",
Version: "v1",
}
ciliumBugtoolFileNameRegex = regexp.MustCompile("GZIP at (.*)\n")
gopsRegexp = regexp.MustCompile(`^(?P<pid>\d+).*\*`)
gopsStats = []string{
"memstats",
"stack",
"stats",
}
gopsProfiling = []string{
"pprof-heap",
"pprof-cpu",
}
gopsTrace = "trace"
certificate = schema.GroupVersionResource{
Group: "cert-manager.io",
Resource: "certificates",
Version: "v1",
}
// Gateway API resource group versions used for sysdumping these
gatewayClass = schema.GroupVersionResource{
Group: "gateway.networking.k8s.io",
Resource: "gatewayclasses",
Version: "v1",
}
gateway = schema.GroupVersionResource{
Group: "gateway.networking.k8s.io",
Resource: "gateways",
Version: "v1",
}
referenceGrant = schema.GroupVersionResource{
Group: "gateway.networking.k8s.io",
Resource: "referencegrants",
Version: "v1beta1",
}
httpRoute = schema.GroupVersionResource{
Group: "gateway.networking.k8s.io",
Resource: "httproutes",
Version: "v1",
}
tlsRoute = schema.GroupVersionResource{
Group: "gateway.networking.k8s.io",
Resource: "tlsroutes",
Version: "v1alpha2",
}
tcpRoute = schema.GroupVersionResource{
Group: "gateway.networking.k8s.io",
Resource: "tcproutes",
Version: "v1alpha2",
}
udpRoute = schema.GroupVersionResource{
Group: "gateway.networking.k8s.io",
Resource: "udproutes",
Version: "v1alpha2",
}
grpcRoute = schema.GroupVersionResource{
Group: "gateway.networking.k8s.io",
Resource: "grpcroutes",
Version: "v1alpha2",
}
)

this is not ideal since you need to know which cilium-cli version to use for the sysdump command to correctly capture all the custom resources.

instead, magically detect custom resource versions that are being used in the cluster.

@michi-covalent michi-covalent added the good first issue Good for newcomers label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: Todo
Development

No branches or pull requests

1 participant