diff --git a/.github/workflows/chart-lint-test-release.yaml b/.github/workflows/chart-lint-test-release.yaml index 40da862..630538c 100644 --- a/.github/workflows/chart-lint-test-release.yaml +++ b/.github/workflows/chart-lint-test-release.yaml @@ -50,9 +50,18 @@ jobs: if: steps.list-changed.outputs.changed == 'true' uses: helm/kind-action@v1 + - name: Create LocalStack auth token secret + if: steps.list-changed.outputs.changed == 'true' + # LocalStack requires an auth token for all installations + # The LOCALSTACK_AUTH_TOKEN secret must be configured in the GitHub repository settings + run: | + kubectl create namespace testing + kubectl create secret generic --namespace testing localstack-auth-token \ + --from-literal=auth-token="${{ secrets.LOCALSTACK_AUTH_TOKEN }}" + - name: Run chart-testing (install) if: steps.list-changed.outputs.changed == 'true' - run: ct install --target-branch ${{ github.event.repository.default_branch }} + run: ct install --target-branch ${{ github.event.repository.default_branch }} --namespace testing release: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 7a38919..be22468 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,7 @@ [LocalStack 💻](https://localstack.cloud) is a cloud service emulator that runs in a single container on your laptop or in your CI environment. With LocalStack, you can run your AWS applications or Lambdas entirely on your local machine without connecting to a remote cloud provider! Whether you are testing complex CDK applications or Terraform configurations, or just beginning to learn about AWS services, LocalStack helps speed up and simplify your testing and development workflow. -LocalStack supports a growing number of AWS services, like AWS Lambda, S3, Dynamodb, Kinesis, SQS, SNS, and **many** more! The [**Pro version** of LocalStack](https://localstack.cloud/pricing) supports additional APIs and advanced features. You can find a comprehensive list of supported APIs on our [☑️ Feature Coverage](https://docs.localstack.cloud/aws/feature-coverage/) page. - +LocalStack for AWS supports a bunch of AWS services, like AWS Lambda, S3, Dynamodb, Kinesis, SQS, SNS, and **many** more! LocalStack also provides additional features to make your life as a cloud developer easier! Check out LocalStack's [Cloud Developer Tools](https://docs.localstack.cloud/tools/) for more information. ## TL;DR diff --git a/charts/localstack/Chart.yaml b/charts/localstack/Chart.yaml index 509c908..c4b093c 100644 --- a/charts/localstack/Chart.yaml +++ b/charts/localstack/Chart.yaml @@ -2,7 +2,7 @@ annotations: category: Infrastructure apiVersion: v2 appVersion: latest -version: 0.6.27 +version: 0.7.0 name: localstack description: LocalStack - a fully functional local AWS cloud stack type: application diff --git a/charts/localstack/README.md b/charts/localstack/README.md index 972efa4..eb76f1e 100644 --- a/charts/localstack/README.md +++ b/charts/localstack/README.md @@ -6,11 +6,23 @@ Helm Charts for LocalStack. ## TL;DR +**Note:** LocalStack now requires an auth token for all installations. + +Create a `values.yaml` file with your auth token: +```yaml +extraEnvVars: + - name: LOCALSTACK_AUTH_TOKEN + value: "" +``` + +Then install the chart: ```bash $ helm repo add localstack-charts https://localstack.github.io/helm-charts -$ helm install my-release localstack-charts/localstack +$ helm install my-release localstack-charts/localstack -f values.yaml ``` +See the [Authentication](#authentication) section for alternative configuration methods for your auth token. + ## Introduction LocalStack provides an easy-to-use test/mocking framework for developing Cloud applications. @@ -21,9 +33,11 @@ To install the chart with the release name `my-release`: ```bash $ helm repo add localstack-charts https://localstack.github.io/helm-charts -$ helm install my-release localstack-charts/localstack +$ helm install my-release localstack-charts/localstack -f values.yaml ``` +**Important:** LocalStack requires an auth token for all installations. You must configure your auth token as described in the [Authentication](#authentication) section below before installing the chart. + These commands deploy LocalStack on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation. > **Tip**: List all releases using `helm list` @@ -38,37 +52,28 @@ $ helm delete my-release The command removes all the Kubernetes components associated with the chart and deletes the release. -## LocalStack Pro - -You can use this chart with LocalStack Pro by: -1. Changing the image to `localstack/localstack-pro`. -2. Providing your Auth Token as an environment variable. -_(API keys are deprecated by Localstack v3.0)_ - -You can set these values in a YAML file (in this example `pro-values.yaml`): +## Authentication +You can set the auth token in a YAML file (in this example `values.yaml`): ```yaml -image: - repository: localstack/localstack-pro - extraEnvVars: - name: LOCALSTACK_AUTH_TOKEN value: "" ``` If you have the LocalStack Auth Token in a secret, you can also reference it directly with `extraEnvVars`: -``` +```yaml extraEnvVars: - name: LOCALSTACK_AUTH_TOKEN valueFrom: secretKeyRef: name: - key: + key: ``` -And you can use these values when installing the chart in your cluster: +Then use these values when installing the chart in your cluster: ```bash $ helm repo add localstack-charts https://localstack.github.io/helm-charts -$ helm install my-release localstack-charts/localstack -f pro-values.yaml +$ helm install my-release localstack-charts/localstack -f values.yaml ``` @@ -180,6 +185,9 @@ When raising a pull request with a fix or new feature, please make sure to: ## Change Log +* v0.7.0: Prepare for image consolidation, default to localstack/localstack-pro +* v0.6.0: Upgrade to LocalStack v2 +* v0.5.0: Add external service ports, additional configs, k8s lambda executor * v0.4.2: Remove default ingress annotation * v0.4.1: Add the ability to set service annotations * v0.4.0: Add the ability to set annotations on all objects globally and specifically add localstack-init-scripts-config.sh ConfigMap diff --git a/charts/localstack/ci/ci-values.yaml b/charts/localstack/ci/ci-values.yaml new file mode 100644 index 0000000..0a08ec5 --- /dev/null +++ b/charts/localstack/ci/ci-values.yaml @@ -0,0 +1,23 @@ +# CI test values for chart-testing +# This file is automatically used by the chart-testing tool during CI runs + +# Enable debug mode for better test output +debug: true + +# Set DNS policy to avoid circular DNS issues in test environments +dnsPolicy: "Default" + +# Configure LocalStack auth token from a Kubernetes secret +# The secret is created by the GitHub workflow before running tests +extraEnvVars: + - name: LOCALSTACK_AUTH_TOKEN + valueFrom: + secretKeyRef: + name: localstack-auth-token + key: auth-token + +# Enable startup scripts to test initialization +enableStartupScripts: true +startupScriptContent: | + #!/bin/bash + awslocal sqs create-queue --queue-name test-queue diff --git a/charts/localstack/templates/NOTES.txt b/charts/localstack/templates/NOTES.txt index 0de1c44..8debedf 100644 --- a/charts/localstack/templates/NOTES.txt +++ b/charts/localstack/templates/NOTES.txt @@ -1,3 +1,6 @@ +IMPORTANT: LocalStack requires an auth token to be configured via extraEnvVars. +Ensure you have set LOCALSTACK_AUTH_TOKEN in your values file or the deployment will not function properly. + 1. Get the application URL by running these commands: {{- if .Values.ingress.enabled }} {{- range $host := .Values.ingress.hosts }} diff --git a/charts/localstack/test-values.yaml b/charts/localstack/test-values.yaml index 5c42114..f5aa5d5 100644 --- a/charts/localstack/test-values.yaml +++ b/charts/localstack/test-values.yaml @@ -37,24 +37,21 @@ ingress: - path: / pathType: ImplementationSpecific -# enable localstack pro (don't forget to set your API key) -# image: -# repository: localstack/localstack-pro +# REQUIRED: LocalStack requires an auth token for all installations. +# You can set the auth token from an already existing secret: +extraEnvVars: +- name: LOCALSTACK_AUTH_TOKEN + valueFrom: + secretKeyRef: + name: localstack-auth-token + key: auth-token -# set the API key from an already existing secret -# extraEnvVars: -# - name: LOCALSTACK_AUTH_TOKEN -# valueFrom: -# secretKeyRef: -# name: -# key: - -# or set the API key directly +# Or set the auth token directly: # extraEnvVars: # - name: LOCALSTACK_AUTH_TOKEN -# value: "" +# value: "" -# enable kubernetes lambda executor (only pro) +# enable kubernetes lambda executor # lambda: # executor: "kubernetes" diff --git a/charts/localstack/values.yaml b/charts/localstack/values.yaml index 3fbe20a..f087726 100644 --- a/charts/localstack/values.yaml +++ b/charts/localstack/values.yaml @@ -11,7 +11,7 @@ updateStrategy: type: RollingUpdate image: - repository: localstack/localstack + repository: localstack/localstack-pro tag: "latest" pullPolicy: IfNotPresent @@ -93,6 +93,15 @@ mountDind: ## All the parameters from the configuatioan can be added using extraEnvVars. ## Ref. https://docs.localstack.cloud/references/configuration/ +## +## REQUIRED: LocalStack requires an auth token for all installations. +## You must configure LOCALSTACK_AUTH_TOKEN via extraEnvVars or a secret. +## Example: +## extraEnvVars: +## - name: LOCALSTACK_AUTH_TOKEN +## value: "" +## +## Additional configuration examples: ## extraEnvVars: ## - name: DEFAULT_REGION ## value: "us-east-1"