GithubHelp home page GithubHelp logo

helm-charts's Introduction

What is Unleash?

Unleash is a powerful open source solution for feature management. It streamlines your development workflow, accelerates software delivery, and empowers teams to control how and when they roll out new features to end users. With Unleash, you can deploy code to production in smaller, more manageable releases at your own pace.

Feature flags in Unleash let you test your code with real production data, reducing the risk of negatively impacting your users' experience. It also enables your team to work on multiple features simultaneously without the need for separate feature branches.

Unleash is the most popular open source solution for feature flagging on GitHub. It supports 15 official client and server SDKs and over 15 community SDKs. You can even create your own SDK if you wish. Unleash is compatible with any language and framework.


Getting Started with Unleash

1. Setting Up Unleash

To get started with Unleash, you need git and docker installed on your machine.

Execute the following commands:

git clone [email protected]:Unleash/unleash.git
cd unleash
docker compose up -d

Then point your browser to localhost:4242 and log in using:

  • username: admin
  • password: unleash4all

If you'd rather run the source code in this repo directly via Node.js, see the step-by-step instructions to get up and running in the contributing guide.

2. Connect your SDK

Find your preferred SDK in our list of official SDKs and import it into your project. Follow the setup guides for your specific SDK.

If you use the docker compose file from the previous step, here's the configuration details you'll need to get going:

  • For front-end SDKs, use:
    • URL: http://localhost:4242/api/frontend/
    • clientKey: default:development.unleash-insecure-frontend-api-token
  • For server-side SDKs, use:
    • Unleash API URL: http://localhost:4242/api/
    • API token: default:development.unleash-insecure-api-token

If you use a different setup, your configuration details will most likely also be different.

Check a feature flag

Checking the state of a feature flag in your code is easy! The syntax will vary depending on your language, but all you need is a simple function call to check whether a flag is available. Here's how it might look in Java:

if (unleash.isEnabled("AwesomeFeature")) {
  // do new, flashy thing
} else {
  // do old, boring stuff
}

Run Unleash on a service?

If you don't want to run Unleash locally, we also provide easy deployment setups for Heroku and Digital Ocean:

Deploy to Heroku Deploy to DigitalOcean

Configure and run Unleash anywhere

The above sections show you how to get up and running quickly and easily. When you're ready to start configuring and customizing Unleash for your own environment, check out the documentation for getting started with self-managed deployments, Unleash configuration options, or running Unleash locally via docker.


Online demo

Try out the Unleash online demo.

The Unleash online demo


Community and help — sharing is caring

We know that learning a new tool can be hard and time-consuming. We have a growing community that loves to help out. Please don't hesitate to reach out for help.

Join Unleash on Slack

💬 Join Unleash on Slack if you want ask open questions about Unleash, feature toggling or discuss these topics in general.

💻 Create a GitHub issue if you have found a bug or have ideas on how to improve Unleash.

📚 Visit the documentation for more in-depth descriptions, how-to guides, and more.

📖 Learn more about the principles of building and scaling feature flag solutions.


Contribute to Unleash

Unleash is the largest open source feature flag solution on GitHub. Building Unleash is a collaborative effort, and we owe a lot of gratitude to many smart and talented individuals. Building it together with the community ensures that we build a product that solves real problems for real people. We'd love to have your help too: Please feel free to open issues or provide pull requests.

Check out the CONTRIBUTING.md file for contribution guidelines and the Unleash developer guide for tips on environment setup, running the tests, and running Unleash from source.

Contributors

The Unleash contributors


Features our users love

Flexibility and adaptability

Security and performance

  • Privacy by design (GDPR and Schrems II). End-user data never leaves your application.
  • Audit logs
  • Enforce OWASP's secure headers via the strict HTTPS-only mode
  • Flexible hosting options: host it on premise or in the cloud (any cloud)
  • Scale the Unleash Proxy independently of the Unleash server to support any number of front-end clients without overloading your Unleash instance

Looking for more features?

If you're looking for one of the following features, please take a look at our Pro and Enterprise plans:


Architecture

Read more in the system overview section of the Unleash documentation.


Unleash SDKs

To connect your application to Unleash you'll need to use a client SDK for your programming language.

Official server-side SDKs:

Official front-end SDKs:

The front-end SDKs connects via the Unleash Proxy in order to ensure privacy, scalability and security.

Community SDKs:

If none of the official SDKs fit your need, there's also a number of community-developed SDKs where you might find an implementation for your preferred language (such as Elixir, Dart, Clojure, and more).


Users of Unleash

Unleash is trusted by thousands of companies all over the world.

Proud Open-Source users: (send us a message if you want to add your logo here)

The Unleash logo encircled by logos for Finn.no, nav (the Norwegian Labour and Welfare Administration), Budgets, Otovo, and Amedia. The encircling logos are all connected to the Unleash logo.


Migration guides

Unleash has evolved significantly over the past few years, and we know how hard it can be to keep software up to date. If you're using the current major version, upgrading shouldn't be an issue. If you're on a previous major version, check out the Unleash migration guide!


Want to know more about Unleash?

Videos and podcasts

Articles and more

helm-charts's People

Contributors

