Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
📚 Add documentation to install with Kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
bameda committed Oct 14, 2024
1 parent 11c3dc1 commit 25d45ef
Showing 1 changed file with 146 additions and 0 deletions.
146 changes: 146 additions & 0 deletions technical-guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,152 @@ Postgres database and another one for the assets uploaded by your users (images
clips). There may be more volumes if you enable other features, as explained in the file
itself.


## Install with Kubernetes

This section details everything you need to know to get Penpot up and running in production environments using a Kubernetes cluster of your choice. To do this, we have created a <a href="https://helm.sh/" target="_blank">Helm<a> repository with everything you need.

Therefore, your prerequisite will be to have a Kubernetes cluster on which we can install Helm.

### What is Helm

*Helm* is the package manager for Kubernetes. A *Chart* is a Helm package. It contains all of the resource definitions necessary to run an application, tool, or service inside of a Kubernetes cluster. Think of it like the Kubernetes equivalent of a Homebrew formula, an Apt dpkg, or a Yum RPM file.

A Repository is the place where charts can be collected and shared. It's like Perl's CPAN archive or the Fedora Package Database, but for Kubernetes packages.

A Release is an instance of a chart running in a Kubernetes cluster. One chart can often be installed many times into the same cluster. And each time it is installed, a new release is created. Consider a MySQL chart. If you want two databases running in your cluster, you can install that chart twice. Each one will have its own release, which will in turn have its own release name.

With these concepts in mind, we can now explain Helm like this:

> Helm installs charts into Kubernetes clusters, creating a new release for each installation. And to find new charts, you can search Helm chart repositories.
### Install Helm

<p class="advice">
Skip this section if you already have Helm installed in your system.
</p>

There are two methods of installing Helm.

#### From The Helm Project (official)

Helm has an installer script that will automatically grab the latest version
of Helm and [install it
locally](https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3).

You can fetch that script, and then execute it locally. It's well documented so
that you can read through it and understand what it is doing before you run it.

```bash
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
```

Yes, you can `curl
https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash` if
you want to live on the edge.

#### Through Package Managers (community)

The Helm community provides the ability to install Helm through operating system
package managers. These are not supported by the Helm project and are not
considered trusted 3rd parties.

- From Apt (Debian/Ubuntu)
```bash
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
sudo apt-get install apt-transport-https --yes
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm
```
- From dnf/yum (fedora >= 35)
```bash
sudo dnf install helm
```
- From Snap
```bash
sudo snap install helm --classic
```
- From Homebrew (macOS)
```bash
brew install helm
```
- From Chocolatey (Windows)
```bash
choco install kubernetes-helm
```
- From Scoop (Windows)
```bash
scoop install helm
```
- From Winget (Windows)
```bash
winget install Helm.Helm
```

### Add Penpot repository

```bash
helm repo add penpot http://helm.penpot.app
```

### Install Penpot Chart

To install the chart with the release name `my-release`:

```bash
helm install my-release penpot/penpot
```

You can customize the installation specify each parameter using the `--set key=value[,key=value]` argument to helm install. For example,

```bash
helm install my-release \
--set global.postgresqlEnabled=true \
--set global.redisEnabled=true \
--set persistence.assets.enabled=true \
penpot/penpot
```

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

```bash
helm install my-release -f values.yaml penpot/penpot
```

### Configure Penpot with Helm Chart

In the previous section we have shown how to configure penpot during installation by using parameters or by using a yaml file.

The default values are defined in the <a href="https://github.com/penpot/penpot-helm/blob/main/charts/penpot/values.yaml" target="_blank">`values.yml`</a> file itself, which you can use as a basis for creating your own settings.

You can also consult the list of parameters on the <a href="https://artifacthub.io/packages/helm/penpot/penpot#parameters" target="_blank">ArtifactHub page of the project</a>.

### Upgrade Penpot

When a new version of Penpot's chart is released, or when you want to change the configuration of your release, you can use the helm upgrade command.

```bash
helm upgrade my-release -f values.yaml penpot/penpot
```

An upgrade takes an existing release and upgrades it according to the information you provide. Because Kubernetes charts can be large and complex, Helm tries to perform the least invasive upgrade. It will only update things that have changed since the last release.

After each upgrade, a new *revision* will be generated. You can check the revision history of a release with `helm history my-release` and go back to the previous revision if something went wrong with `helm rollback my-release 1` (`1` is the revision number of the previous release revision).

### Backup Penpot

The Penpot's Helm Chart uses different Persistent Volumes to store all persistent data. This allows you to delete and recreate the instance whenever you want without losing information.

You back up data from a Persistent Volume via snapshots, so you will want to ensure that your container storage interface (CSI) supports volume snapshots. There are a couple of different options for the CSI driver that you choose. All of the major cloud providers have their respective CSI drivers.

At last, there are two Persistent Volumes used: one for the Postgres database and another one for the assets uploaded by your users (images and svg clips). There may be more volumes if you enable other features, as explained in the file itself.

You have to back up your custom settings too (the yaml file or the list of parameters you are using during you setup).


## Unofficial self-host options

There are some other options, **NOT SUPPORTED BY PENPOT**:
Expand Down

0 comments on commit 25d45ef

Please sign in to comment.