├── .github └── workflows │ └── workflow.yml ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── backends ├── .npmignore ├── kubernetes-client-node.js ├── kubernetes-client-node.test.js └── request │ ├── auth-providers │ ├── cmd.js │ └── openid.js │ ├── client.js │ ├── client.test.js │ ├── config.js │ ├── config.test │ ├── deprecated.test.js │ ├── fixtures │ │ ├── foo-auth-data │ │ ├── foo-cert-data │ │ ├── foo-cert-key │ │ ├── kube-fixture-two.yml │ │ └── kube-fixture.yml │ └── index.test.js │ └── index.js ├── docs ├── 1.10 │ ├── APIService.md │ ├── Binding.md │ ├── CertificateSigningRequest.md │ ├── Cluster.md │ ├── ClusterRole.md │ ├── ClusterRoleBinding.md │ ├── ComponentStatus.md │ ├── ConfigMap.md │ ├── ControllerRevision.md │ ├── CronJob.md │ ├── CustomResourceDefinition.md │ ├── DaemonSet.md │ ├── Deployment.md │ ├── DeploymentRollback.md │ ├── Endpoints.md │ ├── Event.md │ ├── Eviction.md │ ├── HorizontalPodAutoscaler.md │ ├── Ingress.md │ ├── InitializerConfiguration.md │ ├── Job.md │ ├── LimitRange.md │ ├── LocalSubjectAccessReview.md │ ├── MutatingWebhookConfiguration.md │ ├── Namespace.md │ ├── NetworkPolicy.md │ ├── Node.md │ ├── PersistentVolume.md │ ├── PersistentVolumeClaim.md │ ├── Pod.md │ ├── PodDisruptionBudget.md │ ├── PodPreset.md │ ├── PodSecurityPolicy.md │ ├── PodTemplate.md │ ├── PriorityClass.md │ ├── README.md │ ├── ReplicaSet.md │ ├── ReplicationController.md │ ├── ResourceQuota.md │ ├── Role.md │ ├── RoleBinding.md │ ├── Scale.md │ ├── Secret.md │ ├── SelfSubjectAccessReview.md │ ├── SelfSubjectRulesReview.md │ ├── Service.md │ ├── ServiceAccount.md │ ├── StatefulSet.md │ ├── StorageClass.md │ ├── SubjectAccessReview.md │ ├── TokenReview.md │ ├── ValidatingWebhookConfiguration.md │ └── VolumeAttachment.md ├── 1.11 │ ├── APIService.md │ ├── Binding.md │ ├── CertificateSigningRequest.md │ ├── Cluster.md │ ├── ClusterRole.md │ ├── ClusterRoleBinding.md │ ├── ComponentStatus.md │ ├── ConfigMap.md │ ├── ControllerRevision.md │ ├── CronJob.md │ ├── CustomResourceDefinition.md │ ├── DaemonSet.md │ ├── Deployment.md │ ├── DeploymentRollback.md │ ├── Endpoints.md │ ├── Event.md │ ├── Eviction.md │ ├── HorizontalPodAutoscaler.md │ ├── Ingress.md │ ├── InitializerConfiguration.md │ ├── Job.md │ ├── LimitRange.md │ ├── LocalSubjectAccessReview.md │ ├── MutatingWebhookConfiguration.md │ ├── Namespace.md │ ├── NetworkPolicy.md │ ├── Node.md │ ├── PersistentVolume.md │ ├── PersistentVolumeClaim.md │ ├── Pod.md │ ├── PodDisruptionBudget.md │ ├── PodPreset.md │ ├── PodSecurityPolicy.md │ ├── PodTemplate.md │ ├── PriorityClass.md │ ├── README.md │ ├── ReplicaSet.md │ ├── ReplicationController.md │ ├── ResourceQuota.md │ ├── Role.md │ ├── RoleBinding.md │ ├── Scale.md │ ├── Secret.md │ ├── SelfSubjectAccessReview.md │ ├── SelfSubjectRulesReview.md │ ├── Service.md │ ├── ServiceAccount.md │ ├── StatefulSet.md │ ├── StorageClass.md │ ├── SubjectAccessReview.md │ ├── TokenReview.md │ ├── ValidatingWebhookConfiguration.md │ └── VolumeAttachment.md ├── 1.12 │ ├── APIService.md │ ├── Binding.md │ ├── CertificateSigningRequest.md │ ├── Cluster.md │ ├── ClusterRole.md │ ├── ClusterRoleBinding.md │ ├── ComponentStatus.md │ ├── ConfigMap.md │ ├── ControllerRevision.md │ ├── CronJob.md │ ├── CustomResourceDefinition.md │ ├── DaemonSet.md │ ├── Deployment.md │ ├── DeploymentRollback.md │ ├── Endpoints.md │ ├── Event.md │ ├── Eviction.md │ ├── HorizontalPodAutoscaler.md │ ├── Ingress.md │ ├── InitializerConfiguration.md │ ├── Job.md │ ├── Lease.md │ ├── LimitRange.md │ ├── LocalSubjectAccessReview.md │ ├── MutatingWebhookConfiguration.md │ ├── Namespace.md │ ├── NetworkPolicy.md │ ├── Node.md │ ├── NodeProxyOptions.md │ ├── PersistentVolume.md │ ├── PersistentVolumeClaim.md │ ├── Pod.md │ ├── PodAttachOptions.md │ ├── PodDisruptionBudget.md │ ├── PodExecOptions.md │ ├── PodPortForwardOptions.md │ ├── PodPreset.md │ ├── PodProxyOptions.md │ ├── PodSecurityPolicy.md │ ├── PodTemplate.md │ ├── PriorityClass.md │ ├── README.md │ ├── ReplicaSet.md │ ├── ReplicationController.md │ ├── ResourceQuota.md │ ├── Role.md │ ├── RoleBinding.md │ ├── Scale.md │ ├── Secret.md │ ├── SelfSubjectAccessReview.md │ ├── SelfSubjectRulesReview.md │ ├── Service.md │ ├── ServiceAccount.md │ ├── ServiceProxyOptions.md │ ├── StatefulSet.md │ ├── StorageClass.md │ ├── SubjectAccessReview.md │ ├── TokenReview.md │ ├── ValidatingWebhookConfiguration.md │ └── VolumeAttachment.md └── 1.13 │ ├── APIService.md │ ├── AuditSink.md │ ├── Binding.md │ ├── CertificateSigningRequest.md │ ├── Cluster.md │ ├── ClusterRole.md │ ├── ClusterRoleBinding.md │ ├── ComponentStatus.md │ ├── ConfigMap.md │ ├── ControllerRevision.md │ ├── CronJob.md │ ├── CustomResourceDefinition.md │ ├── DaemonSet.md │ ├── Deployment.md │ ├── DeploymentRollback.md │ ├── Endpoints.md │ ├── Event.md │ ├── Eviction.md │ ├── HorizontalPodAutoscaler.md │ ├── Ingress.md │ ├── InitializerConfiguration.md │ ├── Job.md │ ├── Lease.md │ ├── LimitRange.md │ ├── LocalSubjectAccessReview.md │ ├── MutatingWebhookConfiguration.md │ ├── Namespace.md │ ├── NetworkPolicy.md │ ├── Node.md │ ├── NodeProxyOptions.md │ ├── PersistentVolume.md │ ├── PersistentVolumeClaim.md │ ├── Pod.md │ ├── PodAttachOptions.md │ ├── PodDisruptionBudget.md │ ├── PodExecOptions.md │ ├── PodPortForwardOptions.md │ ├── PodPreset.md │ ├── PodProxyOptions.md │ ├── PodSecurityPolicy.md │ ├── PodTemplate.md │ ├── PriorityClass.md │ ├── README.md │ ├── ReplicaSet.md │ ├── ReplicationController.md │ ├── ResourceQuota.md │ ├── Role.md │ ├── RoleBinding.md │ ├── Scale.md │ ├── Secret.md │ ├── SelfSubjectAccessReview.md │ ├── SelfSubjectRulesReview.md │ ├── Service.md │ ├── ServiceAccount.md │ ├── ServiceProxyOptions.md │ ├── StatefulSet.md │ ├── StorageClass.md │ ├── SubjectAccessReview.md │ ├── TokenReview.md │ ├── ValidatingWebhookConfiguration.md │ └── VolumeAttachment.md ├── examples ├── apply-deploy.js ├── basic-auth.js ├── basic.js ├── canary-controller.js ├── client-from-apiserver-swagger.js ├── convenience-properties.js ├── crontabs-crd.json ├── deployment-create-patch-rollback.js ├── deployment-notifier.js ├── deploymentnotifier-crd.json ├── iam-auth.js ├── in-cluster-auth.js ├── kubernetes-client-node.js ├── nginx-deployment.json ├── nginx-deploymentnotifier.json ├── pod-exec.js ├── pod-logs.js ├── sync-client-version.js ├── timeout.js ├── using-crds.js ├── vpa │ ├── index.js │ └── vpa-crd.json └── watch.js ├── integration ├── kind.yaml ├── run-mocha.sh └── test │ ├── basic.js │ ├── busybox-pod.yaml │ ├── common.js │ ├── env.js │ ├── patch.js │ └── stream.js ├── lib ├── .npmignore ├── alias.js ├── config.js ├── index.js ├── specs │ ├── swagger-1.10.json.gz │ ├── swagger-1.11.json.gz │ ├── swagger-1.12.json.gz │ └── swagger-1.13.json.gz ├── swagger-client.js └── swagger-client.test.js ├── merging-with-kubernetes.md ├── package-lock.json ├── package.json ├── renovate.json ├── scripts ├── docs.js ├── templates │ ├── .gitattributes │ ├── markdown-client.mustache │ ├── markdown-group.mustache │ ├── markdown-kind.mustache │ ├── markdown-operation.mustache │ ├── ts-interface.mustache │ └── ts-namespace.mustache ├── test-generated.sh └── typings.js └── typings ├── .npmignore ├── index.d.ts ├── index.test.ts └── tsconfig.json /.github/workflows/workflow.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test: 7 | runs-on: ubuntu-latest 8 | strategy: 9 | matrix: 10 | node: [ '12', '10' ] 11 | name: Node ${{ matrix.node }} 12 | steps: 13 | - uses: actions/checkout@v2 14 | - name: Setup node 15 | uses: actions/setup-node@v1 16 | with: 17 | node-version: ${{ matrix.node }} 18 | - run: npm install 19 | - run: if [[ $(node -v) =~ v10.*$ ]]; then npm run test-10; else npm run test; fi 20 | test-integration: 21 | runs-on: ubuntu-latest 22 | name: Cluster integration 23 | steps: 24 | - uses: actions/checkout@v2 25 | - name: Setup node 26 | uses: actions/setup-node@v1 27 | with: 28 | node-version: 12 29 | - run: npm install 30 | - run: npm run test-integration 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | coverage/ 3 | .nyc_output/ 4 | npm-debug.log 5 | 6 | # Assuming you don't want to check this in 7 | yarn.lock 8 | yarn-error.log 9 | 10 | # IntelliJ project files 11 | .idea 12 | 13 | # Integration testing 14 | integration/.kubeconfig.integration 15 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to kubernetes-client 2 | 3 | Thanks for taking the time to contribute! 4 | 5 | ## Submitting an Issue 6 | 7 | We will try to respond to every issue. The issues that get the 8 | quickest response are the ones that are easiest to respond to. The 9 | issues that are easiest to respond to usually include the 10 | following: 11 | 12 | * A small self sufficient code example to reproduce the issue. 13 | * For requests for help, a small self sufficient code example that 14 | illustrates what you're currently attempting to implement. 15 | * For API feature requests, links to supporting API documentation or 16 | examples from Kubernetes clients in other languages (*e.g.*, 17 | ). 18 | 19 | ## Submitting a Pull Request 20 | 21 | The most useful PRs ensure the following: 22 | 23 | 1. Include tests with your PR. Check out [`test/`](test) for adding 24 | unit tests. See the testing section in 25 | [README.md](https://github.com/godaddy/kubernetes-client#testing) for 26 | tips on running tests. 27 | 1. Run `npm test` locally. Fix any issues before submitting your PR. 28 | 1. After submitting a PR, Travis CI tests will run. Fix any issues 29 | Travis CI reports. 30 | 31 | ## Adding Swagger specificatins 32 | 33 | It's useful to package Swagger specifications with 34 | kubernetes-client. To add newly released specifications: 35 | 36 | * Visit 37 | and select the release branch. 38 | * Download the swagger.json file. 39 | * Gzip it and add it to [lib/specs](lib/specs). 40 | * Update documentation by running `npm run docs`, adding the generated 41 | files and changes, and updating the 42 | [`Documentation`](./README.md#documentation) section of the README.md. 43 | * Create a PR. 44 | 45 | ## Publishing a new release 46 | 47 | If you're a maintainer use `npm run release` to start the release 48 | process and follow the instructions printed to the console. 49 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 GoDaddy Operating Company, LLC. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kubernetes-client 2 | 3 | [![Build Status][build]](https://travis-ci.org/godaddy/kubernetes-client) [![Greenkeeper badge][greenkeeper]](https://greenkeeper.io/) 4 | 5 | [greenkeeper]: https://badges.greenkeeper.io/godaddy/kubernetes-client.svg 6 | [build]: https://travis-ci.org/godaddy/kubernetes-client.svg?branch=master 7 | 8 | Simplified [Kubernetes API](http://kubernetes.io/) client for Node.js. 9 | 10 | ## Installation 11 | 12 | Install via npm: 13 | 14 | ``` 15 | npm i kubernetes-client --save 16 | ``` 17 | 18 | ## Initializing 19 | 20 | kubernetes-client generates a Kubernetes API client at runtime based 21 | on a Swagger / OpenAPI specification. You can generate a client using 22 | the cluster's kubeconfig file and that cluster's API specification. 23 | 24 | To create the config required to make a client, you can either: 25 | 26 | let kubernetes-client configure automatically by trying the `KUBECONFIG` 27 | environment variable first, then `~/.kube/config`, then an in-cluster 28 | service account, and lastly settling on a default proxy configuration: 29 | 30 | ```js 31 | const client = new Client({ version: '1.13' }) 32 | ``` 33 | 34 | provide your own path to a file: 35 | 36 | ```js 37 | const { KubeConfig } = require('kubernetes-client') 38 | const kubeconfig = new KubeConfig() 39 | kubeconfig.loadFromFile('~/some/path') 40 | const Request = require('kubernetes-client/backends/request') 41 | 42 | const backend = new Request({ kubeconfig }) 43 | const client = new Client({ backend, version: '1.13' }) 44 | ``` 45 | 46 | provide a configuration object from memory: 47 | 48 | ```js 49 | // Should match the kubeconfig file format exactly 50 | const config = { 51 | apiVersion: 'v1', 52 | clusters: [], 53 | contexts: [], 54 | 'current-context': '', 55 | kind: 'Config', 56 | users: [] 57 | } 58 | const { KubeConfig } = require('kubernetes-client') 59 | const kubeconfig = new KubeConfig() 60 | kubeconfig.loadFromString(JSON.stringify(config)) 61 | 62 | const Request = require('kubernetes-client/backends/request') 63 | const backend = new Request({ kubeconfig }) 64 | const client = new Client({ backend, version: '1.13' }) 65 | ``` 66 | 67 | and you can also specify the context by setting it in the `kubeconfig` 68 | object: 69 | 70 | ```js 71 | kubeconfig.setCurrentContext('dev') 72 | ``` 73 | 74 | You can also elide the `.version` and pass an OpenAPI specification: 75 | 76 | ```js 77 | const spec = require('./swagger.json') 78 | const client = new Client({ spec }) 79 | ``` 80 | 81 | or load a specification dynamically from the kube-apiserver: 82 | 83 | ```js 84 | const client = new Client() 85 | await client.loadSpec() 86 | ``` 87 | 88 | See [Examples](#examples) for more configuration examples. 89 | 90 | ## Basic usage 91 | 92 | kubernetes-client translates Path Item Objects \[[1]\] (*e.g*., 93 | `/api/v1/namespaces`) to object chains ending in HTTP methods (*e.g.*, 94 | `api.v1.namespaces.get`). 95 | 96 | So, to fetch all Namespaces: 97 | 98 | ```js 99 | const namespaces = await client.api.v1.namespaces.get() 100 | ``` 101 | 102 | kubernetes-client translates Path Templating \[[2]\] (*e.g.*, 103 | `/apis/apps/v1/namespaces/{namespace}/deployments`) to function calls (*e.g.*, 104 | `apis.apps.v1.namespaces('default').deployments`). 105 | 106 | So, to create a new Deployment in the default Namespace: 107 | 108 | ```js 109 | const deploymentManifest = require('./nginx-deployment.json') 110 | const create = await client.apis.apps.v1.namespaces('default').deployments.post({ body: deploymentManifest }) 111 | ``` 112 | 113 | and then fetch your newly created Deployment: 114 | 115 | ```js 116 | const deployment = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).get() 117 | ``` 118 | 119 | and finally, remove the Deployment: 120 | 121 | ```js 122 | await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).delete() 123 | ``` 124 | 125 | kubernetes-client supports `.delete`, `.get`, `.patch`, `.post`, and `.put`. 126 | 127 | ## Documentation 128 | 129 | kubernetes-client generates documentation for the included 130 | specifications: 131 | 132 | * [Kubernetes API v1.10](docs/1.10/README.md) 133 | * [Kubernetes API v1.11](docs/1.11/README.md) 134 | * [Kubernetes API v1.12](docs/1.12/README.md) 135 | * [Kubernetes API v1.13](docs/1.13/README.md) 136 | 137 | ## TypeScript 138 | 139 | kubernetes-client includes a typings declartion file for Kubernetes 140 | API 1.13 and a complimentry `Client1_13` class: 141 | 142 | ```typescript 143 | import * as ApiClient from 'kubernetes-client'; 144 | 145 | const Client = ApiClient.Client1_13; 146 | const client = new Client({ version: '1.13' }); 147 | ``` 148 | 149 | When using TypeScript, kubernetes-client does not support dynamically 150 | generating a client via `.loadSpec()`. 151 | 152 | ## Examples 153 | 154 | [examples/](examples/) has snippets for using kubernetes-client: 155 | 156 | * The basic usage example from above: [basic.js](./examples/basic.js) 157 | * Use error handling to simulate `kubectl apply -f`: [apply-deploy.js](./examples/apply-deploy.js) 158 | * Create a `client` from your kube-apiserver's swagger.json: 159 | [client-from-apiserver-swagger.js](./examples/client-from-apiserver-swagger.js) 160 | * Create a `client` from one of the included Swagger specifications: 161 | [sync-client-version.js](./examples/sync-client-version.js) 162 | * Using resource aliases supported by `kubectl` (*e.g.*, `.po` vs 163 | `.pods`): [convenience-properties.js](./examples/convenience-properties.js) 164 | * Use watch endpoints to get a JSON stream of Deployment events: 165 | [watch.js](./examples/watch.js) 166 | * Extend the Kubernetes API and a `client` with a 167 | CustomerResourceDefinition: [using-crds.js](./examples/using-crds.js) 168 | * An extended CustomResourceDefinition example that implements a 169 | controller to "notify" on changes to Deployment objects: 170 | [deployment-notifier.js](./examples/deployment-notifier.js) 171 | * A basic canary controller that removes Pods from a Service if they 172 | log an error: [canary-controller.js](./examples/canary-controller.js) 173 | * Create a `client` using basic-auth: 174 | [basic-auth.js](./examples/basic-auth.js) 175 | * Create a `client` using IAM authenticator and cmd auth (works with Amazon EKS): 176 | [iam-auth.js](./examples/iam-auth.js) 177 | * Generate [badges](https://github.com/badges/shields) showing the 178 | status of your Deployments. Illustrates using the in-cluster config: 179 | [kubernetes-badges](https://github.com/silasbw/kubernetes-badges) 180 | * Create a deployment, patch a change, and rollback to the original version: 181 | [deployment-create-patch-rollback.js](./examples/deployment-create-patch-rollback.js) 182 | * Access [VerticalPodAutoscalers](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler): [vpas/](./examples/vpas) 183 | * Create a `client` using an in-cluster configuration: [in-cluster-auth.js](./examples/in-cluster-auth.js) 184 | 185 | ## Contributing 186 | 187 | See the kubernetes-client [Issues](./issues) if you're interested in 188 | helping out; and look over the [CONTRIBUTING.md](./CONTRIBUTING.md) 189 | before submitting new Issues and Pull Requests. 190 | 191 | ## Testing 192 | 193 | Run the unit tests: 194 | 195 | ``` 196 | npm test 197 | ``` 198 | 199 | The integration tests use the `current-context` in your kubeconfig file. Run the integration tests: 200 | 201 | ``` 202 | npm run test-integration 203 | ``` 204 | 205 | Run integration tests with the `@kubernetes/client-node` backend: 206 | 207 | ``` 208 | KUBERNETES_CLIENT_BACKEND=client-node npm run test-integration 209 | ``` 210 | 211 | ## References 212 | 213 | * [An Intuitive Node.js Client for the Kubernetes API](https://godaddy.github.io/2018/04/10/an-intuitive-nodejs-client-for-the-kubernetes-api/) 214 | * [Kubernetes Reference Documentation](https://kubernetes.io/docs/reference/) 215 | 216 | ## License 217 | 218 | [MIT](LICENSE) 219 | 220 | [1]: https://swagger.io/specification/#pathItemObject 221 | [2]: https://swagger.io/specification/#pathTemplating 222 | -------------------------------------------------------------------------------- /backends/.npmignore: -------------------------------------------------------------------------------- 1 | *.test.js 2 | *.test 3 | -------------------------------------------------------------------------------- /backends/kubernetes-client-node.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const camelCase = require('camelcase') 4 | const k8s = require('@kubernetes/client-node') 5 | const { PassThrough, Readable } = require('stream') 6 | 7 | // 8 | // https://github.com/kubernetes-client/javascript 9 | // 10 | class ClientNodeBackend { 11 | constructor (options) { 12 | this.client = options.client || k8s 13 | this.kubeconfig = options.kubeconfig 14 | this.apiClients = { } 15 | } 16 | 17 | _getApiClient (tag) { 18 | const apiType = camelCase(tag, { pascalCase: true }) + 'Api' 19 | if (!(apiType in this.apiClients)) { 20 | this.apiClients[apiType] = this.kubeconfig.makeApiClient(this.client[apiType]) 21 | } 22 | return this.apiClients[apiType] 23 | } 24 | 25 | getLogByteStream (options) { 26 | const log = new this.client.Log(this.kubeconfig) 27 | const qs = options.qs || options.parameters || {} 28 | const containerName = qs.container 29 | const stream = new PassThrough() 30 | 31 | // 32 | // node-client pipes to the log stream iff the apiserver returns 200. Assume 33 | // that if the stream is readable, then node-client has attached the pipe 34 | // and the call was successful. 35 | // 36 | // Otherwise, node-client calls the callback with an err. 37 | // 38 | // node-client also calls the callback when the connection terminates. We 39 | // ignore that. 40 | // 41 | return new Promise((resolve, reject) => { 42 | stream.once('readable', () => { 43 | resolve(stream) 44 | }) 45 | log.log(options.pathnameParameters.namespace, 46 | options.pathnameParameters.name, 47 | containerName, 48 | stream, 49 | err => { if (err) return reject(err) }, 50 | qs) 51 | }) 52 | } 53 | 54 | async getWatchObjectStream (options) { 55 | const watch = new this.client.Watch(this.kubeconfig) 56 | 57 | const stream = new Readable({ 58 | objectMode: true, 59 | read: () => { /* .watch callback pushes to stream below */ }, 60 | destroy: (err, cb) => { 61 | req.destroy(err) 62 | req.abort() 63 | cb(err) 64 | } 65 | }) 66 | 67 | const req = watch.watch( 68 | options.pathname, 69 | Object.assign({}, options.qs, options.parameters), 70 | (type, object) => stream.push({ type, object }), 71 | err => stream.destroy(err) 72 | ) 73 | 74 | return stream 75 | } 76 | 77 | http (options) { 78 | const pathItemObject = options.pathItemObject 79 | const operationObject = pathItemObject[options.method.toLowerCase()] 80 | const tag = operationObject.tags[0] 81 | 82 | const apiClient = this._getApiClient(tag) 83 | 84 | // 85 | // In older Kubernetes API OpenAPI specifications the Operation IDs include 86 | // the tag, but in newer versions (including the ones used to generate 87 | // @kubernetes/client-node), the tag is absent. 88 | // 89 | // Support older versions of the Swagger specifications by removing the tag 90 | // part. 91 | // 92 | const method = operationObject.operationId.replace(camelCase(tag, { pascalCase: true }), '') 93 | 94 | // 95 | // @kubernetes/client-node methods take parameters in the order the OpenAPI 96 | // specification declares them. 97 | // 98 | const parameterObjects = (pathItemObject.parameters || []).concat(operationObject.parameters || []) 99 | const orderedParameterObjects = parameterObjects 100 | .filter(parameterObject => parameterObject.required) 101 | .concat(parameterObjects 102 | .filter(parameterObject => !parameterObject.required)) 103 | 104 | // 105 | // Older versions of the Kubernetes API OpenAPI specifications requires body 106 | // for _some_ delete operations (e.g., deleteNamespacedDeployment). The API 107 | // does not actually require it and newer specifications remove the 108 | // requirement. Try to Workaround this issue by adding an empty body to 109 | // @kubernetes/client-node calls. 110 | // 111 | let body = options.body 112 | if (options.method.toLowerCase() === 'delete' && !body) { 113 | body = {} 114 | } 115 | 116 | const parameters = Object.assign( 117 | { body }, 118 | options.pathnameParameters, 119 | options.qs, 120 | options.parameters) 121 | const args = orderedParameterObjects.reduce((acc, operationParameter) => { 122 | const name = operationParameter.name 123 | if (name in parameters) { 124 | acc.push(parameters[name]) 125 | } else { 126 | acc.push(undefined) 127 | } 128 | return acc 129 | }, []) 130 | 131 | const extraOptions = {} 132 | if (options.headers) { 133 | extraOptions.headers = options.headers 134 | } 135 | args.push(extraOptions) 136 | 137 | return apiClient[method].apply(apiClient, args) 138 | .then(res => { 139 | res.statusCode = res.response.statusCode 140 | return res 141 | }) 142 | .catch(err => { 143 | if (!err.body) throw err 144 | const error = new Error(err.body.message) 145 | // .code is backwards compatible with pre-5.0.0 code. 146 | error.code = err.response.statusCode 147 | error.statusCode = err.response.statusCode 148 | throw error 149 | }) 150 | } 151 | } 152 | 153 | module.exports = ClientNodeBackend 154 | -------------------------------------------------------------------------------- /backends/kubernetes-client-node.test.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | /* eslint-env mocha */ 3 | 4 | const { expect } = require('chai') 5 | const sinon = require('sinon') 6 | 7 | const ClientNodeBackend = require('./kubernetes-client-node') 8 | 9 | describe('lib.backends.kubernetes-client-node', () => { 10 | it('calls the expected method', done => { 11 | const fakeK8sClient = { Core_v1Api: 'foo' } 12 | const fakeKubeconfig = { 13 | makeApiClient: sinon.spy(() => { 14 | return { 15 | getStuff: (bar, foo) => { 16 | return new Promise((resolve, reject) => { 17 | expect(bar).to.equal('bar') 18 | expect(foo).to.equal('foo') 19 | resolve({ 20 | response: { 21 | statusCode: 200 22 | } 23 | }) 24 | }) 25 | } 26 | } 27 | }) 28 | } 29 | 30 | const options = { 31 | method: 'GET', 32 | pathnameParameters: { 33 | foo: 'foo' 34 | }, 35 | parameters: { 36 | bar: 'bar' 37 | }, 38 | pathItemObject: { 39 | get: { 40 | operationId: 'getStuff', 41 | parameters: [{ 42 | name: 'foo' 43 | }], 44 | tags: ['core_v1'] 45 | }, 46 | parameters: [{ 47 | name: 'bar' 48 | }] 49 | } 50 | } 51 | 52 | const client = new ClientNodeBackend({ 53 | client: fakeK8sClient, 54 | kubeconfig: fakeKubeconfig 55 | }) 56 | 57 | client.http(options) 58 | .then(res => done()) 59 | .catch(done) 60 | }) 61 | }) 62 | -------------------------------------------------------------------------------- /backends/request/auth-providers/cmd.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Fetches a bearer token via comamnd 3 | */ 4 | 5 | 'use strict' 6 | 7 | // for API compatability 8 | /* eslint no-sync: 0 */ 9 | const spawnSync = require('child_process').spawnSync 10 | 11 | function getProperty (propertyName, object) { 12 | // remove leading . 13 | if (propertyName.match(/^\./)) { 14 | propertyName = propertyName.replace(/^\./, '') 15 | } 16 | 17 | const parts = propertyName.split('.') 18 | const length = parts.length 19 | 20 | let property = object || this 21 | for (let i = 0; i < length; i++) { 22 | property = property[parts[i]] 23 | } 24 | 25 | return property 26 | } 27 | 28 | module.exports = { 29 | refresh: function (config) { 30 | return new Promise((resolve, reject) => { 31 | const cmd = config['cmd-path'] 32 | const args = config['cmd-args'].split(' ') 33 | const cmdEnv = config['cmd-env'] 34 | 35 | let output 36 | 37 | if (process.platform === 'win32') { 38 | output = spawnSync(cmd, args, { 39 | env: Object.assign({}, process.env, cmdEnv), 40 | windowsHide: true, 41 | shell: true 42 | }) 43 | } else { 44 | output = spawnSync(cmd, args, { 45 | env: Object.assign({}, process.env, cmdEnv), 46 | windowsHide: true 47 | }) 48 | } 49 | 50 | let result 51 | try { 52 | result = JSON.parse(output.stdout.toString('utf8')) 53 | } catch (err) { 54 | return reject(new Error('Failed to run cmd.')) 55 | } 56 | 57 | const token = getProperty(config['token-key'].replace(/[{}]+/g, ''), result) 58 | 59 | return resolve(token) 60 | }) 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /backends/request/auth-providers/openid.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Refreshes a OpenID token. 3 | */ 4 | 5 | 'use strict' 6 | 7 | const Issuer = require('openid-client').Issuer 8 | 9 | module.exports = { 10 | refresh: function (config) { 11 | return new Promise((resolve, reject) => { 12 | Issuer.discover(config['idp-issuer-url']) 13 | .then(function (ourIssuer) { 14 | const client = new ourIssuer.Client({ 15 | client_id: config['client-id'], 16 | client_secret: config['client-secret'] 17 | }) 18 | 19 | return client.refresh(config['refresh-token']) 20 | }) 21 | .then(tokenSet => { 22 | return resolve(tokenSet.id_token) 23 | }) 24 | .catch(reject) 25 | }) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /backends/request/client.test.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 'use strict' 3 | 4 | const { expect } = require('chai') 5 | const nock = require('nock') 6 | 7 | const KubeConfig = require('../../lib/config') 8 | const Request = require('./client') 9 | 10 | const url = 'http://mock.kube.api' 11 | const kubeconfig = new KubeConfig() 12 | kubeconfig.loadFromClusterAndUser( 13 | { name: 'cluster', server: url }, 14 | { name: 'user' }) 15 | 16 | describe('lib.backends.request', () => { 17 | describe('Request', () => { 18 | it('handles empty responses', done => { 19 | nock(url) 20 | .get('/foo') 21 | .reply(200) 22 | 23 | const backend = new Request({ kubeconfig }) 24 | backend.http({ 25 | method: 'GET', 26 | pathname: '/foo' 27 | }).then(res => { 28 | expect(res.body).to.be.an('undefined') 29 | done() 30 | }) 31 | }) 32 | }) 33 | }) 34 | -------------------------------------------------------------------------------- /backends/request/config.test/fixtures/foo-auth-data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/kubernetes-client/9a57c1675e8a42dc838169c3b442566cee23b24d/backends/request/config.test/fixtures/foo-auth-data -------------------------------------------------------------------------------- /backends/request/config.test/fixtures/foo-cert-data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/kubernetes-client/9a57c1675e8a42dc838169c3b442566cee23b24d/backends/request/config.test/fixtures/foo-cert-data -------------------------------------------------------------------------------- /backends/request/config.test/fixtures/foo-cert-key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/kubernetes-client/9a57c1675e8a42dc838169c3b442566cee23b24d/backends/request/config.test/fixtures/foo-cert-key -------------------------------------------------------------------------------- /backends/request/config.test/fixtures/kube-fixture-two.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Config 3 | preferences: {} 4 | 5 | contexts: 6 | - context: 7 | cluster: foo-cluster-1 8 | namespace: ramp 9 | user: developer 10 | name: foo-ramp-up 11 | current-context: foo-ramp-up 12 | -------------------------------------------------------------------------------- /backends/request/config.test/fixtures/kube-fixture.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | clusters: 3 | - cluster: 4 | certificate-authority-data: foo-auth-data 5 | server: https://192.168.42.121:8443 6 | name: foo-cluster-1 7 | contexts: 8 | - context: 9 | cluster: foo-cluster-1 10 | namespace: default 11 | user: foo-user 12 | name: foo-context-1 13 | current-context: foo-context-1 14 | kind: Config 15 | preferences: {} 16 | users: 17 | - name: foo-user 18 | user: 19 | client-certificate-data: foo-cert-data 20 | client-key-data: foo-cert-key 21 | 22 | -------------------------------------------------------------------------------- /backends/request/index.js: -------------------------------------------------------------------------------- 1 | const Request = require('./client') 2 | 3 | Request.config = require('./config') 4 | 5 | module.exports = Request 6 | -------------------------------------------------------------------------------- /docs/1.10/Binding.md: -------------------------------------------------------------------------------- 1 | # Binding 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### api.v1.namespaces(namespace).pods(name).binding.post 8 | 9 | create binding of a Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the Binding | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.pretty` | If 'true', then the output is pretty printed. | 24 | 25 | #### Body 26 | 27 | | Parameter | Description | 28 | | --------- | ----------- | 29 | | `body` | #/definitions/io.k8s.api.core.v1.Binding | 30 | 31 | ### api.v1.namespaces(namespace).bindings.post 32 | 33 | create a Binding 34 | 35 | #### Path 36 | 37 | | Parameter | Description | 38 | | --------- | ----------- | 39 | | `namespace` | object name and auth scope, such as for teams and projects | 40 | 41 | #### Query 42 | 43 | | Parameter | Description | 44 | | --------- | ----------- | 45 | | `qs` | Querystring object | 46 | | `qs.pretty` | If 'true', then the output is pretty printed. | 47 | 48 | #### Body 49 | 50 | | Parameter | Description | 51 | | --------- | ----------- | 52 | | `body` | #/definitions/io.k8s.api.core.v1.Binding | 53 | 54 | -------------------------------------------------------------------------------- /docs/1.10/Cluster.md: -------------------------------------------------------------------------------- 1 | # Cluster 2 | 3 | * [misc operations](#misc) 4 | 5 | ## misc 6 | 7 | ### apis.autoscaling.v2beta1.get 8 | 9 | get available resources 10 | 11 | ### apis.autoscaling.v1.get 12 | 13 | get available resources 14 | 15 | ### apis.autoscaling.get 16 | 17 | get information of a group 18 | 19 | ### apis.apps.v1beta2.get 20 | 21 | get available resources 22 | 23 | ### apis.apps.v1beta1.get 24 | 25 | get available resources 26 | 27 | ### apis.apps.v1.get 28 | 29 | get available resources 30 | 31 | ### apis.apps.get 32 | 33 | get information of a group 34 | 35 | ### apis.rbac.authorization.k8s.io.v1beta1.get 36 | 37 | get available resources 38 | 39 | ### apis.rbac.authorization.k8s.io.v1alpha1.get 40 | 41 | get available resources 42 | 43 | ### apis.rbac.authorization.k8s.io.v1.get 44 | 45 | get available resources 46 | 47 | ### apis.rbac.authorization.k8s.io.get 48 | 49 | get information of a group 50 | 51 | ### apis.policy.v1beta1.get 52 | 53 | get available resources 54 | 55 | ### apis.policy.get 56 | 57 | get information of a group 58 | 59 | ### apis.networking.k8s.io.v1.get 60 | 61 | get available resources 62 | 63 | ### apis.networking.k8s.io.get 64 | 65 | get information of a group 66 | 67 | ### apis.extensions.v1beta1.get 68 | 69 | get available resources 70 | 71 | ### apis.extensions.get 72 | 73 | get information of a group 74 | 75 | ### apis.events.k8s.io.v1beta1.get 76 | 77 | get available resources 78 | 79 | ### apis.events.k8s.io.get 80 | 81 | get information of a group 82 | 83 | ### apis.batch.v2alpha1.get 84 | 85 | get available resources 86 | 87 | ### apis.batch.v1beta1.get 88 | 89 | get available resources 90 | 91 | ### apis.batch.v1.get 92 | 93 | get available resources 94 | 95 | ### apis.batch.get 96 | 97 | get information of a group 98 | 99 | ### apis.settings.k8s.io.v1alpha1.get 100 | 101 | get available resources 102 | 103 | ### apis.settings.k8s.io.get 104 | 105 | get information of a group 106 | 107 | ### apis.storage.k8s.io.v1beta1.get 108 | 109 | get available resources 110 | 111 | ### apis.storage.k8s.io.v1alpha1.get 112 | 113 | get available resources 114 | 115 | ### apis.storage.k8s.io.v1.get 116 | 117 | get available resources 118 | 119 | ### apis.storage.k8s.io.get 120 | 121 | get information of a group 122 | 123 | ### apis.scheduling.k8s.io.v1alpha1.get 124 | 125 | get available resources 126 | 127 | ### apis.scheduling.k8s.io.get 128 | 129 | get information of a group 130 | 131 | ### apis.apiregistration.k8s.io.v1beta1.get 132 | 133 | get available resources 134 | 135 | ### apis.apiregistration.k8s.io.v1.get 136 | 137 | get available resources 138 | 139 | ### apis.apiregistration.k8s.io.get 140 | 141 | get information of a group 142 | 143 | ### apis.apiextensions.k8s.io.v1beta1.get 144 | 145 | get available resources 146 | 147 | ### apis.apiextensions.k8s.io.get 148 | 149 | get information of a group 150 | 151 | ### apis.admissionregistration.k8s.io.v1beta1.get 152 | 153 | get available resources 154 | 155 | ### apis.admissionregistration.k8s.io.v1alpha1.get 156 | 157 | get available resources 158 | 159 | ### apis.admissionregistration.k8s.io.get 160 | 161 | get information of a group 162 | 163 | ### apis.certificates.k8s.io.v1beta1.get 164 | 165 | get available resources 166 | 167 | ### apis.certificates.k8s.io.get 168 | 169 | get information of a group 170 | 171 | ### apis.authorization.k8s.io.v1beta1.get 172 | 173 | get available resources 174 | 175 | ### apis.authorization.k8s.io.v1.get 176 | 177 | get available resources 178 | 179 | ### apis.authorization.k8s.io.get 180 | 181 | get information of a group 182 | 183 | ### apis.authentication.k8s.io.v1beta1.get 184 | 185 | get available resources 186 | 187 | ### apis.authentication.k8s.io.v1.get 188 | 189 | get available resources 190 | 191 | ### apis.authentication.k8s.io.get 192 | 193 | get information of a group 194 | 195 | ### apis.get 196 | 197 | get available API versions 198 | 199 | ### api.v1.get 200 | 201 | get available resources 202 | 203 | ### api.get 204 | 205 | get available API versions 206 | 207 | ### logs(logpath).get 208 | 209 | 210 | 211 | #### Path 212 | 213 | | Parameter | Description | 214 | | --------- | ----------- | 215 | | `logpath` | path to the log | 216 | 217 | ### logs.get 218 | 219 | 220 | 221 | ### version.get 222 | 223 | get the code version 224 | 225 | -------------------------------------------------------------------------------- /docs/1.10/ComponentStatus.md: -------------------------------------------------------------------------------- 1 | # ComponentStatus 2 | 3 | * [read operations](#read) 4 | 5 | ## read 6 | 7 | ### api.v1.componentstatuses(name).get 8 | 9 | read the specified ComponentStatus 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the ComponentStatus | 16 | 17 | #### Query 18 | 19 | | Parameter | Description | 20 | | --------- | ----------- | 21 | | `qs` | Querystring object | 22 | | `qs.pretty` | If 'true', then the output is pretty printed. | 23 | 24 | ### api.v1.componentstatuses.get 25 | 26 | list objects of kind ComponentStatus 27 | 28 | #### Query 29 | 30 | | Parameter | Description | 31 | | --------- | ----------- | 32 | | `qs` | Querystring object | 33 | | `qs.continue` | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | 34 | | `qs.fieldSelector` | A selector to restrict the list of returned objects by their fields. Defaults to everything. | 35 | | `qs.includeUninitialized` | If true, partially initialized resources are included in the response. | 36 | | `qs.labelSelector` | A selector to restrict the list of returned objects by their labels. Defaults to everything. | 37 | | `qs.limit` | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | 38 | | `qs.pretty` | If 'true', then the output is pretty printed. | 39 | | `qs.resourceVersion` | When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. | 40 | | `qs.timeoutSeconds` | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | 41 | | `qs.watch` | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | 42 | 43 | -------------------------------------------------------------------------------- /docs/1.10/DeploymentRollback.md: -------------------------------------------------------------------------------- 1 | # DeploymentRollback 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.apps.v1beta1.namespaces(namespace).deployments(name).rollback.post 8 | 9 | create rollback of a Deployment 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the DeploymentRollback | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.pretty` | If 'true', then the output is pretty printed. | 24 | 25 | #### Body 26 | 27 | | Parameter | Description | 28 | | --------- | ----------- | 29 | | `body` | #/definitions/io.k8s.api.apps.v1beta1.DeploymentRollback | 30 | 31 | ### apis.extensions.v1beta1.namespaces(namespace).deployments(name).rollback.post 32 | 33 | create rollback of a Deployment 34 | 35 | #### Path 36 | 37 | | Parameter | Description | 38 | | --------- | ----------- | 39 | | `name` | name of the DeploymentRollback | 40 | | `namespace` | object name and auth scope, such as for teams and projects | 41 | 42 | #### Query 43 | 44 | | Parameter | Description | 45 | | --------- | ----------- | 46 | | `qs` | Querystring object | 47 | | `qs.pretty` | If 'true', then the output is pretty printed. | 48 | 49 | #### Body 50 | 51 | | Parameter | Description | 52 | | --------- | ----------- | 53 | | `body` | #/definitions/io.k8s.api.extensions.v1beta1.DeploymentRollback | 54 | 55 | -------------------------------------------------------------------------------- /docs/1.10/Eviction.md: -------------------------------------------------------------------------------- 1 | # Eviction 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### api.v1.namespaces(namespace).pods(name).eviction.post 8 | 9 | create eviction of a Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the Eviction | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.pretty` | If 'true', then the output is pretty printed. | 24 | 25 | #### Body 26 | 27 | | Parameter | Description | 28 | | --------- | ----------- | 29 | | `body` | #/definitions/io.k8s.api.policy.v1beta1.Eviction | 30 | 31 | -------------------------------------------------------------------------------- /docs/1.10/LocalSubjectAccessReview.md: -------------------------------------------------------------------------------- 1 | # LocalSubjectAccessReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1beta1.namespaces(namespace).localsubjectaccessreviews.post 8 | 9 | create a LocalSubjectAccessReview 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `namespace` | object name and auth scope, such as for teams and projects | 16 | 17 | #### Query 18 | 19 | | Parameter | Description | 20 | | --------- | ----------- | 21 | | `qs` | Querystring object | 22 | | `qs.pretty` | If 'true', then the output is pretty printed. | 23 | 24 | #### Body 25 | 26 | | Parameter | Description | 27 | | --------- | ----------- | 28 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.LocalSubjectAccessReview | 29 | 30 | ### apis.authorization.k8s.io.v1.namespaces(namespace).localsubjectaccessreviews.post 31 | 32 | create a LocalSubjectAccessReview 33 | 34 | #### Path 35 | 36 | | Parameter | Description | 37 | | --------- | ----------- | 38 | | `namespace` | object name and auth scope, such as for teams and projects | 39 | 40 | #### Query 41 | 42 | | Parameter | Description | 43 | | --------- | ----------- | 44 | | `qs` | Querystring object | 45 | | `qs.pretty` | If 'true', then the output is pretty printed. | 46 | 47 | #### Body 48 | 49 | | Parameter | Description | 50 | | --------- | ----------- | 51 | | `body` | #/definitions/io.k8s.api.authorization.v1.LocalSubjectAccessReview | 52 | 53 | -------------------------------------------------------------------------------- /docs/1.10/README.md: -------------------------------------------------------------------------------- 1 | * [HorizontalPodAutoscaler](HorizontalPodAutoscaler.md) 2 | * [Cluster](Cluster.md) 3 | * [DaemonSet](DaemonSet.md) 4 | * [StatefulSet](StatefulSet.md) 5 | * [ReplicaSet](ReplicaSet.md) 6 | * [Deployment](Deployment.md) 7 | * [ControllerRevision](ControllerRevision.md) 8 | * [Scale](Scale.md) 9 | * [DeploymentRollback](DeploymentRollback.md) 10 | * [Role](Role.md) 11 | * [RoleBinding](RoleBinding.md) 12 | * [ClusterRole](ClusterRole.md) 13 | * [ClusterRoleBinding](ClusterRoleBinding.md) 14 | * [PodDisruptionBudget](PodDisruptionBudget.md) 15 | * [PodSecurityPolicy](PodSecurityPolicy.md) 16 | * [NetworkPolicy](NetworkPolicy.md) 17 | * [Ingress](Ingress.md) 18 | * [Event](Event.md) 19 | * [CronJob](CronJob.md) 20 | * [Job](Job.md) 21 | * [PodPreset](PodPreset.md) 22 | * [VolumeAttachment](VolumeAttachment.md) 23 | * [StorageClass](StorageClass.md) 24 | * [PriorityClass](PriorityClass.md) 25 | * [APIService](APIService.md) 26 | * [CustomResourceDefinition](CustomResourceDefinition.md) 27 | * [ValidatingWebhookConfiguration](ValidatingWebhookConfiguration.md) 28 | * [MutatingWebhookConfiguration](MutatingWebhookConfiguration.md) 29 | * [InitializerConfiguration](InitializerConfiguration.md) 30 | * [CertificateSigningRequest](CertificateSigningRequest.md) 31 | * [LocalSubjectAccessReview](LocalSubjectAccessReview.md) 32 | * [SelfSubjectAccessReview](SelfSubjectAccessReview.md) 33 | * [SelfSubjectRulesReview](SelfSubjectRulesReview.md) 34 | * [SubjectAccessReview](SubjectAccessReview.md) 35 | * [TokenReview](TokenReview.md) 36 | * [Pod](Pod.md) 37 | * [Binding](Binding.md) 38 | * [Eviction](Eviction.md) 39 | * [Service](Service.md) 40 | * [ReplicationController](ReplicationController.md) 41 | * [ResourceQuota](ResourceQuota.md) 42 | * [PersistentVolumeClaim](PersistentVolumeClaim.md) 43 | * [ConfigMap](ConfigMap.md) 44 | * [Endpoints](Endpoints.md) 45 | * [LimitRange](LimitRange.md) 46 | * [PodTemplate](PodTemplate.md) 47 | * [Secret](Secret.md) 48 | * [ServiceAccount](ServiceAccount.md) 49 | * [Namespace](Namespace.md) 50 | * [PersistentVolume](PersistentVolume.md) 51 | * [Node](Node.md) 52 | * [ComponentStatus](ComponentStatus.md) 53 | -------------------------------------------------------------------------------- /docs/1.10/SelfSubjectAccessReview.md: -------------------------------------------------------------------------------- 1 | # SelfSubjectAccessReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1beta1.selfsubjectaccessreviews.post 8 | 9 | create a SelfSubjectAccessReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.pretty` | If 'true', then the output is pretty printed. | 17 | 18 | #### Body 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.SelfSubjectAccessReview | 23 | 24 | ### apis.authorization.k8s.io.v1.selfsubjectaccessreviews.post 25 | 26 | create a SelfSubjectAccessReview 27 | 28 | #### Query 29 | 30 | | Parameter | Description | 31 | | --------- | ----------- | 32 | | `qs` | Querystring object | 33 | | `qs.pretty` | If 'true', then the output is pretty printed. | 34 | 35 | #### Body 36 | 37 | | Parameter | Description | 38 | | --------- | ----------- | 39 | | `body` | #/definitions/io.k8s.api.authorization.v1.SelfSubjectAccessReview | 40 | 41 | -------------------------------------------------------------------------------- /docs/1.10/SelfSubjectRulesReview.md: -------------------------------------------------------------------------------- 1 | # SelfSubjectRulesReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1beta1.selfsubjectrulesreviews.post 8 | 9 | create a SelfSubjectRulesReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.pretty` | If 'true', then the output is pretty printed. | 17 | 18 | #### Body 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.SelfSubjectRulesReview | 23 | 24 | ### apis.authorization.k8s.io.v1.selfsubjectrulesreviews.post 25 | 26 | create a SelfSubjectRulesReview 27 | 28 | #### Query 29 | 30 | | Parameter | Description | 31 | | --------- | ----------- | 32 | | `qs` | Querystring object | 33 | | `qs.pretty` | If 'true', then the output is pretty printed. | 34 | 35 | #### Body 36 | 37 | | Parameter | Description | 38 | | --------- | ----------- | 39 | | `body` | #/definitions/io.k8s.api.authorization.v1.SelfSubjectRulesReview | 40 | 41 | -------------------------------------------------------------------------------- /docs/1.10/SubjectAccessReview.md: -------------------------------------------------------------------------------- 1 | # SubjectAccessReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1beta1.subjectaccessreviews.post 8 | 9 | create a SubjectAccessReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.pretty` | If 'true', then the output is pretty printed. | 17 | 18 | #### Body 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.SubjectAccessReview | 23 | 24 | ### apis.authorization.k8s.io.v1.subjectaccessreviews.post 25 | 26 | create a SubjectAccessReview 27 | 28 | #### Query 29 | 30 | | Parameter | Description | 31 | | --------- | ----------- | 32 | | `qs` | Querystring object | 33 | | `qs.pretty` | If 'true', then the output is pretty printed. | 34 | 35 | #### Body 36 | 37 | | Parameter | Description | 38 | | --------- | ----------- | 39 | | `body` | #/definitions/io.k8s.api.authorization.v1.SubjectAccessReview | 40 | 41 | -------------------------------------------------------------------------------- /docs/1.10/TokenReview.md: -------------------------------------------------------------------------------- 1 | # TokenReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authentication.k8s.io.v1beta1.tokenreviews.post 8 | 9 | create a TokenReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.pretty` | If 'true', then the output is pretty printed. | 17 | 18 | #### Body 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `body` | #/definitions/io.k8s.api.authentication.v1beta1.TokenReview | 23 | 24 | ### apis.authentication.k8s.io.v1.tokenreviews.post 25 | 26 | create a TokenReview 27 | 28 | #### Query 29 | 30 | | Parameter | Description | 31 | | --------- | ----------- | 32 | | `qs` | Querystring object | 33 | | `qs.pretty` | If 'true', then the output is pretty printed. | 34 | 35 | #### Body 36 | 37 | | Parameter | Description | 38 | | --------- | ----------- | 39 | | `body` | #/definitions/io.k8s.api.authentication.v1.TokenReview | 40 | 41 | -------------------------------------------------------------------------------- /docs/1.11/Binding.md: -------------------------------------------------------------------------------- 1 | # Binding 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### api.v1.namespaces(namespace).pods(name).binding.post 8 | 9 | create binding of a Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the Binding | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.pretty` | If 'true', then the output is pretty printed. | 24 | 25 | #### Body 26 | 27 | | Parameter | Description | 28 | | --------- | ----------- | 29 | | `body` | #/definitions/io.k8s.api.core.v1.Binding | 30 | 31 | ### api.v1.namespaces(namespace).bindings.post 32 | 33 | create a Binding 34 | 35 | #### Path 36 | 37 | | Parameter | Description | 38 | | --------- | ----------- | 39 | | `namespace` | object name and auth scope, such as for teams and projects | 40 | 41 | #### Query 42 | 43 | | Parameter | Description | 44 | | --------- | ----------- | 45 | | `qs` | Querystring object | 46 | | `qs.pretty` | If 'true', then the output is pretty printed. | 47 | 48 | #### Body 49 | 50 | | Parameter | Description | 51 | | --------- | ----------- | 52 | | `body` | #/definitions/io.k8s.api.core.v1.Binding | 53 | 54 | -------------------------------------------------------------------------------- /docs/1.11/Cluster.md: -------------------------------------------------------------------------------- 1 | # Cluster 2 | 3 | * [misc operations](#misc) 4 | 5 | ## misc 6 | 7 | ### apis.apps.v1.get 8 | 9 | get available resources 10 | 11 | ### apis.apps.v1beta1.get 12 | 13 | get available resources 14 | 15 | ### apis.apps.v1beta2.get 16 | 17 | get available resources 18 | 19 | ### apis.apps.get 20 | 21 | get information of a group 22 | 23 | ### apis.events.k8s.io.v1beta1.get 24 | 25 | get available resources 26 | 27 | ### apis.events.k8s.io.get 28 | 29 | get information of a group 30 | 31 | ### apis.rbac.authorization.k8s.io.v1beta1.get 32 | 33 | get available resources 34 | 35 | ### apis.rbac.authorization.k8s.io.v1alpha1.get 36 | 37 | get available resources 38 | 39 | ### apis.rbac.authorization.k8s.io.v1.get 40 | 41 | get available resources 42 | 43 | ### apis.rbac.authorization.k8s.io.get 44 | 45 | get information of a group 46 | 47 | ### apis.policy.v1beta1.get 48 | 49 | get available resources 50 | 51 | ### apis.policy.get 52 | 53 | get information of a group 54 | 55 | ### apis.networking.k8s.io.v1.get 56 | 57 | get available resources 58 | 59 | ### apis.networking.k8s.io.get 60 | 61 | get information of a group 62 | 63 | ### apis.extensions.v1beta1.get 64 | 65 | get available resources 66 | 67 | ### apis.extensions.get 68 | 69 | get information of a group 70 | 71 | ### apis.settings.k8s.io.v1alpha1.get 72 | 73 | get available resources 74 | 75 | ### apis.settings.k8s.io.get 76 | 77 | get information of a group 78 | 79 | ### apis.batch.v2alpha1.get 80 | 81 | get available resources 82 | 83 | ### apis.batch.v1beta1.get 84 | 85 | get available resources 86 | 87 | ### apis.batch.v1.get 88 | 89 | get available resources 90 | 91 | ### apis.batch.get 92 | 93 | get information of a group 94 | 95 | ### apis.autoscaling.v2beta1.get 96 | 97 | get available resources 98 | 99 | ### apis.autoscaling.v1.get 100 | 101 | get available resources 102 | 103 | ### apis.autoscaling.get 104 | 105 | get information of a group 106 | 107 | ### apis.certificates.k8s.io.v1beta1.get 108 | 109 | get available resources 110 | 111 | ### apis.certificates.k8s.io.get 112 | 113 | get information of a group 114 | 115 | ### apis.storage.k8s.io.v1.get 116 | 117 | get available resources 118 | 119 | ### apis.storage.k8s.io.v1beta1.get 120 | 121 | get available resources 122 | 123 | ### apis.storage.k8s.io.v1alpha1.get 124 | 125 | get available resources 126 | 127 | ### apis.storage.k8s.io.get 128 | 129 | get information of a group 130 | 131 | ### apis.admissionregistration.k8s.io.v1alpha1.get 132 | 133 | get available resources 134 | 135 | ### apis.admissionregistration.k8s.io.v1beta1.get 136 | 137 | get available resources 138 | 139 | ### apis.admissionregistration.k8s.io.get 140 | 141 | get information of a group 142 | 143 | ### apis.apiextensions.k8s.io.v1beta1.get 144 | 145 | get available resources 146 | 147 | ### apis.apiextensions.k8s.io.get 148 | 149 | get information of a group 150 | 151 | ### apis.apiregistration.k8s.io.v1.get 152 | 153 | get available resources 154 | 155 | ### apis.apiregistration.k8s.io.v1beta1.get 156 | 157 | get available resources 158 | 159 | ### apis.apiregistration.k8s.io.get 160 | 161 | get information of a group 162 | 163 | ### apis.scheduling.k8s.io.v1beta1.get 164 | 165 | get available resources 166 | 167 | ### apis.scheduling.k8s.io.v1alpha1.get 168 | 169 | get available resources 170 | 171 | ### apis.scheduling.k8s.io.get 172 | 173 | get information of a group 174 | 175 | ### apis.authorization.k8s.io.v1beta1.get 176 | 177 | get available resources 178 | 179 | ### apis.authorization.k8s.io.v1.get 180 | 181 | get available resources 182 | 183 | ### apis.authorization.k8s.io.get 184 | 185 | get information of a group 186 | 187 | ### apis.authentication.k8s.io.v1beta1.get 188 | 189 | get available resources 190 | 191 | ### apis.authentication.k8s.io.v1.get 192 | 193 | get available resources 194 | 195 | ### apis.authentication.k8s.io.get 196 | 197 | get information of a group 198 | 199 | ### apis.get 200 | 201 | get available API versions 202 | 203 | ### api.v1.get 204 | 205 | get available resources 206 | 207 | ### api.get 208 | 209 | get available API versions 210 | 211 | ### logs(logpath).get 212 | 213 | 214 | 215 | #### Path 216 | 217 | | Parameter | Description | 218 | | --------- | ----------- | 219 | | `logpath` | path to the log | 220 | 221 | ### logs.get 222 | 223 | 224 | 225 | ### version.get 226 | 227 | get the code version 228 | 229 | -------------------------------------------------------------------------------- /docs/1.11/ComponentStatus.md: -------------------------------------------------------------------------------- 1 | # ComponentStatus 2 | 3 | * [read operations](#read) 4 | 5 | ## read 6 | 7 | ### api.v1.componentstatuses(name).get 8 | 9 | read the specified ComponentStatus 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the ComponentStatus | 16 | 17 | #### Query 18 | 19 | | Parameter | Description | 20 | | --------- | ----------- | 21 | | `qs` | Querystring object | 22 | | `qs.pretty` | If 'true', then the output is pretty printed. | 23 | 24 | ### api.v1.componentstatuses.get 25 | 26 | list objects of kind ComponentStatus 27 | 28 | #### Query 29 | 30 | | Parameter | Description | 31 | | --------- | ----------- | 32 | | `qs` | Querystring object | 33 | | `qs.continue` | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | 34 | | `qs.fieldSelector` | A selector to restrict the list of returned objects by their fields. Defaults to everything. | 35 | | `qs.includeUninitialized` | If true, partially initialized resources are included in the response. | 36 | | `qs.labelSelector` | A selector to restrict the list of returned objects by their labels. Defaults to everything. | 37 | | `qs.limit` | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | 38 | | `qs.pretty` | If 'true', then the output is pretty printed. | 39 | | `qs.resourceVersion` | When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. | 40 | | `qs.timeoutSeconds` | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | 41 | | `qs.watch` | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | 42 | 43 | -------------------------------------------------------------------------------- /docs/1.11/DeploymentRollback.md: -------------------------------------------------------------------------------- 1 | # DeploymentRollback 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.apps.v1beta1.namespaces(namespace).deployments(name).rollback.post 8 | 9 | create rollback of a Deployment 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the DeploymentRollback | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.pretty` | If 'true', then the output is pretty printed. | 24 | 25 | #### Body 26 | 27 | | Parameter | Description | 28 | | --------- | ----------- | 29 | | `body` | #/definitions/io.k8s.api.apps.v1beta1.DeploymentRollback | 30 | 31 | ### apis.extensions.v1beta1.namespaces(namespace).deployments(name).rollback.post 32 | 33 | create rollback of a Deployment 34 | 35 | #### Path 36 | 37 | | Parameter | Description | 38 | | --------- | ----------- | 39 | | `name` | name of the DeploymentRollback | 40 | | `namespace` | object name and auth scope, such as for teams and projects | 41 | 42 | #### Query 43 | 44 | | Parameter | Description | 45 | | --------- | ----------- | 46 | | `qs` | Querystring object | 47 | | `qs.pretty` | If 'true', then the output is pretty printed. | 48 | 49 | #### Body 50 | 51 | | Parameter | Description | 52 | | --------- | ----------- | 53 | | `body` | #/definitions/io.k8s.api.extensions.v1beta1.DeploymentRollback | 54 | 55 | -------------------------------------------------------------------------------- /docs/1.11/Eviction.md: -------------------------------------------------------------------------------- 1 | # Eviction 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### api.v1.namespaces(namespace).pods(name).eviction.post 8 | 9 | create eviction of a Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the Eviction | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.pretty` | If 'true', then the output is pretty printed. | 24 | 25 | #### Body 26 | 27 | | Parameter | Description | 28 | | --------- | ----------- | 29 | | `body` | #/definitions/io.k8s.api.policy.v1beta1.Eviction | 30 | 31 | -------------------------------------------------------------------------------- /docs/1.11/LocalSubjectAccessReview.md: -------------------------------------------------------------------------------- 1 | # LocalSubjectAccessReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1beta1.namespaces(namespace).localsubjectaccessreviews.post 8 | 9 | create a LocalSubjectAccessReview 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `namespace` | object name and auth scope, such as for teams and projects | 16 | 17 | #### Query 18 | 19 | | Parameter | Description | 20 | | --------- | ----------- | 21 | | `qs` | Querystring object | 22 | | `qs.pretty` | If 'true', then the output is pretty printed. | 23 | 24 | #### Body 25 | 26 | | Parameter | Description | 27 | | --------- | ----------- | 28 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.LocalSubjectAccessReview | 29 | 30 | ### apis.authorization.k8s.io.v1.namespaces(namespace).localsubjectaccessreviews.post 31 | 32 | create a LocalSubjectAccessReview 33 | 34 | #### Path 35 | 36 | | Parameter | Description | 37 | | --------- | ----------- | 38 | | `namespace` | object name and auth scope, such as for teams and projects | 39 | 40 | #### Query 41 | 42 | | Parameter | Description | 43 | | --------- | ----------- | 44 | | `qs` | Querystring object | 45 | | `qs.pretty` | If 'true', then the output is pretty printed. | 46 | 47 | #### Body 48 | 49 | | Parameter | Description | 50 | | --------- | ----------- | 51 | | `body` | #/definitions/io.k8s.api.authorization.v1.LocalSubjectAccessReview | 52 | 53 | -------------------------------------------------------------------------------- /docs/1.11/README.md: -------------------------------------------------------------------------------- 1 | * [ControllerRevision](ControllerRevision.md) 2 | * [DaemonSet](DaemonSet.md) 3 | * [Deployment](Deployment.md) 4 | * [ReplicaSet](ReplicaSet.md) 5 | * [StatefulSet](StatefulSet.md) 6 | * [Scale](Scale.md) 7 | * [Cluster](Cluster.md) 8 | * [DeploymentRollback](DeploymentRollback.md) 9 | * [Event](Event.md) 10 | * [RoleBinding](RoleBinding.md) 11 | * [Role](Role.md) 12 | * [ClusterRole](ClusterRole.md) 13 | * [ClusterRoleBinding](ClusterRoleBinding.md) 14 | * [PodDisruptionBudget](PodDisruptionBudget.md) 15 | * [PodSecurityPolicy](PodSecurityPolicy.md) 16 | * [NetworkPolicy](NetworkPolicy.md) 17 | * [Ingress](Ingress.md) 18 | * [PodPreset](PodPreset.md) 19 | * [CronJob](CronJob.md) 20 | * [Job](Job.md) 21 | * [HorizontalPodAutoscaler](HorizontalPodAutoscaler.md) 22 | * [CertificateSigningRequest](CertificateSigningRequest.md) 23 | * [StorageClass](StorageClass.md) 24 | * [VolumeAttachment](VolumeAttachment.md) 25 | * [InitializerConfiguration](InitializerConfiguration.md) 26 | * [MutatingWebhookConfiguration](MutatingWebhookConfiguration.md) 27 | * [ValidatingWebhookConfiguration](ValidatingWebhookConfiguration.md) 28 | * [CustomResourceDefinition](CustomResourceDefinition.md) 29 | * [APIService](APIService.md) 30 | * [PriorityClass](PriorityClass.md) 31 | * [LocalSubjectAccessReview](LocalSubjectAccessReview.md) 32 | * [SelfSubjectAccessReview](SelfSubjectAccessReview.md) 33 | * [SelfSubjectRulesReview](SelfSubjectRulesReview.md) 34 | * [SubjectAccessReview](SubjectAccessReview.md) 35 | * [TokenReview](TokenReview.md) 36 | * [Pod](Pod.md) 37 | * [Binding](Binding.md) 38 | * [Eviction](Eviction.md) 39 | * [Service](Service.md) 40 | * [ReplicationController](ReplicationController.md) 41 | * [ResourceQuota](ResourceQuota.md) 42 | * [PersistentVolumeClaim](PersistentVolumeClaim.md) 43 | * [LimitRange](LimitRange.md) 44 | * [PodTemplate](PodTemplate.md) 45 | * [Secret](Secret.md) 46 | * [ServiceAccount](ServiceAccount.md) 47 | * [ConfigMap](ConfigMap.md) 48 | * [Endpoints](Endpoints.md) 49 | * [Namespace](Namespace.md) 50 | * [Node](Node.md) 51 | * [PersistentVolume](PersistentVolume.md) 52 | * [ComponentStatus](ComponentStatus.md) 53 | -------------------------------------------------------------------------------- /docs/1.11/SelfSubjectAccessReview.md: -------------------------------------------------------------------------------- 1 | # SelfSubjectAccessReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1beta1.selfsubjectaccessreviews.post 8 | 9 | create a SelfSubjectAccessReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.pretty` | If 'true', then the output is pretty printed. | 17 | 18 | #### Body 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.SelfSubjectAccessReview | 23 | 24 | ### apis.authorization.k8s.io.v1.selfsubjectaccessreviews.post 25 | 26 | create a SelfSubjectAccessReview 27 | 28 | #### Query 29 | 30 | | Parameter | Description | 31 | | --------- | ----------- | 32 | | `qs` | Querystring object | 33 | | `qs.pretty` | If 'true', then the output is pretty printed. | 34 | 35 | #### Body 36 | 37 | | Parameter | Description | 38 | | --------- | ----------- | 39 | | `body` | #/definitions/io.k8s.api.authorization.v1.SelfSubjectAccessReview | 40 | 41 | -------------------------------------------------------------------------------- /docs/1.11/SelfSubjectRulesReview.md: -------------------------------------------------------------------------------- 1 | # SelfSubjectRulesReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1beta1.selfsubjectrulesreviews.post 8 | 9 | create a SelfSubjectRulesReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.pretty` | If 'true', then the output is pretty printed. | 17 | 18 | #### Body 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.SelfSubjectRulesReview | 23 | 24 | ### apis.authorization.k8s.io.v1.selfsubjectrulesreviews.post 25 | 26 | create a SelfSubjectRulesReview 27 | 28 | #### Query 29 | 30 | | Parameter | Description | 31 | | --------- | ----------- | 32 | | `qs` | Querystring object | 33 | | `qs.pretty` | If 'true', then the output is pretty printed. | 34 | 35 | #### Body 36 | 37 | | Parameter | Description | 38 | | --------- | ----------- | 39 | | `body` | #/definitions/io.k8s.api.authorization.v1.SelfSubjectRulesReview | 40 | 41 | -------------------------------------------------------------------------------- /docs/1.11/SubjectAccessReview.md: -------------------------------------------------------------------------------- 1 | # SubjectAccessReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1beta1.subjectaccessreviews.post 8 | 9 | create a SubjectAccessReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.pretty` | If 'true', then the output is pretty printed. | 17 | 18 | #### Body 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.SubjectAccessReview | 23 | 24 | ### apis.authorization.k8s.io.v1.subjectaccessreviews.post 25 | 26 | create a SubjectAccessReview 27 | 28 | #### Query 29 | 30 | | Parameter | Description | 31 | | --------- | ----------- | 32 | | `qs` | Querystring object | 33 | | `qs.pretty` | If 'true', then the output is pretty printed. | 34 | 35 | #### Body 36 | 37 | | Parameter | Description | 38 | | --------- | ----------- | 39 | | `body` | #/definitions/io.k8s.api.authorization.v1.SubjectAccessReview | 40 | 41 | -------------------------------------------------------------------------------- /docs/1.11/TokenReview.md: -------------------------------------------------------------------------------- 1 | # TokenReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authentication.k8s.io.v1beta1.tokenreviews.post 8 | 9 | create a TokenReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.pretty` | If 'true', then the output is pretty printed. | 17 | 18 | #### Body 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `body` | #/definitions/io.k8s.api.authentication.v1beta1.TokenReview | 23 | 24 | ### apis.authentication.k8s.io.v1.tokenreviews.post 25 | 26 | create a TokenReview 27 | 28 | #### Query 29 | 30 | | Parameter | Description | 31 | | --------- | ----------- | 32 | | `qs` | Querystring object | 33 | | `qs.pretty` | If 'true', then the output is pretty printed. | 34 | 35 | #### Body 36 | 37 | | Parameter | Description | 38 | | --------- | ----------- | 39 | | `body` | #/definitions/io.k8s.api.authentication.v1.TokenReview | 40 | 41 | -------------------------------------------------------------------------------- /docs/1.12/Binding.md: -------------------------------------------------------------------------------- 1 | # Binding 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### api.v1.namespaces(namespace).pods(name).binding.post 8 | 9 | create binding of a Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the Binding | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 24 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 25 | | `qs.pretty` | If 'true', then the output is pretty printed. | 26 | 27 | #### Body 28 | 29 | | Parameter | Description | 30 | | --------- | ----------- | 31 | | `body` | #/definitions/io.k8s.api.core.v1.Binding | 32 | 33 | ### api.v1.namespaces(namespace).bindings.post 34 | 35 | create a Binding 36 | 37 | #### Path 38 | 39 | | Parameter | Description | 40 | | --------- | ----------- | 41 | | `namespace` | object name and auth scope, such as for teams and projects | 42 | 43 | #### Query 44 | 45 | | Parameter | Description | 46 | | --------- | ----------- | 47 | | `qs` | Querystring object | 48 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 49 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 50 | | `qs.pretty` | If 'true', then the output is pretty printed. | 51 | 52 | #### Body 53 | 54 | | Parameter | Description | 55 | | --------- | ----------- | 56 | | `body` | #/definitions/io.k8s.api.core.v1.Binding | 57 | 58 | -------------------------------------------------------------------------------- /docs/1.12/Cluster.md: -------------------------------------------------------------------------------- 1 | # Cluster 2 | 3 | * [misc operations](#misc) 4 | 5 | ## misc 6 | 7 | ### apis.apps.v1beta1.get 8 | 9 | get available resources 10 | 11 | ### apis.apps.v1.get 12 | 13 | get available resources 14 | 15 | ### apis.apps.v1beta2.get 16 | 17 | get available resources 18 | 19 | ### apis.apps.get 20 | 21 | get information of a group 22 | 23 | ### apis.rbac.authorization.k8s.io.v1alpha1.get 24 | 25 | get available resources 26 | 27 | ### apis.rbac.authorization.k8s.io.v1.get 28 | 29 | get available resources 30 | 31 | ### apis.rbac.authorization.k8s.io.v1beta1.get 32 | 33 | get available resources 34 | 35 | ### apis.rbac.authorization.k8s.io.get 36 | 37 | get information of a group 38 | 39 | ### apis.policy.v1beta1.get 40 | 41 | get available resources 42 | 43 | ### apis.policy.get 44 | 45 | get information of a group 46 | 47 | ### apis.networking.k8s.io.v1.get 48 | 49 | get available resources 50 | 51 | ### apis.networking.k8s.io.get 52 | 53 | get information of a group 54 | 55 | ### apis.settings.k8s.io.v1alpha1.get 56 | 57 | get available resources 58 | 59 | ### apis.settings.k8s.io.get 60 | 61 | get information of a group 62 | 63 | ### apis.extensions.v1beta1.get 64 | 65 | get available resources 66 | 67 | ### apis.extensions.get 68 | 69 | get information of a group 70 | 71 | ### apis.autoscaling.v1.get 72 | 73 | get available resources 74 | 75 | ### apis.autoscaling.v2beta1.get 76 | 77 | get available resources 78 | 79 | ### apis.autoscaling.v2beta2.get 80 | 81 | get available resources 82 | 83 | ### apis.autoscaling.get 84 | 85 | get information of a group 86 | 87 | ### apis.events.k8s.io.v1beta1.get 88 | 89 | get available resources 90 | 91 | ### apis.events.k8s.io.get 92 | 93 | get information of a group 94 | 95 | ### apis.batch.v1.get 96 | 97 | get available resources 98 | 99 | ### apis.batch.v1beta1.get 100 | 101 | get available resources 102 | 103 | ### apis.batch.v2alpha1.get 104 | 105 | get available resources 106 | 107 | ### apis.batch.get 108 | 109 | get information of a group 110 | 111 | ### apis.coordination.k8s.io.v1beta1.get 112 | 113 | get available resources 114 | 115 | ### apis.coordination.k8s.io.get 116 | 117 | get information of a group 118 | 119 | ### apis.apiregistration.k8s.io.v1.get 120 | 121 | get available resources 122 | 123 | ### apis.apiregistration.k8s.io.v1beta1.get 124 | 125 | get available resources 126 | 127 | ### apis.apiregistration.k8s.io.get 128 | 129 | get information of a group 130 | 131 | ### apis.storage.k8s.io.v1.get 132 | 133 | get available resources 134 | 135 | ### apis.storage.k8s.io.v1beta1.get 136 | 137 | get available resources 138 | 139 | ### apis.storage.k8s.io.v1alpha1.get 140 | 141 | get available resources 142 | 143 | ### apis.storage.k8s.io.get 144 | 145 | get information of a group 146 | 147 | ### apis.scheduling.k8s.io.v1alpha1.get 148 | 149 | get available resources 150 | 151 | ### apis.scheduling.k8s.io.v1beta1.get 152 | 153 | get available resources 154 | 155 | ### apis.scheduling.k8s.io.get 156 | 157 | get information of a group 158 | 159 | ### apis.authorization.k8s.io.v1.get 160 | 161 | get available resources 162 | 163 | ### apis.authorization.k8s.io.v1beta1.get 164 | 165 | get available resources 166 | 167 | ### apis.authorization.k8s.io.get 168 | 169 | get information of a group 170 | 171 | ### apis.admissionregistration.k8s.io.v1alpha1.get 172 | 173 | get available resources 174 | 175 | ### apis.admissionregistration.k8s.io.v1beta1.get 176 | 177 | get available resources 178 | 179 | ### apis.admissionregistration.k8s.io.get 180 | 181 | get information of a group 182 | 183 | ### apis.apiextensions.k8s.io.v1beta1.get 184 | 185 | get available resources 186 | 187 | ### apis.apiextensions.k8s.io.get 188 | 189 | get information of a group 190 | 191 | ### apis.certificates.k8s.io.v1beta1.get 192 | 193 | get available resources 194 | 195 | ### apis.certificates.k8s.io.get 196 | 197 | get information of a group 198 | 199 | ### apis.authentication.k8s.io.v1beta1.get 200 | 201 | get available resources 202 | 203 | ### apis.authentication.k8s.io.v1.get 204 | 205 | get available resources 206 | 207 | ### apis.authentication.k8s.io.get 208 | 209 | get information of a group 210 | 211 | ### apis.get 212 | 213 | get available API versions 214 | 215 | ### api.v1.get 216 | 217 | get available resources 218 | 219 | ### api.get 220 | 221 | get available API versions 222 | 223 | ### logs(logpath).get 224 | 225 | 226 | 227 | #### Path 228 | 229 | | Parameter | Description | 230 | | --------- | ----------- | 231 | | `logpath` | path to the log | 232 | 233 | ### logs.get 234 | 235 | 236 | 237 | ### version.get 238 | 239 | get the code version 240 | 241 | -------------------------------------------------------------------------------- /docs/1.12/ComponentStatus.md: -------------------------------------------------------------------------------- 1 | # ComponentStatus 2 | 3 | * [read operations](#read) 4 | 5 | ## read 6 | 7 | ### api.v1.componentstatuses(name).get 8 | 9 | read the specified ComponentStatus 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the ComponentStatus | 16 | 17 | #### Query 18 | 19 | | Parameter | Description | 20 | | --------- | ----------- | 21 | | `qs` | Querystring object | 22 | | `qs.pretty` | If 'true', then the output is pretty printed. | 23 | 24 | ### api.v1.componentstatuses.get 25 | 26 | list objects of kind ComponentStatus 27 | 28 | #### Query 29 | 30 | | Parameter | Description | 31 | | --------- | ----------- | 32 | | `qs` | Querystring object | 33 | | `qs.continue` | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the "next key".

