Skip to content
Snippets Groups Projects
Unverified Commit 7c4ce217 authored by Théo Zimmermann's avatar Théo Zimmermann
Browse files

Document image creation, update to coreos 38 and set availability zone.

parent 60925554
No related branches found
No related tags found
No related merge requests found
## Installation process
This document describes the installation process of Coder for the INF110 labs on the R2 OpenStack cluster.
It should be possible to adapt this to other use cases or OpenStack clusters with minor modifications.
This document describes the installation process of Coder for the INF110 labs on the R2 OpenStack.
It should be possible to adapt this to other use cases or OpenStack instances with minor modifications.
### Prerequisites
We will need an OpenStack project, an `openrc` file, and the OpenStack CLI tools. The CLI tools are available in the `nix develop` environment.
```bash
source openrc # automatically done by the nix env if you have this file
```
The project should have a Fedora CoreOS image available.
```bash
openstack image list
```
If not, it can be created using the following command (after downloading the image from the [Fedora CoreOS website](https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/38.20230806.3.0/x86_64/fedora-coreos-38.20230806.3.0-openstack.x86_64.qcow2.xz)):
```bash
openstack image create Fedora-CoreOS-38 --file=fedora-coreos-38.20230806.3.0-openstack.x86_64.qcow2 --disk-format=qcow2 --container-format=bare --property os_distro='fedora-coreos'
```
The project should know about your SSH keypair.
```bash
openstack keypair list
```
If not, you can add it using the following command:
```bash
export KEYPAIR= # your keypair name
openstack keypair create --public-key ~/.ssh/id_rsa.pub $KEYPAIR
```
You may want to add the `export KEYPAIR=...` line to your `openrc` file to avoid having to set it each time.
### Create the cluster template
```bash
source openrc # automatically done by the nix env / make sure to have this file
export KEYPAIR= # your keypair
export KEYPAIR= # your keypair name
openstack coe cluster template create \
--coe kubernetes \
--image coreos-35 \
--image Fedora-CoreOS-38 \
--external-network $(openstack network show provider -f json | jq -r .id) \
--keypair $KEYPAIR \
--network-driver flannel \
......@@ -19,7 +53,7 @@ openstack coe cluster template create \
--flavor m2.xlarge \
--master-flavor m1.medium \
--docker-storage-driver overlay2 \
--labels 'auto_healing_enabled=true,auto_scaling_enabled=true,min_node_count=1,max_node_count=100,boot_volume_type=LVM-NVME,etcd_volume_type=LVM-NVME,docker_volume_type=LVM-NVME' \
--labels 'auto_healing_enabled=true,auto_scaling_enabled=true,min_node_count=1,max_node_count=100,boot_volume_type=LVM-NVME,etcd_volume_type=LVM-NVME,docker_volume_type=LVM-NVME,availability_zone=nova' \
--registry-enabled \
--insecure-registry '10.0.0.99:5000' \
--server-type vm \
......@@ -33,7 +67,13 @@ openstack coe cluster template create \
openstack coe cluster create --cluster-template coder --node-count 1 inf110
```
It can happen that the cluster creation hangs. In that case, log in to the master node and check if it reports that the `etcd` service failed. If so, restart the `etcd` service and the cluster creation should continue.
You can follow the cluster creation process using the "Orchestration > Stacks" section of the OpenStack dashboard or using the CLI:
```bash
openstack coe cluster show inf110
```
It can happen that the cluster creation hangs during the step of creating the master node. In that case, try associating a public IP to the master node. If it still doesn't resolve the problem, log in to the master node and check if it reports that the `etcd` service failed. If so, restart the `etcd` service and the cluster creation should continue.
```bash
sudo systemctl restart etcd
......@@ -46,7 +86,7 @@ This registry will be used to store the Docker image of the Coder workspace.
```bash
openstack server create \
--flavor smi-worker \
--image coreos-35 \
--image Fedora-CoreOS-38 \
--no-network \
--security-group default \
--security-group registry \
......@@ -164,7 +204,7 @@ rpm-ostree install helm # no reboot required
kubectl create namespace coder
kubectl apply -f /tmp/postgresql-pvc.yml -n coder
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install coder-db bitnami/postgresql -n coder -f /tmp/postgresql-values.yml --version 13.0.0 # latest compatible version with Helm 3.2 and thus coreos 35
helm install coder-db bitnami/postgresql -n coder -f /tmp/postgresql-values.yml --version 13.0.0 # latest compatible version with Helm 3.2 and thus coreos 38
kubectl create secret generic coder-db-url -n coder --from-literal=url="postgres://coder:coder@coder-db-postgresql.coder.svc.cluster.local:5432/coder?sslmode=disable"
helm repo add coder-v2 https://helm.coder.com/v2
helm install coder coder-v2/coder --namespace coder --values /tmp/coder-values.yml --version 2.13.5 # Latest stable version
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment