Skip to content

Commit

Permalink
add quickstart doc for porter configuration file (#2038)
Browse files Browse the repository at this point in the history
* add quickstart doc for porter configuration file

Signed-off-by: Yingrong Zhao <[email protected]>

* rename file

Signed-off-by: Yingrong Zhao <[email protected]>

* address comments

Signed-off-by: Yingrong Zhao <[email protected]>
  • Loading branch information
VinozzZ authored Apr 28, 2022
1 parent 62435ad commit d7a7995
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,17 @@ pygmentsStyle = "friendly"
identifier = "quickstart-credentials"
weight = 3
parent = "quickstart"
[[menu.main]]
name = "Configuration"
url = "/quickstart/configuration/"
identifier = "quickstart-configuration"
weight = 4
parent = "quickstart"
[[menu.main]]
name = "Desired State"
url = "/quickstart/desired-state/"
identifier = "quickstart-desired-state"
weight = 4
weight = 5
parent = "quickstart"
[[menu.main]]
name = "Examples"
Expand Down
56 changes: 56 additions & 0 deletions docs/content/quickstart/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: "QuickStart: Configuration"
descriptions: Control Porter's behavior with its config file
layout: single
---

You now know how to install a bundle, passing in a credential or parameter set
with Porter's default settings.
Porter can be configured with some global settings, which are separate from any
bundle specific configuration, and which apply across all bundles.
This QuickStart walks you through how to set up and utilize the configuration
file to achieve some common tasks.

## Create configuration file

First, let's create the configuration file.

In your PORTER_HOME directory, by default ~/.porter/, create a file with name
config.yaml.
```yaml
touch ~/.porter/config.yaml
```

## Define default global namespace for bundles

Instead of explicitly setting namespace for multiple bundles one by one, we can define a global default namespace
in the configuration file like so:
```yaml
namespace: "dev"
```
## Work with bundle that contains sensitive data
Porter does not persist sensitive data in its database, and instead stores it a
secret store defined in the configuration file. When a secret store is not
configured, Porter returns an error when sensitive data is detected during a bundle execution. To
try out porter with bundles that contain sensitive data, such as using sensitive parameters
or generating sensitive outputs, copy and paste below code into the
configuration file:
```yaml
default-secrets-plugin: "filesystem"
```
This enables the filesystem secret plugin to store any sensitive parameters
provided by users, or sensitive outputs generated by bundles.
The filesystem plugin should not be used in production environments since data
is stored as plain text in Porter's home directory. Please use either the [azure-keyvault](/plugins/azure#secrets)
or [hashicorp-vault](/plugins/hashicorp/#plugin-configuration) plugin for production.
## Next Steps
In this QuickStart you learned how to configure Porter to define global default
value for bundles and porter itself. You also learned how to work with bundles
that contains or produces sensitive data.
* [Learn more about Porter's configuration file](/configuration)

0 comments on commit d7a7995

Please sign in to comment.