From 8d70d73f8680e0f74bfab9426c18b373efe15304 Mon Sep 17 00:00:00 2001 From: Kris Coleman Date: Mon, 30 Mar 2026 16:02:22 -0400 Subject: [PATCH 1/2] fix(flipt): rewrite license docs to use actual CLI commands The getting started docs referenced non-existent scripts (./scripts/setup-dev-license.sh, ./scripts/install.sh), Makefile targets (install-with-license, clean-license), and env var workflows (.replicated/license.env) that were never created. Replaced with the deterministic flow: create a customer, download the license file via `replicated customer download-license`, and pass it to helm via `--set-file replicated.license=license.yaml`. Co-Authored-By: Claude Opus 4.6 --- applications/flipt/QUICKSTART.md | 28 +--- applications/flipt/TROUBLESHOOTING.md | 16 +- .../flipt/docs/DEVELOPMENT_LICENSE.md | 149 +++++++----------- 3 files changed, 76 insertions(+), 117 deletions(-) diff --git a/applications/flipt/QUICKSTART.md b/applications/flipt/QUICKSTART.md index 5474b9a6..b0a0adbf 100644 --- a/applications/flipt/QUICKSTART.md +++ b/applications/flipt/QUICKSTART.md @@ -8,20 +8,9 @@ Get up and running with Flipt in 5 minutes. - Helm 3.8+ - kubectl configured -## ⚠️ Prerequisites +## ⚠️ Replicated License -Before you begin, you need a **Replicated development license**: - -```bash -# 1. Set your Replicated API token & License -export REPLICATED_API_TOKEN= -export REPLICATED_LICENSE_ID= -``` - -**Don't have a Replicated account?** - -- Sign up at [vendor.replicated.com](https://vendor.replicated.com) -- See [Development License Guide](docs/DEVELOPMENT_LICENSE.md) for detailed instructions +The Replicated SDK requires a development license. See the [Development License Guide](docs/DEVELOPMENT_LICENSE.md) for how to create one. ## Option 1: Manual Helm Install on local machine @@ -29,20 +18,13 @@ If you prefer to run commands manually: ```bash # Step 1: Update chart dependencies (includes CloudNativePG operator) -cd chart -rm -f Chart.lock # Clean cached files -helm repo add flipt https://helm.flipt.io -helm repo add valkey https://valkey.io/valkey-helm/ -helm repo add cnpg https://cloudnative-pg.github.io/charts -helm repo add replicated https://charts.replicated.com -helm repo update -helm dependency update -cd .. +make update-deps # Step 2: Install Flipt (operator included automatically) helm install flipt ./chart \ --namespace flipt \ --create-namespace \ + --set-file replicated.license=license.yaml \ --wait \ --timeout 10m @@ -60,7 +42,7 @@ For enterprise deployments with Admin Console: ```bash export REPLICATED_APP=flipt - export REPLICATED_LICENSE_ID= + export REPLICATED_API_TOKEN= make release ``` diff --git a/applications/flipt/TROUBLESHOOTING.md b/applications/flipt/TROUBLESHOOTING.md index 14512c0b..a26280a4 100644 --- a/applications/flipt/TROUBLESHOOTING.md +++ b/applications/flipt/TROUBLESHOOTING.md @@ -131,15 +131,21 @@ Error: either license in the config file or integration license id must be speci **Cause:** No Replicated license is configured. -**Solution:** Set up a development license: +**Solution:** Download your license file and pass it during install or upgrade: ```bash -# Quick setup -export REPLICATED_API_TOKEN=your-token -export REPLICATED_LICENSE_ID=your-license-id +# Download your license (see docs/DEVELOPMENT_LICENSE.md for full setup) +replicated customer download-license \ + --app flipt \ + --customer "" \ + --output license.yaml + +helm upgrade flipt ./chart \ + --namespace flipt \ + --set-file replicated.license=license.yaml ``` -**Detailed guide:** See [docs/DEVELOPMENT_LICENSE.md](docs/DEVELOPMENT_LICENSE.md) +**Need a license?** See [docs/DEVELOPMENT_LICENSE.md](docs/DEVELOPMENT_LICENSE.md) --- diff --git a/applications/flipt/docs/DEVELOPMENT_LICENSE.md b/applications/flipt/docs/DEVELOPMENT_LICENSE.md index 2421256e..d44ad6d9 100644 --- a/applications/flipt/docs/DEVELOPMENT_LICENSE.md +++ b/applications/flipt/docs/DEVELOPMENT_LICENSE.md @@ -13,32 +13,6 @@ Flipt integrates with Replicated's SDK to provide: The Replicated SDK requires a valid license to function, even in development environments. -## Quick Start - -### Option 1: Automated Setup (Recommended) - -```bash -# 1. Set up your Replicated API token -export REPLICATED_API_TOKEN=your-token-here - -# 2. Run the setup script -./scripts/setup-dev-license.sh - -# 3. Load the license -source .replicated/license.env - -# 4. Install Flipt -./scripts/install.sh -``` - -### Option 2: Using Makefile - -```bash -# Set up license and install in one command -export REPLICATED_API_TOKEN=your-token-here -make install-with-license -``` - ## Prerequisites ### 1. Replicated CLI @@ -74,46 +48,44 @@ replicated version export REPLICATED_API_TOKEN=your-token-here ``` - Or add to your shell profile (~/.bashrc, ~/.zshrc): - ```bash - echo 'export REPLICATED_API_TOKEN=your-token-here' >> ~/.zshrc - source ~/.zshrc - ``` - -## Manual License Setup - -If you prefer manual setup or need more control: +## Creating a Development License ### Step 1: Create a Development Customer +Pick a customer name you'll reuse in subsequent steps: + ```bash +CUSTOMER_NAME="dev-$(whoami)" + replicated customer create \ --app flipt \ - --name "dev-$(whoami)-$(date +%s)" \ + --name "$CUSTOMER_NAME" \ --channel Unstable \ - --license-type dev \ - --output json > customer.json + --license-type dev ``` -### Step 2: Extract License ID +### Step 2: Download the License ```bash -LICENSE_ID=$(jq -r '.id' customer.json) -echo "License ID: $LICENSE_ID" +replicated customer download-license \ + --app flipt \ + --customer "$CUSTOMER_NAME" \ + --output license.yaml ``` -### Step 3: Save License Configuration +### Step 3: Install Flipt with the License ```bash -mkdir -p .replicated -echo "REPLICATED_LICENSE_ID=$LICENSE_ID" > .replicated/license.env -``` - -### Step 4: Use License +# Update chart dependencies first +make update-deps -```bash -source .replicated/license.env -./scripts/install.sh +# Install with the downloaded license file +helm install flipt ./chart \ + --namespace flipt \ + --create-namespace \ + --set-file replicated.license=license.yaml \ + --wait \ + --timeout 15m ``` ## License Management @@ -137,17 +109,7 @@ replicated customer ls --output json | \ ### License Expiry -Development licenses may have expiration dates. If your license expires: - -1. Delete the old license: - ```bash - make clean-license - ``` - -2. Create a new one: - ```bash - ./scripts/setup-dev-license.sh - ``` +Development licenses may have expiration dates. If your license expires, create a new one following the steps above. ## Troubleshooting @@ -164,15 +126,20 @@ Your API token may be invalid or expired: ### Error: "license not found" -The license secret may not be created: +The license may not be set correctly: ```bash -# Verify secret exists -kubectl get secret replicated-license -n flipt +# Check the current helm values +helm get values flipt --namespace flipt + +# Re-download and apply the license +replicated customer download-license \ + --app flipt \ + --customer "$CUSTOMER_NAME" \ + --output license.yaml -# Recreate if missing -kubectl create secret generic replicated-license \ - --from-literal=license="$REPLICATED_LICENSE_ID" \ - --namespace flipt +helm upgrade flipt ./chart \ + --namespace flipt \ + --set-file replicated.license=license.yaml ``` ### Pod Still Crashing @@ -193,37 +160,41 @@ For automated testing in CI/CD: ```yaml # Example GitHub Actions -- name: Setup Replicated License +- name: Create Dev Customer env: REPLICATED_API_TOKEN: ${{ secrets.REPLICATED_API_TOKEN }} run: | - ./scripts/setup-dev-license.sh - source .replicated/license.env + CUSTOMER_NAME="ci-${{ github.run_id }}" + echo "CUSTOMER_NAME=$CUSTOMER_NAME" >> $GITHUB_ENV + + replicated customer create \ + --app flipt \ + --name "$CUSTOMER_NAME" \ + --channel Unstable \ + --license-type dev + + replicated customer download-license \ + --app flipt \ + --customer "$CUSTOMER_NAME" \ + --output license.yaml - name: Install Flipt run: | - source .replicated/license.env - ./scripts/install.sh - -- name: Cleanup License + make update-deps + helm install flipt ./chart \ + --namespace flipt \ + --create-namespace \ + --set-file replicated.license=license.yaml \ + --wait --timeout 15m + +- name: Cleanup Customer if: always() + env: + REPLICATED_API_TOKEN: ${{ secrets.REPLICATED_API_TOKEN }} run: | - make clean-license -``` - -## Alternative: Disable Replicated SDK - -If you absolutely need to run without a license (not recommended for production testing): - -```bash -helm install flipt ./chart \ - --namespace flipt \ - --create-namespace \ - --set replicated.enabled=false + replicated customer rm --customer "$CUSTOMER_NAME" ``` -**Note:** This disables all Replicated features including support bundles and preflight checks. - ## Resources - [Replicated CLI Documentation](https://docs.replicated.com/reference/replicated-cli) From 2a1c0aa4a3f3338819d85edb0f752d0b0a41d00b Mon Sep 17 00:00:00 2001 From: Kris Coleman Date: Tue, 31 Mar 2026 01:12:49 -0400 Subject: [PATCH 2/2] chore: update applications/flipt/docs/DEVELOPMENT_LICENSE.md Co-authored-by: James Wilson <14128934+jmboby@users.noreply.github.com> --- applications/flipt/docs/DEVELOPMENT_LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/flipt/docs/DEVELOPMENT_LICENSE.md b/applications/flipt/docs/DEVELOPMENT_LICENSE.md index d44ad6d9..e25fc41d 100644 --- a/applications/flipt/docs/DEVELOPMENT_LICENSE.md +++ b/applications/flipt/docs/DEVELOPMENT_LICENSE.md @@ -61,7 +61,7 @@ replicated customer create \ --app flipt \ --name "$CUSTOMER_NAME" \ --channel Unstable \ - --license-type dev + --type dev ``` ### Step 2: Download the License