Skip to content

Commit

Permalink
doc: add section about pre-defined variables, closes nais/core#127
Browse files Browse the repository at this point in the history
  • Loading branch information
Muni10 committed Aug 3, 2023
1 parent e1c56d7 commit c4292ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/nais-application/good-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ Note that in this definition, secrets (database credentials, certificates, API t
Both ConfigMap and Secret are Kubernetes resources that can be exposed to an application as environment variables.
See [envFrom ConfigMap](https://doc.nais.io/nais-application/application/#envfromconfigmap), and [envFrom Secret](https://doc.nais.io/nais-application/application/#envfromsecret) for more details.

## Use enviroment variables exposed by the platform

Some environment variables are made available to the pods by default when deployed on the NAIS platform, depending on which features are enabled. Examples of such features are tokenx, azurerator and aivenator. Avoid setting your own environment variables for these values and use pre-defined variables instead.

This will ease or eliminate the need for configuration when the platform changes.

## Set reasonable resource requests and limits

Expand Down Expand Up @@ -108,4 +113,4 @@ If your application only has a single replica, then your users will experience d
If you wish to avoid unnecessary downtime, your application should run at least 2 replicas.

If your application functions in a way that requires that only a single pod is active, you can employ [leader election](https://doc.nais.io/addons/leader-election/) to select a leader that does the work,
while keeping a running backup replica ready to step in should the leader be killed.
while keeping a running backup replica ready to step in should the leader be killed.

0 comments on commit c4292ad

Please sign in to comment.