-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Comments
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 SolutionWhen 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:
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 }}
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 Current plan usage: 10.92% Have feedback or need help? |
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: 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 |
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
The text was updated successfully, but these errors were encountered: