Skip to content

Commit 544ba82

Browse files
committed
docs: add services provisioning
1 parent 1dfafd0 commit 544ba82

2 files changed

Lines changed: 153 additions & 1 deletion

File tree

content/en/docs/admin-guide/create-region.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Create Your First Region
33
description: Let's setup a new region and its Kiwi and Kaktus instances
4-
weight: 3
4+
weight: 4
55
---
66

77
Orchestrator being ready, we can now boostrap our first region.

content/en/docs/admin-guide/provision-services.md

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,155 @@ title: Provisioning Services
33
description: Let's provision our services
44
weight: 7
55
---
6+
7+
Infrastructure is finally all set. We only need to finalize the setup of a few services (from Kahuna's perspective) and we're done.
8+
9+
## Storage Pool
10+
11+
Let's update your TF configuration to simply declare the following:
12+
13+
```hcl
14+
locals {
15+
ceph_port = 3300
16+
17+
eu-west {
18+
pools = {
19+
"eu-west-ssd" = {
20+
desc = "SSD"
21+
secret = "YOUR_CEPH_FSID",
22+
cost = 200.0,
23+
type = "rbd",
24+
pool = "rbd",
25+
address = "ceph",
26+
default = true,
27+
agents = [
28+
"kaktus-eu-west-a-1",
29+
"kaktus-eu-west-a-2",
30+
"kaktus-eu-west-a-3",
31+
]
32+
},
33+
}
34+
}
35+
}
36+
37+
resource "kowabunga_storage_pool" "eu-west" {
38+
for_each = local.eu-west.pools
39+
region = kowabunga_region.eu-west.id
40+
name = each.key
41+
desc = "${local.eu-west.desc} - ${each.value.desc}"
42+
pool = each.value.pool
43+
address = each.value.address
44+
port = try(each.value.port, local.ceph_port)
45+
secret = try(each.value.secret, "")
46+
price = try(each.value.cost, null)
47+
currency = local.currency
48+
default = try(each.value.default, false)
49+
agents = [for agent in try(each.value.agents, []) : kowabunga_agent.eu-west[agent].id]
50+
}
51+
```
52+
53+
What we're doing here is instructing **Kahuna** that there's a Ceph storage pool that can be used to provision RBD images. It will connect to **ceph** DNS record on port **3300**, and use one of the 3 **agents** defined to connect to pool **rbd**. It'll also arbitrary (as we did for **Katkus** instances) set the global storage pool price to **200 EUR / month**, so virtual resource cost computing can happen.
54+
55+
{{< alert color="warning" title="Warning" >}}
56+
Take care of updating the **YOUR_CEPH_FSID** secret value with the one you've set in Ansible **kowabunga_ceph_fsid** variable. Libvirt won't be able to reach the cluster without this information.
57+
{{< /alert >}}
58+
59+
And apply:
60+
61+
```sh
62+
$ kobra tf apply
63+
```
64+
65+
## NFS Storage
66+
67+
Now if you previously created an NFS endpoint want to expose it through **Kylo** services, you'll also need to setup the following TF resources:
68+
69+
```hcl
70+
locals {
71+
ganesha_port = 54934
72+
73+
eu-west {
74+
nfs = {
75+
"eu-west-nfs" = {
76+
desc = "NFS Storage Volume",
77+
endpoint = "ceph.storage.eu-west.acme.local",
78+
fs = "nfs",
79+
backends = [
80+
"10.50.102.11",
81+
"10.50.102.12",
82+
"10.50.102.13",
83+
],
84+
default = true,
85+
}
86+
}
87+
}
88+
89+
}
90+
91+
resource "kowabunga_storage_nfs" "eu-west" {
92+
for_each = local.eu-west.nfs
93+
region = kowabunga_region.eu-west.id
94+
name = each.key
95+
desc = "${local.eu-west.desc} - ${each.value.desc}"
96+
endpoint = each.value.endpoint
97+
fs = each.value.fs
98+
backends = each.value.backends
99+
port = try(each.value.port, local.ganesha_port)
100+
default = try(each.value.default, false)
101+
}
102+
```
103+
104+
In a very same way, this simply instructs **Kahuna** how to access NFS resources and provide **Kylo** services. you must ensure that **endpoint** and **backends** values map to your local storage domain and associated Kaktus instances. They'll be used further by **Kylo** instances to create NFS shares over Ceph.
105+
106+
And again, apply:
107+
108+
```sh
109+
$ kobra tf apply
110+
```
111+
112+
## OS Image Templates
113+
114+
And finally, let's declare OS image templates. Without those, you won't be able to spin up any kind of **Kompute** virtual machines instances after all. Image templates must be ready-to-boot, cloud-init compatible and either in QCOW2 (smaller to download, prefered) or RAW format.
115+
116+
Up to you to use pre-built community images or host your own custom one on a public HTTP server.
117+
118+
{{< alert color="warning" title="Warning" >}}
119+
Note that URL must be reachable from Kaktus nodes, not Kahuna one (so can be private network).
120+
121+
The module however does not support authentication at the moment, so images must be "publicly" available.
122+
{{< /alert >}}
123+
124+
```hcl
125+
locals {
126+
# WARNING: these must can be in either QCOW2 (recommended) or RAW format
127+
# Example usage for conversion, if needed:
128+
# $ qemu-img convert -f qcow2 -O raw ubuntu-22.04-server-cloudimg-amd64.img ubuntu-22.04-server-cloudimg-amd64.raw
129+
templates = {
130+
"ubuntu-cloudimg-generic-24.04" = {
131+
desc = "Ubuntu 24.04 (Noble)",
132+
source = "https://cloud-images.ubuntu.com/noble/20250805/noble-server-cloudimg-amd64.img"
133+
default = true
134+
}
135+
}
136+
}
137+
138+
resource "kowabunga_template" "eu-west" {
139+
for_each = local.templates
140+
pool = kowabunga_storage_pool.eu-brezel["eu-west-ssd"].id
141+
name = each.key
142+
desc = each.value.desc
143+
os = try(each.value.os, "linux")
144+
source = each.value.source
145+
default = try(each.value.default, false)
146+
}
147+
```
148+
149+
At creation, declared images will be download by one of the **Kaktus** agent and stored into Ceph cluster. After that, one can simply reference them by their name when creating **Kompute** instances.
150+
151+
{{< alert color="warning" title="Warning" >}}
152+
Depending on remote source, image size and your network performance, retrieving images can take a significant amount of time (several minuutes). TF provider is set to use a 30mn timeout by default. Update it accordingly if you believe this won't be enough.
153+
{{< /alert >}}
154+
155+
Congratulations, you're now done with administration tasks and infrastructure provisionning. You now have a fully working Kowabunga setup, ready to be consumed by end users.
156+
157+
Let's then [provision our first project](/docs/user-guide/create-project/) !

0 commit comments

Comments
 (0)