Skip to content
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

Allow configuration through environment variables #962

Closed
spawnia opened this issue Mar 25, 2021 · 3 comments
Closed

Allow configuration through environment variables #962

spawnia opened this issue Mar 25, 2021 · 3 comments

Comments

@spawnia
Copy link

spawnia commented Mar 25, 2021

I am currently setting up Sentry Relay in our Kubernetes cluster. Passing the configuration as a file works fine, but is relatively verbose.

kind: Deployment
spec:
  template:
    spec:
      containers:
        - name: relay
          image: getsentry/relay
          volumeMounts:
            - mountPath: /work/.relay
              name: relay
      volumes:
        - name: relay
          configMap:
            name: relay
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: relay
data:
  config.yml: |
    relay:
      mode: proxy

It would be nice if I could pass the configuration values as environment variables instead.

kind: Deployment
spec:
  template:
    spec:
      containers:
        - name: relay
          image: getsentry/relay
          env:
            - name: RELAY_MODE
              value: proxy

Such a configuration style is common practice among many other Docker images i have used.

@RaduW
Copy link
Contributor

RaduW commented Mar 25, 2021

Relay already supports setting common configuration parameters with either command line arguments or environment variables.
Please have a look at:
https://github.com/getsentry/relay/blob/master/relay/src/cli.rs#L53-L91
in order to see how to do that through either command line arguments or environment variables.

@RaduW RaduW closed this as completed Mar 25, 2021
@spawnia
Copy link
Author

spawnia commented Mar 25, 2021

Thank you for the quick answer. How would i specify the mode with that?

@RaduW
Copy link
Contributor

RaduW commented Mar 25, 2021

Mode is unfortunately not one of the configurations you can specify through command line or environment variables.
The default mode is managed if you need a different mode you would need to provide a configuration file.

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

No branches or pull requests

2 participants