80 lines
1.5 KiB
Markdown
80 lines
1.5 KiB
Markdown
|
|
# Kubernetes Templates
|
||
|
|
|
||
|
|
Jinja2 templates for generating Kubernetes manifests.
|
||
|
|
|
||
|
|
## Templates
|
||
|
|
|
||
|
|
### `deployment.yaml.j2`
|
||
|
|
|
||
|
|
Generate Kubernetes Deployment manifests from Nickel configuration.
|
||
|
|
|
||
|
|
Includes:
|
||
|
|
- Pod template spec
|
||
|
|
- Resource requests/limits
|
||
|
|
- Environment variables from config
|
||
|
|
- Health checks (liveness/readiness probes)
|
||
|
|
- Replica configuration
|
||
|
|
|
||
|
|
Usage:
|
||
|
|
```bash
|
||
|
|
nickel export vapora.enterprise.ncl | \
|
||
|
|
jinja2 templates/kubernetes/deployment.yaml.j2 > vapora-deployment.yaml
|
||
|
|
```
|
||
|
|
|
||
|
|
### `configmap.yaml.j2`
|
||
|
|
|
||
|
|
Generate Kubernetes ConfigMap for storing configuration.
|
||
|
|
|
||
|
|
Includes:
|
||
|
|
- Config file content
|
||
|
|
- Environment variables
|
||
|
|
- Metadata labels
|
||
|
|
|
||
|
|
Usage:
|
||
|
|
```bash
|
||
|
|
nickel export vapora.multiuser.ncl | \
|
||
|
|
jinja2 templates/kubernetes/configmap.yaml.j2 > vapora-configmap.yaml
|
||
|
|
```
|
||
|
|
|
||
|
|
### `service.yaml.j2`
|
||
|
|
|
||
|
|
Generate Kubernetes Service manifests.
|
||
|
|
|
||
|
|
Includes:
|
||
|
|
- Service type (ClusterIP, LoadBalancer, etc.)
|
||
|
|
- Port mappings
|
||
|
|
- Selectors
|
||
|
|
|
||
|
|
Usage:
|
||
|
|
```bash
|
||
|
|
jinja2 templates/kubernetes/service.yaml.j2 > vapora-service.yaml
|
||
|
|
```
|
||
|
|
|
||
|
|
### `ingress.yaml.j2`
|
||
|
|
|
||
|
|
Generate Kubernetes Ingress for routing.
|
||
|
|
|
||
|
|
Includes:
|
||
|
|
- Host rules
|
||
|
|
- TLS configuration
|
||
|
|
- Backend service references
|
||
|
|
|
||
|
|
## Workflow
|
||
|
|
|
||
|
|
```
|
||
|
|
Nickel Config
|
||
|
|
↓
|
||
|
|
Render Deployment Manifest
|
||
|
|
Render ConfigMap Manifest
|
||
|
|
Render Service Manifest
|
||
|
|
Render Ingress Manifest
|
||
|
|
↓
|
||
|
|
Apply to Cluster (kubectl apply)
|
||
|
|
```
|
||
|
|
|
||
|
|
## References
|
||
|
|
|
||
|
|
- Parent: `../README.md`
|
||
|
|
- Kubernetes docs: https://kubernetes.io/docs/
|
||
|
|
- ConfigMap patterns: https://kubernetes.io/docs/concepts/configuration/configmap/
|