achelak avatar alv91 avatar brtkwr avatar chriswk avatar fredrikoseberg avatar gardleopard avatar gastonfournier avatar ivarconr avatar jmsantorum avatar keisku avatar kwasniew avatar langesven avatar martinrw avatar mbarczyk avatar monotek avatar ngoduykhanh avatar nkz-soft avatar nunogois avatar phooijenga avatar plavy avatar prabhu43 avatar sighphyre avatar slallema avatar stogas avatar sturman avatar thomasheartman avatar yayburritos avatar yuvals41 avatar z0rc avatar zied-jt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

helm-charts's Issues

Setting UNLEASH_URL and BASE_PATH causes CLBO error

Describe the bug

Okay so I was able to get Unleash up and running. However, when I am setting a context path as / in ingress rule, it is accessible but not when it is set to /unleash.

This works:
` hosts:

host:
paths:
    path: /
    pathType: Prefix`

But not this

`hosts:

host:
paths:
    path: /unleash
    pathType: Prefix`

My UNLEASH_URL is set to /unleash

When I set the context path to /unleash I get 404 error for /static/style-770afaee.css net::ERR_ABORTED 404 (Not Found) and /static/index-17d74ac9.js net::ERR_ABORTED 404 (Not Found)


So I tried setting BASE_URI_PATH in the env variable. But then I am getting below error in pod logs and it goes into CrashLoopBackOff state.

Steps to reproduce the bug

No response

Expected behavior

Unleash should start and serve on /unleash

Logs, error output, etc.

[ERROR] TypeError [ERR_INVALID_URL]: Invalid URL at new NodeError (node:internal/errors:405:5) at new URL (node:internal/url:611:13) at findRootUrl (/unleash/node_modules/unleash-server/dist/lib/openapi/index.js:213:21) at createOpenApiSchema (/unleash/node_modules/unleash-server/dist/lib/openapi/index.js:222:17) at new OpenApiService (/unleash/node_modules/unleash-server/dist/lib/services/openapi-service.js:16:102) at createServices (/unleash/node_modules/unleash-server/dist/lib/services/index.js:161:28) at createApp (/unleash/node_modules/unleash-server/dist/lib/server-impl.js:69:52) at Object.start (/unleash/node_modules/unleash-server/dist/lib/server-impl.js:163:27)

Screenshots

No response

Additional context

No response

Unleash version

No response

Subscription type

None

Hosting type

None

SDK information (language and version)

No response

No possibility to take database user from secrets

Hi, I want to use unleash chart v1.1.1 to deploy it unleash v3.x on k8s.

I checked deployments file and I found that the database user is exposed which is against security policy in my current project.

Could you change it to take user from secrets?

Another thing is related to the way how I have to pass the database password. To make it work I have to point to existing secrets.
I'm going to use deployments per env and feature branch. It's quite problematic to write additional scripts to create and manage secrets for temporary deployments. For now I found a hack to create dynamic secrets in this chart
values.yaml

secrets:
  POSTGRESQL_PASSWORD: <my_password>

dbConfig:
  user: <my_user>
  useExistingSecret:
    # the deployment name is dynamic, I have to do additional work to put the correct name
    name: <set_externally_the unleash_release_name>
    key: POSTGRESQL_PASSWORD

It would be much better to move DATABASE_USER and DATABASE_PASS to secrets and then declare
values.yaml:

secrets:
  DATABASE_USER: <my_user>
  DATABASE_PASS: <my_password>

For backward compatibility it will be good to add sth like (not tested):
deployment.yaml

{{- if not hasKey .Values.secret "DATABASE_USER" }} 
            - name: DATABASE_USER
              value: "{{ .Values.dbConfig.user }}"
{{- end}}
{{- if not hasKey .Values.secret "DATABASE_PASS" }} 
            - name: DATABASE_PASS
              value: "{{ .Values.dbConfig.pass }}{{ end }}"
{{- end}}

Chart.appVersion vs. imageTag

Currently _helpers.tpl defines the label app.kubernetes.io/version as Chart.AppVersion.
This leads to confusion if image.tag is overridden as this is the actual used application version.
Chart.AppVersion cannot be overriden when installing a helm chart for reasons I don't know.
Maybe an easy fix would be to set the version label to: {{ .Values.image.tag | default .Chart.AppVersion }}?

Of course, another fix would be to timely update this Helm chart after each Unleash release so that most people wouldn't alter image.tag but just update to the latest Helm chart version.

helm values for health checks not configurable in unleash-edge

Describe the feature request

I want to be able to edit the helm values for the livenessProbe and redinessProbe urls.

Background

Currently the environment variable for the BASE_PATH will allow overwriting of the base path for unleash-edge. This can cause a situation where your health checks are actually at /BASE_PATH/internal-backstage/health and you cannot deploy using the provided helm chart for unleash-edge. In unleash itself, it allows for changing the base path, as well as changing the health-check paths to allow for a base path change.

Solution suggestions

  1. Update the deployment.yaml file to allow for configuration in the values.yaml file for the livenessProbe and redinessProbe values, much like unleash's helm charts
  2. Update the deployment.yaml file to use the readiness command outlined in the documentation here
    1. This may require an update to the utility that is called to utilize the BASE_PATH environment variable

PR for the first solution: #97

Support optional CloudSQL proxy sidecar

Describe the feature request

I want unleash to optionally support cloudsql proxy sidecar as an alternative to postgres.

Background

