|
| 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 | + |
| 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 | + |
| 71 | + |
| 72 | +The first user is granted admin permissions automatically. You can grant admin permissions to more users in the admin panel. |
| 73 | + |
| 74 | + |
| 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. |
0 commit comments