You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add to readme about referencing objects outside of the core API
* Update usage section
* Apply suggestions from code review
Co-authored-by: pablochacin <pablochacin@gmail.com>
Copy file name to clipboardExpand all lines: README.md
+63-3Lines changed: 63 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -44,10 +44,26 @@ Using the `k6` binary with `xk6-kubernetes`, run the k6 test as usual:
44
44
```
45
45
# Usage
46
46
47
-
The API assumes a `kubeconfig` configuration is available at any of the following default locations:
48
-
* at the location pointed by the `KUBECONFIG` environment variable
49
-
* at `$HOME/.kube`
47
+
By default, the API assumes a `kubeconfig` configuration is available at `$HOME/.kube`.
50
48
49
+
Alternatively, you can pass in the following options as a javascript Object to the Kubernetes constructor to configure access to the Kubernetes API server:
50
+
51
+
| Option | Value | Description |
52
+
| -- | --| ---- |
53
+
| config_path | /path/to/kubeconfig | Kubeconfig file location. You can also set this to __ENV.KUBECONFIG to use the location pointed by the `KUBECONFIG` environment variable |
54
+
| server |<SERVER_HOST>| Kubernetes API server URL |
55
+
| token |<TOKEN>| Bearer Token for authenticating to the Kubernetes API server |
56
+
57
+
```javascript
58
+
59
+
import { Kubernetes } from 'k6/x/kubernetes';
60
+
61
+
export default function() {
62
+
const k = new Kubernetes({
63
+
config_map: '/path/to/kubeconfig',
64
+
});
65
+
}
66
+
```
51
67
52
68
# APIs
53
69
@@ -141,6 +157,50 @@ export default function () {
141
157
}
142
158
```
143
159
160
+
#### Interacting with objects created by CRDs
161
+
162
+
For objects outside of the core API, use the fully-qualified resource name.
The `xk6-kubernetes` extension offers helpers to facilitate common tasks when setting up a tests. All helper functions work in a namespace to facilitate the development of tests segregated by namespace. The helpers are accessed using the following method:
0 commit comments