At the moment we are using externally deployed cloudsql proxy hooked up to unleash but sometime, transient network issues prevent DNS resolution between unleash pod and gcloudsql proxy service, having it run as a sidecar is more secure and the recommended way of deploying cloudsql proxy which also prevents the service from being advertised in the namespace.

Solution suggestions

No response

Error: The server does not support SSL connections

Describe the bug

Unable to deploy Unleash with built-in Postgres DB with default DB values.

Helm Chart: unleash
Helm Chart Version: 4.1.1

Steps to reproduce the bug

  1. helm repo add unleash https://docs.getunleash.io/helm-charts
  2. helm template unleash unleash/unleash
  3. helm install unleash unleash/unleash
  4. check Unleash pod logs

Expected behavior

Unleash migrate a postgres DB and started successfully.

Logs, error output, etc.

[2024-05-10T16:01:04.890] [ERROR] server-impl.js - Locking error: The server does not support SSL connections
[2024-05-10T16:01:04.892] [ERROR] server-impl.js - Failed to migrate db Error: The server does not support SSL connections
    at Socket.<anonymous> (/unleash/node_modules/pg/lib/connection.js:77:37)
    at Object.onceWrapper (node:events:632:26)
    at Socket.emit (node:events:517:28)
    at addChunk (node:internal/streams/readable:335:12)
    at readableAddChunk (node:internal/streams/readable:308:9)
    at Readable.push (node:internal/streams/readable:245:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: The server does not support SSL connections
    at Socket.<anonymous> (/unleash/node_modules/pg/lib/connection.js:77:37)
    at Object.onceWrapper (node:events:632:26)
    at Socket.emit (node:events:517:28)
    at addChunk (node:internal/streams/readable:335:12)
    at readableAddChunk (node:internal/streams/readable:308:9)
    at Readable.push (node:internal/streams/readable:245:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

Node.js v18.18.2

Screenshots

No response

Additional context

Most likely the issue is related to this change https://github.com/Unleash/helm-charts/pull/139/files#diff-9576a5f35de34ba1784129471c2262fc5bc8bd10b69c258b07f25e1a0d1f5d44R51-R54
When I downgraded to Helm Chart Version 4.0.2, Unleash started without any errors

Unleash version

No response

Subscription type

Open source

Hosting type

Self-hosted

SDK information (language and version)

No response

How to enable serverMetrics

I see from the config file that I can set serverMetrics to enable prometheus metrics, what do I need to do in values.yaml?

add support for secret csi provider

Describe the feature request

hello,

i encountered an issue while deploying the helm chart and wanting to use secret store provider aws to safely deploy and use the secret in my aws secret manager
https://github.com/aws/secrets-store-csi-driver-provider-aws

I encountered the issue while trying to use the volumes, but I don't see support for it on the values yaml..

i need to use the volume in the deployment yaml like this:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: unleash-proxy
spec:
  template:
    spec:
      volumes:
        - name: secrets-store-inline
          csi:
            driver: secrets-store.csi.k8s.io
            readOnly: true
            volumeAttributes:
              secretProviderClass: "unleash-proxy-secret-provider"

Background

No response

Solution suggestions

i would suggest that i can use the values.yaml to change the volumes in the deployment template and maybe even add a secretStoreProvider template in the chart, these solution will clearly solve the issue

Thank you!

Publish K8S version support

Describe the feature request

I'd like for us to commit to which version range of k8s we support

Background

I'd like to be able to trust that Unleash works with the k8s version I'm using, but I realise that the Unleash team can't verify their releases on every K8S release. Having a supported range published somewhere, or a "We support versions that have not reached their EOL according to https://kubernetes.io/releases/" would be something I could deal with.

Solution suggestions

Publish a supported range or a strategy dependent on versions from https://kubernetes.io/releases/.

Unleash-Proxy helm-chart Deployment template missing quotation mark closing

Describe the bug

There is no quotation closing here, beacause of that UNLEASH_URL is always ended with quota sign, creating 403 error for unleash-proxy.
https://github.com/Unleash/helm-charts/blob/unleash-proxy-0.3.0/charts/unleash-proxy/templates/deployment.yaml#L57

Steps to reproduce the bug

No response

Expected behavior

No response

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

unleash-proxy helm chart 0.3.0

Subscription type

None

Hosting type

None

SDK information (language and version)

No response

ValidationError when enabling Ingress

Hi,

The chart seems to work as intended until I enable the ingress:

helm upgrade -i -f values.yaml unleash unleash/unleash

Error: UPGRADE FAILED: template: unleash/templates/ingress.yaml:35:21: executing "unleash/templates/ingress.yaml" at <.path>: can't evaluate field path in type interface {}

values.yaml:

ingress:
  enabled: true #modified!
  annotations:
    {}
    # kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: "true"
  hosts:
    - host: chart-example.local
      paths: ["/test"] #modified!
  tls: []
  #  - secretName: chart-example-tls
  #    hosts:
  #      - chart-example.local

The above values.yaml is an extract from values.yaml, modified as commented above.

Am I doing something wrong or is this a template problem?

[ISSUE] Azure AD Authentication dependancies

On values.yaml file some example of custom auth are availables here : https://github.com/Unleash/unleash-examples/tree/main/v4
I'm trying to implement Azure AD Auth. After upgrading configmap with index.js & azure-auth-hook.js i got the following error message :

Error: Cannot find module 'passport-azure-ad'
Require stack:
- /unleash/azure-auth-hook.js
- /unleash/index.js 

Here is my configmap values :

# You can also add your own custom auth:
# https://github.com/Unleash/unleash-examples/tree/main/v4
configMaps: 
 index.js:
   mountPath: /unleash/index.js
   content: |-
    const unleash = require('unleash-server');

    const azureAuthHook = require('./azure-auth-hook');

    unleash.start({
        db: {
            user: 'unleash_user',
            password: 'passord',
            host: 'localhost',
            port: 5432,
            database: 'unleash',
            ssl: false,
        },
        authentication: {
            type: 'custom',
            customAuthHandler: azureAuthHook,
        },
        server: {
            enableRequestLogger: true,
            baseUriPath: '',
        },
        logLevel: 'info',
    });
 azure-auth-hook.js:
   mountPath: /unleash/azure-auth-hook.js
   content: |-
      /* eslint-disable import/no-extraneous-dependencies */
      /* eslint-disable import/no-unresolved */

      'use strict';

      /**
      * Azure AD hook for securing an Unleash server
      *
      * This example assumes that all users authenticating via
      * azure should have access. You would probably limit access
      * to users you trust, for example users within a tenant.
      *
      * The implementation assumes the following environment variables:
      *
      *  - AUTH_HOST
      *  - AUTH_CLIENT_ID
      *  - AUTH_CLIENT_SECRET
      *  - AUTH_TENANT_ID
      */

      const unleash = require('unleash-server');
      const passport = require('@passport-next/passport');
      const OIDCStrategy = require('passport-azure-ad').OIDCStrategy;

      const host = "https://features-auth.dev.interflora.bzh/";
      const clientID = "d8477324-90fa-4771-8d37-13567368f5ef";
      const clientSecret = "S9D7Q~zVvZMFfEh46ozodXN2Af-2VAdzivSzy";
      const tenantID = "ae228da7-1ce3-40d8-9cad-6324f71f9b1c";

      function azureAdminOauth(app, config, services) {
        const { baseUriPath } = config.server;
        const { userService } = services;

        passport.use(
          'azure',
          // Check passport azure ad documentation for option details: https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/maintenance/passport-azure-ad#4112-options
          new OIDCStrategy(
            {
              identityMetadata: `https://login.microsoftonline.com/${tenantID}/v2.0/.well-known/openid-configuration`,
              clientID,
              clientSecret,
              redirectUrl: `${host}/api/auth/callback`,
              responseType: 'code',
              responseMode: 'query',
              scope: ['openid', 'email'],
              allowHttpForRedirectUrl: true,
            },
            async (iss, sub, profile, accessToken, refreshToken, cb) => {
              const user = await userService.loginUserWithoutPassword(
                profile._json.email,
                true
              );
              cb(null, user);
            }
          )
        );

        app.use(passport.initialize());
        app.use(passport.session());
        passport.serializeUser((user, done) => done(null, user));
        passport.deserializeUser((user, done) => done(null, user));

        app.get(
          '/auth/azure/login',
          passport.authenticate('azure', { scope: ['email'] })
        );
        app.get(
          '/api/auth/callback',
          passport.authenticate('azure', {
            failureRedirect: '/api/admin/error-login',
          }),
          (req, res) => {
            res.redirect('/');
          }
        );

        app.use('/api/admin/', (req, res, next) => {
          if (req.user) {
            next();
          } else {
            return res
              .status('401')
              .json(
                new unleash.AuthenticationRequired({
                  path: '/auth/azure/login',
                  type: 'custom',
                  message: `You have to identify yourself in order to use Unleash. Click the button and follow the instructions.`,
                })
              )
              .end();
          }
        });
      }

      module.exports = azureAdminOauth;

Docker images seems to have been built without this dependancy.
What is the best way to get it running ?

Thank you for your help

DB connections fails for version 4.0.0

Issue:
With image tag 4.0.0, unleash server fails to start with following error.

Failed to migrate db OperationalError: The server does not support SSL connections

Reason:

postgres is not accepting ssl connection, but unleash trying to open db connection with SSL.

Solution:
Configure unleash to open DB connection with SSL disabled

[Feature request] Set service nodePort value if one is specified

For users who want to deploy the chart to a local or test Kubernetes cluster and want to use the NodePort type for ingress, it would be great to allow passing in a static NodePort value.

Specifically supporting the following change:

diff --git a/charts/unleash/templates/service.yaml b/charts/unleash/templates/service.yaml
index 2937e5f..6aaf629 100644
--- a/charts/unleash/templates/service.yaml
+++ b/charts/unleash/templates/service.yaml
@@ -15,6 +15,9 @@ spec:
   ports:
     - port: {{ .Values.service.port }}
       targetPort: http
+      {{ if .Values.service.nodePort }}
+      nodePort: {{ .Values.service.nodePort }}
+      {{ end }}
       protocol: TCP
       name: http
   selector:

Thank you!

gh-pages helm repo index.yaml is missing

As there was no chart change the release chart action has not released the index.yaml for the helm repo.
See: https://github.com/Unleash/helm-charts/runs/1921530495?check_suite_focus=true

This can be fixed manually by adding the following index.yaml to the gh-pages branch:

apiVersion: v1
entries:
  unleash:
  - apiVersion: v2
    appVersion: 3.11.2
    created: "2021-02-18T20:11:02.176057684+01:00"
    dependencies:
    - condition: postgresql.enabled
      name: postgresql
      repository: https://charts.bitnami.com/bitnami
      version: 10.3.1
    description: Unleash is a open source feature flag & toggle system, that gives you a great overview over all feature toggles across all your applications and services.
    digest: 3e2d59a9e81a67df8592813caa401b9aa9f6c9f2555c8a137b2387d5ce5e75f6
    maintainers:
    - name: evanstucker-hates-2fa
    - email: [email protected]
      name: ivarconr
    name: unleash
    sources:
    - https://github.com/Unleash/unleash
    - https://github.com/Unleash/unleash-docker
    - https://github.com/Unleash/helm-charts
    type: application
    urls:
    - https://github.com/Unleash/helm-charts/releases/download/unleash-1.0.0/unleash-1.0.0.tgz
    version: 1.0.0
generated: "2021-02-17T20:11:02.167112377+01:00"

I would have created an pr but i can't see the gh-pages branch even if https://unleash.github.io/helm-charts seems to be created from the repo readme.

After adding the file to the repo it should be available via: https://unleash.github.io/helm-charts/index.yaml.

If this works repo can be added to https://artifacthub.io/ :)

Failed to migrate db OperationalError: timeout expired

Describe the bug

While installing unleash through helm chart, I am getting the error as mentioned below:
(I am using rds instance here instead of postgresql pod)

[2023-10-15T18:39:37.873] [ERROR] server-impl.js - Failed to migrate db OperationalError: timeout expired
at Timeout._onTimeout (/unleash/node_modules/pg/lib/client.js:106:28)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7) {
cause: Error: timeout expired
at Timeout._onTimeout (/unleash/node_modules/pg/lib/client.js:106:28)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7),
isOperational: true
}
[ERROR] Error: timeout expired
at Timeout._onTimeout (/unleash/node_modules/pg/lib/client.js:106:28)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7)

