|
| 1 | +# kup6s-pages Helm Chart |
| 2 | + |
| 3 | +Cloud native multi-tenant static web-hosting for Kubernetes. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +kup6s-pages deploys static websites from Git repositories to Kubernetes. A single nginx pod serves all sites efficiently, with Traefik handling routing via `addPrefix` middleware. The operator automatically manages IngressRoutes and TLS certificates. |
| 8 | + |
| 9 | +**Key Features:** |
| 10 | + |
| 11 | +- Single nginx pod for all sites (no per-site overhead) |
| 12 | +- CRD-based declarative configuration |
| 13 | +- Automatic TLS via cert-manager |
| 14 | +- Traefik IngressRoute integration |
| 15 | +- Git-based deployments with webhook support |
| 16 | +- Private repository support via deploy tokens |
| 17 | + |
| 18 | +## Prerequisites |
| 19 | + |
| 20 | +- Kubernetes 1.24+ |
| 21 | +- Helm 3.0+ |
| 22 | +- Traefik ingress controller |
| 23 | +- cert-manager (for TLS) |
| 24 | +- RWX-capable StorageClass (for shared site storage) |
| 25 | + |
| 26 | +## Installation |
| 27 | + |
| 28 | +### Install from OCI Registry |
| 29 | + |
| 30 | +```bash |
| 31 | +helm install pages oci://ghcr.io/kup6s/kup6s-pages \ |
| 32 | + --create-namespace \ |
| 33 | + --namespace kup6s-pages \ |
| 34 | + --set operator.pagesDomain=pages.example.com \ |
| 35 | + --set 'syncer.allowedHosts={github.com}' |
| 36 | +``` |
| 37 | + |
| 38 | +### Install from Source |
| 39 | + |
| 40 | +```bash |
| 41 | +git clone https://github.com/kup6s/pages.git |
| 42 | +cd pages/charts/kup6s-pages |
| 43 | +helm install pages . \ |
| 44 | + --create-namespace \ |
| 45 | + --namespace kup6s-pages \ |
| 46 | + --set operator.pagesDomain=pages.example.com \ |
| 47 | + --set 'syncer.allowedHosts={github.com}' |
| 48 | +``` |
| 49 | + |
| 50 | +## Required Configuration |
| 51 | + |
| 52 | +### Pages Domain |
| 53 | + |
| 54 | +The `operator.pagesDomain` setting determines the base domain for hosted sites: |
| 55 | + |
| 56 | +```bash |
| 57 | +--set operator.pagesDomain=pages.example.com |
| 58 | +``` |
| 59 | + |
| 60 | +Sites will be accessible at `<site-name>.pages.example.com`. |
| 61 | + |
| 62 | +### Allowed Git Hosts (Security) |
| 63 | + |
| 64 | +**IMPORTANT:** The `syncer.allowedHosts` setting is **required** to prevent SSRF attacks. It limits which Git hosts can be cloned: |
| 65 | + |
| 66 | +```bash |
| 67 | +--set 'syncer.allowedHosts={github.com,gitlab.com}' |
| 68 | +``` |
| 69 | + |
| 70 | +For self-hosted Git servers: |
| 71 | + |
| 72 | +```bash |
| 73 | +--set 'syncer.allowedHosts={git.example.com,github.com}' |
| 74 | +``` |
| 75 | + |
| 76 | +## Quick Start Example |
| 77 | + |
| 78 | +After installation, deploy a static site: |
| 79 | + |
| 80 | +```bash |
| 81 | +kubectl apply -f - <<EOF |
| 82 | +apiVersion: pages.kup6s.com/v1beta1 |
| 83 | +kind: StaticSite |
| 84 | +metadata: |
| 85 | + name: my-website |
| 86 | + namespace: kup6s-pages |
| 87 | +spec: |
| 88 | + repo: https://github.com/user/my-website.git |
| 89 | + domain: my-website.pages.example.com |
| 90 | +EOF |
| 91 | +``` |
| 92 | + |
| 93 | +Check the site status: |
| 94 | + |
| 95 | +```bash |
| 96 | +kubectl get staticsites -n kup6s-pages |
| 97 | +``` |
| 98 | + |
| 99 | +The site will be accessible at `https://my-website.pages.example.com` once the operator creates the IngressRoute and TLS certificate. |
| 100 | + |
| 101 | +## Common Configuration Examples |
| 102 | + |
| 103 | +### Custom Domain with Wildcard TLS |
| 104 | + |
| 105 | +For many sites on a single wildcard certificate: |
| 106 | + |
| 107 | +```bash |
| 108 | +helm install pages oci://ghcr.io/kup6s/kup6s-pages \ |
| 109 | + --set operator.pagesDomain=pages.example.com \ |
| 110 | + --set operator.pagesTlsMode=wildcard \ |
| 111 | + --set operator.pagesWildcardSecret=wildcard-tls-cert \ |
| 112 | + --set 'syncer.allowedHosts={github.com}' |
| 113 | +``` |
| 114 | + |
| 115 | +Create the wildcard certificate separately: |
| 116 | + |
| 117 | +```yaml |
| 118 | +apiVersion: cert-manager.io/v1 |
| 119 | +kind: Certificate |
| 120 | +metadata: |
| 121 | + name: wildcard-tls-cert |
| 122 | + namespace: kup6s-pages |
| 123 | +spec: |
| 124 | + secretName: wildcard-tls-cert |
| 125 | + dnsNames: |
| 126 | + - "*.pages.example.com" |
| 127 | + issuerRef: |
| 128 | + name: letsencrypt-prod |
| 129 | + kind: ClusterIssuer |
| 130 | +``` |
| 131 | +
|
| 132 | +### Custom Storage Class |
| 133 | +
|
| 134 | +```bash |
| 135 | +helm install pages oci://ghcr.io/kup6s/kup6s-pages \ |
| 136 | + --set storage.storageClass=nfs-client \ |
| 137 | + --set storage.size=50Gi \ |
| 138 | + --set operator.pagesDomain=pages.example.com \ |
| 139 | + --set 'syncer.allowedHosts={github.com}' |
| 140 | +``` |
| 141 | + |
| 142 | +### Private Repository Access |
| 143 | + |
| 144 | +Store credentials as a Kubernetes secret: |
| 145 | + |
| 146 | +```bash |
| 147 | +kubectl create secret generic my-deploy-token \ |
| 148 | + -n kup6s-pages \ |
| 149 | + --from-literal=username=deploy-token \ |
| 150 | + --from-literal=password=YOUR_TOKEN |
| 151 | +``` |
| 152 | + |
| 153 | +Reference in StaticSite: |
| 154 | + |
| 155 | +```yaml |
| 156 | +apiVersion: pages.kup6s.com/v1beta1 |
| 157 | +kind: StaticSite |
| 158 | +metadata: |
| 159 | + name: private-site |
| 160 | + namespace: kup6s-pages |
| 161 | +spec: |
| 162 | + repo: https://github.com/user/private-repo.git |
| 163 | + domain: private.pages.example.com |
| 164 | + authSecretRef: |
| 165 | + name: my-deploy-token |
| 166 | +``` |
| 167 | +
|
| 168 | +## Configuration Options |
| 169 | +
|
| 170 | +See [values.yaml](values.yaml) for all available configuration options. |
| 171 | +
|
| 172 | +Key settings: |
| 173 | +
|
| 174 | +| Parameter | Description | Default | |
| 175 | +|-----------|-------------|---------| |
| 176 | +| `operator.pagesDomain` | Base domain for sites | `""` (required) | |
| 177 | +| `operator.pagesTlsMode` | TLS mode: `individual` or `wildcard` | `individual` | |
| 178 | +| `syncer.allowedHosts` | Allowed Git hosts (SECURITY) | `[]` (required) | |
| 179 | +| `storage.storageClass` | StorageClass for site storage | `""` (cluster default) | |
| 180 | +| `storage.size` | PVC size | `10Gi` | |
| 181 | +| `operator.clusterIssuer` | cert-manager ClusterIssuer | `letsencrypt-prod` | |
| 182 | + |
| 183 | +## Documentation |
| 184 | + |
| 185 | +Full documentation: https://pages-docs.sites.kup6s.com |
| 186 | + |
| 187 | +- [Installation Guide](https://pages-docs.sites.kup6s.com/installation/) |
| 188 | +- [Usage Guide](https://pages-docs.sites.kup6s.com/usage/) |
| 189 | +- [Configuration Reference](https://pages-docs.sites.kup6s.com/reference/) |
| 190 | +- [Troubleshooting](https://pages-docs.sites.kup6s.com/troubleshooting/) |
| 191 | + |
| 192 | +## Support |
| 193 | + |
| 194 | +- Report issues: https://github.com/kup6s/pages/issues |
| 195 | +- Source code: https://github.com/kup6s/pages |
| 196 | + |
| 197 | +## License |
| 198 | + |
| 199 | +EUPL-1.2 |
0 commit comments