-
Notifications
You must be signed in to change notification settings - Fork 6
fix(flipt): rewrite license docs to use Replicated CLI commands #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
kriscoleman
wants to merge
2
commits into
main
Choose a base branch
from
kriscoleman/fix-flipt-license-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| --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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This worked as expected in my testing |
||
|
|
||
| - 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) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No doubt you will find this too but it wants to use the customer id instead of name:
Error: find customer "dev-jwilson": get customer by name: customer "dev-jwilson" is ambiguous, please use customer ID