Hello,
This is the code i'm working on
https://github.com/SotolitoLabs/cockpit/blob/moximo-0.4.0-156/pkg/moxim
o/moximo.js#L196
I disabled "SecurityContextDeny" in KUBE_ADMISSION_CONTROL in the
/etc/kubernetes/apiserver file and it works.
I just need how to get the API token for the "CockpitKubeRequest"
function for this code to work in a secure way.
Thanks!
Ivan
El sáb, 03-02-2018 a las 07:22 +0100, Stef Walter escribió:
> I would suggest making sure that ```kubectl config view``` returns
> valid
> date in the same Linux account that you're using to log into Cockpit.
>
> But helping you with this, without being able to see the code is
> gonna
> be pretty hit and miss. Suggest you push something to GitHub
> somewhere
> so folks can try it out and give advice.
>
> Stef
>
> On 02.02.2018 18:58, Iván Chavero wrote:
> > El jue, 01-02-2018 a las 06:30 +0100, Stef Walter escribió:
> > > Maybe something like this, or its related code would be a place
> > > to
> > > start
> > > investigating?
> > >
> > > pkg/kubernetes/scripts/main.js:
> > > KubeDiscoverSettingsProvider.KubeDiscoverSettingsFactory =
> > > "cockpitKubeDiscoverSettings";
> >
> > I checked the code related to that and tried this:
> >
> > kubectl = cockpitKubectlConfig.read();
> > request = new CockpitKubeRequest("POST", rc_link,
> > JSON.stringify(data.data), kubectl);
> >
> >
> > but still didn't work
> >
> > >
> >
> > Cheers,
> >
> > Stef
> >
> > On 01.02.2018 04:12, Iván Chavero wrote:
> > 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
> >
> > _______________________________________________
> > cockpit-devel mailing list -- cockpit-devel(a)lists.fedorahosted.org
> > To unsubscribe send an email to cockpit-devel-
> > leave(a)lists.fedorahosted.org
> >
> >
> > _______________________________________________
> > cockpit-devel mailing list -- cockpit-devel(a)lists.fedorahosted.org
> > To unsubscribe send an email to cockpit-devel-
> > leave(a)lists.fedorahosted.org
> > _______________________________________________
> > cockpit-devel mailing list -- cockpit-devel(a)lists.fedorahosted.org
> > To unsubscribe send an email to cockpit-devel-leave(a)lists.fedorahos
> >
ted.org
> >
>
>