Steps to reproduce the bug

No response

Expected behavior

No response

Logs, error output, etc.

[2023-10-15T18:39:37.873] [ERROR] server-impl.js - Failed to migrate db OperationalError: timeout expired
    at Timeout._onTimeout (/unleash/node_modules/pg/lib/client.js:106:28)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7) {
  cause: Error: timeout expired
      at Timeout._onTimeout (/unleash/node_modules/pg/lib/client.js:106:28)
      at listOnTimeout (node:internal/timers:569:17)
      at process.processTimers (node:internal/timers:512:7),
  isOperational: true
}
[ERROR] Error: timeout expired
    at Timeout._onTimeout (/unleash/node_modules/pg/lib/client.js:106:28)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7)

Screenshots

No response

Additional context

No response

Unleash version

5.4.4

Subscription type

Open source

Hosting type

None

SDK information (language and version)

No response

Correct Environment Variable in Helm Deployment Template

Describe the bug

Within the Helm template used to deploy our application, there is an environment variable named DATABASE that is incorrectly configured. It should be DATABASE_NAME.

While investigating an issue with the application not functioning correctly when using a database name other than unleash, we identified the root cause to be the misconfiguration in the Helm deployment template. Within this template, the DATABASE environment variable is set to an incorrect value. This causes issues when the database name is different from unleash, as the application expects an environment variable named DATABASE_NAME.

Steps to reproduce the bug

1 - Deploy the application using the Helm template.
2 - Change the database name to something other than unleash.
3 - Notice that the application does not function correctly due to expecting an environment variable DATABASE_NAME instead of DATABASE.

Expected behavior

No response

Logs, error output, etc.

[2024-03-11T19:26:22.801] [ERROR] server-impl.js - Locking error: database "unleash" does not exist
[2024-03-11T19:26:22.803] [ERROR] server-impl.js - Failed to migrate db Error: Connection terminated unexpectedly
    at /unleash/node_modules/pg/lib/client.js:526:17
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /unleash/node_modules/unleash-server/dist/lib/util/db-lock.js:30:9
    at async Object.start (/unleash/node_modules/unleash-server/dist/lib/server-impl.js:149:17)
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: Connection terminated unexpectedly
    at /unleash/node_modules/pg/lib/client.js:526:17
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /unleash/node_modules/unleash-server/dist/lib/util/db-lock.js:30:9
    at async Object.start (/unleash/node_modules/unleash-server/dist/lib/server-impl.js:149:17)

Screenshots

No response

Additional context

No response

Unleash version

No response

Subscription type

None

Hosting type

None

SDK information (language and version)

No response

Allow JSON in dbConfig.ssl

Describe the feature request

As per Unleash documentation, DATABASE_SSL ain't limited to true or false, can be a JSON with SSL options too. https://docs.getunleash.io/using-unleash/deploy/configuring-unleash#dbssl-vs-database_ssl-options

Using AWS RDS as a database, I need this JSON, because true or false doesn't work. But a JSON string in YAML doesn't work well, so something need to be done

Background

