2023-08-21 23:14:53 +09:00
|
|
|
# Running a iceshrimp server with Kubernetes and Helm
|
2023-05-11 08:07:45 +09:00
|
|
|
|
|
|
|
This is a [Helm](https://helm.sh/) chart directory in the root of the project
|
2023-08-21 23:14:53 +09:00
|
|
|
that you can use to deploy iceshrimp to a Kubernetes cluster
|
2023-05-11 08:07:45 +09:00
|
|
|
|
|
|
|
## Deployment
|
|
|
|
|
|
|
|
1. Copy the example helm values and make your changes:
|
|
|
|
```shell
|
|
|
|
cp .config/helm_values_example.yml .config/helm_values.yml
|
|
|
|
```
|
|
|
|
|
|
|
|
2. Update helm dependencies:
|
|
|
|
```shell
|
|
|
|
cd chart
|
|
|
|
helm dependency list $dir 2> /dev/null | tail +2 | head -n -1 | awk '{ print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done;
|
|
|
|
cd ../
|
|
|
|
```
|
|
|
|
|
2023-08-21 23:14:53 +09:00
|
|
|
3. Create the iceshrimp helm release (also used to update existing deployment):
|
2023-05-11 08:07:45 +09:00
|
|
|
```shell
|
|
|
|
helm upgrade \
|
|
|
|
--install \
|
2023-08-21 23:14:53 +09:00
|
|
|
--namespace iceshrimp \
|
2023-05-11 08:07:45 +09:00
|
|
|
--create-namespace \
|
2023-08-21 23:14:53 +09:00
|
|
|
iceshrimp chart/ \
|
2023-05-11 08:07:45 +09:00
|
|
|
-f .config/helm_values.yml
|
|
|
|
```
|
|
|
|
|
2023-08-21 23:14:53 +09:00
|
|
|
4. Watch your iceshrimp server spin up:
|
2023-05-11 08:07:45 +09:00
|
|
|
```shell
|
2023-08-21 23:14:53 +09:00
|
|
|
kubectl -n iceshrimp get po -w
|
2023-05-11 08:07:45 +09:00
|
|
|
```
|
|
|
|
|
|
|
|
5. Initial the admin user and managed config:
|
|
|
|
```shell
|
2023-08-21 23:14:53 +09:00
|
|
|
export iceshrimp_USERNAME="my_desired_admin_handle" && \
|
|
|
|
export iceshrimp_PASSWORD="myDesiredInitialPassword" && \
|
|
|
|
export iceshrimp_HOST="iceshrimp.example.com" && \
|
|
|
|
export iceshrimp_TOKEN=$(curl -X POST https://$iceshrimp_HOST/api/admin/accounts/create -H "Content-Type: application/json" -d "{ \"username\":\"$iceshrimp_USERNAME\", \"password\":\"$iceshrimp_PASSWORD\" }" | jq -r '.token') && \
|
|
|
|
echo "Save this token: ${iceshrimp_TOKEN}" && \
|
|
|
|
curl -X POST -H "Authorization: Bearer $iceshrimp_TOKEN" https://$iceshrimp_HOST/api/admin/accounts/hosted
|
2023-05-11 08:07:45 +09:00
|
|
|
```
|
|
|
|
|
|
|
|
6. Enjoy!
|