-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aliases): add the nice-to-have aliases to the dynamic client code (
#209)
- Loading branch information
Showing
4 changed files
with
95 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// Use the shorter resource name aliases. | ||
// | ||
const Client = require('kubernetes-client').SyncClient | ||
const config = require('kubernetes-client').config; | ||
|
||
const deploymentManifest = require('./nginx-deployment.json'); | ||
|
||
async function main() { | ||
try { | ||
const client = new Client({ config: config.fromKubeconfig(), version: '1.9' }); | ||
const create = await client.apis.apps.v1.ns('default').deploy.post({ body: deploymentManifest }); | ||
console.log('Result: ', create); | ||
} catch (err) { | ||
console.error('Error: ', err); | ||
} | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters