Skip to content

Commit f7b4272

Browse files
markphelpsclaude
andauthored
Feat/flipt v2 helm chart (#229)
* feat: add Helm chart for Flipt v2 * feat: update Flipt v2 chart configuration and documentation - Fix startup command to use 'flipt server' for v2 - Remove deprecated configurations from values.yaml - Comment out all default config options to use Flipt v2 defaults - Simplify README to link to official v2 documentation - Update feature descriptions to focus on v2 core capabilities Signed-off-by: Mark Phelps <[email protected]> * feat: update Chart.yaml versions to reflect v2 beta status - Set chart version to 2.0.0-beta - Set appVersion to v2-beta to match current Docker image tag Signed-off-by: Mark Phelps <[email protected]> * feat: restructure README documentation for v1 and v2 charts - Create new root README explaining both v1 and v2 charts with comparison - Move v1-specific content to charts/flipt/README.md - Update v1 chart README to match v2 structure and be chart-specific - Add values table, examples, and troubleshooting sections to v1 README - Provide clear guidance on choosing between v1 and v2 Signed-off-by: Mark Phelps <[email protected]> * feat: remove v1-specific badges from root README - Remove chart version and Flipt version badges that are v1-specific - Root README now focuses on explaining both charts without version-specific badges Signed-off-by: Mark Phelps <[email protected]> * feat: enhance README with v2 streaming and secrets management features - Add links to official v1 and v2 documentation - Highlight v2's real-time streaming API vs v1's polling-based updates - Document v2's built-in secrets management (File, HashiCorp Vault) - Add GPG commit signing support comparison - Update decision criteria to include streaming and secrets features Signed-off-by: Mark Phelps <[email protected]> * chore: fmt Signed-off-by: Mark Phelps <[email protected]> * fix: resolve linting issues in v2 chart files - Add missing newlines at end of Chart.yaml, values.yaml, and README files - Remove trailing spaces from values.yaml line 170 - All files now pass yamllint validation Signed-off-by: Mark Phelps <[email protected]> * fix: correct command rendering in deployment template - Fix command template to use toYaml for proper list rendering - Resolves container startup issue where command was treated as single string - Now correctly renders ['/flipt', 'server'] as separate arguments Signed-off-by: Mark Phelps <[email protected]> * fix: correct command rendering in v1 deployment template - Apply same fix as v2 chart for command template rendering - Use toYaml to properly render command array instead of single string - Ensures consistent behavior between v1 and v2 charts Signed-off-by: Mark Phelps <[email protected]> * chore: add DEVELOPMENT instructions Signed-off-by: Mark Phelps <[email protected]> * chore: rm flipt-data from migration template Signed-off-by: Mark Phelps <[email protected]> * chore: bump v1 chart version Signed-off-by: Mark Phelps <[email protected]> * fix: correct memory utilization percentage in HPA templates Fixed bug where memory-based autoscaling was incorrectly using targetCPUUtilizationPercentage instead of targetMemoryUtilizationPercentage in both v1 and v2 chart HPA templates. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> --------- Signed-off-by: Mark Phelps <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent 9eabb30 commit f7b4272

26 files changed

+1777
-74
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
ct_previous*
22
.envrc
33
node_modules
4+
5+
# Claude Code instructions file
6+
CLAUDE.md

DEVELOPMENT.md

Lines changed: 356 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,356 @@
1+
# Development Guide
2+
3+
This guide provides instructions for local development and testing of the Flipt Helm charts.
4+
5+
## Prerequisites
6+
7+
Before you begin, ensure you have the following tools installed:
8+
9+
- [Docker](https://docs.docker.com/get-docker/)
10+
- [kubectl](https://kubernetes.io/docs/tasks/tools/)
11+
- [Helm](https://helm.sh/docs/intro/install/) (v3.0+)
12+
- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
13+
- [chart-testing (ct)](https://github.com/helm/chart-testing#installation)
14+
15+
## Setting Up Local Development Environment
16+
17+
### 1. Create a kind Cluster
18+
19+
```bash
20+
# Create a new kind cluster for testing
21+
kind create cluster --name flipt-dev
22+
23+
# Verify the cluster is running
24+
kubectl cluster-info --context kind-flipt-dev
25+
kubectl get nodes
26+
```
27+
28+
### 2. Clone and Navigate to Repository
29+
30+
```bash
31+
git clone https://github.com/flipt-io/helm-charts.git
32+
cd helm-charts
33+
```
34+
35+
## Testing Charts Locally
36+
37+
### Testing Flipt v1 Chart
38+
39+
```bash
40+
# Install Flipt v1 chart
41+
helm install flipt-v1-test ./charts/flipt
42+
43+
# Check deployment status
44+
kubectl get pods -l app.kubernetes.io/name=flipt
45+
kubectl get svc -l app.kubernetes.io/name=flipt
46+
47+
# View logs
48+
kubectl logs -l app.kubernetes.io/name=flipt
49+
50+
# Port forward to access Flipt UI
51+
kubectl port-forward svc/flipt-v1-test 8080:8080
52+
53+
# Visit http://localhost:8080 in your browser
54+
```
55+
56+
### Testing Flipt v2 Chart
57+
58+
```bash
59+
# Install Flipt v2 chart
60+
helm install flipt-v2-test ./charts/flipt-v2
61+
62+
# Check deployment status
63+
kubectl get pods -l app.kubernetes.io/name=flipt-v2
64+
kubectl get svc -l app.kubernetes.io/name=flipt-v2
65+
66+
# View logs
67+
kubectl logs -l app.kubernetes.io/name=flipt-v2
68+
69+
# Port forward to access Flipt UI
70+
kubectl port-forward svc/flipt-v2-test 8080:8080
71+
72+
# Visit http://localhost:8080 in your browser
73+
```
74+
75+
## Testing with Custom Values
76+
77+
### Create Test Values Files
78+
79+
Create custom values files for testing different configurations:
80+
81+
```bash
82+
# Create test values for v1
83+
cat > test-values-v1.yaml << EOF
84+
ingress:
85+
enabled: true
86+
className: nginx
87+
hosts:
88+
- host: flipt-v1.local
89+
paths:
90+
- path: /
91+
pathType: Prefix
92+
93+
flipt:
94+
config:
95+
log:
96+
level: DEBUG
97+
db:
98+
url: "file:/var/opt/flipt/flipt.db"
99+
EOF
100+
101+
# Create test values for v2
102+
cat > test-values-v2.yaml << EOF
103+
ingress:
104+
enabled: true
105+
className: nginx
106+
hosts:
107+
- host: flipt-v2.local
108+
paths:
109+
- path: /
110+
pathType: Prefix
111+
112+
flipt:
113+
config:
114+
log:
115+
level: DEBUG
116+
storage:
117+
type: local
118+
local:
119+
path: /var/opt/flipt
120+
EOF
121+
```
122+
123+
### Install with Custom Values
124+
125+
```bash
126+
# Install v1 with custom values
127+
helm install flipt-v1-custom ./charts/flipt -f test-values-v1.yaml
128+
129+
# Install v2 with custom values
130+
helm install flipt-v2-custom ./charts/flipt-v2 -f test-values-v2.yaml
131+
```
132+
133+
## Development Workflow
134+
135+
### 1. Template Testing (Dry Run)
136+
137+
Before installing, always test your templates:
138+
139+
```bash
140+
# Test v1 chart templates
141+
helm template flipt-v1-test ./charts/flipt
142+
143+
# Test v2 chart templates
144+
helm template flipt-v2-test ./charts/flipt-v2
145+
146+
# Test with custom values
147+
helm template flipt-v1-test ./charts/flipt -f test-values-v1.yaml
148+
helm template flipt-v2-test ./charts/flipt-v2 -f test-values-v2.yaml
149+
150+
# Save templates to files for inspection
151+
helm template flipt-v1-test ./charts/flipt > v1-templates.yaml
152+
helm template flipt-v2-test ./charts/flipt-v2 > v2-templates.yaml
153+
```
154+
155+
### 2. Chart Linting
156+
157+
```bash
158+
# Lint all charts
159+
ct lint --lint-conf lintconf.yaml --target-branch main
160+
161+
# Lint specific chart
162+
ct lint --lint-conf lintconf.yaml --charts charts/flipt
163+
ct lint --lint-conf lintconf.yaml --charts charts/flipt-v2
164+
165+
# YAML linting
166+
yamllint -c lintconf.yaml charts/
167+
168+
# Helm linting
169+
helm lint charts/flipt
170+
helm lint charts/flipt-v2
171+
```
172+
173+
### 3. Upgrade Testing
174+
175+
```bash
176+
# Test upgrades for v1
177+
helm upgrade flipt-v1-test ./charts/flipt
178+
helm upgrade flipt-v1-test ./charts/flipt -f test-values-v1.yaml
179+
180+
# Test upgrades for v2
181+
helm upgrade flipt-v2-test ./charts/flipt-v2
182+
helm upgrade flipt-v2-test ./charts/flipt-v2 -f test-values-v2.yaml
183+
```
184+
185+
### 4. Chart Testing with ct
186+
187+
```bash
188+
# Run comprehensive chart tests
189+
ct install --config ct.yaml
190+
191+
# Test specific charts
192+
ct install --config ct.yaml --charts charts/flipt
193+
ct install --config ct.yaml --charts charts/flipt-v2
194+
```
195+
196+
## Debugging Common Issues
197+
198+
### Pod Not Starting
199+
200+
```bash
201+
# Check pod status
202+
kubectl get pods -l app.kubernetes.io/instance=<release-name>
203+
204+
# Describe pod for detailed information
205+
kubectl describe pod -l app.kubernetes.io/instance=<release-name>
206+
207+
# Check logs
208+
kubectl logs -l app.kubernetes.io/instance=<release-name>
209+
210+
# Check events
211+
kubectl get events --sort-by=.metadata.creationTimestamp
212+
```
213+
214+
### Configuration Issues
215+
216+
```bash
217+
# Check ConfigMap contents
218+
kubectl get configmap <release-name> -o yaml
219+
220+
# Check rendered templates
221+
helm get manifest <release-name>
222+
223+
# Check values used
224+
helm get values <release-name>
225+
```
226+
227+
### Network Issues
228+
229+
```bash
230+
# Check services
231+
kubectl get svc -l app.kubernetes.io/instance=<release-name>
232+
233+
# Check endpoints
234+
kubectl get endpoints <release-name>
235+
236+
# Test connectivity
237+
kubectl run -it --rm debug --image=busybox --restart=Never -- sh
238+
# Inside the pod: wget -qO- http://<service-name>:8080/health
239+
```
240+
241+
## Making Changes
242+
243+
### 1. Modify Chart Files
244+
245+
Make your changes to:
246+
- `charts/flipt/` (for v1 changes)
247+
- `charts/flipt-v2/` (for v2 changes)
248+
249+
### 2. Test Changes
250+
251+
```bash
252+
# Lint changes
253+
ct lint --lint-conf lintconf.yaml --target-branch main
254+
255+
# Template test
256+
helm template test-release ./charts/flipt
257+
helm template test-release ./charts/flipt-v2
258+
259+
# Install test
260+
helm install test-release ./charts/flipt
261+
helm install test-release ./charts/flipt-v2
262+
```
263+
264+
### 3. Clean Up Test Releases
265+
266+
```bash
267+
# List releases
268+
helm list
269+
270+
# Uninstall test releases
271+
helm uninstall flipt-v1-test
272+
helm uninstall flipt-v2-test
273+
helm uninstall flipt-v1-custom
274+
helm uninstall flipt-v2-custom
275+
```
276+
277+
## Environment Cleanup
278+
279+
### Clean Up Kubernetes Resources
280+
281+
```bash
282+
# Delete all test releases
283+
helm list --short | xargs -I {} helm uninstall {}
284+
285+
# Verify cleanup
286+
kubectl get all
287+
```
288+
289+
### Delete kind Cluster
290+
291+
```bash
292+
# Delete the development cluster
293+
kind delete cluster --name flipt-dev
294+
295+
# Verify deletion
296+
kind get clusters
297+
```
298+
299+
## Tips and Best Practices
300+
301+
### 1. Use Separate Namespaces
302+
303+
```bash
304+
# Create namespace for testing
305+
kubectl create namespace flipt-test
306+
307+
# Install charts in specific namespace
308+
helm install flipt-v1 ./charts/flipt -n flipt-test
309+
helm install flipt-v2 ./charts/flipt-v2 -n flipt-test
310+
311+
# Clean up namespace
312+
kubectl delete namespace flipt-test
313+
```
314+
315+
### 2. Monitor Resource Usage
316+
317+
```bash
318+
# Check resource usage
319+
kubectl top nodes
320+
kubectl top pods
321+
322+
# Check resource requests/limits
323+
kubectl describe deployment <release-name>
324+
```
325+
326+
### 3. Test Different Scenarios
327+
328+
- Test with minimal values (defaults)
329+
- Test with custom configurations
330+
- Test upgrades between versions
331+
- Test with different Kubernetes versions
332+
- Test resource limits and requests
333+
- Test ingress configurations
334+
- Test persistent storage
335+
336+
### 4. Version Testing
337+
338+
```bash
339+
# Test with specific image versions
340+
helm install flipt-v1 ./charts/flipt --set image.tag=v1.59.0
341+
helm install flipt-v2 ./charts/flipt-v2 --set image.tag=v2-beta
342+
```
343+
344+
## Continuous Integration
345+
346+
The repository uses GitHub Actions for automated testing. You can run similar tests locally:
347+
348+
```bash
349+
# Run the same linting as CI
350+
ct lint --lint-conf lintconf.yaml --target-branch main
351+
352+
# Run the same installation tests as CI
353+
ct install --config ct.yaml
354+
```
355+
356+
For more information about the CI pipeline, see the GitHub Actions workflows in `.github/workflows/`.

0 commit comments

Comments
 (0)