Skip to content

Instantly share code, notes, and snippets.

@AshishThakur
Created February 18, 2021 10:23
Show Gist options
  • Save AshishThakur/84f20b8624172027675a3f6bd1ee2c4c to your computer and use it in GitHub Desktop.
Save AshishThakur/84f20b8624172027675a3f6bd1ee2c4c to your computer and use it in GitHub Desktop.
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