This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | 34 | | `qs.fieldSelector` | A selector to restrict the list of returned objects by their fields. Defaults to everything. | 35 | | `qs.includeUninitialized` | If true, partially initialized resources are included in the response. | 36 | | `qs.labelSelector` | A selector to restrict the list of returned objects by their labels. Defaults to everything. | 37 | | `qs.limit` | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | 38 | | `qs.pretty` | If 'true', then the output is pretty printed. | 39 | | `qs.resourceVersion` | When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. | 40 | | `qs.timeoutSeconds` | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | 41 | | `qs.watch` | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | 42 | 43 | -------------------------------------------------------------------------------- /docs/1.12/DeploymentRollback.md: -------------------------------------------------------------------------------- 1 | # DeploymentRollback 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.apps.v1beta1.namespaces(namespace).deployments(name).rollback.post 8 | 9 | create rollback of a Deployment 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the DeploymentRollback | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 24 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 25 | | `qs.pretty` | If 'true', then the output is pretty printed. | 26 | 27 | #### Body 28 | 29 | | Parameter | Description | 30 | | --------- | ----------- | 31 | | `body` | #/definitions/io.k8s.api.apps.v1beta1.DeploymentRollback | 32 | 33 | ### apis.extensions.v1beta1.namespaces(namespace).deployments(name).rollback.post 34 | 35 | create rollback of a Deployment 36 | 37 | #### Path 38 | 39 | | Parameter | Description | 40 | | --------- | ----------- | 41 | | `name` | name of the DeploymentRollback | 42 | | `namespace` | object name and auth scope, such as for teams and projects | 43 | 44 | #### Query 45 | 46 | | Parameter | Description | 47 | | --------- | ----------- | 48 | | `qs` | Querystring object | 49 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 50 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 51 | | `qs.pretty` | If 'true', then the output is pretty printed. | 52 | 53 | #### Body 54 | 55 | | Parameter | Description | 56 | | --------- | ----------- | 57 | | `body` | #/definitions/io.k8s.api.extensions.v1beta1.DeploymentRollback | 58 | 59 | -------------------------------------------------------------------------------- /docs/1.12/Eviction.md: -------------------------------------------------------------------------------- 1 | # Eviction 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### api.v1.namespaces(namespace).pods(name).eviction.post 8 | 9 | create eviction of a Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the Eviction | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 24 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 25 | | `qs.pretty` | If 'true', then the output is pretty printed. | 26 | 27 | #### Body 28 | 29 | | Parameter | Description | 30 | | --------- | ----------- | 31 | | `body` | #/definitions/io.k8s.api.policy.v1beta1.Eviction | 32 | 33 | -------------------------------------------------------------------------------- /docs/1.12/LocalSubjectAccessReview.md: -------------------------------------------------------------------------------- 1 | # LocalSubjectAccessReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1.namespaces(namespace).localsubjectaccessreviews.post 8 | 9 | create a LocalSubjectAccessReview 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `namespace` | object name and auth scope, such as for teams and projects | 16 | 17 | #### Query 18 | 19 | | Parameter | Description | 20 | | --------- | ----------- | 21 | | `qs` | Querystring object | 22 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 23 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 24 | | `qs.pretty` | If 'true', then the output is pretty printed. | 25 | 26 | #### Body 27 | 28 | | Parameter | Description | 29 | | --------- | ----------- | 30 | | `body` | #/definitions/io.k8s.api.authorization.v1.LocalSubjectAccessReview | 31 | 32 | ### apis.authorization.k8s.io.v1beta1.namespaces(namespace).localsubjectaccessreviews.post 33 | 34 | create a LocalSubjectAccessReview 35 | 36 | #### Path 37 | 38 | | Parameter | Description | 39 | | --------- | ----------- | 40 | | `namespace` | object name and auth scope, such as for teams and projects | 41 | 42 | #### Query 43 | 44 | | Parameter | Description | 45 | | --------- | ----------- | 46 | | `qs` | Querystring object | 47 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 48 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 49 | | `qs.pretty` | If 'true', then the output is pretty printed. | 50 | 51 | #### Body 52 | 53 | | Parameter | Description | 54 | | --------- | ----------- | 55 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.LocalSubjectAccessReview | 56 | 57 | -------------------------------------------------------------------------------- /docs/1.12/NodeProxyOptions.md: -------------------------------------------------------------------------------- 1 | # NodeProxyOptions 2 | 3 | * [proxy operations](#proxy) 4 | 5 | ## proxy 6 | 7 | ### api.v1.nodes(name).proxy(path).get 8 | 9 | connect GET requests to proxy of Node 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the NodeProxyOptions | 16 | | `path` | path to the resource | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 24 | 25 | ### api.v1.nodes(name).proxy(path).delete 26 | 27 | connect DELETE requests to proxy of Node 28 | 29 | #### Path 30 | 31 | | Parameter | Description | 32 | | --------- | ----------- | 33 | | `name` | name of the NodeProxyOptions | 34 | | `path` | path to the resource | 35 | 36 | #### Query 37 | 38 | | Parameter | Description | 39 | | --------- | ----------- | 40 | | `qs` | Querystring object | 41 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 42 | 43 | ### api.v1.nodes(name).proxy(path).options 44 | 45 | connect OPTIONS requests to proxy of Node 46 | 47 | #### Path 48 | 49 | | Parameter | Description | 50 | | --------- | ----------- | 51 | | `name` | name of the NodeProxyOptions | 52 | | `path` | path to the resource | 53 | 54 | #### Query 55 | 56 | | Parameter | Description | 57 | | --------- | ----------- | 58 | | `qs` | Querystring object | 59 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 60 | 61 | ### api.v1.nodes(name).proxy(path).patch 62 | 63 | connect PATCH requests to proxy of Node 64 | 65 | #### Path 66 | 67 | | Parameter | Description | 68 | | --------- | ----------- | 69 | | `name` | name of the NodeProxyOptions | 70 | | `path` | path to the resource | 71 | 72 | #### Query 73 | 74 | | Parameter | Description | 75 | | --------- | ----------- | 76 | | `qs` | Querystring object | 77 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 78 | 79 | ### api.v1.nodes(name).proxy(path).post 80 | 81 | connect POST requests to proxy of Node 82 | 83 | #### Path 84 | 85 | | Parameter | Description | 86 | | --------- | ----------- | 87 | | `name` | name of the NodeProxyOptions | 88 | | `path` | path to the resource | 89 | 90 | #### Query 91 | 92 | | Parameter | Description | 93 | | --------- | ----------- | 94 | | `qs` | Querystring object | 95 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 96 | 97 | ### api.v1.nodes(name).proxy(path).put 98 | 99 | connect PUT requests to proxy of Node 100 | 101 | #### Path 102 | 103 | | Parameter | Description | 104 | | --------- | ----------- | 105 | | `name` | name of the NodeProxyOptions | 106 | | `path` | path to the resource | 107 | 108 | #### Query 109 | 110 | | Parameter | Description | 111 | | --------- | ----------- | 112 | | `qs` | Querystring object | 113 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 114 | 115 | ### api.v1.nodes(name).proxy.get 116 | 117 | connect GET requests to proxy of Node 118 | 119 | #### Path 120 | 121 | | Parameter | Description | 122 | | --------- | ----------- | 123 | | `name` | name of the NodeProxyOptions | 124 | 125 | #### Query 126 | 127 | | Parameter | Description | 128 | | --------- | ----------- | 129 | | `qs` | Querystring object | 130 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 131 | 132 | ### api.v1.nodes(name).proxy.delete 133 | 134 | connect DELETE requests to proxy of Node 135 | 136 | #### Path 137 | 138 | | Parameter | Description | 139 | | --------- | ----------- | 140 | | `name` | name of the NodeProxyOptions | 141 | 142 | #### Query 143 | 144 | | Parameter | Description | 145 | | --------- | ----------- | 146 | | `qs` | Querystring object | 147 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 148 | 149 | ### api.v1.nodes(name).proxy.options 150 | 151 | connect OPTIONS requests to proxy of Node 152 | 153 | #### Path 154 | 155 | | Parameter | Description | 156 | | --------- | ----------- | 157 | | `name` | name of the NodeProxyOptions | 158 | 159 | #### Query 160 | 161 | | Parameter | Description | 162 | | --------- | ----------- | 163 | | `qs` | Querystring object | 164 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 165 | 166 | ### api.v1.nodes(name).proxy.patch 167 | 168 | connect PATCH requests to proxy of Node 169 | 170 | #### Path 171 | 172 | | Parameter | Description | 173 | | --------- | ----------- | 174 | | `name` | name of the NodeProxyOptions | 175 | 176 | #### Query 177 | 178 | | Parameter | Description | 179 | | --------- | ----------- | 180 | | `qs` | Querystring object | 181 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 182 | 183 | ### api.v1.nodes(name).proxy.post 184 | 185 | connect POST requests to proxy of Node 186 | 187 | #### Path 188 | 189 | | Parameter | Description | 190 | | --------- | ----------- | 191 | | `name` | name of the NodeProxyOptions | 192 | 193 | #### Query 194 | 195 | | Parameter | Description | 196 | | --------- | ----------- | 197 | | `qs` | Querystring object | 198 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 199 | 200 | ### api.v1.nodes(name).proxy.put 201 | 202 | connect PUT requests to proxy of Node 203 | 204 | #### Path 205 | 206 | | Parameter | Description | 207 | | --------- | ----------- | 208 | | `name` | name of the NodeProxyOptions | 209 | 210 | #### Query 211 | 212 | | Parameter | Description | 213 | | --------- | ----------- | 214 | | `qs` | Querystring object | 215 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 216 | 217 | -------------------------------------------------------------------------------- /docs/1.12/PodAttachOptions.md: -------------------------------------------------------------------------------- 1 | # PodAttachOptions 2 | 3 | * [proxy operations](#proxy) 4 | 5 | ## proxy 6 | 7 | ### api.v1.namespaces(namespace).pods(name).attach.get 8 | 9 | connect GET requests to attach of Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the PodAttachOptions | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.container` | The container in which to execute the command. Defaults to only container if there is only one container in the pod. | 24 | | `qs.stderr` | Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true. | 25 | | `qs.stdin` | Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false. | 26 | | `qs.stdout` | Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true. | 27 | | `qs.tty` | TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false. | 28 | 29 | ### api.v1.namespaces(namespace).pods(name).attach.post 30 | 31 | connect POST requests to attach of Pod 32 | 33 | #### Path 34 | 35 | | Parameter | Description | 36 | | --------- | ----------- | 37 | | `name` | name of the PodAttachOptions | 38 | | `namespace` | object name and auth scope, such as for teams and projects | 39 | 40 | #### Query 41 | 42 | | Parameter | Description | 43 | | --------- | ----------- | 44 | | `qs` | Querystring object | 45 | | `qs.container` | The container in which to execute the command. Defaults to only container if there is only one container in the pod. | 46 | | `qs.stderr` | Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true. | 47 | | `qs.stdin` | Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false. | 48 | | `qs.stdout` | Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true. | 49 | | `qs.tty` | TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false. | 50 | 51 | -------------------------------------------------------------------------------- /docs/1.12/PodExecOptions.md: -------------------------------------------------------------------------------- 1 | # PodExecOptions 2 | 3 | * [proxy operations](#proxy) 4 | 5 | ## proxy 6 | 7 | ### api.v1.namespaces(namespace).pods(name).exec.get 8 | 9 | connect GET requests to exec of Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the PodExecOptions | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.command` | Command is the remote command to execute. argv array. Not executed within a shell. | 24 | | `qs.container` | Container in which to execute the command. Defaults to only container if there is only one container in the pod. | 25 | | `qs.stderr` | Redirect the standard error stream of the pod for this call. Defaults to true. | 26 | | `qs.stdin` | Redirect the standard input stream of the pod for this call. Defaults to false. | 27 | | `qs.stdout` | Redirect the standard output stream of the pod for this call. Defaults to true. | 28 | | `qs.tty` | TTY if true indicates that a tty will be allocated for the exec call. Defaults to false. | 29 | 30 | ### api.v1.namespaces(namespace).pods(name).exec.post 31 | 32 | connect POST requests to exec of Pod 33 | 34 | #### Path 35 | 36 | | Parameter | Description | 37 | | --------- | ----------- | 38 | | `name` | name of the PodExecOptions | 39 | | `namespace` | object name and auth scope, such as for teams and projects | 40 | 41 | #### Query 42 | 43 | | Parameter | Description | 44 | | --------- | ----------- | 45 | | `qs` | Querystring object | 46 | | `qs.command` | Command is the remote command to execute. argv array. Not executed within a shell. | 47 | | `qs.container` | Container in which to execute the command. Defaults to only container if there is only one container in the pod. | 48 | | `qs.stderr` | Redirect the standard error stream of the pod for this call. Defaults to true. | 49 | | `qs.stdin` | Redirect the standard input stream of the pod for this call. Defaults to false. | 50 | | `qs.stdout` | Redirect the standard output stream of the pod for this call. Defaults to true. | 51 | | `qs.tty` | TTY if true indicates that a tty will be allocated for the exec call. Defaults to false. | 52 | 53 | -------------------------------------------------------------------------------- /docs/1.12/PodPortForwardOptions.md: -------------------------------------------------------------------------------- 1 | # PodPortForwardOptions 2 | 3 | * [proxy operations](#proxy) 4 | 5 | ## proxy 6 | 7 | ### api.v1.namespaces(namespace).pods(name).portforward.get 8 | 9 | connect GET requests to portforward of Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the PodPortForwardOptions | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.ports` | List of ports to forward Required when using WebSockets | 24 | 25 | ### api.v1.namespaces(namespace).pods(name).portforward.post 26 | 27 | connect POST requests to portforward of Pod 28 | 29 | #### Path 30 | 31 | | Parameter | Description | 32 | | --------- | ----------- | 33 | | `name` | name of the PodPortForwardOptions | 34 | | `namespace` | object name and auth scope, such as for teams and projects | 35 | 36 | #### Query 37 | 38 | | Parameter | Description | 39 | | --------- | ----------- | 40 | | `qs` | Querystring object | 41 | | `qs.ports` | List of ports to forward Required when using WebSockets | 42 | 43 | -------------------------------------------------------------------------------- /docs/1.12/PodProxyOptions.md: -------------------------------------------------------------------------------- 1 | # PodProxyOptions 2 | 3 | * [proxy operations](#proxy) 4 | 5 | ## proxy 6 | 7 | ### api.v1.namespaces(namespace).pods(name).proxy(path).get 8 | 9 | connect GET requests to proxy of Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the PodProxyOptions | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | | `path` | path to the resource | 18 | 19 | #### Query 20 | 21 | | Parameter | Description | 22 | | --------- | ----------- | 23 | | `qs` | Querystring object | 24 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 25 | 26 | ### api.v1.namespaces(namespace).pods(name).proxy(path).delete 27 | 28 | connect DELETE requests to proxy of Pod 29 | 30 | #### Path 31 | 32 | | Parameter | Description | 33 | | --------- | ----------- | 34 | | `name` | name of the PodProxyOptions | 35 | | `namespace` | object name and auth scope, such as for teams and projects | 36 | | `path` | path to the resource | 37 | 38 | #### Query 39 | 40 | | Parameter | Description | 41 | | --------- | ----------- | 42 | | `qs` | Querystring object | 43 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 44 | 45 | ### api.v1.namespaces(namespace).pods(name).proxy(path).options 46 | 47 | connect OPTIONS requests to proxy of Pod 48 | 49 | #### Path 50 | 51 | | Parameter | Description | 52 | | --------- | ----------- | 53 | | `name` | name of the PodProxyOptions | 54 | | `namespace` | object name and auth scope, such as for teams and projects | 55 | | `path` | path to the resource | 56 | 57 | #### Query 58 | 59 | | Parameter | Description | 60 | | --------- | ----------- | 61 | | `qs` | Querystring object | 62 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 63 | 64 | ### api.v1.namespaces(namespace).pods(name).proxy(path).patch 65 | 66 | connect PATCH requests to proxy of Pod 67 | 68 | #### Path 69 | 70 | | Parameter | Description | 71 | | --------- | ----------- | 72 | | `name` | name of the PodProxyOptions | 73 | | `namespace` | object name and auth scope, such as for teams and projects | 74 | | `path` | path to the resource | 75 | 76 | #### Query 77 | 78 | | Parameter | Description | 79 | | --------- | ----------- | 80 | | `qs` | Querystring object | 81 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 82 | 83 | ### api.v1.namespaces(namespace).pods(name).proxy(path).post 84 | 85 | connect POST requests to proxy of Pod 86 | 87 | #### Path 88 | 89 | | Parameter | Description | 90 | | --------- | ----------- | 91 | | `name` | name of the PodProxyOptions | 92 | | `namespace` | object name and auth scope, such as for teams and projects | 93 | | `path` | path to the resource | 94 | 95 | #### Query 96 | 97 | | Parameter | Description | 98 | | --------- | ----------- | 99 | | `qs` | Querystring object | 100 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 101 | 102 | ### api.v1.namespaces(namespace).pods(name).proxy(path).put 103 | 104 | connect PUT requests to proxy of Pod 105 | 106 | #### Path 107 | 108 | | Parameter | Description | 109 | | --------- | ----------- | 110 | | `name` | name of the PodProxyOptions | 111 | | `namespace` | object name and auth scope, such as for teams and projects | 112 | | `path` | path to the resource | 113 | 114 | #### Query 115 | 116 | | Parameter | Description | 117 | | --------- | ----------- | 118 | | `qs` | Querystring object | 119 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 120 | 121 | ### api.v1.namespaces(namespace).pods(name).proxy.get 122 | 123 | connect GET requests to proxy of Pod 124 | 125 | #### Path 126 | 127 | | Parameter | Description | 128 | | --------- | ----------- | 129 | | `name` | name of the PodProxyOptions | 130 | | `namespace` | object name and auth scope, such as for teams and projects | 131 | 132 | #### Query 133 | 134 | | Parameter | Description | 135 | | --------- | ----------- | 136 | | `qs` | Querystring object | 137 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 138 | 139 | ### api.v1.namespaces(namespace).pods(name).proxy.delete 140 | 141 | connect DELETE requests to proxy of Pod 142 | 143 | #### Path 144 | 145 | | Parameter | Description | 146 | | --------- | ----------- | 147 | | `name` | name of the PodProxyOptions | 148 | | `namespace` | object name and auth scope, such as for teams and projects | 149 | 150 | #### Query 151 | 152 | | Parameter | Description | 153 | | --------- | ----------- | 154 | | `qs` | Querystring object | 155 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 156 | 157 | ### api.v1.namespaces(namespace).pods(name).proxy.options 158 | 159 | connect OPTIONS requests to proxy of Pod 160 | 161 | #### Path 162 | 163 | | Parameter | Description | 164 | | --------- | ----------- | 165 | | `name` | name of the PodProxyOptions | 166 | | `namespace` | object name and auth scope, such as for teams and projects | 167 | 168 | #### Query 169 | 170 | | Parameter | Description | 171 | | --------- | ----------- | 172 | | `qs` | Querystring object | 173 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 174 | 175 | ### api.v1.namespaces(namespace).pods(name).proxy.patch 176 | 177 | connect PATCH requests to proxy of Pod 178 | 179 | #### Path 180 | 181 | | Parameter | Description | 182 | | --------- | ----------- | 183 | | `name` | name of the PodProxyOptions | 184 | | `namespace` | object name and auth scope, such as for teams and projects | 185 | 186 | #### Query 187 | 188 | | Parameter | Description | 189 | | --------- | ----------- | 190 | | `qs` | Querystring object | 191 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 192 | 193 | ### api.v1.namespaces(namespace).pods(name).proxy.post 194 | 195 | connect POST requests to proxy of Pod 196 | 197 | #### Path 198 | 199 | | Parameter | Description | 200 | | --------- | ----------- | 201 | | `name` | name of the PodProxyOptions | 202 | | `namespace` | object name and auth scope, such as for teams and projects | 203 | 204 | #### Query 205 | 206 | | Parameter | Description | 207 | | --------- | ----------- | 208 | | `qs` | Querystring object | 209 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 210 | 211 | ### api.v1.namespaces(namespace).pods(name).proxy.put 212 | 213 | connect PUT requests to proxy of Pod 214 | 215 | #### Path 216 | 217 | | Parameter | Description | 218 | | --------- | ----------- | 219 | | `name` | name of the PodProxyOptions | 220 | | `namespace` | object name and auth scope, such as for teams and projects | 221 | 222 | #### Query 223 | 224 | | Parameter | Description | 225 | | --------- | ----------- | 226 | | `qs` | Querystring object | 227 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 228 | 229 | -------------------------------------------------------------------------------- /docs/1.12/README.md: -------------------------------------------------------------------------------- 1 | * [ControllerRevision](ControllerRevision.md) 2 | * [Deployment](Deployment.md) 3 | * [StatefulSet](StatefulSet.md) 4 | * [DeploymentRollback](DeploymentRollback.md) 5 | * [Scale](Scale.md) 6 | * [Cluster](Cluster.md) 7 | * [DaemonSet](DaemonSet.md) 8 | * [ReplicaSet](ReplicaSet.md) 9 | * [RoleBinding](RoleBinding.md) 10 | * [Role](Role.md) 11 | * [ClusterRole](ClusterRole.md) 12 | * [ClusterRoleBinding](ClusterRoleBinding.md) 13 | * [PodDisruptionBudget](PodDisruptionBudget.md) 14 | * [PodSecurityPolicy](PodSecurityPolicy.md) 15 | * [NetworkPolicy](NetworkPolicy.md) 16 | * [PodPreset](PodPreset.md) 17 | * [Ingress](Ingress.md) 18 | * [HorizontalPodAutoscaler](HorizontalPodAutoscaler.md) 19 | * [Event](Event.md) 20 | * [Job](Job.md) 21 | * [CronJob](CronJob.md) 22 | * [Lease](Lease.md) 23 | * [APIService](APIService.md) 24 | * [StorageClass](StorageClass.md) 25 | * [VolumeAttachment](VolumeAttachment.md) 26 | * [PriorityClass](PriorityClass.md) 27 | * [LocalSubjectAccessReview](LocalSubjectAccessReview.md) 28 | * [SelfSubjectAccessReview](SelfSubjectAccessReview.md) 29 | * [SelfSubjectRulesReview](SelfSubjectRulesReview.md) 30 | * [SubjectAccessReview](SubjectAccessReview.md) 31 | * [InitializerConfiguration](InitializerConfiguration.md) 32 | * [MutatingWebhookConfiguration](MutatingWebhookConfiguration.md) 33 | * [ValidatingWebhookConfiguration](ValidatingWebhookConfiguration.md) 34 | * [CustomResourceDefinition](CustomResourceDefinition.md) 35 | * [CertificateSigningRequest](CertificateSigningRequest.md) 36 | * [TokenReview](TokenReview.md) 37 | * [PodProxyOptions](PodProxyOptions.md) 38 | * [PodAttachOptions](PodAttachOptions.md) 39 | * [Binding](Binding.md) 40 | * [Eviction](Eviction.md) 41 | * [PodExecOptions](PodExecOptions.md) 42 | * [Pod](Pod.md) 43 | * [PodPortForwardOptions](PodPortForwardOptions.md) 44 | * [ServiceProxyOptions](ServiceProxyOptions.md) 45 | * [Service](Service.md) 46 | * [ResourceQuota](ResourceQuota.md) 47 | * [PersistentVolumeClaim](PersistentVolumeClaim.md) 48 | * [ReplicationController](ReplicationController.md) 49 | * [Endpoints](Endpoints.md) 50 | * [Secret](Secret.md) 51 | * [ServiceAccount](ServiceAccount.md) 52 | * [LimitRange](LimitRange.md) 53 | * [ConfigMap](ConfigMap.md) 54 | * [PodTemplate](PodTemplate.md) 55 | * [Namespace](Namespace.md) 56 | * [PersistentVolume](PersistentVolume.md) 57 | * [Node](Node.md) 58 | * [NodeProxyOptions](NodeProxyOptions.md) 59 | * [ComponentStatus](ComponentStatus.md) 60 | -------------------------------------------------------------------------------- /docs/1.12/SelfSubjectAccessReview.md: -------------------------------------------------------------------------------- 1 | # SelfSubjectAccessReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1.selfsubjectaccessreviews.post 8 | 9 | create a SelfSubjectAccessReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 17 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 18 | | `qs.pretty` | If 'true', then the output is pretty printed. | 19 | 20 | #### Body 21 | 22 | | Parameter | Description | 23 | | --------- | ----------- | 24 | | `body` | #/definitions/io.k8s.api.authorization.v1.SelfSubjectAccessReview | 25 | 26 | ### apis.authorization.k8s.io.v1beta1.selfsubjectaccessreviews.post 27 | 28 | create a SelfSubjectAccessReview 29 | 30 | #### Query 31 | 32 | | Parameter | Description | 33 | | --------- | ----------- | 34 | | `qs` | Querystring object | 35 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 36 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 37 | | `qs.pretty` | If 'true', then the output is pretty printed. | 38 | 39 | #### Body 40 | 41 | | Parameter | Description | 42 | | --------- | ----------- | 43 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.SelfSubjectAccessReview | 44 | 45 | -------------------------------------------------------------------------------- /docs/1.12/SelfSubjectRulesReview.md: -------------------------------------------------------------------------------- 1 | # SelfSubjectRulesReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1.selfsubjectrulesreviews.post 8 | 9 | create a SelfSubjectRulesReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 17 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 18 | | `qs.pretty` | If 'true', then the output is pretty printed. | 19 | 20 | #### Body 21 | 22 | | Parameter | Description | 23 | | --------- | ----------- | 24 | | `body` | #/definitions/io.k8s.api.authorization.v1.SelfSubjectRulesReview | 25 | 26 | ### apis.authorization.k8s.io.v1beta1.selfsubjectrulesreviews.post 27 | 28 | create a SelfSubjectRulesReview 29 | 30 | #### Query 31 | 32 | | Parameter | Description | 33 | | --------- | ----------- | 34 | | `qs` | Querystring object | 35 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 36 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 37 | | `qs.pretty` | If 'true', then the output is pretty printed. | 38 | 39 | #### Body 40 | 41 | | Parameter | Description | 42 | | --------- | ----------- | 43 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.SelfSubjectRulesReview | 44 | 45 | -------------------------------------------------------------------------------- /docs/1.12/SubjectAccessReview.md: -------------------------------------------------------------------------------- 1 | # SubjectAccessReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1.subjectaccessreviews.post 8 | 9 | create a SubjectAccessReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 17 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 18 | | `qs.pretty` | If 'true', then the output is pretty printed. | 19 | 20 | #### Body 21 | 22 | | Parameter | Description | 23 | | --------- | ----------- | 24 | | `body` | #/definitions/io.k8s.api.authorization.v1.SubjectAccessReview | 25 | 26 | ### apis.authorization.k8s.io.v1beta1.subjectaccessreviews.post 27 | 28 | create a SubjectAccessReview 29 | 30 | #### Query 31 | 32 | | Parameter | Description | 33 | | --------- | ----------- | 34 | | `qs` | Querystring object | 35 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 36 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 37 | | `qs.pretty` | If 'true', then the output is pretty printed. | 38 | 39 | #### Body 40 | 41 | | Parameter | Description | 42 | | --------- | ----------- | 43 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.SubjectAccessReview | 44 | 45 | -------------------------------------------------------------------------------- /docs/1.12/TokenReview.md: -------------------------------------------------------------------------------- 1 | # TokenReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authentication.k8s.io.v1beta1.tokenreviews.post 8 | 9 | create a TokenReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 17 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 18 | | `qs.pretty` | If 'true', then the output is pretty printed. | 19 | 20 | #### Body 21 | 22 | | Parameter | Description | 23 | | --------- | ----------- | 24 | | `body` | #/definitions/io.k8s.api.authentication.v1beta1.TokenReview | 25 | 26 | ### apis.authentication.k8s.io.v1.tokenreviews.post 27 | 28 | create a TokenReview 29 | 30 | #### Query 31 | 32 | | Parameter | Description | 33 | | --------- | ----------- | 34 | | `qs` | Querystring object | 35 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 36 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 37 | | `qs.pretty` | If 'true', then the output is pretty printed. | 38 | 39 | #### Body 40 | 41 | | Parameter | Description | 42 | | --------- | ----------- | 43 | | `body` | #/definitions/io.k8s.api.authentication.v1.TokenReview | 44 | 45 | -------------------------------------------------------------------------------- /docs/1.13/Binding.md: -------------------------------------------------------------------------------- 1 | # Binding 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### api.v1.namespaces(namespace).pods(name).binding.post 8 | 9 | create binding of a Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the Binding | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 24 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 25 | | `qs.pretty` | If 'true', then the output is pretty printed. | 26 | 27 | #### Body 28 | 29 | | Parameter | Description | 30 | | --------- | ----------- | 31 | | `body` | #/definitions/io.k8s.api.core.v1.Binding | 32 | 33 | ### api.v1.namespaces(namespace).bindings.post 34 | 35 | create a Binding 36 | 37 | #### Path 38 | 39 | | Parameter | Description | 40 | | --------- | ----------- | 41 | | `namespace` | object name and auth scope, such as for teams and projects | 42 | 43 | #### Query 44 | 45 | | Parameter | Description | 46 | | --------- | ----------- | 47 | | `qs` | Querystring object | 48 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 49 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 50 | | `qs.pretty` | If 'true', then the output is pretty printed. | 51 | 52 | #### Body 53 | 54 | | Parameter | Description | 55 | | --------- | ----------- | 56 | | `body` | #/definitions/io.k8s.api.core.v1.Binding | 57 | 58 | -------------------------------------------------------------------------------- /docs/1.13/Cluster.md: -------------------------------------------------------------------------------- 1 | # Cluster 2 | 3 | * [misc operations](#misc) 4 | 5 | ## misc 6 | 7 | ### apis.apps.v1beta1.get 8 | 9 | get available resources 10 | 11 | ### apis.apps.v1.get 12 | 13 | get available resources 14 | 15 | ### apis.apps.v1beta2.get 16 | 17 | get available resources 18 | 19 | ### apis.apps.get 20 | 21 | get information of a group 22 | 23 | ### apis.settings.k8s.io.v1alpha1.get 24 | 25 | get available resources 26 | 27 | ### apis.settings.k8s.io.get 28 | 29 | get information of a group 30 | 31 | ### apis.rbac.authorization.k8s.io.v1alpha1.get 32 | 33 | get available resources 34 | 35 | ### apis.rbac.authorization.k8s.io.v1.get 36 | 37 | get available resources 38 | 39 | ### apis.rbac.authorization.k8s.io.v1beta1.get 40 | 41 | get available resources 42 | 43 | ### apis.rbac.authorization.k8s.io.get 44 | 45 | get information of a group 46 | 47 | ### apis.policy.v1beta1.get 48 | 49 | get available resources 50 | 51 | ### apis.policy.get 52 | 53 | get information of a group 54 | 55 | ### apis.networking.k8s.io.v1.get 56 | 57 | get available resources 58 | 59 | ### apis.networking.k8s.io.get 60 | 61 | get information of a group 62 | 63 | ### apis.extensions.v1beta1.get 64 | 65 | get available resources 66 | 67 | ### apis.extensions.get 68 | 69 | get information of a group 70 | 71 | ### apis.autoscaling.v1.get 72 | 73 | get available resources 74 | 75 | ### apis.autoscaling.v2beta1.get 76 | 77 | get available resources 78 | 79 | ### apis.autoscaling.v2beta2.get 80 | 81 | get available resources 82 | 83 | ### apis.autoscaling.get 84 | 85 | get information of a group 86 | 87 | ### apis.batch.v1.get 88 | 89 | get available resources 90 | 91 | ### apis.batch.v1beta1.get 92 | 93 | get available resources 94 | 95 | ### apis.batch.v2alpha1.get 96 | 97 | get available resources 98 | 99 | ### apis.batch.get 100 | 101 | get information of a group 102 | 103 | ### apis.events.k8s.io.v1beta1.get 104 | 105 | get available resources 106 | 107 | ### apis.events.k8s.io.get 108 | 109 | get information of a group 110 | 111 | ### apis.coordination.k8s.io.v1beta1.get 112 | 113 | get available resources 114 | 115 | ### apis.coordination.k8s.io.get 116 | 117 | get information of a group 118 | 119 | ### apis.apiregistration.k8s.io.v1.get 120 | 121 | get available resources 122 | 123 | ### apis.apiregistration.k8s.io.v1beta1.get 124 | 125 | get available resources 126 | 127 | ### apis.apiregistration.k8s.io.get 128 | 129 | get information of a group 130 | 131 | ### apis.storage.k8s.io.v1alpha1.get 132 | 133 | get available resources 134 | 135 | ### apis.storage.k8s.io.v1.get 136 | 137 | get available resources 138 | 139 | ### apis.storage.k8s.io.v1beta1.get 140 | 141 | get available resources 142 | 143 | ### apis.storage.k8s.io.get 144 | 145 | get information of a group 146 | 147 | ### apis.auditregistration.k8s.io.v1alpha1.get 148 | 149 | get available resources 150 | 151 | ### apis.auditregistration.k8s.io.get 152 | 153 | get information of a group 154 | 155 | ### apis.scheduling.k8s.io.v1beta1.get 156 | 157 | get available resources 158 | 159 | ### apis.scheduling.k8s.io.v1alpha1.get 160 | 161 | get available resources 162 | 163 | ### apis.scheduling.k8s.io.get 164 | 165 | get information of a group 166 | 167 | ### apis.authorization.k8s.io.v1.get 168 | 169 | get available resources 170 | 171 | ### apis.authorization.k8s.io.v1beta1.get 172 | 173 | get available resources 174 | 175 | ### apis.authorization.k8s.io.get 176 | 177 | get information of a group 178 | 179 | ### apis.admissionregistration.k8s.io.v1alpha1.get 180 | 181 | get available resources 182 | 183 | ### apis.admissionregistration.k8s.io.v1beta1.get 184 | 185 | get available resources 186 | 187 | ### apis.admissionregistration.k8s.io.get 188 | 189 | get information of a group 190 | 191 | ### apis.certificates.k8s.io.v1beta1.get 192 | 193 | get available resources 194 | 195 | ### apis.certificates.k8s.io.get 196 | 197 | get information of a group 198 | 199 | ### apis.apiextensions.k8s.io.v1beta1.get 200 | 201 | get available resources 202 | 203 | ### apis.apiextensions.k8s.io.get 204 | 205 | get information of a group 206 | 207 | ### apis.authentication.k8s.io.v1.get 208 | 209 | get available resources 210 | 211 | ### apis.authentication.k8s.io.v1beta1.get 212 | 213 | get available resources 214 | 215 | ### apis.authentication.k8s.io.get 216 | 217 | get information of a group 218 | 219 | ### apis.get 220 | 221 | get available API versions 222 | 223 | ### api.v1.get 224 | 225 | get available resources 226 | 227 | ### api.get 228 | 229 | get available API versions 230 | 231 | ### logs(logpath).get 232 | 233 | 234 | 235 | #### Path 236 | 237 | | Parameter | Description | 238 | | --------- | ----------- | 239 | | `logpath` | path to the log | 240 | 241 | ### logs.get 242 | 243 | 244 | 245 | ### version.get 246 | 247 | get the code version 248 | 249 | -------------------------------------------------------------------------------- /docs/1.13/ComponentStatus.md: -------------------------------------------------------------------------------- 1 | # ComponentStatus 2 | 3 | * [read operations](#read) 4 | 5 | ## read 6 | 7 | ### api.v1.componentstatuses(name).get 8 | 9 | read the specified ComponentStatus 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the ComponentStatus | 16 | 17 | #### Query 18 | 19 | | Parameter | Description | 20 | | --------- | ----------- | 21 | | `qs` | Querystring object | 22 | | `qs.pretty` | If 'true', then the output is pretty printed. | 23 | 24 | ### api.v1.componentstatuses.get 25 | 26 | list objects of kind ComponentStatus 27 | 28 | #### Query 29 | 30 | | Parameter | Description | 31 | | --------- | ----------- | 32 | | `qs` | Querystring object | 33 | | `qs.continue` | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the "next key".

