Re: [lxc-users] How to bootstrap a new cluster via REST API?

15 views
Skip to first unread message

Stéphane Graber

unread,
Jun 7, 2021, 4:13:02 PMJun 7
to Felix Gläske, lxc-users
I've not done it by hand in a while so my answer may not be 100%
accurate, but the best way to join a cluster these days is through
`PUT /1.0/cluster` which then takes:
- cluster_address as the address and port of the cluster you're joining
- cluster_certificate as the X509 PEM encoded certificate of the
cluster (cluster.crt on the target cluster effectively)
- server_address as the address and port of the joining server
- cluster_password as the trust password of the target cluster
- server_name as the name of the joining server
- enabled which must be set to true
- member_config as a list of key/value answers to the config
questions available in `GET /1.0/cluster` on the target cluster

On Mon, Jun 7, 2021 at 3:04 AM Felix Gläske <soup...@gmail.com> wrote:
>
> I'm trying to bootstrap a new cluster using the http rest api but I'm not 100% sure how to implement it.
> I'm looking at the PUT /1.0/cluster endpoint (https://linuxcontainers.org/lxd/api/master/#/cluster/cluster_put)
>
> Which values do I have to send to bootstrap a cluster? If I don't specify any ClusterCertificate, the api tells me "No target cluster member certificate provided". But when I want to bootstrap a cluster wouldn't I have to provide a key for the certificate as well somehow?
>
> Can someone explain in more detail how to use the API endpoint(s) for what I want to achieve or are there examples available somewhere that I have not found yet?
>
> Best
> Felix
>
> --
> You received this message because you are subscribed to the Google Groups "lxc-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to lxc-users+...@lists.linuxcontainers.org.
> To view this discussion on the web visit https://groups.google.com/a/lists.linuxcontainers.org/d/msgid/lxc-users/703e4374-ac13-4987-b73f-b750bc1bb006n%40lists.linuxcontainers.org.

Andrey Repin

unread,
Jun 9, 2021, 10:05:06 PMJun 9
to Stéphane Graber
Greetings, Stéphane Graber!

> I've not done it by hand in a while so my answer may not be 100%
> accurate, but the best way to join a cluster these days is through
> `PUT /1.0/cluster` which then takes:
> - cluster_address as the address and port of the cluster you're joining

Felix want to **create a new cluster**, by the sound of his message.

> - cluster_certificate as the X509 PEM encoded certificate of the
> cluster (cluster.crt on the target cluster effectively)
> - server_address as the address and port of the joining server
> - cluster_password as the trust password of the target cluster
> - server_name as the name of the joining server
> - enabled which must be set to true
> - member_config as a list of key/value answers to the config
> questions available in `GET /1.0/cluster` on the target cluster

> On Mon, Jun 7, 2021 at 3:04 AM Felix Gläske <soup...@gmail.com> wrote:
>>
>> I'm trying to bootstrap a new cluster using the http rest api but I'm not 100% sure how to implement it.
>> I'm looking at the PUT /1.0/cluster endpoint (https://linuxcontainers.org/lxd/api/master/#/cluster/cluster_put)
>>
>> Which values do I have to send to bootstrap a cluster? If I don't specify any ClusterCertificate, the api tells me "No target cluster member certificate provided". But when I want to bootstrap a cluster wouldn't I have to provide a key for the certificate as well somehow?
>>
>> Can someone explain in more detail how to use the API endpoint(s) for what I want to achieve or are there examples available somewhere that I have not found yet?
>>
>> Best
>> Felix
>>
>> --
>> You received this message because you are subscribed to the Google Groups "lxc-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to lxc-users+...@lists.linuxcontainers.org.
>> To view this discussion on the web visit https://groups.google.com/a/lists.linuxcontainers.org/d/msgid/lxc-users/703e4374-ac13-4987-b73f-b750bc1bb006n%40lists.linuxcontainers.org.



--
With best regards,
Andrey Repin
Thursday, June 10, 2021 4:52:48

Sorry for my terrible english...

Stéphane Graber

unread,
Jun 15, 2021, 11:12:24 PMJun 15
to Andrey Repin
Ah right, for that, it's even easier, doing PUT with just:

- server_address as the address and port you want LXD to listen on
for cluster traffic
- server_name as the name to use to refer to the initial server
- enabled which must be set to true

> To view this discussion on the web visit https://groups.google.com/a/lists.linuxcontainers.org/d/msgid/lxc-users/624519758.20210610045325%40yandex.ru.
Reply all
Reply to author
Forward
0 new messages