Hello,
I'm writing a cockpit package based on the kubernetes modules and i got an error while trying to create replication controllers and services from files:
kube-controller-manager[3793]: I0131 20:56:41.083074 3793 event.go:217] Event(v1.ObjectReference{Kind:"ReplicationController", Namespace:"default", Name:"webserver-controller", UID:"52463259-064a- 11e8-b244-086d41bdeb72", APIVersion:"v1", ResourceVersion:"1741601", FieldPath:""}): type: 'Warning' reason: 'FailedCreate' Error creating: No API token found for service account "default", retry after the token is automatically created and added to the service account
i'm trying to create the service and replication controller with the following code:
$http.get(service.rc_file).then(function(data) { service.json.service = data.data; console.log("Creating RC from JSON: " + JSON.stringify(data.data)); request = new CockpitKubeRequest("POST", link, JSON.stringify(data.data), ""); request.then(function(response) { console.log("Create RC RESPONSE: " + response); });
});
I've checked the kubernetes package and is not clear to me how to create or get the token.
Can somebody give me a hand?
Thanks, Ivan