You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/getting-started/kahuna-setup.md
+281Lines changed: 281 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,3 +3,284 @@ title: Setup Kahuna
3
3
description: Let's start with the orchestration core
4
4
weight: 3
5
5
---
6
+
7
+
Now let's suppose that you've cloned the Git platform repository template and that your **Kahuna** instance server has been provisioned with latest Ubuntu LTS distribution. Be sure that it is SSH-accessible with some local user.
8
+
9
+
Let's take the following assumptions for the rest of this tutorial:
10
+
11
+
- We only have one single **Kahuna** instance (no high-availability).
12
+
- Local bootstrap user with **sudo** privileges is *ubuntu*, with key-based SSH authentication.
13
+
-**Kahuna** instance is public-Internet exposed through IP address *1.2.3.4*, translated to *kowabunga.acme.com* DNS.
14
+
-**Kahuna** instance is private-network exposed through IP address *10.0.0.1*.
15
+
-**Kahuna** instance hostname is **kowabunga-kahuna-1**.
16
+
17
+
## Setup DNS
18
+
19
+
Please ensure that your *kowabunga.acme.com* domain translates to public IP address *1.2.3.4*. Configuration is up to you and your DNS provider and can be done manually.
20
+
21
+
Being IaC-supporters, we advise using OpenTofu for that purpose. Let's see how we can do, using Cloudflare DNS provider.
22
+
23
+
Start by editing the **terraform/providers.tf** file in your platform's repository:
The instance is now declared to be part of **kahuna** group and Ansible will use **ubuntu** local user account to connect through SSH.
91
+
92
+
Note that doing so, you can now safely:
93
+
94
+
- declare host-specific variables in **ansible/host_vars/10.0.0.1.yml** file.
95
+
- declare host-specific sensitive variables in **ansible/host_vars/10.0.0.1.sops.yml** file.
96
+
- declare **kahuna** group-specific variables in **ansible/group_vars/kahuna/main.yml** file.
97
+
- declare **kahuna** group-specific sensitive variables in **ansible/group_vars/kahuna.sops.yml** file.
98
+
- declare any other global variables in **ansible/group_vars/all/main.yml** file.
99
+
- declare any other global sensitive variables in **ansible/group_vars/all.sops.yml** file.
100
+
101
+
Note that Ansible variables precedence will apply:
102
+
103
+
```txt
104
+
role defaults < all vars < group vars < host vars < role vars
105
+
```
106
+
107
+
## Ansible Kowabunga Collection
108
+
109
+
Kowabunga comes with an official [Ansible Collection](https://galaxy.ansible.com/ui/repo/published/kowabunga/cloud/) and its associated [documentation](https://ansible.kowabunga.cloud/kowabunga/cloud/index.html#plugins-in-kowabunga-cloud).
110
+
111
+
The collection contains:
112
+
113
+
-**roles** and **playbooks** to easily deploy the various [Kahuna](/docs/concepts/kahuna/), [Koala](/docs/concepts/koala/), [Kiwi](/docs/concepts/kiwi/) and [Kaktus](/docs/concepts/kaktus/) instances.
114
+
-**actions** so you can create your own tasks to interact and manage a previously setup Kowabunga instance.
115
+
116
+
Check out **ansible/requirements.yml** file to declare the specific collection version you'd like to use:
117
+
118
+
```yaml
119
+
---
120
+
collections:
121
+
- name: kowabunga.cloud
122
+
version: 0.0.1
123
+
```
124
+
125
+
By default, your platform is configured to pull a tagged official release from Ansible Galaxy. You may however prefer to pull it directly from Git, using latest commit for instance. This can be accomodated through:
Once defined, simply pull it into your local machine:
136
+
137
+
```sh
138
+
$ kobra ansible pull
139
+
```
140
+
141
+
## Kahuna Settings
142
+
143
+
**Kahuna** instance deployment will take care of everything. It'll take the assumption of running a supported Ubuntu LTS release, enforce some configuration and security settings, install the necessary packages, create local admin user accounts, if required, and setup some form of deny-all filtering policy firewall, so you're safely exposed.
144
+
145
+
### Admin Accounts
146
+
147
+
Let's start by declaring some user admin accounts we'd like to create. We don't want to keep on using the single nominative **ubuntu** account for everyone after all.
148
+
149
+
Simply create/edit the **ansible/inventories/group_vars/all/main.yml** file the following way:
to declare all your expected admin users, and add their respective SSH public key files in the **ansible/files/pubkeys** directory, e.g.:
161
+
162
+
```sh
163
+
$ tree ansible/files/pubkeys/
164
+
ansible/files/pubkeys/
165
+
└── admin_user_1
166
+
└── admin_user_2
167
+
```
168
+
169
+
{{< alert color="success" title="Note" >}}
170
+
Note that all registered admin accounts will have password-less **sudo** privileges.
171
+
{{< /alert >}}
172
+
173
+
We'd also recommend you to set/update the **root** account password. By default, Ubuntu comes without any, making it impossible to login. Kowabunga's playbook make sure that root login is prohibited from SSH for security reasons (e.g. brute-force attacks) but we encourage you setting one, as it's always useful, especially on public cloud VPS or bare metal servers to get a console/IPMI access to log into.
174
+
175
+
If you intend to do so, simply edit the secrets file:
If you **Kahuna** instance is connected on public Internet, it is more than recommended to enable a network firewall. This can be easily done by extending the **ansible/inventories/group_vars/kahuna/main.yml** file with:
190
+
191
+
```yaml
192
+
kowabunga_firewall_enabled: true
193
+
kowabunga_firewall_open_tcp_ports:
194
+
- 22
195
+
- 80
196
+
- 443
197
+
```
198
+
199
+
Note that we're limited opened ports to SSH and HTTP/HTTPS here, which should be more than enough (HTTP is only used by **Caddy** server for certificate auto-renewal and will redirect traffic to HTTPS anyway). If you don't expect your instance to be SSH-accessible on public Internet, you can safely drop this line.
200
+
201
+
### MongoDB
202
+
203
+
**Kahuna** comes with a bundled, ready-to-be-used **MongoDB** deployment. This comes in handy if you only have a unique instance to manage. This remains however optional (default), as you may very well be willing to re-use an existing external production-grade MongoDB cluster, already deployed.
204
+
205
+
If you intend to go with the bundled one, a few settings must be configured in **ansible/inventories/group_vars/kahuna/main.yml** file:
This will basically instruct Ansible to install MongoDB server, configure it with a replicaset (so it can be part of a future cluster instance, we never know), secure it with admin credentials of your choice and create a **kowabunga** database/collection and associated service user.
229
+
230
+
### Kahuna Settings
231
+
232
+
Finally, let's ensure the **Kahuna** orchestrator gets everything he needs to operate.
233
+
234
+
You'll need to define:
235
+
236
+
- a custom email address (and associated SMTP connection settings) for **Kahuna** to be able to send email notifications to users.
237
+
- a randomly generated key to sign JWT tokens (please ensure it is secure enough, not to compromise issued tokens robustness).
238
+
- a randomly generated admin API key. It'll be used to provision the admin bits of Kowabunga, until proper user accounts have been created.
239
+
- a private/public SSH key-pair to be used by platform admins to seamlessly SSH into instantiated [Kompute](/docs/services/kompute/) instances. Please ensure that the private key is being stored securely somewhere.
240
+
241
+
Then simply edit the **ansible/inventories/group_vars/kahuna/main.yml** file the following way:
We're done with configuration (finally) ! All we need to do now is finally run Ansible to make things live. This is done by invoking the **kahuna** playbook from the **kowabunga.cloud** collection:
273
+
274
+
```sh
275
+
$ kobra ansible deploy -p kowabunga.cloud.kahuna
276
+
```
277
+
278
+
Note that, under-the-hood, Ansible will use [Ansible Mitogen extension](https://mitogen.networkgenomics.com/ansible_detailed.html) to speed things up. Bear in mind that Ansible's run is idempotent. Anything's failing can be re-executed. You can also run it as many times you want, or re-run it in the next 6 months or so, provided you're using a tagged collection, the end result will always be the same.
279
+
280
+
After a few minutes, if everything's went okay, you should have a working **Kahuna** instance, i.e.:
281
+
282
+
- A [Caddy](https://caddyserver.com/) frontal reverse-proxy, taking care of automatic TLS certificate issuance, renewal and traffic termination, forwarding requests back to either [Koala](/docs/concepts/koala/) Web application or [Kahuna](/docs/concepts/kahuna/) backend server.
283
+
- The [Kahuna](/docs/concepts/kahuna/) backend server itself, our core orchestrator.
0 commit comments