|
| 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 v1.24 |
| 10 | +1. Your username and password to log in to the registry. 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 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 build-in options to 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 chose to use the built-int 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 global values section. |
| 32 | + |
| 33 | +### Annotated configuration |
| 34 | + |
| 35 | +HELM_CHART_VALUES_FILE |
| 36 | + |
| 37 | +#### Login to the Helm registry and install the chart |
| 38 | + |
| 39 | +To install the Private Packagist Self-Hosted Helm Chart configure values based on your setup and then run the commands below. |
| 40 | +Make sure you replace `YOUR_USERNAME`, `YOUR_PASSWORD`, `YOURVALUES.yaml`, and `VERSION` with your values before running the commands. |
| 41 | + |
| 42 | +``` |
| 43 | +helm registry login registry.replicated.com --username YOUR_USERNAME --password YOUR_PASSWORD |
| 44 | +helm install -f YOURVALUES.yaml private-packagist oci://registry.replicated.com/privatepackagistkots/unstable/private-packagist --version VERSION |
| 45 | +``` |
| 46 | + |
| 47 | +#### Authentication Setup |
| 48 | +Within Private Packagist Self-Hosted, you now need to set up at least one user authentication method. |
| 49 | +You have the choice between authentication with email addresses and passwords and several OAuth integrations with third-party services. |
| 50 | +We provide integrations with on-premises versions of GitHub, Bitbucket, GitLab, or their public services on github.com, bitbucket.org, |
| 51 | +or gitlab.com. Follow the instructions to create the respective required identifiers, tokens, and secrets. |
| 52 | + |
| 53 | +* [GitHub (Enterprise) Integration Setup](./github-integration-setup.md) |
| 54 | +* [Bitbucket.org Integration Setup](./bitbucket-integration-setup.md) |
| 55 | +* [Bitbucket Data Center / Server Integration Setup](./bitbucket-server-integration-setup.md) |
| 56 | +* [GitLab Integration Setup](./gitlab-integration-setup.md) |
| 57 | +* [Authentication with Email Addresses and Passwords](./authentication-email-addresses-passwords-setup.md). |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +#### Selecting Admins |
| 63 | +After setting up an integration, you can log in through the top menu. Register an account and pick a username. |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +The first user is granted admin permissions automatically. You can grant admin permissions to more users in the admin panel. |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +#### Switching to Production Mode |
| 72 | +Head back to the admin console to disable the Setup Mode in the configuration. Once the preflight checks passed, you can |
| 73 | +apply the changes. |
| 74 | + |
| 75 | +That’s it! Private Packagist Self-Hosted is now ready to be used! You’ll find all further information in the web interface. |
| 76 | + |
| 77 | +## Database and storage with dynamic volumes |
| 78 | + |
| 79 | +Private Packagist Self-Hosted will set up PostgreSQL, Redis, and MinIO to store application data and Composer packages. |
| 80 | +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. |
| 81 | +Configure the Storage Class under the Kubernetes Settings on the Config page in the admin console. |
| 82 | + |
| 83 | +Alternatively, you can configure Private Packagist Self-Hosted to use your own PostgreSQL, Redis, and blob storage. |
| 84 | +For blob storage, we currently support Azure Blob Storage, Google Cloud Storage, AWS S3, and other S3-compatible storage solutions. |
| 85 | + |
| 86 | +## Security |
| 87 | + |
| 88 | +The Private Packagist Self-Hosted application expects that TLS termination happens at or before the Ingress level. |
| 89 | +All traffic within the cluster is unencrypted. |
| 90 | + |
| 91 | +Make sure your Kubernetes network plugin encrypts connections between pods to avoid potential security issues. |
| 92 | + |
| 93 | +## Backups |
| 94 | + |
| 95 | +The Replicated admin console integrates with [Velero](https://velero.io/), a tool to back up and restore your Kubernetes |
| 96 | +cluster resources and persistent volumes. Private Packagist Self-Hosted provides annotations to help back up and restore |
| 97 | +the application with Velero. |
| 98 | + |
| 99 | +If you are using your own backup solution, we recommend making regular backups of PostgreSQL, Redis, and the used blob |
| 100 | +storage. |
0 commit comments