Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How do you specify your .env values? #37

Open
asdbnasd2OPasd opened this issue Oct 11, 2023 · 2 comments
Open

How do you specify your .env values? #37

asdbnasd2OPasd opened this issue Oct 11, 2023 · 2 comments

Comments

@asdbnasd2OPasd
Copy link

asdbnasd2OPasd commented Oct 11, 2023

Sorry for probably missing something really obvious - but how do you do the setup the values?

I can see the avilable variables here: https://docs.soketi.app/app-management/array-driver

But when installing with helm, how do I pass SOKETI_DEFAULT_APP_ID, SOKETI_DEFAULT_APP_KEY, SOKETI_DEFAULT_APP_SECRET? Thanks

TIA

@codeautopilot
Copy link

codeautopilot bot commented Oct 11, 2023

The codebase is a web application that uses Soketi, a simple, fast and resilient open-source WebSockets server written in Typescript. It's built on top of uWebSockets.js, one of the most efficient WebSocket libraries. The application is deployed using Helm, a package manager for Kubernetes. The .env file is used to store environment variables that are used across the application. The user wants to know how to set the values for SOKETI_DEFAULT_APP_ID, SOKETI_DEFAULT_APP_KEY, and SOKETI_DEFAULT_APP_SECRET when installing with Helm.

Assistant's Solution

When installing with Helm, you can pass environment variables through the values.yaml file or directly through the command line.

Here's how you can do it:

  1. Using values.yaml file:

In your Helm chart, you should have a values.yaml file. You can specify your environment variables there. For example:

env:
  SOKETI_DEFAULT_APP_ID: your_app_id
  SOKETI_DEFAULT_APP_KEY: your_app_key
  SOKETI_DEFAULT_APP_SECRET: your_app_secret

Then, in your deployment.yaml file (which should be in the templates folder of your Helm chart), you can use these values:

spec:
  containers:
    - name: your_container_name
      image: your_image_name
      env:
        - name: SOKETI_DEFAULT_APP_ID
          value: {{ .Values.env.SOKETI_DEFAULT_APP_ID }}
        - name: SOKETI_DEFAULT_APP_KEY
          value: {{ .Values.env.SOKETI_DEFAULT_APP_KEY }}
        - name: SOKETI_DEFAULT_APP_SECRET
          value: {{ .Values.env.SOKETI_DEFAULT_APP_SECRET }}
  1. Directly through the command line:

You can also pass the environment variables directly through the command line when installing the Helm chart:

helm install your_chart_name . --set env.SOKETI_DEFAULT_APP_ID=your_app_id,env.SOKETI_DEFAULT_APP_KEY=your_app_key,env.SOKETI_DEFAULT_APP_SECRET=your_app_secret

Remember to replace your_app_id, your_app_key, and your_app_secret with your actual values.


Current plan usage: 10.92%


Have feedback or need help?

Discord
Documentation
support@codeautopilot.com

@maxvisser
Copy link

maxvisser commented Apr 2, 2024

The helm cli example did not work for me as the deployment does not contain any setting for the env variabled.

Did this instead; I added it from a secret which I already created for my laravel app in k8s:
values.yaml

app:
  extraEnv:
      - name: SOKETI_DEFAULT_APP_ID
        valueFrom:
          secretKeyRef:
            name: app-env-secrets
            key: PUSHER_APP_ID
      - name: SOKETI_DEFAULT_APP_KEY
        valueFrom:
          secretKeyRef:
            name: app-env-secrets
            key: PUSHER_APP_KEY
      - name: SOKETI_DEFAULT_APP_SECRET
        valueFrom:
          secretKeyRef:
            name: app-env-secrets
            key: PUSHER_APP_SECRET

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants