Kubernetes helm chart: trying to automate 100% #678

Closed
opened 2023-12-16 16:59:49 +00:00 by kfirfer · 3 comments

Hello

Im trying to automate the garage installation with helm chart 100%
What that means that I writting a python/bash script that run after the helm installation and with predefined secrets+passwords+and endpoints, he will create new layout, buckets, users, etc
The problem I encountering that the instances is generating keys
What should I do then ? How can I know beforehand the keys(ids) ?

Thanks !

Hello Im trying to automate the garage installation with helm chart 100% What that means that I writting a python/bash script that run after the helm installation and with predefined secrets+passwords+and endpoints, he will create new layout, buckets, users, etc The problem I encountering that the instances is generating keys What should I do then ? How can I know beforehand the keys(ids) ? Thanks !
Owner

Why can't you use the admin API to retrieve the keys when they are generated, and then inject that in your kubernetes configuration database?

Otherwise, there is the garage key import / ImportAccessKey functionnality to add an existing access key/secret key pair to Garage. They have to be formatted properly, i.e. be generated by another Garage instance.

Why can't you use the admin API to retrieve the keys when they are generated, and then inject that in your kubernetes configuration database? Otherwise, there is the `garage key import` / ImportAccessKey functionnality to add an existing access key/secret key pair to Garage. They have to be formatted properly, i.e. be generated by another Garage instance.
Author

@lx
I mean the nodes id's , in order to create new layout:

def configure_layout():
    url = "http://127.0.0.1:3903/v1/layout"
    nodes = []
    ids = [
        "e0341ceea1f3f2dd4b37b079db96a19de37b94d4351d3de4990e543fb3974590",
        "9e1b3f63e1da2b721d61d0d4dbd907b765b0f2be495543315c993de36c049e32",
        "b36f6a694f6740cdf5a48f8c4cbc71582616792730241b0f51d1506c74e9a6b9",
    ]
    for _id in ids:
        nodes.append({
            "id": _id,
            "zone": "par1",
            "capacity": 2000000000000,
            "tags": []
        })
    payload = json.dumps(nodes)
    headers = {
        'Content-Type': CT,
        'Authorization': AUTHZ
    }
    response = requests.request("POST", url, headers=headers, data=payload)

how do i get the ids?
e0341ceea1f3f2dd4b37b079db96a19de37b94d4351d3de4990e543fb3974590
9e1b3f63e1da2b721d61d0d4dbd907b765b0f2be495543315c993de36c049e32
b36f6a694f6740cdf5a48f8c4cbc71582616792730241b0f51d1506c74e9a6b9

currently im getting those ID's manually from the logs

@lx I mean the nodes id's , in order to create new layout: ``` def configure_layout(): url = "http://127.0.0.1:3903/v1/layout" nodes = [] ids = [ "e0341ceea1f3f2dd4b37b079db96a19de37b94d4351d3de4990e543fb3974590", "9e1b3f63e1da2b721d61d0d4dbd907b765b0f2be495543315c993de36c049e32", "b36f6a694f6740cdf5a48f8c4cbc71582616792730241b0f51d1506c74e9a6b9", ] for _id in ids: nodes.append({ "id": _id, "zone": "par1", "capacity": 2000000000000, "tags": [] }) payload = json.dumps(nodes) headers = { 'Content-Type': CT, 'Authorization': AUTHZ } response = requests.request("POST", url, headers=headers, data=payload) ``` how do i get the ids? e0341ceea1f3f2dd4b37b079db96a19de37b94d4351d3de4990e543fb3974590 9e1b3f63e1da2b721d61d0d4dbd907b765b0f2be495543315c993de36c049e32 b36f6a694f6740cdf5a48f8c4cbc71582616792730241b0f51d1506c74e9a6b9 currently im getting those ID's manually from the logs
Author

found what needed:

import requests

url = "http://127.0.0.1:3903/v1/status"

payload = {}
headers = {
  'Authorization': 'Bearer <token>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

thanks!

found what needed: ``` import requests url = "http://127.0.0.1:3903/v1/status" payload = {} headers = { 'Authorization': 'Bearer <token>' } response = requests.request("GET", url, headers=headers, data=payload) print(response.text) ``` thanks!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/garage#678
No description provided.