UPDATE May 2021: Lovia Group is no longer using Unleash. For feature flags, we are using AWS AppConfig.
Unleash is a feature flag service, that is also provided by GitLab. GitLab is currently open sourcing the feature flags feature, and when it arrives in GitLab.com we will not need to host our own Unleash.
Unleash on Kubernetes
We deploy Unleash on our Kubernetes DO Singapore cluster. It requires PostgreSQL which can be set up as DigitalOcean Managed PostgreSQL database (unfortunately its CA is not publicly trusted). Unfortunately nimrodshn/unleash-helm is no longer maintained so we deploy Unleash manually.
PostgreSQL Preparation and Secrets
Workaround: Until unleash PR #585 is accepted, we use PostgreSQL helm chart instead of Managed DigitalOcean.
1 2 | helm repo add bitnami https://charts.bitnami.com/bitnami helm install postgresql bitnami/postgresql --set persistence.size=1Gi |
Create PostgreSQL instance (if not exists), create user “unleash”, then create the database “unleash” with that user.
1 2 3 | CREATE USER unleash PASSWORD '***' ; GRANT unleash TO doadmin; CREATE DATABASE unleash OWNER unleash; |
Save the JDBC URL secret in Kubernetes as unleash
with keys postgresql-url
.
1 2 3 4 5 6 | apiVersion: v1 kind: Secret metadata: name: unleash data: postgresql-url: *BASE64 ENCODED postgres : // URL* |
1 | kubectl apply -f unleash-secret.yaml |
Deploy Unleash DaemonSet
Ideally we could add CA certificate using Kubernetes ConfigMap, but this doesn’t work for Node.js.
Make the deployment unleash-server.yaml
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | apiVersion: apps/v1 kind: DaemonSet metadata: name: unleash-server-daemonset spec: selector: matchLabels: app: unleash-server template: metadata: labels: app: unleash-server spec: hostNetwork: true containers: - name : unleash-server image: unleashorg/unleash-server : latest imagePullPolicy: IfNotPresent ports: - protocol : TCP name: http containerPort: 4242 env: - name : POD_NAME valueFrom: fieldRef: fieldPath: metadata.name - name : POD_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace - name : NODE_ENV value: 'production' # value: 'development' - name : DATABASE_URL #value: postgres://postgres:unleash@unleash-db.default/postgres valueFrom: secretKeyRef: name: unleash key: postgresql-url resources: limits: memory: 100Mi requests: memory: 100Mi nodeSelector: kubernetes.io/hostname : pool-2gb-3ng5e |
Open Firewall for Unleash only for our app server: (since Unleash is by default unsecured)
1 | doctl compute firewall create --name unleash --inbound-rules "protocol:tcp,ports:4242,address:54.208.38.215" --tag-names=k8s:84a39cbd-ecbe-4dfd-86ea-2bc789ca5198 |
You can also add the Kubernetes cluster. For administration purposes, you may open the firewall temporarily for your own IP address.
Check DaemonSets:
1 | kubectl get daemonset -o wide |
Now you can manage feature toggles:

Unleash Client Libraries
https://docs.gitlab.com/ee/user/project/operations/feature_flags.html#client-libraries