【发布时间】:2015-10-26 15:54:07
【问题描述】:
我已通过googleapis nodejs client 成功连接到容器引擎并取回集群对象(根据文档here),并将masterAuth 对象保存到磁盘上的json 文件中。但是,我仍然无法弄清楚如何向 apiserver 发出经过身份验证的请求:
var request = require("request");
var key = require("path/to/key/json");
var options = {
url: "https://IPofKubernetesCluster/api/v1/endpoints",
cert: key.clientCertificate,
ca: key.clusterCaCertificate,
key: key.clientKey,
passphrase: null
};
request.get(options, function(e, r, body) {});
代码失败,出现以下错误:
crypto.js:131
c.context.setKey(options.key);
^
Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
at Object.exports.createCredentials (crypto.js:131:17)
at Object.exports.connect (tls.js:1345:27)
at Agent.createConnection (https.js:79:14)
at Agent.createSocket (http.js:1294:16)
at Agent.addRequest (http.js:1270:23)
at new ClientRequest (http.js:1417:16)
at Object.exports.request (https.js:123:10)
at Request.start(node_modules/request/request.js:793:30)
at Request.end (node_modules/request/request.js:1400:10)
at end (node_modules/request/request.js:564:14)
任何帮助将不胜感激。
【问题讨论】:
标签: google-cloud-platform kubernetes google-kubernetes-engine