Skip to content

Commit ac66279

Browse files
Merge pull request #91 from packagist/kubernetes-helm
Kubernetes: first iteration of Helm chart documentation
2 parents 63ba703 + 94d0ba6 commit ac66279

File tree

2 files changed

+115
-1
lines changed

2 files changed

+115
-1
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Installing the Private Packagist Self-Hosted Helm chart in an existing Kubernetes cluster
2+
##
3+
4+
The Private Packagist Self-Hosted Helm chart allows you to install Private Packagist in an existing Kubernetes cluster,
5+
to instead install Private Packagist Self-Hosted without an existing Kubernetes cluster, follow [this guide](./kubernetes-embedded.md).
6+
7+
## General requirements
8+
9+
1. A Kubernetes cluster v1.23 or newer
10+
1. Your username and password to log in to the Helm registry on registry.replicated.com. You can find your credentials in your Private Packagist account at https://packagist.com. Don't have one yet? [Sign up for a free trial license!](https://packagist.com/self-hosted)
11+
1. One (sub-)domain to operate the web interface, e.g. packagist.myintranet.com
12+
1. One (sub-)domain to operate the composer repository, e.g. repo.packagist.myintranet.com or packagist-repo.myintranet.com
13+
1. An SSL certificate valid for both chosen domains
14+
1. An SMTP server or a GMail account for Private Packagist Self-Hosted to send email
15+
1. If your firewall restricts external connections then the following domains must be accessible from the server:
16+
* hub.docker.com
17+
* proxy.replicated.com
18+
* registry.replicated.com
19+
* replicated.app
20+
* amazonaws.com
21+
* k8s.gcr.io
22+
23+
## Installation
24+
25+
Private Packagist Self-Hosted requires PostgreSQL, Redis, and blob storage to store application data and Composer packages.
26+
You can either use the built-in options that come with the Helm chart or use your own PostgreSQL, Redis, and blob storage.
27+
For blob storage, we currently support Azure Blob Storage, Google Cloud Storage, AWS S3, and other S3-compatible storage solutions.
28+
29+
Please note that if you choose to use the built-in solution then each of the storage requires one or more volumes using
30+
[dynamic volume provision](https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/) to allocate storage for the different Pods.
31+
Configure the Storage Class in the values.yaml under `global.storageClass`.
32+
33+
### Annotated configuration
34+
35+
To install the Private Packagist Self-Hosted Helm Chart configure values based on your setup, store them in a YAML file, e.g. `values.yaml`, and then run the commands below.
36+
37+
HELM_CHART_VALUES_FILE
38+
39+
#### Login to the Helm registry and install the chart
40+
41+
Make sure you replace `YOUR_USERNAME`, `YOUR_PASSWORD`, `values.yaml`, and `VERSION` with your values before running the commands.
42+
You can find the latest Private Packagist version on our [changelog page](/docs/self-hosted/changelog).
43+
44+
```
45+
helm registry login registry.replicated.com --username YOUR_USERNAME --password YOUR_PASSWORD
46+
helm install -f values.yaml private-packagist oci://registry.replicated.com/privatepackagistkots/private-packagist --version VERSION
47+
```
48+
49+
Verify that the helm chart is deployed by running `kubectl get pods` and verifying that the `repo`, `ui`, and `worker` pods are running.
50+
You should then be able to access the web interface by opening the configured domain in the browser, e.g. https://packagist.myintranet.com.
51+
52+
#### Authentication Setup
53+
Within Private Packagist Self-Hosted, you now need to set up at least one user authentication method.
54+
You have the choice between authentication with email addresses and passwords and several OAuth integrations with third-party services.
55+
We provide integrations with on-premises versions of GitHub, Bitbucket, GitLab, or their public services on github.com, bitbucket.org,
56+
or gitlab.com. Follow the instructions to create the respective required identifiers, tokens, and secrets.
57+
58+
* [GitHub (Enterprise) Integration Setup](./github-integration-setup.md)
59+
* [Bitbucket.org Integration Setup](./bitbucket-integration-setup.md)
60+
* [Bitbucket Data Center / Server Integration Setup](./bitbucket-server-integration-setup.md)
61+
* [GitLab Integration Setup](./gitlab-integration-setup.md)
62+
* [Authentication with Email Addresses and Passwords](./authentication-email-addresses-passwords-setup.md).
63+
64+
65+
![Add Integration](/Resources/public/img/docs/self-hosted/08-integration.png)
66+
67+
#### Selecting Admins
68+
After setting up an integration, you can log in through the top menu. Register an account and pick a username.
69+
70+
![Register Admin](/Resources/public/img/docs/self-hosted/09-register-admin.png)
71+
72+
The first user is granted admin permissions automatically. You can grant admin permissions to more users in the admin panel.
73+
74+
![Add Admin](/Resources/public/img/docs/self-hosted/10-add-admin.png)
75+
76+
#### Switching to Production Mode
77+
Edit your values.yaml to disable the Setup Mode.
78+
79+
* Change `application.setupMode.enabled` in the values.yaml
80+
* Apply the changes in your cluster with `helm upgrade`
81+
* Restart the ui deployment to apply the changes in the application `kubectl rollout restart deployment ui`
82+
83+
That’s it! Private Packagist Self-Hosted is now ready to be used! You’ll find all further information in the web interface.
84+
85+
## Database and storage with dynamic volumes
86+
87+
Private Packagist Self-Hosted will set up PostgreSQL, Redis, and MinIO to store application data and Composer packages.
88+
Each of them requires one or more volumes using [dynamic volume provision](https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/) to allocate storage for the different Pods.
89+
Configure the Storage Class in the values.yaml under `global.storageClass`.
90+
91+
Alternatively, you can configure Private Packagist Self-Hosted to use your own PostgreSQL, Redis, and blob storage.
92+
For blob storage, we currently support Azure Blob Storage, Google Cloud Storage, AWS S3, and other S3-compatible storage solutions.
93+
You can configure the blob storage in the values.yaml under `storage.type`.
94+
95+
## Security
96+
97+
The Private Packagist Self-Hosted application expects that TLS termination happens at or before the Ingress level.
98+
All traffic within the cluster is unencrypted.
99+
100+
Ensure your Kubernetes network plugin encrypts connections between pods to avoid potential security issues.
101+
102+
## Backups
103+
104+
The Private Packagist Self-Hosted application integrates with [Velero](https://velero.io/), a tool to back up and restore your Kubernetes
105+
cluster resources and persistent volumes. Private Packagist Self-Hosted provides annotations to help back up and restore
106+
the application with Velero.
107+
108+
If you are using your own backup solution, we recommend making regular backups of PostgreSQL, Redis, and the used blob
109+
storage.

docs/self-hosted/kubernetes.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ such as backups or updates.
1313
Private Packagist Self-Hosted Kubernetes can either be installed in an existing cluster or using an installer that creates
1414
an embedded Kubernetes cluster on a linux machine.
1515

16+
#### Installing the Private Packagist Self-Hosted Kubernetes Helm chart in an existing cluster
17+
18+
If you already have an existing Kubernetes cluster running, and are comfortable installing Helm charts then follow [this guide](./kubernetes-helm.md).
19+
1620
#### Installing Private Packagist Self-Hosted Kubernetes in an existing cluster
1721

18-
If you already have an existing Kubernetes cluster running, follow [this guide](./kubernetes-existing.md).
22+
If you already have an existing Kubernetes cluster running, and would like to manage the application with a full fledged
23+
admin interface then follow [this guide](./kubernetes-existing.md).
1924

2025
#### Installing Private Packagist Self-Hosted Kubernetes in a Kubernetes cluster installed with kURL
2126

0 commit comments

Comments
 (0)