fukuops/k8s/charts/_template/README.md

105 lines
2.8 KiB
Markdown

# chart
A Helm chart template with standardized structure for self-hosted services.
## TL;DR
```bash
helm install chart oci://git.roboces.dev/catalin/fukuops/chart --version 1.0.0 -n apps-roboces
```
## Prerequisites
- Kubernetes 1.19+
- Helm 3+
- A NFS storage class (default: `truenas-nfs-csi`) - only if persistence is enabled
- An existing `Secret` with credentials if required (see `secret.existingSecretName`)
## Configuration
### Basic Configuration
```yaml
service:
type: LoadBalancer
port: 80
ingress:
enabled: true
className: "traefik"
hosts:
- host: chart.example.com
paths:
- path: /
pathType: Prefix
```
### With Persistence
```yaml
persistence:
enabled: true
storageClass: "truenas-nfs-csi"
accessMode: ReadWriteMany
size: 10Gi
```
### With Secrets
```yaml
secret:
existingSecretName: chart-secrets
```
## Values Reference
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| `replicaCount` | int | `1` | Number of replicas |
| `image.repository` | string | `nginx` | Image repository |
| `image.pullPolicy` | string | `IfNotPresent` | Image pull policy |
| `image.tag` | string | `.Chart.AppVersion` | Image tag |
| `service.type` | string | `LoadBalancer` | Service type |
| `service.port` | int | `80` | Service port |
| `service.targetPort` | int | `80` | Container port |
| `ingress.enabled` | bool | `false` | Enable ingress |
| `ingress.className` | string | `traefik` | Ingress class |
| `persistence.enabled` | bool | `false` | Enable persistence |
| `persistence.storageClass` | string | `truenas-nfs-csi` | Storage class |
| `persistence.accessMode` | string | `ReadWriteMany` | Access mode |
| `persistence.size` | string | `1Gi` | PVC size |
| `persistence.name` | string | `chart-data` | PVC name |
| `secret.existingSecretName` | string | `""` | Existing secret name |
| `resources` | object | `{}` | Container resources |
| `livenessProbe` | object | (see values.yaml) | Liveness probe |
| `readinessProbe` | object | (see values.yaml) | Readiness probe |
| `nodeSelector` | object | `{}` | Node selector |
| `tolerations` | array | `[]` | Tolerations |
| `affinity` | object | `{}` | Affinity rules |
## Persistence
When persistence is enabled, a PVC named `chart-data` is created. The PVC uses the `truenas-nfs-csi` storage class by default with `ReadWriteMany` access mode.
## Secret Management
The chart looks for an existing `Secret` with the name specified in `secret.existingSecretName`. If not provided, no secret is mounted.
## Troubleshooting
### Pod not starting
```bash
kubectl get pvc -n apps-roboces -l app.kubernetes.io/name=chart
```
### Check logs
```bash
kubectl logs chart-0 -n apps-roboces
```
### Verify configmap
```bash
kubectl get configmap chart-config -n apps-roboces -o yaml
```