Comments (3)
After some tries, that helper doesn't work IDK and I'm a bit lost inside goja to troubleshoot the panic :/
nvm, I have modified a bit the current code to check if we are in-cluster if kubeconfig = ""
and now it's working perfectly. This is my patch:
func getClientConfig(options KubeConfig) (*rest.Config, error) {
kubeconfig := options.ConfigPath
if kubeconfig == "" {
// are we in-cluster?
config, err := restclient.InClusterConfig()
if err == nil {
return config, nil
}
// we aren't in-cluster
home := homedir.HomeDir()
if home == "" {
return nil, errors.New("home directory not found")
}
kubeconfig = filepath.Join(home, ".kube", "config")
}
return clientcmd.BuildConfigFromFlags("", kubeconfig)
}
If it's possible, I'd like to draft a PR fixing this instead of having to fork and maintain the repo from my side. Do you want the PR? (I hope so, but maybe there is any good reason that IDK for not supporting in-cluster)
FYI @javaducky
I can try to go further with the controller-runtime helper if you prefer that approach (but maybe I need some help)
from xk6-kubernetes.
@JorTurFer, please submit a PR with what you've got working. I'll take a look at it as well.
from xk6-kubernetes.
@JorTurFer, please submit a PR with what you've got working. I'll take a look at it as well.
Sure, this is the PR: #101
It's a really small change, but it allows to run this extension inside the cluster using k6-operator. I had to create all the RBAC stuff obviously, but with this change + RBAC changes, I had been able to run the load tests using k6-operator
from xk6-kubernetes.
Related Issues (20)
- Allow login with server host and token HOT 1
- Bump dependencies and CI
- Arrays of objects returned by xk6-kubernetes do not have the length property
- Redesign scope of xk6-kubernetes API HOT 10
- Implement generic k8s interface
- Add support for deploying custom resources HOT 2
- Add helper function for creating random namespaces
- Add helper function for waiting a Deployment is ready
- Deleting namespace using the generic interface fails
- Re-implement generic Apply method using dynamic client's apply HOT 1
- Apply fails if the resources already exist HOT 1
- Add options parameter to Delete function in Generic API
- Ingresses missing from generic resource API
- Add examples for CRDs
- Remove Deprecated API
- Move helper functions to helpers package in new API
- TypeScript type definitions HOT 1
- Migrate example scripts from deprecated APIs
- Upgrade dependencies and CI to latest specs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xk6-kubernetes.