|
| 1 | +# Deployment |
| 2 | + |
| 3 | +This Helm chart deploys the POSIX Mapper application, which is designed to map POSIX file system operations to a cloud-native environment. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Kubernetes 1.27+ |
| 8 | +- Helm 3.0+ |
| 9 | +- Deployed PostgreSQL database for application data storage |
| 10 | + |
| 11 | +### PostgreSQL Database |
| 12 | +The POSIX Mapper requires a PostgreSQL database to store UID/GID mappings. As this is a critical component, ensure that your database is properly configured and accessible from the POSIX Mapper application. Use some persistent storage solution (like a Persistent Volume Claim) to ensure that the database data is not lost if deploying PostgreSQL in Kubernetes, or install a dedicated instance outside of the cluster. |
| 13 | + |
| 14 | +#### Sample PostgreSQL Installation (in Kubernetes) |
| 15 | +You can deploy a PostgreSQL database using the following Helm chart, with a PVC to ensure data persistence (Using `skaha-system` namespace as an example): |
| 16 | + |
| 17 | +##### Persistent Volume Claim (PVC) |
| 18 | +Create a Persistent Volume Claim (PVC) for PostgreSQL: |
| 19 | +```yaml |
| 20 | +apiVersion: v1 |
| 21 | +kind: PersistentVolumeClaim |
| 22 | +metadata: |
| 23 | + name: posix-mapper-postgres-pvc |
| 24 | + namespace: skaha-system |
| 25 | +spec: |
| 26 | + accessModes: |
| 27 | + - ReadWriteOnce |
| 28 | + resources: |
| 29 | + requests: |
| 30 | + storage: 2Gi |
| 31 | + storageClassName: "" |
| 32 | + selector: |
| 33 | + matchLabels: |
| 34 | + storage: posix-mapper-postgres-storage |
| 35 | +``` |
| 36 | +
|
| 37 | +This will need to match to a Persistent Volume (PV) that is available in your Kubernetes cluster. An example PV could look like this for a CephFS instance in an OpenStack Share: |
| 38 | +
|
| 39 | +```yaml |
| 40 | +--- |
| 41 | +apiVersion: v1 |
| 42 | +kind: PersistentVolume |
| 43 | +metadata: |
| 44 | + name: posix-mapper-postgres-pv |
| 45 | + labels: |
| 46 | + storage: posix-mapper-postgres-storage |
| 47 | +spec: |
| 48 | + capacity: |
| 49 | + storage: 2Gi |
| 50 | + volumeMode: Filesystem |
| 51 | + accessModes: |
| 52 | + - ReadWriteMany |
| 53 | + persistentVolumeReclaimPolicy: Delete |
| 54 | + storageClassName: "" |
| 55 | + cephfs: |
| 56 | + monitors: |
| 57 | + - 10.0.0.1:6789 |
| 58 | + - 10.0.0.2:6789 |
| 59 | + path: /volumes/myvolume |
| 60 | + user: posix-mapper-postgres |
| 61 | + readOnly: false |
| 62 | + secretRef: |
| 63 | + name: posix-mapper-postgres-secret |
| 64 | + namespace: skaha-system |
| 65 | +``` |
| 66 | +
|
| 67 | +Ultimately, it will be up to the deployment to ensure that the PVC is bound to a suitable PV, and that the PV is available in the cluster. |
| 68 | +
|
| 69 | +##### Install PostgreSQL using Helm |
| 70 | +
|
| 71 | +```bash |
| 72 | +helm repo add bitnami https://charts.bitnami.com/bitnami |
| 73 | +helm repo update |
| 74 | +``` |
| 75 | + |
| 76 | +Use a Helm Values file to customize the installation. This will initialize the database schema and set up the required user credentials. The schema should match what the POSIX Mapper expects in its configuration. |
| 77 | +Create a file named `my-postgresql-values.yaml` with the following content: |
| 78 | +```yaml |
| 79 | +auth: |
| 80 | + username: posixmapperuser |
| 81 | + password: posixmapperpwd |
| 82 | + database: posixmapper |
| 83 | +primary: |
| 84 | + initdb: |
| 85 | + scripts: |
| 86 | + init_schema.sql: | |
| 87 | + create schema mapping; |
| 88 | + persistence: |
| 89 | + enabled: true |
| 90 | + existingClaim: posix-mapper-postgres-pvc |
| 91 | +``` |
| 92 | +```bash |
| 93 | +helm install posix-mapper-postgres bitnami/postgresql \ |
| 94 | + --namespace skaha-system \ |
| 95 | + --values my-postgresql-values.yaml |
| 96 | +``` |
| 97 | + |
| 98 | + |
| 99 | +## POSIX Mapper Installation |
| 100 | +To deploy the POSIX Mapper application using the Helm chart, follow these steps: |
| 101 | + |
| 102 | +1. **Add the Helm Repository** |
| 103 | +```bash |
| 104 | +helm repo add science-platform-repo https://images.opencadc.org/chartrepo/platform |
| 105 | +helm repo update |
| 106 | +``` |
| 107 | + |
| 108 | +2. **Install the POSIX Mapper Chart**: |
| 109 | +```bash |
| 110 | +helm -n skaha-system --values <myvalues.yaml> install posix-mapper science-platform-repo/posix-mapper |
| 111 | +``` |
| 112 | + |
| 113 | +## Configuration |
| 114 | +The POSIX Mapper Helm chart comes with _some_ default configuration suitable for most deployments. However, you can customize the installation by providing your own `values.yaml` file. This allows you to override default settings such as resource allocations, environment variables, and other parameters, as well as set **required** parameters such as the PostgreSQL database configuration. |
| 115 | + |
| 116 | +To customize the installation: |
| 117 | + |
| 118 | +- **Create a `local-values.yaml` File**: Define your custom configurations in this file. |
| 119 | +- **Install the Chart with Custom Values**: |
| 120 | +```bash |
| 121 | +helm -n skaha-system upgrade --install --values local-values.yaml posix-mapper science-platform-repo/posix-mapper |
| 122 | +``` |
| 123 | + |
| 124 | +### Supported Configuration Options |
| 125 | +See the [values.yaml](values.yaml) file for a complete list of configuration options. Below are some of the key parameters you can configure: |
| 126 | + |
| 127 | +| Parameter | Description | Default | |
| 128 | +|-----------|-------------|---------| |
| 129 | +| `kubernetesClusterDomain` | Kubernetes cluster domain used to find internal hosts | `cluster.local` | |
| 130 | +| `replicaCount` | Number of POSIX Mapper replicas to deploy | `1` | |
| 131 | +| `tolerations` | Array of tolerations to pass to Kubernetes for fine-grained Node targeting of the `posix-mapper` API | `[]` | |
| 132 | +| `deployment.hostname` | Hostname for the POSIX Mapper deployment | `""` | |
| 133 | +| `deployment.posixMapper.loggingGroups` | List of groups permitted to adjust logging levels for the POSIX Mapper service. | `[]` | |
| 134 | +| `deployment.posixMapper.image` | POSIX Mapper Docker image | `images.opencadc.org/platform/posix-mapper:<current release version>` | |
| 135 | +| `deployment.posixMapper.imagePullPolicy` | Image pull policy for the POSIX Mapper container | `IfNotPresent` | |
| 136 | +| `deployment.posixMapper.resourceID` | Resource ID (URI) for this POSIX Mapper service | `""` | |
| 137 | +| `deployment.posixMapper.oidcURI` | URI (or URL) for the OIDC service | `""` | |
| 138 | +| `deployment.posixMapper.gmsID` | Resource ID (URI) for the IVOA Group Management Service | `""` | |
| 139 | +| `deployment.posixMapper.minUID` | Minimum UID for POSIX Mapper operations. High to avoid conflicts. | `10000` | |
| 140 | +| `deployment.posixMapper.minGID` | Minimum GID for POSIX Mapper operations. High to avoid conflicts. | `900000` | |
| 141 | +| `deployment.posixMapper.registryURL` | URL for the IVOA registry containing service locations | `""` | |
| 142 | +| `deployment.posixMapper.nodeAffinity` | Kubernetes Node affinity for the POSIX Mapper API Pod | `{}` | |
| 143 | +| `deployment.posixMapper.extraPorts` | List of extra ports to expose in the POSIX Mapper service. See the `values.yaml` file for examples. | `[]` | |
| 144 | +| `deployment.posixMapper.extraVolumeMounts` | List of extra volume mounts to be mounted in the POSIX Mapper deployment. See the `values.yaml` file for examples. | `[]` | |
| 145 | +| `deployment.posixMapper.extraVolumes` | List of extra volumes to be mounted in the POSIX Mapper deployment. See the `values.yaml` file for examples. | `[]` | |
| 146 | +| `deployment.posixMapper.extraHosts` | List of extra hosts to be added to the POSIX Mapper deployment. See the `values.yaml` file for examples. | `[]` | |
| 147 | +| `deployment.posixMapper.extraEnv` | List of extra environment variables to be set in the POSIX Mapper service. See the `values.yaml` file for examples. | `[]` | |
| 148 | +| `deployment.posixMapper.resources` | Resource requests and limits for the POSIX Mapper API | `{}` | |
| 149 | +| `postgresql.maxActive` | Maximum number of active connections to the PostgreSQL database | `8` | |
| 150 | +| `postgresql.url` | Required JDBC URL for the PostgreSQL database | `""` | |
| 151 | +| `postgresql.schema` | Required Database schema to use for the POSIX Mapper | `""` | |
| 152 | +| `postgresql.auth.username` | Username for the PostgreSQL database | `""` | |
| 153 | +| `postgresql.auth.password` | Password for the PostgreSQL database | `""` | |
| 154 | + |
0 commit comments