Skip to content

Commit e602ed3

Browse files
authored
v0.9.0: Update to FeatBit v5.2.0 with Database Migration Scripts (#65)
This pull request upgrades the FeatBit Helm chart and related Kubernetes manifests to version 0.9.0, with a corresponding application update to v5.2.0. It introduces new database migration scripts for both PostgreSQL and MongoDB, updates documentation to clarify upgrade and dependency procedures, and ensures all image tags are aligned with the new release. The most significant changes are grouped below. Release and Version Updates Bumped Helm chart version to 0.9.0 and application version to 5.2.0 in Chart.yaml, values.yaml, and all example deployment files to ensure consistency across environments. Database Migration Scripts (exernal databases excluded) Added new migration scripts for PostgreSQL (06_v5.2.0.sql) and MongoDB (05_v5.2.0.js) to support schema changes required for v5.2.0, including new columns, default values, and updated policies/permissions for feature flags and environments. Documentation Improvements Updated README.md to clarify upgrade procedures, emphasizing manual execution of migration scripts before upgrading, and added a dedicated "Migration and Upgrades" section. Revised dependency notice and recommendations for production environments, highlighting Bitnami image deprecation and the need for external managed services. Policy and Permissions Enhancements (via migrations) Migration scripts update organization, policy, and access token documents/tables to improve feature flag management, environment access, and default policy behaviors for both "Administrator" and "Developer" roles.
1 parent 33d64eb commit e602ed3

File tree

9 files changed

+429
-43
lines changed

9 files changed

+429
-43
lines changed

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ charts/featbit/
107107
image:
108108
registry: docker.io
109109
repository: featbit/<service>
110-
tag: "5.1.4"
110+
tag: "5.2.0"
111111

112112
service:
113113
type: ClusterIP
@@ -229,4 +229,4 @@ Create in `examples/standard/` or `examples/pro/`:
229229

230230
- Main repository: https://github.com/featbit/featbit
231231
- Chart repository: https://github.com/featbit/featbit-charts
232-
- Current version: 0.8.0 (App: 5.1.4)
232+
- Current version: 0.9.0 (App: 5.2.0)

README.md

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,6 @@ This Helm chart bootstraps a [FeatBit](https://github.com/featbit/featbit) insta
77
* Kubernetes >=1.23
88
* Helm >= 3.7.0
99

10-
## ⚠️ Dependencies Notice
11-
12-
🚨 **CRITICAL: Bitnami Image Repository Changes (Effective August 2025)**
13-
14-
This chart includes the following infrastructure dependencies which are **strictly for testing and development purposes**:
15-
16-
- **PostgreSQL**: Default primary database *(⚠️ bitnami legacy images only, no update)*
17-
- **MongoDB**: Alternative primary database
18-
- **Redis**: Required caching layer *(⚠️ bitnami legacy images only, no update)*
19-
- **Kafka**: Optional messaging system *(⚠️ bitnami legacy images only, no updates)*
20-
- **ClickHouse**: Optional analytics database *(⚠️ bitnami legacy images only, no updates)*
21-
22-
**For local testing/development**, we provide example configurations in [`charts/featbit/examples/standard/`](./charts/featbit/examples/standard/) that use specific container images:
23-
- [`featbit-standard-local-pg.yaml`](./charts/featbit/examples/standard/featbit-standard-local-pg.yaml) - PostgreSQL + Redis configuration for local Docker Desktop Kubernetes
24-
- [`featbit-standard-local-mongo.yaml`](./charts/featbit/examples/standard/featbit-standard-local-mongo.yaml) - MongoDB + Redis configuration for local Docker Desktop Kubernetes
25-
26-
These examples leverage the default image configurations in `values.yaml`, which specify tested and compatible versions for local development environments.
27-
28-
29-
**For production environments**, we HIGHLY recommend that you use external managed services (your own included):
30-
31-
- **PostgreSQL/MongoDB**: Configure `externalPostgresql` or `externalMongodb` with managed database services (Azure Database for PostgreSQL, AWS RDS, Google Cloud SQL, etc.)
32-
- **Redis**: Configure `externalRedis` with managed Redis services (Azure Cache for Redis, AWS ElastiCache, Google Cloud Memorystore, etc.)
33-
- **Kafka**: Configure `externalKafka` with managed Kafka services (Confluent Cloud, AWS MSK, Azure Event Hubs, etc.)
34-
- **ClickHouse**: Configure `externalClickhouse` with managed ClickHouse services (ClickHouse Cloud, Altinity.Cloud, etc.)
35-
36-
3710
## Usage
3811

3912
[Helm](https://helm.sh) must be installed to use the charts. Please refer to
@@ -73,6 +46,30 @@ Helm's [documentation](https://helm.sh/docs)
7346

7447
Note that if your device is based on the arm64 architecture, please use version 0.2.1 and above.
7548

49+
## Migration and Upgrades
50+
51+
🔄 **Starting from Helm Chart v0.9.0 (FeatBit v5.2.0)**
52+
53+
Each release includes migration scripts in the [`migration/`](./migration/) folder. **Database migrations are NOT executed automatically by Helm** - they must be reviewed and executed manually by your DBA or database team before upgrading.
54+
55+
**For external databases**: Always check `migration/RELEASE-v{version}.md` for required database schema changes before running `helm upgrade`.
56+
57+
## ⚠️ Dependencies Notice
58+
59+
🚨 **CRITICAL: Bitnami Image Repository Changes (Effective August 2025)**
60+
61+
This chart includes infrastructure dependencies (PostgreSQL/MongoDB, Redis, Kafka, ClickHouse) which are **strictly for testing and development purposes** using bitnami legacy images with no updates.
62+
63+
**For local testing/development**, use the provided example configurations:
64+
- [`featbit-standard-local-pg.yaml`](./charts/featbit/examples/standard/featbit-standard-local-pg.yaml) - PostgreSQL + Redis configuration for local Docker Desktop Kubernetes
65+
- [`featbit-standard-local-mongo.yaml`](./charts/featbit/examples/standard/featbit-standard-local-mongo.yaml) - MongoDB + Redis configuration for local Docker Desktop Kubernetes
66+
67+
**For production environments**, we HIGHLY recommend external managed services:
68+
- **PostgreSQL/MongoDB**: Configure `externalPostgresql` or `externalMongodb` with managed database services (Azure Database for PostgreSQL, AWS RDS, Google Cloud SQL, etc.)
69+
- **Redis**: Configure `externalRedis` with managed Redis services (Azure Cache for Redis, AWS ElastiCache, Google Cloud Memorystore, etc.)
70+
- **Kafka**: Configure `externalKafka` with managed Kafka services (Confluent Cloud, AWS MSK, Azure Event Hubs, etc.)
71+
- **ClickHouse**: Configure `externalClickhouse` with managed ClickHouse services (ClickHouse Cloud, Altinity.Cloud, etc.)
72+
7673
## Expose self-hosted deployment
7774

7875
To use FeatBit, three services must be exposed from the internal network of Kubernetes:

charts/featbit/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.8.4
18+
version: 0.9.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "5.1.4"
24+
appVersion: "5.2.0"
2525

2626
kubeVersion: ">=1.23-0"
2727

charts/featbit/examples/aks/featbit-aks-values.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ui:
1616
image:
1717
registry: docker.io
1818
repository: featbit/featbit-ui
19-
tag: "5.1.4"
19+
tag: "5.2.0"
2020
pullPolicy: IfNotPresent
2121

2222
podSecurityContext:
@@ -65,7 +65,7 @@ api:
6565
image:
6666
registry: docker.io
6767
repository: featbit/featbit-api-server
68-
tag: "5.1.4"
68+
tag: "5.2.0"
6969
pullPolicy: IfNotPresent
7070

7171
podSecurityContext:
@@ -133,7 +133,7 @@ els:
133133
image:
134134
registry: docker.io
135135
repository: featbit/featbit-evaluation-server
136-
tag: "5.1.4"
136+
tag: "5.2.0"
137137
pullPolicy: IfNotPresent
138138

139139
podSecurityContext:
@@ -202,7 +202,7 @@ das:
202202
image:
203203
registry: docker.io
204204
repository: featbit/featbit-data-analytics-server
205-
tag: "5.1.4"
205+
tag: "5.2.0"
206206
pullPolicy: IfNotPresent
207207

208208
podSecurityContext:

charts/featbit/examples/standard/featbit-aks-via-ingress-frontdoor.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ui:
2424
image:
2525
registry: docker.io
2626
repository: featbit/featbit-ui
27-
tag: "5.1.4"
27+
tag: "5.2.0"
2828
pullPolicy: IfNotPresent
2929

3030
service:
@@ -59,7 +59,7 @@ api:
5959
image:
6060
registry: docker.io
6161
repository: featbit/featbit-api-server
62-
tag: "5.1.4"
62+
tag: "5.2.0"
6363
pullPolicy: IfNotPresent
6464

6565
service:
@@ -94,7 +94,7 @@ els:
9494
image:
9595
registry: docker.io
9696
repository: featbit/featbit-evaluation-server
97-
tag: "5.1.4"
97+
tag: "5.2.0"
9898
pullPolicy: IfNotPresent
9999

100100
service:
@@ -129,7 +129,7 @@ da-server:
129129
image:
130130
registry: docker.io
131131
repository: featbit/featbit-data-analytics-server
132-
tag: "5.1.4"
132+
tag: "5.2.0"
133133
pullPolicy: IfNotPresent
134134

135135
service:

charts/featbit/templates/mongodb-init-scripts-configmap.yaml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,4 +375,151 @@ data:
375375
if (bulkOps.length > 0) {
376376
db.RelayProxies.bulkWrite(bulkOps, { ordered: false });
377377
}
378+
05_v5.2.0.js: |-
379+
const dbName = "{{ $db }}";
380+
print('use', dbName, 'database')
381+
db = db.getSiblingDB(dbName)
382+
383+
// https://github.com/featbit/featbit/pull/802
384+
385+
db.Segments.updateMany(
386+
{ tags: { $exists: false } },
387+
{ $set: { tags: [] } }
388+
);
389+
390+
// https://github.com/featbit/featbit/pull/811
391+
392+
db.Organizations.updateMany(
393+
{},
394+
{
395+
$set: {
396+
"settings.flagSortedBy": "created_at"
397+
}
398+
}
399+
);
400+
401+
db.Policies.updateOne(
402+
{
403+
type: "SysManaged",
404+
name: "Administrator"
405+
},
406+
{
407+
$push: {
408+
"statements.$[org].actions": {
409+
$each: ["UpdateOrgSortFlagsBy"],
410+
$position: 0
411+
}
412+
}
413+
},
414+
{
415+
arrayFilters: [
416+
{ "org.resourceType": "organization" }
417+
]
418+
}
419+
);
420+
421+
// https://github.com/featbit/featbit/pull/821
422+
423+
db.Policies.updateMany(
424+
{
425+
"statements.resourceType": "flag",
426+
"statements.actions": "ManageFeatureFlag"
427+
},
428+
{
429+
$set: {
430+
"statements.$[stmt].actions": ["*"]
431+
}
432+
},
433+
{
434+
arrayFilters: [
435+
{
436+
"stmt.resourceType": "flag",
437+
"stmt.actions": "ManageFeatureFlag"
438+
}
439+
]
440+
}
441+
)
442+
443+
db.AccessTokens.updateMany(
444+
{
445+
"permissions.resourceType": "flag",
446+
"permissions.actions": "ManageFeatureFlag"
447+
},
448+
{
449+
$set: {
450+
"permissions.$[perm].actions": ["*"]
451+
}
452+
},
453+
{
454+
arrayFilters: [
455+
{
456+
"perm.resourceType": "flag",
457+
"perm.actions": "ManageFeatureFlag"
458+
}
459+
]
460+
}
461+
);
462+
463+
// update built-in 'Administrator' and 'Developer' policies
464+
465+
// add access to envs for 'Developer' policy
466+
db.Policies.updateOne(
467+
{
468+
organizationId: { $eq: null },
469+
type: "SysManaged",
470+
name: "Developer",
471+
"statements.resourceType": { $ne: "env" }
472+
},
473+
{
474+
$push: {
475+
statements: {
476+
id: UUID().toString().split('"')[1],
477+
resourceType: "env",
478+
effect: "allow",
479+
actions: ["CanAccessEnv"],
480+
resources: ["project/*:env/*"]
481+
}
482+
}
483+
}
484+
);
485+
486+
// add access to envs for 'Administrator' policy
487+
db.Policies.updateOne(
488+
{
489+
organizationId: { $eq: null },
490+
type: "SysManaged",
491+
name: "Administrator"
492+
},
493+
{
494+
$set: {
495+
"statements.$[stmt].actions": ["CanAccessEnv", "DeleteEnv", "UpdateEnvSettings", "CreateEnvSecret", "DeleteEnvSecret", "UpdateEnvSecret"]
496+
}
497+
},
498+
{
499+
arrayFilters: [
500+
{ "stmt.resourceType": "env" }
501+
]
502+
}
503+
);
504+
505+
// add full access to feature flags
506+
db.Policies.updateMany(
507+
{
508+
organizationId: { $eq: null },
509+
type: "SysManaged",
510+
name: { $in: ["Administrator", "Developer"] },
511+
"statements.resourceType": { $ne: "flag" }
512+
},
513+
{
514+
$push: {
515+
statements: {
516+
id: UUID(),
517+
resourceType: "flag",
518+
effect: "allow",
519+
actions: ["*"],
520+
resources: ["project/*:env/*:flag/*"]
521+
}
522+
}
523+
}
524+
);
378525
{{- end -}}

0 commit comments

Comments
 (0)