Skip to content

Commit

Permalink
re-orders deploy steps and clarifies instructions (#6109)
Browse files Browse the repository at this point in the history
Previously, if you ran the suggested command `kustomize build
config/default | kubectl apply -f -`, that would render an incorrect
manifest. That is because when the user changed the value of
`IMAGE_TAG_BASE` and `IMG` in the Makefile during a previous step, that
change has not yet been applied to kustomize manifests at the time of
running the suggested command. So the wrong image reference ends up
being rendered, and the manifests get applies to the cluster. `make
deploy` must be run first, which updates the kustomize manifest.

This change clarifies that running `kustomize build config/default` is
part of explaining to the reader how things work, is not a required step
that should apply anything to the cluster, AND importantly should not
be run until after `make deploy`.
  • Loading branch information
mhrivnak authored Oct 24, 2022
1 parent 3d4eb4b commit 67b8a1d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions website/content/en/docs/building-operators/ansible/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,6 @@ make install run

By default, a new namespace is created with name `<project-name>-system`, ex. `memcached-operator-system`, and will be used for the deployment.

The scaffolded `Makefile` uses [`kustomize`][kustomize-docs] to apply
custom configurations and generate manifests from the `config/`
directory, which are piped to `kubectl`.

```sh
kustomize build config/default | kubectl apply -f -
```

Commonly, Operator authors may need to modify `config/rbac` in order to
give their Operator the necessary permissions to reconcile.

Expand All @@ -195,6 +187,15 @@ Run the following to customize the manifests and deploy the operator.
make deploy
```

The scaffolded `Makefile` uses [`kustomize`][kustomize-docs] to apply custom
configurations and generate manifests from the `config/` directory, which are
piped to `kubectl`. Run the following command to see the manifests that were
applied to the cluster.

```sh
kustomize build config/default
```

Verify that the memcached-operator is up and running:

```console
Expand Down

0 comments on commit 67b8a1d

Please sign in to comment.