Created
February 18, 2021 10:23
-
-
Save AshishThakur/84f20b8624172027675a3f6bd1ee2c4c to your computer and use it in GitHub Desktop.
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
const k8s = require('@kubernetes/client-node'); | |
const axios = require('axios').default; | |
const request = require('request'); | |
const kc = new k8s.KubeConfig(); | |
kc.loadFromDefault(); | |
const opts = {}; | |
kc.applyToRequest(opts); | |
axios.get(`${kc.getCurrentCluster().server}/apis/kpack.io/v1alpha1/images`).then(function (response) { | |
// handle success | |
console.log(response); | |
}) | |
.catch(function (error) { | |
// handle error | |
console.log(error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment