Skip to content

Commit

Permalink
Give instructions for deploying multiply
Browse files Browse the repository at this point in the history
Update the deployment instructions to mention the `namespace`,
`namespaces`, and `exclude-crds` config entries.

Signed-off-by: Michael Bridgen <[email protected]>
  • Loading branch information
squaremo committed Sep 27, 2022
1 parent aef0b4d commit f688797
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ At this point your `pulumi` CLI is configured to work with the Pulumi SaaS backe
1. Lastly you will need to [create an AWS Key Management Service (KMS) key](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html#create-symmetric-cmk). This key will be used by Pulumi to encrypt secret configuration values or outputs associated with stacks. Pulumi ensures all secrets are stored encrypted in transit and at rest. By default, the SaaS backend creates per-stack encryption keys to do this, however, Pulumi can leverage KMS as one of [several supported encryption providers](https://www.pulumi.com/docs/intro/concepts/secrets/#available-encryption-providers) instead, thus allowing users to self-manage their encryption keys.
</details>


## Deploy the Operator

Deploy the operator to a Kubernetes cluster.
Expand All @@ -109,6 +108,15 @@ Deploy the API resources for the operator.
kubectl apply -f deploy/yaml
```

This will deploy the operator to the default namespace (which depends on your configuration, and is
usually `"default"`). To deploy to a different namespace:

```bash
kubectl apply -n <namespace> -f deploy/yaml
```

You can deploy to several namespaces by repeating the above command.

### Using Pulumi

First, make sure you have reviewed and performed the tasks identified in the [prerequisite section](#prerequisites).
Expand All @@ -124,6 +132,13 @@ Change directory to the expanded tarball (e.g. `pulumi-kubernetes-operator-x.y.z
```shell
$ pulumi stack init --secrets-provider="awskms:///arn:aws:kms:...?region=<region>"
```
1. (optional) Set the target namespace or namespaces:
```shell
$ # for one namespace:
$ pulumi config set namespace <namespace>
$ # for several namespaces:
$ pulumi config set-all --path --plaintext namespaces[0]=<ns1> --plaintext namespaces[1]=<ns2>
```
1. Run `yarn install` to install the dependencies
1. Run `pulumi up`
</details>
Expand All @@ -136,6 +151,13 @@ Change directory to the expanded tarball (e.g. `pulumi-kubernetes-operator-x.y.z
```shell
$ pulumi stack init --secrets-provider="awskms:///arn:aws:kms:...?region=<region>"
```
1. (optional) Set the target namespace:
```shell
$ # for one namespace:
$ pulumi config set namespace <namespace>
$ # for several namespaces:
$ pulumi config set-all --path --plaintext namespaces[0]=<ns1> --plaintext namespaces[1]=<ns2>
```
1. Run `pulumi up`
</details>

Expand All @@ -147,6 +169,13 @@ Change directory to the expanded tarball (e.g. `pulumi-kubernetes-operator-x.y.z
```shell
$ pulumi stack init --secrets-provider="awskms:///arn:aws:kms:...?region=<region>"
```
1. (optional) Set the target namespace:
```shell
$ # for one namespace:
$ pulumi config set namespace <namespace>
$ # for several namespaces:
$ pulumi config set-all --path --plaintext namespaces[0]=<ns1> --plaintext namespaces[1]=<ns2>
```
1. Run `pulumi up`

</details>
Expand All @@ -159,10 +188,25 @@ Change directory to the expanded tarball (e.g. `pulumi-kubernetes-operator-x.y.z
```shell
$ pulumi stack init --secrets-provider="awskms:///arn:aws:kms:...?region=<region>"
```
1. (optional) Set the target namespace:
```shell
$ # for one namespace:
$ pulumi config set namespace <namespace>
$ # for several namespaces:
$ pulumi config set-all --path --plaintext namespaces[0]=<ns1> --plaintext namespaces[1]=<ns2>
```
1. Run `pulumi up`

</details>

The programs above also install the Custom Resource Definition; if that is installed some other way,
or by another stack, you can exclude it with the config item "exclude-crds":

```shell
$ pulumi config set exclude-crds true
$ pulumi up
```

## Create Pulumi Stack CustomResources

The following are examples to create Pulumi Stacks in Kubernetes that are managed and run by the operator.
Expand Down

0 comments on commit f688797

Please sign in to comment.