I'm deploying Unleash on AWS EKS. After a POC using postgres subchart, wanted to move to RDS. It was unable to connect to the database. Spent a day troubleshooting, replacing the start command with sleep infinity, exec in the pod, try out stuff to make sure I could connect to the database using psql, adding console.log in unleash server, before realizing

  • export DATABASE_SSL=false didn't worked (no pg_hba conf etc etc, aka failed auth)
  • export DATABASE_SSL=true failed due to self signed certificate
  • unset DATABASE_SSL worked
  • export DATABASE_SSL="{ "rejectUnauthorized": false }" worked

Solution suggestions

To get it to work I had to patch the Helm chart templates/deployment.yaml

            - name: DATABASE_SSL
              value: {{ .Values.dbConfig.ssl | toJson | quote }}

Then I could set my values override

dbConfig:
  host: production-unleash.xyzxyzxyzxyz.eu-north-1.rds.amazonaws.com
  ssl: { "rejectUnauthorized": false }

Works for me. But I don't know if this would work with true / false

Security scan vulnerability report for helm 3.04

Describe the bug

We are using Unleash via helm chart - we have downloaded the latest release 3.0.4 https://github.com/Unleash/helm-charts/releases/tag/unleash-3.0.4

This release uses unleash-server 5.5.6 that uses base image 18.7.1

The scan result we sent is the scan after updating to the latest unleash-helm release (3.0.4) and as you can see the results shows 171 vulnerabilities.
We would like to use the latest version but can't upgrade with this vulnerability increase.

Steps to reproduce the bug

scan helm chart with version 3.04 using black-duck binary analysis.

Expected behavior

No response

Logs, error output, etc.

No response

Screenshots

image

Additional context

No response

Unleash version

3.04

Subscription type

Open source

Hosting type

Self-hosted

SDK information (language and version)

GO

Unleash Edge helm chart should allow podLabels to be specified a la Unleash

Describe the feature request

I would like to be able to specify pod labels in the Unleash Edge helm chart.

Background

We use Istio and the lack of ability to specify those labels in Edge prevents us from injecting the Istio sidecar (via code in values.yaml). This results in us losing a bit of observability in terms of the request metrics we get from Istio.

Solution suggestions

I'd like to simply copy the relevant content from the Unleash helm chart and apply it to the Unleash Edge helm chart.

Service in unleash edge helm chart

Describe the bug

I deployed the unleash edge helm chart and i set the token and URL correctly and it was really hard to debug because you cant execute shell inside the pod, and when I exposed the unleash-edge pod through ingress, I was getting 503 error and after a while I found out that the service resource wasn't forwarding the traffic correctly to the pod, it was forwarding it on port 80 and it was exposed on the pod in port 3036

I highly recommend to fix this or at least give an option in the values file to change the ports so it will work correctly because I had to pull the helm chart's and change the templates, instead of deploying it remotely without pulling it

Thanks!

Steps to reproduce the bug

deploy the helm chart and try to reach it from port 80 or 443

Expected behavior

usually services forward traffic to the pod on port 80 and forward traffic from the pod on the port the pod is exposed at (in this case its 3036)

Logs, error output, etc.

No response

Screenshots

Screenshot from 2023-11-12 21-10-42

Additional context

No response

Unleash version

2.1.0

Subscription type

Enterprise

Hosting type

Hosted by Unleash

SDK information (language and version)

helm

Error: couldn't find key `postgresql-password` in Secret `unleash-postgresql`

Describe the bug

Wrong Secret key is used to reference POSTGRESQL_PASSWORD in Unleash Deployment when using default helm chart values

Steps to reproduce the bug

  1. Add Unleash helm repo
    helm repo add unleash https://docs.getunleash.io/helm-charts
  2. Template Unleash helm chart
    helm template unleash/unleash
  3. Find Deployment of Unleash
  4. Check environment variable POSTGRESQL_PASSWORD reference

Actual:
Deployment manifest:

...
spec:
  containers:
    - name: unleash
      env:
        - name: POSTGRESQL_PASSWORD
          valueFrom:
            secretKeyRef:
              name: unleash-postgresql
              key: postgresql-password
...

Secret manifest:

apiVersion: v1
kind: Secret
metadata:
  name: unleash-postgresql
  namespace: "dev"
  labels:
    app.kubernetes.io/name: postgresql
    helm.sh/chart: postgresql-12.1.6
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/managed-by: Helm
type: Opaque
data:
  postgres-password: "Y2lpTlNIbm9xTA=="
  # We don't auto-generate LDAP password when it's not provided as we do for other passwords

The problem is that the Secret does not contain postgresql-password. It has postgres-password key instead.

Expected behavior

No response

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

No response

Subscription type

Open source

Hosting type

Self-hosted

SDK information (language and version)

No response

Support for PostgreSQL Schema

Describe the feature request

Please allow specifying dbConfig.schema property on values.yaml

Background

Right now it's not possible to configure the chart with custom schema: property, therefore all tables get created in public schema, which is inconvenient, since there are a lot of system tables and those Unleash creates cannot be determined (e.g. for data migration to another db instance).

Solution suggestions

dbConfig:
  # if postgres dependency chart is used, this needs to be the same value as postgresql.postgresqlDatabase
  database: unleash-db
+ schema: unleash
  ...

Probes aren't checking /health endpoint

See issue, reported by Robert Grumann here:

https://unleash-community.slack.com/archives/CGN5JT69F/p1614135458011900

