When you save secrets, all secrets are encrypted and stored in your connected cloud account’s secret manager. For example, in AWS, all the secrets are encrypted/stored in Parameter Store.LocalOps only stores the
KEY names for reference.Usage & environment vars
LocalOps securely passes each key value pair as environment variable to your service. So you can read them and use in code as you would do for any other environment variable.How to add/update secrets
During service creation
In New Service form, you can see a section called “Secrets”. You can add your key value pairs in that section and create the service. If you don’t have all secrets handy when you are creating the service, you can add them after service created. We don’t deploy a service until you trigger them from UI or via git push.After service creation
Navigate to Environment > Services > Service section to find “Secrets” tab. In there, you can add/update your secrets anytime.Environment level vs Service level secrets
Secrets can be added at two levels:- Environment level
- Service level
Expressions in secret values
A secret value can contain#{...} expressions. Each expression is replaced with the value it points to — an
environment level secret, another service’s secret, or a service’s in-cluster hostname.
Expressions are evaluated anywhere inside the value, not just when the expression is the whole value. So one secret can
hold a complete URL instead of being split into separate host/port/path variables.
$svc-abc is the alias of a service. You can
copy it from the “Overview” tab of that service.
Examples
What #{$svc-abc} resolves to
A bare alias resolves only when the referenced service actually has an address inside the cluster.
Unresolvable expressions
An expression that cannot be resolved is left in the value exactly as written, braces included, and a warning is logged. This applies to an unknown alias, a missing secret key, a service with no internal hostname, and any form that isn’t in the table above.http://$svc-242g:8080/x that only fails at runtime.
Expressions are evaluated when you save the secret, not on deploy. Create the services you refer to first, then
save the secrets that point at them.
Bare alias as the whole value
A value that is nothing but an alias, with no braces, still resolves to a hostname:#{$svc-abc} above —
so a bare alias of a worker, cron, job or Helm chart service stays literal. Prefer #{...} for new secrets.
Importing other service secrets
You can also import all the secrets defined in another service by using a special key.__import_svc as the key and the alias of the service which you want to import as the value. Any secret added in
the current service will override the imported secret.
Aliases outside secrets
The same alias rules apply everywhere an alias can be used:ops.jsoninit dependency —"type": "service"with"service": "$svc-abc". See Init Jobs. An alias that names no in-cluster service fails the deployment withinvalid svc provided as dependency.- Helm chart
values.yaml— aliases used in the settings of a Helm chart service are replaced with the internal hostname. An alias that doesn’t resolve is left as written.
Expressions in generated Helm charts
When LocalOps generates a Helm chart for your environment,#{...} expressions are resolved at chart generation time,
with two differences:
- A referenced secret marked sensitive is not substituted — the expression is left as written. A sensitive value cannot be inlined into another secret’s value in the chart.
- A referenced secret exposed in the chart renders as a Helm values reference, for example
{{ .Values.global.config.pgHost }}, so chart users can override it in their ownvalues.yaml.