forked from cerc-io/stack-orchestrator
77 lines
1.4 KiB
Markdown
77 lines
1.4 KiB
Markdown
# Helm Chart Generation
|
|
|
|
Generate Kubernetes Helm charts from stack compose files using Kompose.
|
|
|
|
## Prerequisites
|
|
|
|
Install Kompose:
|
|
|
|
```bash
|
|
# Linux
|
|
curl -L https://github.com/kubernetes/kompose/releases/download/v1.34.0/kompose-linux-amd64 -o kompose
|
|
chmod +x kompose
|
|
sudo mv kompose /usr/local/bin/
|
|
|
|
# macOS
|
|
brew install kompose
|
|
|
|
# Verify
|
|
kompose version
|
|
```
|
|
|
|
## Usage
|
|
|
|
### 1. Create spec file
|
|
|
|
```bash
|
|
laconic-so --stack <stack-name> deploy --deploy-to k8s init \
|
|
--kube-config ~/.kube/config \
|
|
--output spec.yml
|
|
```
|
|
|
|
### 2. Generate Helm chart
|
|
|
|
```bash
|
|
laconic-so --stack <stack-name> deploy create \
|
|
--spec-file spec.yml \
|
|
--deployment-dir my-deployment \
|
|
--helm-chart
|
|
```
|
|
|
|
### 3. Deploy to Kubernetes
|
|
|
|
```bash
|
|
helm install my-release my-deployment/chart
|
|
kubectl get pods -n zenith
|
|
```
|
|
|
|
## Output Structure
|
|
|
|
```bash
|
|
my-deployment/
|
|
├── spec.yml # Reference
|
|
├── stack.yml # Reference
|
|
└── chart/ # Helm chart
|
|
├── Chart.yaml
|
|
├── README.md
|
|
└── templates/
|
|
└── *.yaml
|
|
```
|
|
|
|
## Example
|
|
|
|
```bash
|
|
# Generate chart for stage1-zenithd
|
|
laconic-so --stack stage1-zenithd deploy --deploy-to k8s init \
|
|
--kube-config ~/.kube/config \
|
|
--output stage1-spec.yml
|
|
|
|
laconic-so --stack stage1-zenithd deploy create \
|
|
--spec-file stage1-spec.yml \
|
|
--deployment-dir stage1-deployment \
|
|
--helm-chart
|
|
|
|
# Deploy
|
|
helm install stage1-zenithd stage1-deployment/chart
|
|
```
|