This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. | 34 | | `qs.fieldSelector` | A selector to restrict the list of returned objects by their fields. Defaults to everything. | 35 | | `qs.includeUninitialized` | If true, partially initialized resources are included in the response. | 36 | | `qs.labelSelector` | A selector to restrict the list of returned objects by their labels. Defaults to everything. | 37 | | `qs.limit` | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. | 38 | | `qs.pretty` | If 'true', then the output is pretty printed. | 39 | | `qs.resourceVersion` | When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. | 40 | | `qs.timeoutSeconds` | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. | 41 | | `qs.watch` | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | 42 | 43 | -------------------------------------------------------------------------------- /docs/1.13/DeploymentRollback.md: -------------------------------------------------------------------------------- 1 | # DeploymentRollback 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.apps.v1beta1.namespaces(namespace).deployments(name).rollback.post 8 | 9 | create rollback of a Deployment 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the DeploymentRollback | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 24 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 25 | | `qs.pretty` | If 'true', then the output is pretty printed. | 26 | 27 | #### Body 28 | 29 | | Parameter | Description | 30 | | --------- | ----------- | 31 | | `body` | #/definitions/io.k8s.api.apps.v1beta1.DeploymentRollback | 32 | 33 | ### apis.extensions.v1beta1.namespaces(namespace).deployments(name).rollback.post 34 | 35 | create rollback of a Deployment 36 | 37 | #### Path 38 | 39 | | Parameter | Description | 40 | | --------- | ----------- | 41 | | `name` | name of the DeploymentRollback | 42 | | `namespace` | object name and auth scope, such as for teams and projects | 43 | 44 | #### Query 45 | 46 | | Parameter | Description | 47 | | --------- | ----------- | 48 | | `qs` | Querystring object | 49 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 50 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 51 | | `qs.pretty` | If 'true', then the output is pretty printed. | 52 | 53 | #### Body 54 | 55 | | Parameter | Description | 56 | | --------- | ----------- | 57 | | `body` | #/definitions/io.k8s.api.extensions.v1beta1.DeploymentRollback | 58 | 59 | -------------------------------------------------------------------------------- /docs/1.13/Eviction.md: -------------------------------------------------------------------------------- 1 | # Eviction 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### api.v1.namespaces(namespace).pods(name).eviction.post 8 | 9 | create eviction of a Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the Eviction | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 24 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 25 | | `qs.pretty` | If 'true', then the output is pretty printed. | 26 | 27 | #### Body 28 | 29 | | Parameter | Description | 30 | | --------- | ----------- | 31 | | `body` | #/definitions/io.k8s.api.policy.v1beta1.Eviction | 32 | 33 | -------------------------------------------------------------------------------- /docs/1.13/LocalSubjectAccessReview.md: -------------------------------------------------------------------------------- 1 | # LocalSubjectAccessReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1.namespaces(namespace).localsubjectaccessreviews.post 8 | 9 | create a LocalSubjectAccessReview 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `namespace` | object name and auth scope, such as for teams and projects | 16 | 17 | #### Query 18 | 19 | | Parameter | Description | 20 | | --------- | ----------- | 21 | | `qs` | Querystring object | 22 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 23 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 24 | | `qs.pretty` | If 'true', then the output is pretty printed. | 25 | 26 | #### Body 27 | 28 | | Parameter | Description | 29 | | --------- | ----------- | 30 | | `body` | #/definitions/io.k8s.api.authorization.v1.LocalSubjectAccessReview | 31 | 32 | ### apis.authorization.k8s.io.v1beta1.namespaces(namespace).localsubjectaccessreviews.post 33 | 34 | create a LocalSubjectAccessReview 35 | 36 | #### Path 37 | 38 | | Parameter | Description | 39 | | --------- | ----------- | 40 | | `namespace` | object name and auth scope, such as for teams and projects | 41 | 42 | #### Query 43 | 44 | | Parameter | Description | 45 | | --------- | ----------- | 46 | | `qs` | Querystring object | 47 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 48 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 49 | | `qs.pretty` | If 'true', then the output is pretty printed. | 50 | 51 | #### Body 52 | 53 | | Parameter | Description | 54 | | --------- | ----------- | 55 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.LocalSubjectAccessReview | 56 | 57 | -------------------------------------------------------------------------------- /docs/1.13/NodeProxyOptions.md: -------------------------------------------------------------------------------- 1 | # NodeProxyOptions 2 | 3 | * [proxy operations](#proxy) 4 | 5 | ## proxy 6 | 7 | ### api.v1.nodes(name).proxy(path).get 8 | 9 | connect GET requests to proxy of Node 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the NodeProxyOptions | 16 | | `path` | path to the resource | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 24 | 25 | ### api.v1.nodes(name).proxy(path).delete 26 | 27 | connect DELETE requests to proxy of Node 28 | 29 | #### Path 30 | 31 | | Parameter | Description | 32 | | --------- | ----------- | 33 | | `name` | name of the NodeProxyOptions | 34 | | `path` | path to the resource | 35 | 36 | #### Query 37 | 38 | | Parameter | Description | 39 | | --------- | ----------- | 40 | | `qs` | Querystring object | 41 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 42 | 43 | ### api.v1.nodes(name).proxy(path).options 44 | 45 | connect OPTIONS requests to proxy of Node 46 | 47 | #### Path 48 | 49 | | Parameter | Description | 50 | | --------- | ----------- | 51 | | `name` | name of the NodeProxyOptions | 52 | | `path` | path to the resource | 53 | 54 | #### Query 55 | 56 | | Parameter | Description | 57 | | --------- | ----------- | 58 | | `qs` | Querystring object | 59 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 60 | 61 | ### api.v1.nodes(name).proxy(path).patch 62 | 63 | connect PATCH requests to proxy of Node 64 | 65 | #### Path 66 | 67 | | Parameter | Description | 68 | | --------- | ----------- | 69 | | `name` | name of the NodeProxyOptions | 70 | | `path` | path to the resource | 71 | 72 | #### Query 73 | 74 | | Parameter | Description | 75 | | --------- | ----------- | 76 | | `qs` | Querystring object | 77 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 78 | 79 | ### api.v1.nodes(name).proxy(path).post 80 | 81 | connect POST requests to proxy of Node 82 | 83 | #### Path 84 | 85 | | Parameter | Description | 86 | | --------- | ----------- | 87 | | `name` | name of the NodeProxyOptions | 88 | | `path` | path to the resource | 89 | 90 | #### Query 91 | 92 | | Parameter | Description | 93 | | --------- | ----------- | 94 | | `qs` | Querystring object | 95 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 96 | 97 | ### api.v1.nodes(name).proxy(path).put 98 | 99 | connect PUT requests to proxy of Node 100 | 101 | #### Path 102 | 103 | | Parameter | Description | 104 | | --------- | ----------- | 105 | | `name` | name of the NodeProxyOptions | 106 | | `path` | path to the resource | 107 | 108 | #### Query 109 | 110 | | Parameter | Description | 111 | | --------- | ----------- | 112 | | `qs` | Querystring object | 113 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 114 | 115 | ### api.v1.nodes(name).proxy.get 116 | 117 | connect GET requests to proxy of Node 118 | 119 | #### Path 120 | 121 | | Parameter | Description | 122 | | --------- | ----------- | 123 | | `name` | name of the NodeProxyOptions | 124 | 125 | #### Query 126 | 127 | | Parameter | Description | 128 | | --------- | ----------- | 129 | | `qs` | Querystring object | 130 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 131 | 132 | ### api.v1.nodes(name).proxy.delete 133 | 134 | connect DELETE requests to proxy of Node 135 | 136 | #### Path 137 | 138 | | Parameter | Description | 139 | | --------- | ----------- | 140 | | `name` | name of the NodeProxyOptions | 141 | 142 | #### Query 143 | 144 | | Parameter | Description | 145 | | --------- | ----------- | 146 | | `qs` | Querystring object | 147 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 148 | 149 | ### api.v1.nodes(name).proxy.options 150 | 151 | connect OPTIONS requests to proxy of Node 152 | 153 | #### Path 154 | 155 | | Parameter | Description | 156 | | --------- | ----------- | 157 | | `name` | name of the NodeProxyOptions | 158 | 159 | #### Query 160 | 161 | | Parameter | Description | 162 | | --------- | ----------- | 163 | | `qs` | Querystring object | 164 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 165 | 166 | ### api.v1.nodes(name).proxy.patch 167 | 168 | connect PATCH requests to proxy of Node 169 | 170 | #### Path 171 | 172 | | Parameter | Description | 173 | | --------- | ----------- | 174 | | `name` | name of the NodeProxyOptions | 175 | 176 | #### Query 177 | 178 | | Parameter | Description | 179 | | --------- | ----------- | 180 | | `qs` | Querystring object | 181 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 182 | 183 | ### api.v1.nodes(name).proxy.post 184 | 185 | connect POST requests to proxy of Node 186 | 187 | #### Path 188 | 189 | | Parameter | Description | 190 | | --------- | ----------- | 191 | | `name` | name of the NodeProxyOptions | 192 | 193 | #### Query 194 | 195 | | Parameter | Description | 196 | | --------- | ----------- | 197 | | `qs` | Querystring object | 198 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 199 | 200 | ### api.v1.nodes(name).proxy.put 201 | 202 | connect PUT requests to proxy of Node 203 | 204 | #### Path 205 | 206 | | Parameter | Description | 207 | | --------- | ----------- | 208 | | `name` | name of the NodeProxyOptions | 209 | 210 | #### Query 211 | 212 | | Parameter | Description | 213 | | --------- | ----------- | 214 | | `qs` | Querystring object | 215 | | `qs.path` | Path is the URL path to use for the current proxy request to node. | 216 | 217 | -------------------------------------------------------------------------------- /docs/1.13/PodAttachOptions.md: -------------------------------------------------------------------------------- 1 | # PodAttachOptions 2 | 3 | * [proxy operations](#proxy) 4 | 5 | ## proxy 6 | 7 | ### api.v1.namespaces(namespace).pods(name).attach.get 8 | 9 | connect GET requests to attach of Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the PodAttachOptions | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.container` | The container in which to execute the command. Defaults to only container if there is only one container in the pod. | 24 | | `qs.stderr` | Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true. | 25 | | `qs.stdin` | Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false. | 26 | | `qs.stdout` | Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true. | 27 | | `qs.tty` | TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false. | 28 | 29 | ### api.v1.namespaces(namespace).pods(name).attach.post 30 | 31 | connect POST requests to attach of Pod 32 | 33 | #### Path 34 | 35 | | Parameter | Description | 36 | | --------- | ----------- | 37 | | `name` | name of the PodAttachOptions | 38 | | `namespace` | object name and auth scope, such as for teams and projects | 39 | 40 | #### Query 41 | 42 | | Parameter | Description | 43 | | --------- | ----------- | 44 | | `qs` | Querystring object | 45 | | `qs.container` | The container in which to execute the command. Defaults to only container if there is only one container in the pod. | 46 | | `qs.stderr` | Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true. | 47 | | `qs.stdin` | Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false. | 48 | | `qs.stdout` | Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true. | 49 | | `qs.tty` | TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false. | 50 | 51 | -------------------------------------------------------------------------------- /docs/1.13/PodExecOptions.md: -------------------------------------------------------------------------------- 1 | # PodExecOptions 2 | 3 | * [proxy operations](#proxy) 4 | 5 | ## proxy 6 | 7 | ### api.v1.namespaces(namespace).pods(name).exec.get 8 | 9 | connect GET requests to exec of Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the PodExecOptions | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.command` | Command is the remote command to execute. argv array. Not executed within a shell. | 24 | | `qs.container` | Container in which to execute the command. Defaults to only container if there is only one container in the pod. | 25 | | `qs.stderr` | Redirect the standard error stream of the pod for this call. Defaults to true. | 26 | | `qs.stdin` | Redirect the standard input stream of the pod for this call. Defaults to false. | 27 | | `qs.stdout` | Redirect the standard output stream of the pod for this call. Defaults to true. | 28 | | `qs.tty` | TTY if true indicates that a tty will be allocated for the exec call. Defaults to false. | 29 | 30 | ### api.v1.namespaces(namespace).pods(name).exec.post 31 | 32 | connect POST requests to exec of Pod 33 | 34 | #### Path 35 | 36 | | Parameter | Description | 37 | | --------- | ----------- | 38 | | `name` | name of the PodExecOptions | 39 | | `namespace` | object name and auth scope, such as for teams and projects | 40 | 41 | #### Query 42 | 43 | | Parameter | Description | 44 | | --------- | ----------- | 45 | | `qs` | Querystring object | 46 | | `qs.command` | Command is the remote command to execute. argv array. Not executed within a shell. | 47 | | `qs.container` | Container in which to execute the command. Defaults to only container if there is only one container in the pod. | 48 | | `qs.stderr` | Redirect the standard error stream of the pod for this call. Defaults to true. | 49 | | `qs.stdin` | Redirect the standard input stream of the pod for this call. Defaults to false. | 50 | | `qs.stdout` | Redirect the standard output stream of the pod for this call. Defaults to true. | 51 | | `qs.tty` | TTY if true indicates that a tty will be allocated for the exec call. Defaults to false. | 52 | 53 | -------------------------------------------------------------------------------- /docs/1.13/PodPortForwardOptions.md: -------------------------------------------------------------------------------- 1 | # PodPortForwardOptions 2 | 3 | * [proxy operations](#proxy) 4 | 5 | ## proxy 6 | 7 | ### api.v1.namespaces(namespace).pods(name).portforward.get 8 | 9 | connect GET requests to portforward of Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the PodPortForwardOptions | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | | `qs.ports` | List of ports to forward Required when using WebSockets | 24 | 25 | ### api.v1.namespaces(namespace).pods(name).portforward.post 26 | 27 | connect POST requests to portforward of Pod 28 | 29 | #### Path 30 | 31 | | Parameter | Description | 32 | | --------- | ----------- | 33 | | `name` | name of the PodPortForwardOptions | 34 | | `namespace` | object name and auth scope, such as for teams and projects | 35 | 36 | #### Query 37 | 38 | | Parameter | Description | 39 | | --------- | ----------- | 40 | | `qs` | Querystring object | 41 | | `qs.ports` | List of ports to forward Required when using WebSockets | 42 | 43 | -------------------------------------------------------------------------------- /docs/1.13/PodProxyOptions.md: -------------------------------------------------------------------------------- 1 | # PodProxyOptions 2 | 3 | * [proxy operations](#proxy) 4 | 5 | ## proxy 6 | 7 | ### api.v1.namespaces(namespace).pods(name).proxy(path).get 8 | 9 | connect GET requests to proxy of Pod 10 | 11 | #### Path 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `name` | name of the PodProxyOptions | 16 | | `namespace` | object name and auth scope, such as for teams and projects | 17 | | `path` | path to the resource | 18 | 19 | #### Query 20 | 21 | | Parameter | Description | 22 | | --------- | ----------- | 23 | | `qs` | Querystring object | 24 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 25 | 26 | ### api.v1.namespaces(namespace).pods(name).proxy(path).delete 27 | 28 | connect DELETE requests to proxy of Pod 29 | 30 | #### Path 31 | 32 | | Parameter | Description | 33 | | --------- | ----------- | 34 | | `name` | name of the PodProxyOptions | 35 | | `namespace` | object name and auth scope, such as for teams and projects | 36 | | `path` | path to the resource | 37 | 38 | #### Query 39 | 40 | | Parameter | Description | 41 | | --------- | ----------- | 42 | | `qs` | Querystring object | 43 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 44 | 45 | ### api.v1.namespaces(namespace).pods(name).proxy(path).options 46 | 47 | connect OPTIONS requests to proxy of Pod 48 | 49 | #### Path 50 | 51 | | Parameter | Description | 52 | | --------- | ----------- | 53 | | `name` | name of the PodProxyOptions | 54 | | `namespace` | object name and auth scope, such as for teams and projects | 55 | | `path` | path to the resource | 56 | 57 | #### Query 58 | 59 | | Parameter | Description | 60 | | --------- | ----------- | 61 | | `qs` | Querystring object | 62 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 63 | 64 | ### api.v1.namespaces(namespace).pods(name).proxy(path).patch 65 | 66 | connect PATCH requests to proxy of Pod 67 | 68 | #### Path 69 | 70 | | Parameter | Description | 71 | | --------- | ----------- | 72 | | `name` | name of the PodProxyOptions | 73 | | `namespace` | object name and auth scope, such as for teams and projects | 74 | | `path` | path to the resource | 75 | 76 | #### Query 77 | 78 | | Parameter | Description | 79 | | --------- | ----------- | 80 | | `qs` | Querystring object | 81 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 82 | 83 | ### api.v1.namespaces(namespace).pods(name).proxy(path).post 84 | 85 | connect POST requests to proxy of Pod 86 | 87 | #### Path 88 | 89 | | Parameter | Description | 90 | | --------- | ----------- | 91 | | `name` | name of the PodProxyOptions | 92 | | `namespace` | object name and auth scope, such as for teams and projects | 93 | | `path` | path to the resource | 94 | 95 | #### Query 96 | 97 | | Parameter | Description | 98 | | --------- | ----------- | 99 | | `qs` | Querystring object | 100 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 101 | 102 | ### api.v1.namespaces(namespace).pods(name).proxy(path).put 103 | 104 | connect PUT requests to proxy of Pod 105 | 106 | #### Path 107 | 108 | | Parameter | Description | 109 | | --------- | ----------- | 110 | | `name` | name of the PodProxyOptions | 111 | | `namespace` | object name and auth scope, such as for teams and projects | 112 | | `path` | path to the resource | 113 | 114 | #### Query 115 | 116 | | Parameter | Description | 117 | | --------- | ----------- | 118 | | `qs` | Querystring object | 119 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 120 | 121 | ### api.v1.namespaces(namespace).pods(name).proxy.get 122 | 123 | connect GET requests to proxy of Pod 124 | 125 | #### Path 126 | 127 | | Parameter | Description | 128 | | --------- | ----------- | 129 | | `name` | name of the PodProxyOptions | 130 | | `namespace` | object name and auth scope, such as for teams and projects | 131 | 132 | #### Query 133 | 134 | | Parameter | Description | 135 | | --------- | ----------- | 136 | | `qs` | Querystring object | 137 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 138 | 139 | ### api.v1.namespaces(namespace).pods(name).proxy.delete 140 | 141 | connect DELETE requests to proxy of Pod 142 | 143 | #### Path 144 | 145 | | Parameter | Description | 146 | | --------- | ----------- | 147 | | `name` | name of the PodProxyOptions | 148 | | `namespace` | object name and auth scope, such as for teams and projects | 149 | 150 | #### Query 151 | 152 | | Parameter | Description | 153 | | --------- | ----------- | 154 | | `qs` | Querystring object | 155 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 156 | 157 | ### api.v1.namespaces(namespace).pods(name).proxy.options 158 | 159 | connect OPTIONS requests to proxy of Pod 160 | 161 | #### Path 162 | 163 | | Parameter | Description | 164 | | --------- | ----------- | 165 | | `name` | name of the PodProxyOptions | 166 | | `namespace` | object name and auth scope, such as for teams and projects | 167 | 168 | #### Query 169 | 170 | | Parameter | Description | 171 | | --------- | ----------- | 172 | | `qs` | Querystring object | 173 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 174 | 175 | ### api.v1.namespaces(namespace).pods(name).proxy.patch 176 | 177 | connect PATCH requests to proxy of Pod 178 | 179 | #### Path 180 | 181 | | Parameter | Description | 182 | | --------- | ----------- | 183 | | `name` | name of the PodProxyOptions | 184 | | `namespace` | object name and auth scope, such as for teams and projects | 185 | 186 | #### Query 187 | 188 | | Parameter | Description | 189 | | --------- | ----------- | 190 | | `qs` | Querystring object | 191 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 192 | 193 | ### api.v1.namespaces(namespace).pods(name).proxy.post 194 | 195 | connect POST requests to proxy of Pod 196 | 197 | #### Path 198 | 199 | | Parameter | Description | 200 | | --------- | ----------- | 201 | | `name` | name of the PodProxyOptions | 202 | | `namespace` | object name and auth scope, such as for teams and projects | 203 | 204 | #### Query 205 | 206 | | Parameter | Description | 207 | | --------- | ----------- | 208 | | `qs` | Querystring object | 209 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 210 | 211 | ### api.v1.namespaces(namespace).pods(name).proxy.put 212 | 213 | connect PUT requests to proxy of Pod 214 | 215 | #### Path 216 | 217 | | Parameter | Description | 218 | | --------- | ----------- | 219 | | `name` | name of the PodProxyOptions | 220 | | `namespace` | object name and auth scope, such as for teams and projects | 221 | 222 | #### Query 223 | 224 | | Parameter | Description | 225 | | --------- | ----------- | 226 | | `qs` | Querystring object | 227 | | `qs.path` | Path is the URL path to use for the current proxy request to pod. | 228 | 229 | -------------------------------------------------------------------------------- /docs/1.13/README.md: -------------------------------------------------------------------------------- 1 | * [Deployment](Deployment.md) 2 | * [ControllerRevision](ControllerRevision.md) 3 | * [StatefulSet](StatefulSet.md) 4 | * [DeploymentRollback](DeploymentRollback.md) 5 | * [Scale](Scale.md) 6 | * [Cluster](Cluster.md) 7 | * [DaemonSet](DaemonSet.md) 8 | * [ReplicaSet](ReplicaSet.md) 9 | * [PodPreset](PodPreset.md) 10 | * [RoleBinding](RoleBinding.md) 11 | * [Role](Role.md) 12 | * [ClusterRoleBinding](ClusterRoleBinding.md) 13 | * [ClusterRole](ClusterRole.md) 14 | * [PodDisruptionBudget](PodDisruptionBudget.md) 15 | * [PodSecurityPolicy](PodSecurityPolicy.md) 16 | * [NetworkPolicy](NetworkPolicy.md) 17 | * [Ingress](Ingress.md) 18 | * [HorizontalPodAutoscaler](HorizontalPodAutoscaler.md) 19 | * [Job](Job.md) 20 | * [CronJob](CronJob.md) 21 | * [Event](Event.md) 22 | * [Lease](Lease.md) 23 | * [APIService](APIService.md) 24 | * [VolumeAttachment](VolumeAttachment.md) 25 | * [StorageClass](StorageClass.md) 26 | * [AuditSink](AuditSink.md) 27 | * [PriorityClass](PriorityClass.md) 28 | * [LocalSubjectAccessReview](LocalSubjectAccessReview.md) 29 | * [SelfSubjectAccessReview](SelfSubjectAccessReview.md) 30 | * [SelfSubjectRulesReview](SelfSubjectRulesReview.md) 31 | * [SubjectAccessReview](SubjectAccessReview.md) 32 | * [InitializerConfiguration](InitializerConfiguration.md) 33 | * [MutatingWebhookConfiguration](MutatingWebhookConfiguration.md) 34 | * [ValidatingWebhookConfiguration](ValidatingWebhookConfiguration.md) 35 | * [CertificateSigningRequest](CertificateSigningRequest.md) 36 | * [CustomResourceDefinition](CustomResourceDefinition.md) 37 | * [TokenReview](TokenReview.md) 38 | * [PodProxyOptions](PodProxyOptions.md) 39 | * [PodAttachOptions](PodAttachOptions.md) 40 | * [Binding](Binding.md) 41 | * [Eviction](Eviction.md) 42 | * [PodExecOptions](PodExecOptions.md) 43 | * [Pod](Pod.md) 44 | * [PodPortForwardOptions](PodPortForwardOptions.md) 45 | * [ServiceProxyOptions](ServiceProxyOptions.md) 46 | * [Service](Service.md) 47 | * [PersistentVolumeClaim](PersistentVolumeClaim.md) 48 | * [ReplicationController](ReplicationController.md) 49 | * [ResourceQuota](ResourceQuota.md) 50 | * [PodTemplate](PodTemplate.md) 51 | * [ConfigMap](ConfigMap.md) 52 | * [Endpoints](Endpoints.md) 53 | * [Secret](Secret.md) 54 | * [ServiceAccount](ServiceAccount.md) 55 | * [LimitRange](LimitRange.md) 56 | * [Namespace](Namespace.md) 57 | * [PersistentVolume](PersistentVolume.md) 58 | * [Node](Node.md) 59 | * [NodeProxyOptions](NodeProxyOptions.md) 60 | * [ComponentStatus](ComponentStatus.md) 61 | -------------------------------------------------------------------------------- /docs/1.13/SelfSubjectAccessReview.md: -------------------------------------------------------------------------------- 1 | # SelfSubjectAccessReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1.selfsubjectaccessreviews.post 8 | 9 | create a SelfSubjectAccessReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 17 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 18 | | `qs.pretty` | If 'true', then the output is pretty printed. | 19 | 20 | #### Body 21 | 22 | | Parameter | Description | 23 | | --------- | ----------- | 24 | | `body` | #/definitions/io.k8s.api.authorization.v1.SelfSubjectAccessReview | 25 | 26 | ### apis.authorization.k8s.io.v1beta1.selfsubjectaccessreviews.post 27 | 28 | create a SelfSubjectAccessReview 29 | 30 | #### Query 31 | 32 | | Parameter | Description | 33 | | --------- | ----------- | 34 | | `qs` | Querystring object | 35 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 36 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 37 | | `qs.pretty` | If 'true', then the output is pretty printed. | 38 | 39 | #### Body 40 | 41 | | Parameter | Description | 42 | | --------- | ----------- | 43 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.SelfSubjectAccessReview | 44 | 45 | -------------------------------------------------------------------------------- /docs/1.13/SelfSubjectRulesReview.md: -------------------------------------------------------------------------------- 1 | # SelfSubjectRulesReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1.selfsubjectrulesreviews.post 8 | 9 | create a SelfSubjectRulesReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 17 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 18 | | `qs.pretty` | If 'true', then the output is pretty printed. | 19 | 20 | #### Body 21 | 22 | | Parameter | Description | 23 | | --------- | ----------- | 24 | | `body` | #/definitions/io.k8s.api.authorization.v1.SelfSubjectRulesReview | 25 | 26 | ### apis.authorization.k8s.io.v1beta1.selfsubjectrulesreviews.post 27 | 28 | create a SelfSubjectRulesReview 29 | 30 | #### Query 31 | 32 | | Parameter | Description | 33 | | --------- | ----------- | 34 | | `qs` | Querystring object | 35 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 36 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 37 | | `qs.pretty` | If 'true', then the output is pretty printed. | 38 | 39 | #### Body 40 | 41 | | Parameter | Description | 42 | | --------- | ----------- | 43 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.SelfSubjectRulesReview | 44 | 45 | -------------------------------------------------------------------------------- /docs/1.13/SubjectAccessReview.md: -------------------------------------------------------------------------------- 1 | # SubjectAccessReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authorization.k8s.io.v1.subjectaccessreviews.post 8 | 9 | create a SubjectAccessReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 17 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 18 | | `qs.pretty` | If 'true', then the output is pretty printed. | 19 | 20 | #### Body 21 | 22 | | Parameter | Description | 23 | | --------- | ----------- | 24 | | `body` | #/definitions/io.k8s.api.authorization.v1.SubjectAccessReview | 25 | 26 | ### apis.authorization.k8s.io.v1beta1.subjectaccessreviews.post 27 | 28 | create a SubjectAccessReview 29 | 30 | #### Query 31 | 32 | | Parameter | Description | 33 | | --------- | ----------- | 34 | | `qs` | Querystring object | 35 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 36 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 37 | | `qs.pretty` | If 'true', then the output is pretty printed. | 38 | 39 | #### Body 40 | 41 | | Parameter | Description | 42 | | --------- | ----------- | 43 | | `body` | #/definitions/io.k8s.api.authorization.v1beta1.SubjectAccessReview | 44 | 45 | -------------------------------------------------------------------------------- /docs/1.13/TokenReview.md: -------------------------------------------------------------------------------- 1 | # TokenReview 2 | 3 | * [write operations](#write) 4 | 5 | ## write 6 | 7 | ### apis.authentication.k8s.io.v1.tokenreviews.post 8 | 9 | create a TokenReview 10 | 11 | #### Query 12 | 13 | | Parameter | Description | 14 | | --------- | ----------- | 15 | | `qs` | Querystring object | 16 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 17 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 18 | | `qs.pretty` | If 'true', then the output is pretty printed. | 19 | 20 | #### Body 21 | 22 | | Parameter | Description | 23 | | --------- | ----------- | 24 | | `body` | #/definitions/io.k8s.api.authentication.v1.TokenReview | 25 | 26 | ### apis.authentication.k8s.io.v1beta1.tokenreviews.post 27 | 28 | create a TokenReview 29 | 30 | #### Query 31 | 32 | | Parameter | Description | 33 | | --------- | ----------- | 34 | | `qs` | Querystring object | 35 | | `qs.dryRun` | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | 36 | | `qs.includeUninitialized` | If IncludeUninitialized is specified, the object may be returned without completing initialization. | 37 | | `qs.pretty` | If 'true', then the output is pretty printed. | 38 | 39 | #### Body 40 | 41 | | Parameter | Description | 42 | | --------- | ----------- | 43 | | `body` | #/definitions/io.k8s.api.authentication.v1beta1.TokenReview | 44 | 45 | -------------------------------------------------------------------------------- /examples/apply-deploy.js: -------------------------------------------------------------------------------- 1 | // 2 | // Use this pattern to simulate kubectl apply -f; create a Deployment or replace it if it already exists. 3 | // 4 | const Client = require('kubernetes-client').Client 5 | const config = require('kubernetes-client').config 6 | 7 | const deploymentManifest = require('./nginx-deployment.json') 8 | 9 | async function applyDeploy () { 10 | const client = new Client({ config: config.fromKubeconfig(), version: '1.13' }) 11 | 12 | try { 13 | const create = await client.apis.apps.v1.namespaces('default').deployments.post({ body: deploymentManifest }) 14 | console.log('Create:', create) 15 | } catch (err) { 16 | if (err.code !== 409) throw err 17 | const replace = await client.apis.apps.v1.namespaces('default').deployments('nginx-deployment').put({ body: deploymentManifest }) 18 | console.log('Replace:', replace) 19 | } 20 | } 21 | 22 | applyDeploy() 23 | -------------------------------------------------------------------------------- /examples/basic-auth.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // 3 | // Create an API client using basic auth 4 | // 5 | const Client = require('kubernetes-client').Client 6 | 7 | async function main () { 8 | try { 9 | const client = new Client({ 10 | config: { 11 | url: process.env.K8S_CLUSTER_HOST, 12 | auth: { 13 | user: process.env.K8S_USER, 14 | pass: process.env.K8S_PASSWORD 15 | }, 16 | insecureSkipTlsVerify: true 17 | }, 18 | version: process.env.K8S_CLUSTER_VERSION 19 | }) 20 | 21 | // 22 | // Fetch all the pods 23 | const pods = await client.api.v1.pods.get() 24 | pods.body.items.forEach((item) => { 25 | console.log(item.metadata) 26 | }) 27 | 28 | // 29 | // Fetch the Deployment from the kube-system namespace. 30 | // 31 | const deployment = await client.apis.apps.v1.namespaces('kube-system').deployments().get() 32 | deployment.body.items.forEach((item) => { 33 | console.log(item.metadata) 34 | }) 35 | } catch (err) { 36 | console.error('Error: ', err) 37 | } 38 | } 39 | 40 | main() 41 | -------------------------------------------------------------------------------- /examples/basic.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // 3 | // Demonstrate some of the basics. 4 | // 5 | const Client = require('kubernetes-client').Client 6 | 7 | const deploymentManifest = require('./nginx-deployment.json') 8 | 9 | async function main () { 10 | try { 11 | const client = new Client({ version: '1.13' }) 12 | 13 | // 14 | // Get all the Namespaces. 15 | // 16 | const namespaces = await client.api.v1.namespaces.get() 17 | console.log('Namespaces: ', namespaces) 18 | 19 | // 20 | // Create a new Deployment. 21 | // 22 | const create = await client.apis.apps.v1.namespaces('default').deployments.post({ body: deploymentManifest }) 23 | console.log('Create: ', create) 24 | 25 | // 26 | // Fetch the Deployment we just created. 27 | // 28 | const deployment = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).get() 29 | console.log('Deployment: ', deployment) 30 | 31 | // 32 | // Change the Deployment Replica count to 10 33 | // 34 | 35 | const replica = { 36 | spec: { 37 | replicas: 10 38 | } 39 | } 40 | 41 | const replicaModify = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).patch({ body: replica }) 42 | console.log('Replica Modification: ', replicaModify) 43 | 44 | // 45 | // Modify the image tag 46 | // 47 | const newImage = { 48 | spec: { 49 | template: { 50 | spec: { 51 | containers: [{ 52 | name: 'nginx', 53 | image: 'nginx:1.8.1' 54 | }] 55 | } 56 | } 57 | } 58 | } 59 | const imageSet = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).patch({ body: newImage }) 60 | console.log('New Image: ', imageSet) 61 | 62 | // 63 | // Remove the Deployment we created. 64 | // 65 | const removed = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).delete() 66 | console.log('Removed: ', removed) 67 | } catch (err) { 68 | console.error('Error: ', err) 69 | } 70 | } 71 | 72 | main() 73 | -------------------------------------------------------------------------------- /examples/canary-controller.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // 3 | // Simple canary controller example: check Pod logs for any log messages with 4 | // level "error"; on error, re-label the Pod to remove it from a Service. 5 | // 6 | // You can create a Deployment and Service to experiment with using the 7 | // coalmine example: 8 | // 9 | // $ kubectl apply -f examples/coalmine-deploy.json 10 | // $ kubectl expose deployment coalmine --type=NodePort --selector='app=coalmine,state=stable' 11 | // $ minikube service coalmine --url 12 | // 13 | const Client = require('kubernetes-client').Client 14 | const config = require('kubernetes-client').config 15 | const JSONStream = require('json-stream') 16 | 17 | const namespace = 'default' 18 | const deployment = 'coalmine' 19 | 20 | const client = new Client({ config: config.fromKubeconfig(), version: '1.13' }) 21 | 22 | function watchPod (pod) { 23 | const podClient = client.api.v1.namespaces(namespace).pods(pod) 24 | const stream = podClient.log.getStream({ qs: { follow: true } }) 25 | const jsonStream = new JSONStream() 26 | stream.pipe(jsonStream) 27 | 28 | jsonStream.on('data', async object => { 29 | console.log('Log event:', JSON.stringify(object, null, 2)) 30 | if (object.level === 'error') { 31 | console.warn(`Error in ${pod}`) 32 | await podClient.patch({ 33 | body: { 34 | metadata: { 35 | labels: { 36 | state: 'failed' 37 | } 38 | } 39 | } 40 | }) 41 | stream.abort() 42 | } 43 | }) 44 | 45 | // 46 | // Watch logs for 60 seconds. 47 | // 48 | const timeout = setTimeout(() => stream.abort(), 60 * 1000) 49 | jsonStream.on('end', () => clearTimeout(timeout)) 50 | } 51 | 52 | async function main () { 53 | try { 54 | // 55 | // Get the Pod names associated with the Deployment. 56 | // 57 | const manifest = await client.apis.apps.v1.namespaces(namespace).deployments(deployment).get() 58 | const matchLabels = manifest.body.spec.selector.matchLabels 59 | const matchQuery = Object.keys(matchLabels) 60 | .map(label => `${label}=${matchLabels[label]}`) 61 | .join(',') 62 | const pods = await client.api.v1.namespaces(namespace).pods.get({ qs: { labelSelector: matchQuery } }) 63 | pods.body.items.map(podManifest => podManifest.metadata.name).forEach(watchPod) 64 | } catch (err) { 65 | console.error('Error: ', err) 66 | } 67 | } 68 | 69 | main() 70 | -------------------------------------------------------------------------------- /examples/client-from-apiserver-swagger.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // 3 | // Create an API client based on the swagger.json from the current kubeconfig 4 | // cluster. 5 | // 6 | const Client = require('kubernetes-client').Client 7 | const config = require('kubernetes-client').config 8 | 9 | const deploymentManifest = require('./nginx-deployment.json') 10 | 11 | async function main () { 12 | try { 13 | const client = new Client({ config: config.fromKubeconfig() }) 14 | // 15 | // Load the /swagger.json from the kube-apiserver specified in config.fromKubeconfig() 16 | // 17 | await client.loadSpec() 18 | 19 | const create = await client.apis.apps.v1.namespaces('default').deployments.post({ body: deploymentManifest }) 20 | console.log('Result: ', create) 21 | } catch (err) { 22 | console.error('Error: ', err) 23 | } 24 | } 25 | 26 | main() 27 | -------------------------------------------------------------------------------- /examples/convenience-properties.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // 3 | // Use the shorter resource name aliases. 4 | // 5 | const Client = require('kubernetes-client').Client 6 | const config = require('kubernetes-client').config 7 | 8 | const deploymentManifest = require('./nginx-deployment.json') 9 | 10 | async function main () { 11 | try { 12 | const client = new Client({ config: config.fromKubeconfig(), version: '1.13' }) 13 | const create = await client.apis.apps.v1.ns('default').deploy.post({ body: deploymentManifest }) 14 | console.log('Result: ', create) 15 | } catch (err) { 16 | console.error('Error: ', err) 17 | } 18 | } 19 | 20 | main() 21 | -------------------------------------------------------------------------------- /examples/crontabs-crd.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "CustomResourceDefinition", 3 | "spec": { 4 | "scope": "Namespaced", 5 | "version": "v1", 6 | "versions": [{ 7 | "name": "v1", 8 | "served": true, 9 | "storage": true 10 | }], 11 | "group": "stable.example.com", 12 | "names": { 13 | "shortNames": [ 14 | "ct" 15 | ], 16 | "kind": "CronTab", 17 | "plural": "crontabs", 18 | "singular": "crontab" 19 | } 20 | }, 21 | "apiVersion": "apiextensions.k8s.io/v1beta1", 22 | "metadata": { 23 | "name": "crontabs.stable.example.com" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /examples/deployment-create-patch-rollback.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // 3 | // Create a deployment, patch it, and roll back to the original. 4 | // 5 | const Client = require('kubernetes-client').Client 6 | const config = require('kubernetes-client').config 7 | 8 | const deploymentManifest = require('./nginx-deployment.json') 9 | 10 | async function main () { 11 | try { 12 | const client = new Client({ config: config.fromKubeconfig(), version: '1.10' }) 13 | 14 | // Create a deployment 15 | const create = await client.apis.apps.v1.ns('default').deploy.post({ body: deploymentManifest }) 16 | console.log('Create: ', create) 17 | 18 | // Update the deployment 19 | // Change the image from nginx:1.7.9 to nginx:1.9.1 20 | const updateImage = await client.apis.apps.v1.ns('default').deploy('nginx-deployment').patch({ 21 | body: { 22 | spec: { 23 | template: { 24 | spec: { 25 | containers: [{ 26 | name: 'nginx', 27 | image: 'nginx:1.9.1' 28 | }] 29 | } 30 | } 31 | } 32 | } 33 | }) 34 | console.log('Update: ', updateImage) 35 | 36 | // Rollback to nginx:1.7.9 37 | const rollback = await client.apis.apps.v1beta1.namespaces('default').deployments('nginx-deployment').rollback.post({ 38 | body: { 39 | kind: 'DeploymentRollback', 40 | apiVersion: 'apps/v1beta1', 41 | name: 'nginx-deployment' 42 | } 43 | }) 44 | console.log('Rollback: ', rollback) 45 | } catch (err) { 46 | console.error('Error: ', err) 47 | } 48 | } 49 | 50 | main() 51 | -------------------------------------------------------------------------------- /examples/deployment-notifier.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // 3 | // Example "DeploymentNotifier" controller using a Custom Resource Definition 4 | // to configure a "notifier" on changes to Deployments. 5 | // 6 | // You can experiment with the controller by creating a Deployment and an 7 | // associated DeploymentNotifier object: 8 | // 9 | // $ kubectl apply -f examples/nginx-deployment.json 10 | // $ kubectl apply -f examples/nginx-deploymentnotifier.json 11 | // $ kubectl set image deployment/nginx-deployment nginx=nginx:1.9.1 12 | // 13 | // One shortcoming of this implementation is the lack of support for handling 14 | // disconnections from watch endpoints. The kube-apiserver periodically 15 | // disconnects watch streams (according to --min-request-timeout). 16 | // 17 | const Client = require('kubernetes-client').Client 18 | const config = require('kubernetes-client').config 19 | const JSONStream = require('json-stream') 20 | 21 | const crd = require('./deploymentnotifier-crd.json') 22 | 23 | function watchDeployment (client, notifier) { 24 | let version = '(none)' 25 | const stream = client.apis.apps.v1beta.watch.ns('default').deploy(notifier.deploymentName).getStream() 26 | const jsonStream = new JSONStream() 27 | stream.pipe(jsonStream) 28 | 29 | jsonStream.on('data', async event => { 30 | const newVersion = event.object.spec.template.spec.containers.map(container => container.image).join(',') 31 | // 32 | // Simple "notification": log to the console. A better option could be 33 | // calling the New Relic Deployment API or GithHub Deloyment Status or ... 34 | // 35 | console.log(`DeploymentNotifier ${notifier.metadata.name}: ${event.object.metadata.name} ${event.type}`) 36 | if (version !== newVersion) { 37 | console.log(`${version} -> ${newVersion}`, JSON.stringify(notifier.notify, null, 2)) 38 | version = newVersion 39 | } 40 | }) 41 | 42 | return stream 43 | } 44 | 45 | function watchDeploymentNotifiers (client) { 46 | const stream = client.apis['kubernetes-client.io'].v1.watch.deploymentnotifiers.getStream() 47 | const jsonStream = new JSONStream() 48 | stream.pipe(jsonStream) 49 | 50 | const watchers = {} 51 | jsonStream.on('data', async event => { 52 | const id = `${event.object.metadata.namespace}/${event.object.metadata.name}` 53 | if (event.type === 'ADDED') { 54 | // 55 | // Watch the Deployment for each DeploymentNotifier. 56 | // 57 | watchers[id] = watchDeployment(client, event.object) 58 | } else if (event.type === 'DELETED') { 59 | watchers[id].abort() 60 | delete watchers[id] 61 | } 62 | }) 63 | } 64 | 65 | async function main () { 66 | try { 67 | const client = new Client({ config: config.fromKubeconfig() }) 68 | await client.loadSpec() 69 | 70 | // 71 | // Create the CRD if it doesn't already exist. 72 | // 73 | try { 74 | await client.apis['apiextensions.k8s.io'].v1beta1.customresourcedefinitions.post({ body: crd }) 75 | } catch (err) { 76 | // 77 | // API returns a 409 Conflict if CRD already exists. 78 | // 79 | if (err.statusCode !== 409) throw err 80 | } 81 | 82 | // 83 | // Add endpoints to our client 84 | // 85 | client.addCustomResourceDefinition(crd) 86 | 87 | // 88 | // Watch DeploymentNotifiers. 89 | // 90 | watchDeploymentNotifiers(client) 91 | } catch (err) { 92 | console.error('Error: ', err) 93 | } 94 | } 95 | 96 | main() 97 | -------------------------------------------------------------------------------- /examples/deploymentnotifier-crd.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "CustomResourceDefinition", 3 | "spec": { 4 | "scope": "Namespaced", 5 | "versions": [{ 6 | "name": "v1", 7 | "served": true, 8 | "storage": true 9 | }], 10 | "group": "kubernetes-client.io", 11 | "names": { 12 | "shortNames": [ 13 | "dn" 14 | ], 15 | "kind": "DeploymentNotifier", 16 | "plural": "deploymentnotifiers", 17 | "singular": "deploymentnotifier" 18 | } 19 | }, 20 | "apiVersion": "apiextensions.k8s.io/v1beta1", 21 | "metadata": { 22 | "name": "deploymentnotifiers.kubernetes-client.io" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /examples/iam-auth.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // 3 | // Create an API client for an AWS EKS cluster using IAM authentication 4 | // Note: In order for this to work, you must set the environment 5 | // variable AWS_PROFILE 6 | // 7 | const Client = require('kubernetes-client').Client 8 | 9 | async function main () { 10 | try { 11 | const client = new Client({ 12 | config: { 13 | url: process.env.K8S_CLUSTER_HOST, 14 | auth: { 15 | provider: { 16 | type: 'cmd', 17 | config: { 18 | 'cmd-path': 'aws-iam-authenticator', 19 | 'cmd-args': 'token -i ' + process.env.K8S_AUTH_TOKEN, 20 | 'cmd-env': { 21 | AWS_PROFILE: process.env.AWS_PROFILE 22 | }, 23 | 'token-key': 'status.token' 24 | } 25 | } 26 | }, 27 | insecureSkipTlsVerify: true 28 | }, 29 | version: process.env.K8S_CLUSTER_VERSION 30 | }) 31 | 32 | // 33 | // Fetch all the pods 34 | const pods = await client.api.v1.pods.get() 35 | pods.body.items.forEach((item) => { 36 | console.log(item.metadata) 37 | }) 38 | 39 | // 40 | // Fetch the Deployment from the kube-system namespace. 41 | // 42 | const deployment = await client.apis.apps.v1.namespaces('kube-system').deployments().get() 43 | deployment.body.items.forEach((item) => { 44 | console.log(item.metadata) 45 | }) 46 | } catch (err) { 47 | console.error('Error: ', err) 48 | } 49 | } 50 | 51 | main() 52 | -------------------------------------------------------------------------------- /examples/in-cluster-auth.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // 3 | // Create an API client using in cluster configuration. 4 | // 5 | const Client = require('kubernetes-client').Client 6 | const Request = require('kubernetes-client/backends/request') 7 | 8 | // kubernetes-client supports reading the service account credentials [1] 9 | // from different locations by setting the 10 | // `KUBERNETES_CLIENT_SERVICEACCOUNT_ROOT` environment variable. This is 11 | // useful, for example, when running Telepresence [2]. 12 | // 13 | // [1]: https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#accessing-the-api-from-a-pod 14 | // [2]: https://www.telepresence.io/howto/volumes 15 | 16 | async function main () { 17 | try { 18 | const backend = new Request(Request.config.getInCluster()) 19 | const client = new Client({ backend }) 20 | await client.loadSpec() 21 | 22 | // 23 | // Fetch all the pods 24 | const pods = await client.api.v1.pods.get() 25 | pods.body.items.forEach((item) => { 26 | console.log(item.metadata) 27 | }) 28 | 29 | // 30 | // Fetch the Deployment from the kube-system namespace. 31 | // 32 | const deployment = await client.apis.apps.v1.namespaces('kube-system').deployments().get() 33 | deployment.body.items.forEach((item) => { 34 | console.log(item.metadata) 35 | }) 36 | } catch (err) { 37 | console.error('Error: ', err) 38 | } 39 | } 40 | 41 | main() 42 | -------------------------------------------------------------------------------- /examples/kubernetes-client-node.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // 3 | // Demonstrate how to use @kubernetes/client-node as a backend. 4 | // 5 | const k8s = require('@kubernetes/client-node') 6 | 7 | const Client = require('..').Client 8 | const ClientNodeBackend = require('../backends/kubernetes-client-node') 9 | 10 | const deploymentManifest = require('./nginx-deployment.json') 11 | 12 | async function main () { 13 | try { 14 | const kubeconfig = new k8s.KubeConfig() 15 | kubeconfig.loadFromDefault() 16 | 17 | const backend = new ClientNodeBackend({ client: k8s, kubeconfig }) 18 | const client = new Client({ backend, version: '1.10' }) 19 | 20 | // 21 | // Get all the Namespaces. 22 | // 23 | const namespaces = (await client.api.v1.namespaces.get()).body.items.map(namespace => ({ 24 | name: namespace.metadata.name, 25 | status: namespace.status 26 | })) 27 | console.log('Namespaces:', JSON.stringify(namespaces, null, 2)) 28 | 29 | // 30 | // Create a new Deployment. 31 | // 32 | const create = await client.apis.apps.v1.namespaces('default').deployments.post({ body: deploymentManifest }) 33 | console.log('Create:', create.body) 34 | 35 | // 36 | // Fetch the Deployment we just created. 37 | // 38 | const deployment = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).get() 39 | console.log('Deployment: ', deployment.body) 40 | 41 | // 42 | // Change the Deployment Replica count to 10 43 | // 44 | 45 | const replica = { 46 | spec: { 47 | replicas: 10 48 | } 49 | } 50 | 51 | const replicaModify = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).patch({ body: replica }) 52 | console.log('Replica Modification: ', replicaModify) 53 | 54 | // 55 | // Modify the image tag 56 | // 57 | const newImage = { 58 | spec: { 59 | template: { 60 | spec: { 61 | containers: [{ 62 | name: 'nginx', 63 | image: 'nginx:1.8.1' 64 | }] 65 | } 66 | } 67 | } 68 | } 69 | const imageSet = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).patch({ body: newImage }) 70 | console.log('New Image: ', imageSet) 71 | 72 | // 73 | // Remove the Deployment we created. 74 | // 75 | const removed = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).delete() 76 | console.log('Removed: ', removed) 77 | } catch (err) { 78 | console.error('Error:', err.message) 79 | } 80 | } 81 | 82 | main() 83 | -------------------------------------------------------------------------------- /examples/nginx-deployment.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "Deployment", 3 | "spec": { 4 | "replicas": 1, 5 | "template": { 6 | "spec": { 7 | "containers": [ 8 | { 9 | "image": "nginx:1.7.9", 10 | "name": "nginx", 11 | "ports": [ 12 | { 13 | "containerPort": 80 14 | } 15 | ] 16 | } 17 | ] 18 | }, 19 | "metadata": { 20 | "labels": { 21 | "app": "nginx" 22 | } 23 | } 24 | }, 25 | "selector": { 26 | "matchLabels": { 27 | "app": "nginx" 28 | } 29 | } 30 | }, 31 | "apiVersion": "apps/v1", 32 | "metadata": { 33 | "labels": { 34 | "app": "nginx" 35 | }, 36 | "name": "nginx-deployment" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /examples/nginx-deploymentnotifier.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "DeploymentNotifier", 3 | "apiVersion": "kubernetes-client.io/v1", 4 | "metadata": { 5 | "name": "nginx" 6 | }, 7 | "deploymentName": "nginx-deployment", 8 | "notify": { 9 | "accountId": "myAccount", 10 | "key": "myKey" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/pod-exec.js: -------------------------------------------------------------------------------- 1 | // 2 | // Execute commands non-interactively in a pod 3 | // 4 | const Client = require('kubernetes-client').Client 5 | const config = require('kubernetes-client').config 6 | 7 | async function main () { 8 | try { 9 | const client = new Client({ config: config.fromKubeconfig(), version: '1.13' }) 10 | 11 | // Pod with single container 12 | let res = await client.api.v1.namespaces('namespace_name').pods('pod_name').exec.post({ 13 | qs: { 14 | command: ['ls', '-al'], 15 | stdout: true, 16 | stderr: true 17 | } 18 | }) 19 | console.log(res.body) 20 | console.log(res.messages) 21 | 22 | // Pod with multiple containers /must/ specify a container 23 | res = await client.api.v1.namespaces('namespace_name').pods('pod_name').exec.post({ 24 | qs: { 25 | command: ['ls', '-al'], 26 | container: 'container_name', 27 | stdout: true, 28 | stderr: true 29 | } 30 | }) 31 | console.log(res.body) 32 | } catch (err) { 33 | console.error('Error: ', err) 34 | } 35 | } 36 | 37 | main() 38 | -------------------------------------------------------------------------------- /examples/pod-logs.js: -------------------------------------------------------------------------------- 1 | // 2 | // Retrieve logs for a pod. 3 | // 4 | const Client = require('kubernetes-client').Client 5 | const config = require('kubernetes-client').config 6 | 7 | async function main () { 8 | try { 9 | const client = new Client({ config: config.fromKubeconfig(), version: '1.13' }) 10 | 11 | // Pod with single container 12 | let logs = await client.api.v1.namespaces('namespace_name').pods('pod_name').log.get() 13 | console.log(logs.body) 14 | 15 | // Pod with multiple containers 16 | logs = await client.api.v1.namespaces('namespace_name').pods('pod_name').log.get({ 17 | qs: { 18 | container: 'container_name' 19 | } 20 | }) 21 | console.log(logs.body) 22 | } catch (err) { 23 | console.error('Error: ', err) 24 | } 25 | } 26 | 27 | main() 28 | -------------------------------------------------------------------------------- /examples/sync-client-version.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // 3 | // Create an API client based on a specified API version. kubernetes-client uses 4 | // included swagger specification files. 5 | // 6 | const Client = require('kubernetes-client').Client 7 | const config = require('kubernetes-client').config 8 | 9 | const deploymentManifest = require('./nginx-deployment.json') 10 | 11 | async function main () { 12 | try { 13 | const client = new Client({ config: config.fromKubeconfig(), version: '1.13' }) 14 | const create = await client.apis.apps.v1.namespaces('default').deployments.post({ body: deploymentManifest }) 15 | console.log('Result: ', create) 16 | } catch (err) { 17 | console.error('Error: ', err) 18 | } 19 | } 20 | 21 | main() 22 | -------------------------------------------------------------------------------- /examples/timeout.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // 3 | // Demonstrate how to set an HTTP request timeout. 4 | // 5 | const Client = require('../').Client 6 | const config = require('../').config 7 | 8 | async function main () { 9 | try { 10 | // 11 | // Set a long timeout for HTTP requests of 30,000 milliseconds. 12 | // 13 | const timeout = 30000 14 | const client = new Client({ 15 | config: Object.assign(config.fromKubeconfig(), { timeout }), 16 | version: '1.13' 17 | }) 18 | 19 | // 20 | // Get all the Namespaces. 21 | // 22 | const namespaces = await client.api.v1.namespaces.get() 23 | console.log('Namespaces: ', namespaces) 24 | } catch (err) { 25 | console.error('Error: ', err) 26 | } 27 | } 28 | 29 | main() 30 | -------------------------------------------------------------------------------- /examples/using-crds.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // 3 | // Use a Custom Resource Definition to extend the Kubernetes API and the client. 4 | // 5 | const Client = require('..').Client 6 | 7 | const crd = require('./crontabs-crd.json') 8 | 9 | async function main () { 10 | try { 11 | const client = new Client({ version: '1.13' }) 12 | 13 | // 14 | // Create the CRD with the Kubernetes API 15 | // 16 | const create = await client.apis['apiextensions.k8s.io'].v1beta1.customresourcedefinitions.post({ body: crd }) 17 | console.log('Create: ', create) 18 | 19 | // 20 | // Add endpoints to our client 21 | // 22 | client.addCustomResourceDefinition(crd) 23 | 24 | // 25 | // List all the resources of the new type 26 | // 27 | const all = await client.apis['stable.example.com'].v1.namespaces('default').crontabs.get() 28 | console.log('All: ', all) 29 | 30 | // 31 | // Get a specific resources. 32 | // 33 | const one = await client.apis['stable.example.com'].v1.namespaces('default').crontabs('foo').get() 34 | console.log('One: ', one) 35 | } catch (err) { 36 | console.error('Error: ', err) 37 | } 38 | } 39 | 40 | main() 41 | -------------------------------------------------------------------------------- /examples/vpa/index.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console:0 */ 2 | // 3 | // Use an existing VPA Custom Resource Definition to extend the client. 4 | // 5 | const Client = require('kubernetes-client').Client 6 | const config = require('kubernetes-client').config 7 | 8 | const vpa = require('./vpa-crd.json') 9 | 10 | async function main () { 11 | try { 12 | const client = new Client({ 13 | config: config.fromKubeconfig(), 14 | version: '1.12' 15 | }) 16 | 17 | // 18 | // Add endpoints to our client 19 | // 20 | client.addCustomResourceDefinition(vpa) 21 | 22 | // 23 | // List all the resources of the new type 24 | // 25 | const all = await client.apis['autoscaling.k8s.io'].v1beta2.namespaces('default').verticalpodautoscalers.get() 26 | console.log('All VPAs: ', all) 27 | 28 | // 29 | // Get a specific resources. 30 | // 31 | const one = await client.apis['autoscaling.k8s.io'].v1beta2.namespaces('default').verticalpodautoscalers('foo').get() 32 | console.log('foo VPA: ', one) 33 | } catch (err) { 34 | console.error('Error: ', err) 35 | } 36 | } 37 | 38 | main() 39 | -------------------------------------------------------------------------------- /examples/vpa/vpa-crd.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "apiextensions.k8s.io/v1beta1", 3 | "kind": "CustomResourceDefinition", 4 | "metadata": { 5 | "name": "verticalpodautoscalers.autoscaling.k8s.io", 6 | "selfLink": "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/verticalpodautoscalers.autoscaling.k8s.io" 7 | }, 8 | "spec": { 9 | "group": "autoscaling.k8s.io", 10 | "names": { 11 | "kind": "VerticalPodAutoscaler", 12 | "listKind": "VerticalPodAutoscalerList", 13 | "plural": "verticalpodautoscalers", 14 | "shortNames": ["vpa"], 15 | "singular": "verticalpodautoscaler" 16 | }, 17 | "scope": "Namespaced", 18 | "versions": [{ 19 | "name": "v1beta1", 20 | "served": true, 21 | "storage": false 22 | }, 23 | { 24 | "name": "v1beta2", 25 | "served": true, 26 | "storage": true 27 | } 28 | ] 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /examples/watch.js: -------------------------------------------------------------------------------- 1 | // 2 | // Watch changes to a Deployments in a specific Namespace. 3 | // 4 | const Client = require('../lib').Client 5 | const config = require('../lib').config 6 | const JSONStream = require('json-stream') 7 | 8 | const deploymentManifest = require('./nginx-deployment.json') 9 | 10 | async function cleanup (client) { 11 | try { 12 | await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).delete() 13 | } catch (err) { 14 | console.warn(`Unable to delete deployment ${deploymentManifest.metadata.name}. Skipping.`) 15 | } 16 | } 17 | 18 | async function triggerEvents (client) { 19 | // 20 | // Trigger some events 21 | // 22 | for (let count = 0; count < 3; count++) { 23 | await new Promise(resolve => setTimeout(resolve, 1000)) 24 | await client.apis.apps.v1.namespaces('default').deployments.post({ body: deploymentManifest }) 25 | await new Promise(resolve => setTimeout(resolve, 1000)) 26 | await cleanup(client) 27 | } 28 | } 29 | 30 | async function main () { 31 | try { 32 | const client = new Client({ config: config.fromKubeconfig(), version: '1.13' }) 33 | 34 | // 35 | // Clean up our cluster and get ready to trigger events. 36 | // 37 | await cleanup(client) 38 | 39 | // 40 | // Get a JSON stream for Deployment events 41 | // 42 | const stream = client.apis.apps.v1.watch.namespaces('default').deployments.getStream() 43 | const jsonStream = new JSONStream() 44 | stream.pipe(jsonStream) 45 | jsonStream.on('data', object => { 46 | console.log('Event: ', JSON.stringify(object, null, 2)) 47 | }) 48 | 49 | // 50 | // Cause Events to be written to `jsonStream` 51 | // 52 | await triggerEvents(client) 53 | 54 | // 55 | // Disconnect from the watch endpoint 56 | // 57 | stream.abort() 58 | } catch (err) { 59 | console.error('Error: ', err) 60 | } 61 | } 62 | 63 | main() 64 | -------------------------------------------------------------------------------- /integration/kind.yaml: -------------------------------------------------------------------------------- 1 | kind: Cluster 2 | apiVersion: kind.sigs.k8s.io/v1alpha3 3 | networking: 4 | apiServerPort: 6443 5 | kubeadmConfigPatches: 6 | - | 7 | apiVersion: kubelet.config.k8s.io/v1beta1 8 | kind: KubeletConfiguration 9 | metadata: 10 | name: config 11 | # this is only relevant for btrfs uses 12 | # https://github.com/kubernetes/kubernetes/issues/80633#issuecomment-550994513 13 | featureGates: 14 | LocalStorageCapacityIsolation: false 15 | nodes: 16 | - role: control-plane 17 | - role: worker 18 | - role: worker 19 | -------------------------------------------------------------------------------- /integration/run-mocha.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 The Kubernetes Authors. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 17 | KIND_LOGGING="--quiet" 18 | 19 | if ! [ -z "$DEBUG" ]; then 20 | set -x 21 | KIND_LOGGING="--verbosity=4" 22 | fi 23 | 24 | set -o errexit 25 | set -o nounset 26 | set -o pipefail 27 | 28 | RED='\e[35m' 29 | NC='\e[0m' 30 | BGREEN='\e[32m' 31 | 32 | K8S_VERSION=${K8S_VERSION:-v1.15.3} 33 | KIND_CLUSTER_NAME="kubernetes-client-test" 34 | CREATE=${CREATE:-yes} 35 | CLEANUP=${CLEANUP:-yes} 36 | 37 | export KUBECONFIG="$(pwd)/integration/.kubeconfig.integration" 38 | 39 | kind --version || $(echo -e "${RED}Please install kind before running e2e tests${NC}"; exit 1) 40 | 41 | if [ "$CREATE" = "yes" ]; then 42 | echo -e "${BGREEN}Creating Kubernetes cluster with kind${NC}" 43 | kind create cluster \ 44 | ${KIND_LOGGING} \ 45 | --name ${KIND_CLUSTER_NAME} \ 46 | --config ${DIR}/kind.yaml \ 47 | --image "kindest/node:${K8S_VERSION}" 48 | fi 49 | 50 | function cleanup { 51 | if [ "$CLEANUP" = "yes" ]; then 52 | set +e 53 | kind delete cluster \ 54 | ${KIND_LOGGING} \ 55 | --name ${KIND_CLUSTER_NAME} 56 | fi 57 | } 58 | trap cleanup EXIT 59 | 60 | docker pull busybox 61 | kind load docker-image --name ${KIND_CLUSTER_NAME} busybox 62 | 63 | until [ "$(kubectl get nodes | grep -c 'NotReady')" = "0" ]; do 64 | echo -e "${BGREEN}Waiting for Kind nodes...${NC}" 65 | sleep 5 66 | done 67 | 68 | until kubectl get secret | grep -q ^default-token-; do 69 | echo -e "${BGREEN}Waiting for default-token...${NC}" 70 | sleep 3 71 | done 72 | 73 | mocha "$@" 74 | -------------------------------------------------------------------------------- /integration/test/basic.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 'use strict' 3 | 4 | const expect = require('chai').expect 5 | const fs = require('fs') 6 | const yaml = require('js-yaml') 7 | 8 | const { sleep, waitForPod } = require('./common') 9 | const env = require('./env') 10 | 11 | describe('test-integration/basic', () => { 12 | let namespace = null 13 | beforeEach(async () => { 14 | namespace = await env.setupNamespace() 15 | }) 16 | afterEach(async () => { 17 | await env.tearDownNamespace(namespace) 18 | }) 19 | 20 | // Tests beforeEach and afterEach 21 | it('creates and deletes Namespaces', async () => { }) 22 | 23 | it('gets Pod logs', async () => { 24 | const manifest = yaml.safeLoad(fs.readFileSync('./integration/test/busybox-pod.yaml')) 25 | const client = await env.getClient() 26 | await client.api.v1.namespaces(namespace).pods.post({ body: manifest }) 27 | await waitForPod({ client, namespace, name: manifest.metadata.name }) 28 | 29 | for (let attempt = 0; attempt < 3; attempt++) { 30 | const result = await client.api.v1.namespaces(namespace).pods(manifest.metadata.name).log.get() 31 | if (result.body && result.body === 'hello\n') return 32 | await sleep(1000) 33 | } 34 | 35 | expect.fail('Did not read expected Pod log result') 36 | }) 37 | }) 38 | -------------------------------------------------------------------------------- /integration/test/busybox-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: busybox 5 | spec: 6 | containers: 7 | - image: busybox 8 | command: ["sh"] 9 | args: ["-c", "echo hello; sleep 3600"] 10 | imagePullPolicy: IfNotPresent 11 | name: busybox 12 | restartPolicy: Always -------------------------------------------------------------------------------- /integration/test/common.js: -------------------------------------------------------------------------------- 1 | function sleep (ms) { 2 | return new Promise(resolve => setTimeout(resolve, ms)) 3 | } 4 | 5 | async function waitForPod ({ client, namespace, name, timeout = 10000 }) { 6 | let now = (new Date()).getTime() 7 | const end = now + timeout 8 | while (true) { 9 | const pod = await client.api.v1.namespaces(namespace).pods(name).get() 10 | if (pod.body.status.phase === 'Running') return 11 | if (now > end) throw new Error('timeout') 12 | 13 | await sleep(500) 14 | now = (new Date()).getTime() 15 | } 16 | } 17 | 18 | module.exports = { 19 | sleep, 20 | waitForPod 21 | } 22 | -------------------------------------------------------------------------------- /integration/test/env.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable max-nested-callbacks */ 2 | /* eslint-env mocha */ 3 | 'use strict' 4 | 5 | const k8s = require('@kubernetes/client-node') 6 | const Client = require('../../').Client 7 | const ClientNodeBackend = require('../../backends/kubernetes-client-node') 8 | 9 | async function getClient () { 10 | if (process.env.KUBERNETES_CLIENT_BACKEND === 'client-node') { 11 | const kubeconfig = new k8s.KubeConfig() 12 | kubeconfig.loadFromDefault() 13 | const backend = new ClientNodeBackend({ kubeconfig }) 14 | const client = new Client({ backend, version: '1.13' }) 15 | return client 16 | } else { 17 | const client = new Client({}) 18 | await client.loadSpec() 19 | return client 20 | } 21 | } 22 | 23 | let lastNamespace = null 24 | 25 | async function setupNamespace (options) { 26 | options = options || {} 27 | const client = options.client || await getClient() 28 | 29 | const namespace = `test-${Math.floor(Math.random() * 900000 + 100000)}` 30 | lastNamespace = namespace 31 | 32 | await client.api.v1.namespaces.post({ 33 | body: { 34 | metadata: { 35 | name: namespace 36 | } 37 | } 38 | }) 39 | 40 | return namespace 41 | } 42 | 43 | async function tearDownNamespace (options) { 44 | options = options || {} 45 | const client = options.clent || await getClient() 46 | const namespace = options.namespace || lastNamespace 47 | 48 | await client.api.v1.namespaces(namespace).delete() 49 | } 50 | 51 | module.exports = { 52 | getClient, 53 | setupNamespace, 54 | tearDownNamespace 55 | } 56 | -------------------------------------------------------------------------------- /integration/test/patch.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 'use strict' 3 | 4 | const expect = require('chai').expect 5 | const fs = require('fs') 6 | const yaml = require('js-yaml') 7 | 8 | const env = require('./env') 9 | 10 | describe('test-integration/patch', () => { 11 | let namespace = null 12 | beforeEach(async () => { 13 | namespace = await env.setupNamespace() 14 | }) 15 | afterEach(async () => { 16 | await env.tearDownNamespace(namespace) 17 | }) 18 | 19 | it('patches a pod', async () => { 20 | let pod 21 | const manifest = yaml.safeLoad(fs.readFileSync('./integration/test/busybox-pod.yaml')) 22 | const name = manifest.metadata.name 23 | const client = await env.getClient() 24 | await client.api.v1.namespaces(namespace).pods.post({ body: manifest }) 25 | 26 | pod = await client.api.v1.namespaces(namespace).pods(name).get() 27 | expect(pod.body.metadata.annotations).to.equal(undefined) 28 | 29 | await client.api.v1.namespaces(namespace).pods(name).patch({ 30 | body: { 31 | metadata: { 32 | annotations: { 33 | 'patch-test0': process.pid.toString() 34 | } 35 | } 36 | } 37 | }) 38 | 39 | pod = await client.api.v1.namespaces(namespace).pods(name).get() 40 | expect(pod.body.metadata.annotations['patch-test0']).equals(process.pid.toString()) 41 | }) 42 | }) 43 | -------------------------------------------------------------------------------- /integration/test/stream.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 'use strict' 3 | 4 | const expect = require('chai').expect 5 | const fs = require('fs') 6 | const yaml = require('js-yaml') 7 | 8 | const { waitForPod } = require('./common') 9 | const env = require('./env') 10 | 11 | describe('test-integration/stream', () => { 12 | let namespace = null 13 | beforeEach(async () => { 14 | namespace = await env.setupNamespace() 15 | }) 16 | afterEach(async () => { 17 | await env.tearDownNamespace(namespace) 18 | }) 19 | 20 | it('streams Pod logs', async () => { 21 | const manifest = yaml.safeLoad(fs.readFileSync('./integration/test/busybox-pod.yaml')) 22 | const client = await env.getClient() 23 | await client.api.v1.namespaces(namespace).pods.post({ body: manifest }) 24 | await waitForPod({ client, namespace, name: manifest.metadata.name }) 25 | 26 | const stream = await client.api.v1 27 | .namespaces(namespace) 28 | .pods(manifest.metadata.name) 29 | .log 30 | .getByteStream() 31 | 32 | await new Promise((resolve, reject) => { 33 | stream.on('data', data => { 34 | if (data.toString() === 'hello\n') return resolve() 35 | reject(new Error(`Unexpected log contents ${data.toString()}`)) 36 | }) 37 | }) 38 | }) 39 | 40 | it('watches Pod events', async () => { 41 | const manifest = yaml.safeLoad(fs.readFileSync('./integration/test/busybox-pod.yaml')) 42 | const client = await env.getClient() 43 | await client.api.v1.namespaces(namespace).pods.post({ body: manifest }) 44 | await waitForPod({ client, namespace, name: manifest.metadata.name }) 45 | 46 | const stream = await client.api.v1.watch.namespaces(namespace).pods.getObjectStream() 47 | 48 | let gotData = false 49 | await new Promise((resolve, reject) => { 50 | stream.on('data', data => { 51 | gotData = true 52 | expect(['ADDED', 'DELETED', 'MODIFIED']).to.include(data.type) 53 | expect(data.object).to.be.an('object') 54 | stream.destroy() 55 | resolve() 56 | }) 57 | stream.on('error', err => { 58 | stream.destroy() 59 | if (!gotData) reject(err) 60 | }) 61 | }) 62 | }) 63 | }) 64 | -------------------------------------------------------------------------------- /lib/.npmignore: -------------------------------------------------------------------------------- 1 | *.test.js 2 | *.test 3 | -------------------------------------------------------------------------------- /lib/alias.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // We support the full names and all the abbbreviated aliases: 4 | // http://kubernetes.io/docs/user-guide/kubectl-overview/ 5 | // and anything else we think is useful. 6 | const resourceAliases = { 7 | clusterroles: [], 8 | clusterrolebindings: [], 9 | componentstatuses: ['cs'], 10 | configmaps: ['cm'], 11 | cronjobs: [], 12 | customresourcedefinitions: ['crd'], 13 | daemonsets: ['ds'], 14 | deployments: ['deploy'], 15 | events: ['ev'], 16 | endpoints: ['ep'], 17 | horizontalpodautoscalers: ['hpa'], 18 | ingresses: ['ing'], 19 | jobs: [], 20 | limitranges: ['limits'], 21 | namespaces: ['ns'], 22 | nodes: ['no'], 23 | persistentvolumes: ['pv'], 24 | persistentvolumeclaims: ['pvc'], 25 | // Deprecated name of statefulsets in kubernetes 1.4 26 | petsets: [], 27 | pods: ['po'], 28 | replicationcontrollers: ['rc'], 29 | replicasets: ['rs'], 30 | resourcequotas: ['quota'], 31 | roles: [], 32 | rolebindings: [], 33 | // Deprecated name of cronjobs in kubernetes 1.4 34 | scheduledjobs: [], 35 | secrets: [], 36 | serviceaccounts: [], 37 | services: ['svc'], 38 | statefulsets: [], 39 | // Deprecated name of customresourcedefinition in kubernetes 1.7 40 | thirdpartyresources: [] 41 | } 42 | 43 | const esPlurals = { 44 | componentstatuses: true, 45 | ingresses: true 46 | } 47 | 48 | const excludeFromAliasing = { 49 | apis: true, 50 | status: true 51 | } 52 | 53 | module.exports = function (resourceType) { 54 | let aliases = [resourceType] 55 | if (resourceAliases[resourceType]) { 56 | aliases = aliases.concat(resourceAliases[resourceType]) 57 | } 58 | 59 | // 60 | // NOTE(sbw): try to catch things that shouldn't have singular aliases. This 61 | // fails on some relatively common resources, like "status". 62 | // 63 | if ((resourceType.slice(-1) !== 's') || (resourceType in excludeFromAliasing)) { 64 | return aliases 65 | } 66 | 67 | const trimLength = esPlurals[resourceType] ? 2 : 1 68 | const single = resourceType.substr(0, resourceType.length - trimLength) 69 | aliases.push(single) 70 | return aliases 71 | } 72 | -------------------------------------------------------------------------------- /lib/config.js: -------------------------------------------------------------------------------- 1 | const k8s = require('@kubernetes/client-node') 2 | 3 | module.exports = k8s.KubeConfig 4 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | const deprecate = require('depd')('kubernetes-client') 2 | 3 | module.exports = { 4 | Client: require('./swagger-client').Client, 5 | Client1_13: require('./swagger-client').Client1_13, 6 | alias: require('./alias'), 7 | config: require('../backends/request/config'), 8 | KubeConfig: require('./config') 9 | } 10 | 11 | deprecate.property( 12 | module.exports, 13 | 'config', 14 | 'require(\'kubernetes-client\').config,' + 15 | ' use require(\'kubernetes-client/backends/request\').config.') 16 | -------------------------------------------------------------------------------- /lib/specs/swagger-1.10.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/kubernetes-client/9a57c1675e8a42dc838169c3b442566cee23b24d/lib/specs/swagger-1.10.json.gz -------------------------------------------------------------------------------- /lib/specs/swagger-1.11.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/kubernetes-client/9a57c1675e8a42dc838169c3b442566cee23b24d/lib/specs/swagger-1.11.json.gz -------------------------------------------------------------------------------- /lib/specs/swagger-1.12.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/kubernetes-client/9a57c1675e8a42dc838169c3b442566cee23b24d/lib/specs/swagger-1.12.json.gz -------------------------------------------------------------------------------- /lib/specs/swagger-1.13.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/kubernetes-client/9a57c1675e8a42dc838169c3b442566cee23b24d/lib/specs/swagger-1.13.json.gz -------------------------------------------------------------------------------- /merging-with-kubernetes.md: -------------------------------------------------------------------------------- 1 | # Merging with `@kubernetes/client-node` 2 | 3 | [`kubernetes-client`](https://github.com/godaddy/kubernetes-client) is 4 | merging with 5 | [`@kubernetes/client-node`](https://github.com/kubernetes-client/javascript). `kubernetes-client` 6 | will continue to be a "fluent" JavaScript bindings for the 7 | Kubernetes API and `@kubernetes/client-node` will be a lower-level set of API 8 | bindings. As part of this merging process `kubernetes-client` will 9 | adopt some of the `@kubernetes/client-node` APIs. Those changes, 10 | unfortunately, will cause breaking changes to the `kubernetes-client` 11 | API. These breaking changes will be included in 12 | `kubernetes-client@9.0.0`. 13 | 14 | See [Issue #234](https://github.com/kubernetes-client/javascript/issues/234) 15 | and [Pull Request #244](https://github.com/kubernetes-client/javascript/pull/244) for 16 | more discussion. 17 | 18 | ## Preparing to upgrade to 9.0.0 19 | 20 | ### `Client({ config })` 21 | 22 | You must construct your backend of choice with the `config` options. 23 | 24 | ```js 25 | // Depcrecated 26 | const client = new Client({ config: config.fromKubeconfig(), version: '1.14' }) 27 | 28 | // New version 29 | const client = new Client({ version: '1.14' }) 30 | 31 | // Depcrecated 32 | const config = { /* custom config */ } 33 | const client = new Client({ config, version: '1.14' }) 34 | 35 | // New version 36 | const config = { /* custom config */ } 37 | const Request = require('kubernetes-client/backends/request') 38 | const client = new Client({ backend: new Request(config), version: '1.14' }) 39 | ``` 40 | 41 | ### `require('kubernetes-client').config` 42 | 43 | You must access `.config` via the `request` backend. 44 | 45 | ```js 46 | // Depcrecated 47 | const config = require('kubernetes-client').config 48 | 49 | // New version 50 | const config = require('kubernetes-client/backends/request').config 51 | ``` 52 | 53 | ### `.getStream()` 54 | 55 | You can stream `watch` endpoints and `Pod` logs: 56 | 57 | ```js 58 | // Depcrecated `watch` 59 | const events = client.api.v1.watch.namespaces(namespace).pods.getStream() 60 | 61 | // New version `watch` (notice the `await`!) 62 | const events = await client.api.v1.watch.namespaces(namespace).pods.getObjectStream() 63 | 64 | // Deprecated `Pod` logs 65 | const stream = client.api.v1.namespaces(namespace).pods(manifest.metadata.name).log.getStream() 66 | 67 | // new version `Pod` logs (notice the `await`!) 68 | const stream = await client.api.v1.namespaces(namespace).pods(manifest.metadata.name).log.getByteStream() 69 | ``` 70 | 71 | We are going to remove support for streaming other endpoints. 72 | 73 | ### `Request({ kubeconfig })` 74 | 75 | You must construct a `Request` backend with a 76 | [`@kubernetes/client-node` `KubeConfig`](https://github.com/kubernetes-client/javascript) object. 77 | 78 | ```js 79 | // Deprecated loading from kubeconfig file 80 | const Request = require('kubernetes-client/backends/request') 81 | const requestOptions = Request.config.fromKubeconfig(Request.config.loadKubeconfig()) 82 | const backend = new Request(requestOptions) 83 | 84 | // New version of loading from kubeconfig file 85 | const { KubeConfig } = require('kubernetes-client') 86 | const kubeconfig = new KubeConfig() 87 | kubeconfig.loadFromDefault() 88 | const backend = new Request({ kubeconfig }) 89 | 90 | // Deprecated loading from in-cluster config 91 | const requestOptions = Request.config.fromKubeconfig(Request.config.getInCluster()) 92 | const backend = new Request(requestOptions) 93 | 94 | // New reversion of loading from in-cluster config 95 | const kubeconfig = new KubeConfig() 96 | kubeconfig.loadFromCluster() 97 | const backend = new Request({ kubeconfig }) 98 | ``` 99 | 100 | ## Why are you doing this? 101 | 102 | Because it will improve the quality of both JavaScript clients and 103 | reduce the engineering effort required to improve and maintain 104 | them. For example, instead of maintaining multiple implementations of 105 | configuration handling, the community can focus on improving a single 106 | implementation. 107 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kubernetes-client", 3 | "version": "9.0.0", 4 | "description": "Simplified Kubernetes API client.", 5 | "main": "lib/index.js", 6 | "types": "./typings/index.d.ts", 7 | "scripts": { 8 | "coverage": "nyc mocha 'lib/**/*.test.js'", 9 | "docs": "node scripts/docs.js --builtins", 10 | "typings": "node scripts/typings.js --spec lib/specs/swagger-1.13.json.gz --output typings/index.d.ts", 11 | "lint": "standard --fix", 12 | "release": "standard-version --tag-prefix=''", 13 | "test": "standard && mocha 'lib/**/*.test.js' 'backends/**/*.test.js' && npm run test-typings && npm run test-generated", 14 | "test-10": "standard && mocha 'lib/**/*.test.js' 'backends/**/*.test.js' && npm run test-typings", 15 | "test-generated": "scripts/test-generated.sh", 16 | "test-integration": "integration/run-mocha.sh integration/test --timeout 30000", 17 | "test-typings": "tsc --project ./typings" 18 | }, 19 | "repository": "godaddy/kubernetes-client", 20 | "keywords": [ 21 | "kubernetes", 22 | "kubectl", 23 | "containers" 24 | ], 25 | "author": "GoDaddy Operating Company, LLC", 26 | "license": "MIT", 27 | "engines": { 28 | "node": ">=10.13.0" 29 | }, 30 | "files": [ 31 | "backends", 32 | "lib", 33 | "typings" 34 | ], 35 | "dependencies": { 36 | "@kubernetes/client-node": "0.10.2", 37 | "camelcase": "^6.0.0", 38 | "deepmerge": "^4.2.2", 39 | "depd": "^2.0.0", 40 | "js-yaml": "^3.13.1", 41 | "json-stream": "^1.0.0", 42 | "openid-client": "^3.14.0", 43 | "pump": "^3.0.0", 44 | "qs": "^6.9.0", 45 | "request": "^2.88.2", 46 | "swagger-fluent": "^5.0.3", 47 | "url-join": "^4.0.1", 48 | "ws": "^7.2.3" 49 | }, 50 | "devDependencies": { 51 | "@types/node": "13.13.4", 52 | "chai": "4.2.0", 53 | "mocha": "7.1.2", 54 | "mustache": "4.0.1", 55 | "nock": "12.0.3", 56 | "nyc": "15.0.1", 57 | "sinon": "9.0.2", 58 | "standard": "14.3.3", 59 | "standard-version": "7.1.0", 60 | "typescript": "3.8.3", 61 | "yargs": "15.3.1" 62 | }, 63 | "nyc": { 64 | "check-coverage": true, 65 | "lines": 80, 66 | "functions": 70 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /scripts/templates/.gitattributes: -------------------------------------------------------------------------------- 1 | *.mustache eol=lf 2 | -------------------------------------------------------------------------------- /scripts/templates/markdown-client.mustache: -------------------------------------------------------------------------------- 1 | {{#kinds}} 2 | * [{{ kind }}]({{ kindTarget }}) 3 | {{/kinds}} 4 | -------------------------------------------------------------------------------- /scripts/templates/markdown-group.mustache: -------------------------------------------------------------------------------- 1 | ## {{groupKey}} 2 | 3 | {{#operations}} 4 | {{>operation}} 5 | 6 | {{/operations}} 7 | -------------------------------------------------------------------------------- /scripts/templates/markdown-kind.mustache: -------------------------------------------------------------------------------- 1 | # {{ kindKey }} 2 | 3 | {{#groups}} 4 | * [{{ groupKey }} operations](#{{groupKey}}) 5 | {{/groups}} 6 | 7 | {{#groups}} 8 | {{>group}} 9 | {{/groups}} 10 | -------------------------------------------------------------------------------- /scripts/templates/markdown-operation.mustache: -------------------------------------------------------------------------------- 1 | ### {{#jsName}}{{/jsName}} 2 | 3 | {{&description}} 4 | {{#hasPathParameters}} 5 | 6 | #### Path 7 | 8 | | Parameter | Description | 9 | | --------- | ----------- | 10 | {{#parameters}} 11 | {{#isPathParameter}} 12 | | `{{name}}` | {{description}} | 13 | {{/isPathParameter}} 14 | {{/parameters}} 15 | {{/hasPathParameters}} 16 | {{#hasQueryParameters}} 17 | 18 | #### Query 19 | 20 | | Parameter | Description | 21 | | --------- | ----------- | 22 | | `qs` | Querystring object | 23 | {{#parameters}} 24 | {{#isQueryParameter}} 25 | | `qs.{{name}}` | {{#markdownBreaks}}{{description}}{{/markdownBreaks}} | 26 | {{/isQueryParameter}} 27 | {{/parameters}} 28 | {{/hasQueryParameters}} 29 | {{#hasBodyParameters}} 30 | 31 | #### Body 32 | 33 | | Parameter | Description | 34 | | --------- | ----------- | 35 | {{#parameters}} 36 | {{#isBodyParameter}} 37 | | `body` | {{#markdownBreaks}}{{#schema}}{{$ref}}{{/schema}}{{/markdownBreaks}} | 38 | {{/isBodyParameter}} 39 | {{/parameters}} 40 | {{/hasBodyParameters}} 41 | -------------------------------------------------------------------------------- /scripts/templates/ts-interface.mustache: -------------------------------------------------------------------------------- 1 | interface {{tsName}} { 2 | // Path templating 3 | {{#callable}} 4 | ({{name}}: string): {{type}} 5 | {{/callable}} 6 | // Sub-paths 7 | {{#properties}} 8 | '{{name}}': {{type}} 9 | {{/properties}} 10 | // Calls 11 | {{#calls}} 12 | {{method}}(options ?: {{parameterType}}): {{returnType}} 13 | {{/calls}} 14 | addCustomResourceDefinition(schema: object): void 15 | } 16 | -------------------------------------------------------------------------------- /scripts/templates/ts-namespace.mustache: -------------------------------------------------------------------------------- 1 | // Generated by `npm run typings` 2 | export const Client{{clientSuffix}}: ApiClient; 3 | export const config: Configuration; 4 | 5 | export interface AuthorizationConfiguration { 6 | bearer?: string; 7 | user?: { 8 | username: string; 9 | password: string; 10 | } 11 | } 12 | 13 | export interface ClientConfiguration { 14 | url: string; 15 | ca?: string; 16 | key?: string; 17 | auth?: AuthorizationConfiguration; 18 | namespace?: string; 19 | insecureSkipTlsVerify: boolean; 20 | } 21 | 22 | export interface ClusterConfiguration { 23 | url: string; 24 | ca: string; 25 | key?: string; 26 | auth: AuthorizationConfiguration; 27 | namespace?: string; 28 | insecureSkipTlsVerify?: boolean; 29 | } 30 | 31 | export interface Configuration { 32 | fromKubeconfig(kubeconfig?: any, currentContext?: string): ClientConfiguration; 33 | loadKubeconfig(cfgPath?: string): any; 34 | getInCluster() : ClusterConfiguration; 35 | } 36 | 37 | {{#interfaces}} 38 | export {{> tsInterface }} 39 | {{/interfaces}} 40 | 41 | export interface ApiClient { 42 | new(options: any): ApiRoot 43 | } 44 | -------------------------------------------------------------------------------- /scripts/test-generated.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | OUTPUT=$(mktemp) 4 | 5 | node scripts/typings.js --spec lib/specs/swagger-1.13.json.gz --output $OUTPUT 6 | 7 | diff -Naur typings/index.d.ts $OUTPUT 8 | -------------------------------------------------------------------------------- /scripts/typings.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 'use strict' 3 | /* eslint-disable no-sync, no-console */ 4 | 5 | const fs = require('fs') 6 | const mustache = require('mustache') 7 | const path = require('path') 8 | const zlib = require('zlib') 9 | 10 | const Client = require('..').Client 11 | 12 | /** 13 | * Get the typescript interface name for a swagger-fluent component. 14 | * @param {object} component - swagger-fluent Component. 15 | * @returns {string} TypeScript interface name 16 | */ 17 | function interfaceName (component) { 18 | // Root doesn't have splits 19 | if (component.splits.length === 0) { 20 | return 'ApiRoot' 21 | } 22 | 23 | // 24 | // Replace '.'s with '_'s and CamelCase. 25 | // 26 | return component.splits 27 | .map(split => split.replace(/\./g, '_').replace(/./, first => first.toUpperCase())) 28 | .join('') 29 | } 30 | 31 | function walk (component, interfaces) { 32 | const properties = [] 33 | let callable = null 34 | 35 | if (component.children.length) { 36 | component.children.forEach(child => { 37 | const type = walk(component[child], interfaces) 38 | properties.push({ name: child, type }) 39 | }) 40 | } 41 | if (component.templated) { 42 | const type = walk(component('name'), interfaces) 43 | callable = { name: 'name', type } 44 | } 45 | 46 | const calls = [ 47 | 'get', 48 | 'getStream', 49 | 'delete', 50 | 'patch', 51 | 'post', 52 | 'put' 53 | ].filter(call => call in component) 54 | .map(method => ({ 55 | method, 56 | parameterType: 'any', 57 | returnType: 'any' 58 | })) 59 | 60 | const tsName = interfaceName(component) 61 | const templateOptions = { 62 | callable, 63 | calls, 64 | properties, 65 | tsName 66 | } 67 | if (!interfaces.find(iface => iface.tsName === tsName)) { 68 | interfaces.push(templateOptions) 69 | } 70 | 71 | return tsName 72 | } 73 | 74 | function main (args) { 75 | let raw = fs.readFileSync(args.spec) 76 | if (args.spec.endsWith('.gz')) { 77 | raw = zlib.gunzipSync(raw) 78 | } 79 | const spec = JSON.parse(raw) 80 | let clientSuffix = '' 81 | if (spec.info.version) { 82 | clientSuffix = spec.info.version.replace(/v/, '').split('.').slice(0, 2).join('_') 83 | } 84 | const interfaces = [] 85 | 86 | const backend = {} 87 | const client = new Client({ backend, spec }) 88 | walk(client, interfaces) 89 | 90 | const templateOptions = { 91 | clientSuffix, 92 | interfaces 93 | } 94 | 95 | const source = mustache.render( 96 | fs.readFileSync(path.join(__dirname, 'templates/ts-namespace.mustache')).toString(), 97 | templateOptions, 98 | { 99 | tsInterface: fs.readFileSync(path.join(__dirname, 'templates/ts-interface.mustache')).toString() 100 | }) 101 | 102 | if (args.output) { 103 | fs.writeFileSync(args.output, source) 104 | } else { 105 | console.log(source) 106 | } 107 | } 108 | 109 | const argv = require('yargs') 110 | .usage('Usage: $0 [options]') 111 | .option('spec', { 112 | alias: 's', 113 | default: './lib/specs/swagger-1.13.json.gz', 114 | describe: 'Swagger / OpenAPI specification' 115 | }) 116 | .option('output', { 117 | alias: 'o', 118 | describe: 'Declaration file' 119 | }) 120 | .strict() 121 | .help() 122 | .argv 123 | 124 | main(argv) 125 | -------------------------------------------------------------------------------- /typings/.npmignore: -------------------------------------------------------------------------------- 1 | *.test.ts 2 | *.test 3 | -------------------------------------------------------------------------------- /typings/index.test.ts: -------------------------------------------------------------------------------- 1 | import Api = require('./'); 2 | 3 | const Client = Api.Client1_13; 4 | const config = Api.config; 5 | 6 | const deploymentManifest = { 7 | metadata: { 8 | name: 'foo' 9 | } 10 | }; 11 | 12 | async function main0() { 13 | try { 14 | const client = new Client({ config: config.fromKubeconfig(), version: '1.13' }) 15 | const namespaces = await client.api.v1.namespaces.get(); 16 | 17 | // 18 | // Create a new Deployment. 19 | // 20 | const create = await client.apis.apps.v1.namespaces('default').deployments.post({ body: deploymentManifest }); 21 | console.log('Create: ', create); 22 | 23 | // 24 | // Fetch the Deployment we just created. 25 | // 26 | const deployment = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).get(); 27 | console.log('Deployment: ', deployment); 28 | 29 | // 30 | // Change the Deployment Replica count to 10 31 | // 32 | 33 | const replica = { 34 | spec: { 35 | replicas: 10 36 | } 37 | }; 38 | 39 | const replicaModify = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).patch({ body: replica }); 40 | console.log('Replica Modification: ', replicaModify); 41 | 42 | // 43 | // Modify the image tag 44 | // 45 | const newImage = { 46 | spec: { 47 | template: { 48 | spec: { 49 | containers: [{ 50 | name: 'nginx', 51 | image: 'nginx:1.8.1' 52 | }] 53 | } 54 | } 55 | } 56 | }; 57 | const imageSet = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).patch({ body: newImage }); 58 | console.log('New Image: ', imageSet); 59 | 60 | // 61 | // Remove the Deployment we created. 62 | // 63 | const removed = await client.apis.apps.v1.namespaces('default').deployments(deploymentManifest.metadata.name).delete(); 64 | console.log('Removed: ', removed); 65 | } catch (err) { 66 | console.error('Error: ', err); 67 | } 68 | } 69 | 70 | async function main1() { 71 | try { 72 | const client = new Client({ 73 | config: { 74 | url: process.env.K8S_CLUSTER_HOST, 75 | auth: { 76 | user: process.env.K8S_USER, 77 | pass: process.env.K8S_PASSWORD 78 | }, 79 | insecureSkipTlsVerify: true 80 | }, 81 | version: process.env.K8S_CLUSTER_VERSION 82 | }); 83 | 84 | // 85 | // Fetch all the pods 86 | const pods = await client.api.v1.pods.get(); 87 | pods.body.items.forEach((item) => { 88 | console.log(item.metadata); 89 | }); 90 | 91 | // 92 | // Fetch the Deployment from the kube-system namespace. 93 | // 94 | const deployment = await client.apis.apps.v1.namespaces('kube-system').deployments.get(); 95 | deployment.body.items.forEach((item) => { 96 | console.log(item.metadata); 97 | }); 98 | 99 | } catch (err) { 100 | console.error('Error: ', err); 101 | } 102 | } 103 | 104 | async function main2() { 105 | try { 106 | const client = new Client({ config: config.fromKubeconfig(), version: '1.13' }); 107 | const create = await client.apis.apps.v1.ns('default').deploy.post({ body: deploymentManifest }); 108 | console.log('Result: ', create); 109 | } catch (err) { 110 | console.error('Error: ', err); 111 | } 112 | } 113 | 114 | main0(); 115 | main1(); 116 | main2(); 117 | -------------------------------------------------------------------------------- /typings/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "moduleResolution": "node", 6 | "noEmit": true, 7 | }, 8 | "include": [ 9 | "*.ts" 10 | ] 11 | } 12 | --------------------------------------------------------------------------------