Question about readiness-probe and liveness-probe in case of usage in kubernetes:
when I play with kubernetes deployments, I notice that the new instance of unleash during the installation with an http readiness probe on the root folder of the UI already replies with http 200 before the instance has started completely.
This means that Unleash is temporarily not available for kubernetes deployments (new instance not yet fully started, but a stop command has already been sent to the old instance)
Is there a possibility to unleash with http-get or other commands to inquire whether the instance has already started completely so that I can explicitly base the readiness probe on this information?

See /health endpoint here:

https://docs.getunleash.io/docs/api/internal/health

No initContainers support

Hi, I'm having trouble using the chart with a separate postgres database.

We already have a postgres deployment for our other services, and I configured the chart to use it. However, the database "unleash" doesn't exist on that instance (and I don't want to hardcode it there), so migrations fail.

We usually solved this problem by creating an initContainer on the service deployment which would create the database before the main container starts. Is there another way to achieve the same thing or could we add support for initContainers in the deployment template?

Docker image version 5.6.7 contains high number of Vulnerabilities wVulnerabilities

Describe the bug

Hello support.
Please note that unleashorg/unleash-server:5.6.7 contains a high number when many of the issue resolved in 5.7.2 image
see more details at Unleash/unleash#5637
Any plans to switch to the latest docker image 5.7.xx?

Steps to reproduce the bug

No response

Expected behavior

No response

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

No response

Subscription type

None

Hosting type

None

SDK information (language and version)

No response

Unleash helm charts should support external secret providers

Describe the feature request

Unleash helm chart should support external secret integration so that I can store my db creds in AWS secret manager?

Came up in #94 - to avoid having issues addressing three separate bugs, extracted this to a new Feature Request

Background

No response

Solution suggestions

No response

Database environment variables are not picked up by unleash

Describe the bug

I tried to get Unleash working with an external database, but unleash can not pick up the database config that i specified in the values file.

Steps to reproduce the bug

  1. my values.yaml file
  postgresql:
    enabled: false
  dbConfig:
    host: <my database IP address>
    pass: <my password>
    useExistingSecret:
      name: unleash-postgresql
      key: postgresql-password
  1. deploy the helm chart
  2. chart deploy successfully
  3. i check the unleash deployment YAML in kubernetes, it contains all the env vars that i specified
spec:
  containers:
  - env:
    - name: POSTGRESQL_PASSWORD
      valueFrom:
        secretKeyRef:
          key: postgresql-password
          name: unleash-postgresql
    - name: DATABASE
      value: unleash
    - name: DATABASE_HOST
      value: <my database IP address>
    - name: DATABASE_PASS
      value: $(POSTGRESQL_PASSWORD)
    - name: DATABASE_PORT
      value: "5432"
    - name: DATABASE_USER
      value: unleash
    - name: DATABASE_SSL
      value: "false"
  1. but the pod failed to start, it keep throwing this error in the log
[2023-01-06T07:39:19.911] [DEBUG] server-impl.js - DB migration: start
[2023-01-06T07:39:20.008] [ERROR] server-impl.js - Failed to migrate db OperationalError: connect ECONNREFUSED 127.0.0.1:5432
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) {
  cause: Error: connect ECONNREFUSED 127.0.0.1:5432
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '127.0.0.1',
    port: 5432
  },
  isOperational: true,
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 5432
}
[ERROR] Error: connect ECONNREFUSED 127.0.0.1:5432
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
Stream closed EOF for unleash/unleash-stage-6cb446fbc6-g4qh8 (unleash)

Expected behavior

Unleash should pick up the database config from the specified environment variables

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

4.19.1

Subscription type

Open source

Hosting type

Self-hosted

SDK information (language and version)

No response

create helm repo for unleash

I was not able to find unleash via https://artifacthub.io so it seems there is no helm repo available, which hosts the chart?

Did i just missed it?
Unfortunatly there is no Readme.md provided for the chart too, which contains install instructions.

If there is nor helm repo available jet, you could host the Helm chart via Github releases and Github pages.

I'm experienced with this from other repos (kokuwa, kiwigrid, prometheus-community and so on) so if wanted i coud provide an pr, implementing this via Github actions.

Unleash Edge should not set default resources

Describe the bug

Currently Unleash Edge helm charts sets default cpu and memory resources limits in:

resources:
requests:
cpu: 100m
memory: 64Mi
limits:
cpu: 200m
memory: 64Mi

As a consequence we lost the ability to specify only subset of requests in our local values.yaml files, e.g:

  resources:
    limits:
      memory: 6G
      ephemeral-storage: "8Gi"
    requests:
      memory: 4G
      cpu: 1
      ephemeral-storage: "8Gi"

It is rendering to:

  resources:
    limits:
      cpu: 200m                                  # <- I don't want to set up cpu, I have no option to skip it
      memory: 64Mi
    requests:
      cpu: 1
      ephemeral-storage: 8Gi
      memory: 4G

resources.limits.cpu is inherited from charts values.yaml file and I have no option to skip any part of resources. In my particular scenario I don't want to set resources.limits.cpu.

This is a known helm behavior: helm/helm#12488 where if the value is defined in the ancestor (helm chart in this case) I'm not able to omit a part of it.

Steps to reproduce the bug

  1. Create values.yaml file with following content (without resources.limits.cpu):
resources:
  limits:
    memory: 64Mi
  requests:
    cpu: 1
    ephemeral-storage: 8Gi
    memory: 4G
  1. Render helm chart and see how resources are defined:
helm template unleash/unleash-edge -s templates/deployment.yaml -f values.yaml | grep -A50 resources:                                                                                                                                                                                                     (use1-rdev/ep-unleash-edge) 
          resources:
            limits:
              cpu: 200m
              memory: 64Mi
            requests:
              cpu: 1
              ephemeral-storage: 8Gi
              memory: 4G

Expected behavior

The chart should not set default resources, similar to how this is done in Unleash:

resources:
{}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

Logs, error output, etc.

No response

Screenshots

No response

Additional context

Checked on the latest helm chart version: 3.0.6

Unleash version

No response

Subscription type

Open source

Hosting type

Self-hosted

SDK information (language and version)

No response

Missing autoscaling values in values.yaml

Describe the bug

This should be a very simple fix. I would have fixed it myself but the contributing guidelines page returns 404.

Basically add the possible values to the autoscaling field in the values.yaml

autoscaling:
  enabled: false
  minReplicas: 0
  maxReplicas: 0
  targetCPUUtilizationPercentage: 0
  targetMemoryUtilizationPercentage: 0

Steps to reproduce the bug

No response

Expected behavior

No response

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

No response

Subscription type

No response

Hosting type

No response

SDK information (language and version)

No response

Deploy chart using an external database not migrate DB

Describe the bug

When i try to use an external Postgres to deploy on my kubernetes cluster i get this error

[2023-07-19T14:23:00.479] [ERROR] server-impl.js - Failed to migrate db OperationalError: getaddrinfo ENOTFOUND unleash-dev-user
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
  cause: Error: getaddrinfo ENOTFOUND unleash-dev-user
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
    errno: -3008,
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: 'unleash-dev-user'
  },
  isOperational: true,
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'unleash-dev-user'
}
[ERROR] Error: getaddrinfo ENOTFOUND unleash-dev-user
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)

as the error said, it seems that the configuration does'not consider the host configuration

Steps to reproduce the bug

This is my helm configuration

The relevant part of my configuration is

dbConfig:
  database: unleash-dev
  host: 10.*.*.*
  pass: B*********jDq
  port: 5432
  schema: public
  ssl: false
  useExistingSecret:
    key: ""
    name: ""
  user: unleash-dev-user
.....

postgresql:
  auth:
    database: unleash-dev
    password: ***********
    username: unleash-dev-user
  enabled: false
  fullnameOverride: unleash-postgresql

This is the full config

affinity: {}
autoscaling:
  enabled: false
  maxReplicas: 0
  minReplicas: 0
  targetCPUUtilizationPercentage: 70
  targetMemoryUtilizationPercentage: 70
configMaps: {}
containerPort: 4242
dbConfig:
  database: unleash-dev
  host: 10.*.*.*
  pass: B*********jDq
  port: 5432
  schema: public
  ssl: false
  useExistingSecret:
    key: ""
    name: ""
  user: unleash-dev-user
env: []
existingSecrets: ""
fullnameOverride: ""
image:
  pullPolicy: Always
  repository: unleashorg/unleash-server
imagePullSecrets: []
ingress:
  annotations: {}
  className: ""
  enabled: false
  hosts:
  - host: chart-example.local
    paths:
    - path: /
      pathType: ImplementationSpecific
  tls: []
initContainers: []
livenessProbe:
  enabled: true
  initialDelaySeconds: 30
  path: /health
  timeoutSeconds: 10
nameOverride: ""
nodeSelector: {}
podAnnotations: {}
postgresql:
  auth:
    database: unleash-dev
    password: ***********
    username: unleash-dev-user
  enabled: false
  fullnameOverride: unleash-postgresql
readinessProbe:
  enabled: true
  initialDelaySeconds: 30
  path: /health
  periodSeconds: 10
  successThreshold: 5
  timeoutSeconds: 10
replicaCount: 1
resources: {}
secrets: {}
securityContext: {}
service:
  annotations: {}
  loadBalancerIP: ""
  loadBalancerSourceRanges: []
  port: 4242
  type: LoadBalancer
tolerations: []
vpa:
  enabled: false

Expected behavior

I'm expeting that the server start and the migration are applied to my external db

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

3.0.1

Subscription type

Open source

Hosting type

Self-hosted

SDK information (language and version)

No response

livenessProbe and readinessProbe not including proxyBasePath

Describe the bug

When deploying the chart with:

env:
  - name: PROXY_BASE_PATH
    value: features

The livenessProbe and livenessProbe are set to /proxy/health instead of expected /features/proxy/health. This result in pod been marked as down.

Steps to reproduce the bug

  1. Deploy chart using PROXY_BASE_PATH=features and an ingress controller with path=features
  2. Wait for chart to de deployed
  3. Check deployed pod and notice the values of livenessProbe.path and livenessProbe.path
        livenessProbe:
            path: /proxy/health
        readinessProbe:
          httpGet:
            path: /proxy/health

Expected behavior

        livenessProbe:
            path: /features/proxy/health
        readinessProbe:
          httpGet:
            path: /features/proxy/health

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

v0.13.1

Subscription type

Open source

Hosting type

Self-hosted

SDK information (language and version)

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.