Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the 'namespace' cli flag to capa controller #615

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

- [Development instructions](development.md)

## Special use cases

- [Creating multinode control plane clusters](creating-multinode-controlplane-clusters.md)
- [Reconcile Cluster-API objects in a restricted namespace](reconcile-in-custom-namespace.md)

## Project Documentation

- [Initial feature model](proposal/features.md)
Expand Down
52 changes: 52 additions & 0 deletions docs/reconcile-in-custom-namespace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Reconcile Cluster-API Objects In Custom Namespace <!-- omit in toc -->

Cluster-api-provider-aws controllers by default, reconcile cluster-api objects
across all namespaces in the cluster. However, it is possible to restrict
reconciliation to a single namespace and this document tells you how.

## Contents <!-- omit in toc -->

- [Use cases](#use-cases)
- [Configuring `cluster-api-provider-aws` controllers](#configuring-cluster-api-provider-aws-controllers)

## Use cases

- Grouping clusters into a namespace based on the AWS account will allow
managing clusters across multiple AWS accounts. This will require each
`cluster-api-provider-aws` controller to have credentials to their respective
AWS accounts. These credentials can be created as kubernetes secret and be
mounted in the pod at `/root/.aws`.
ashish-amarnath marked this conversation as resolved.
Show resolved Hide resolved
- Grouping clusters into a namespace based on their environment, (test,
qualification, canary, production) will allow a phased rolling out of
`cluster-api-provider-aws` releases.
- Grouping clusters into a namespace based on the infrastructure provider will
allow running multiple cluster-api provider implementations side-by-side and
manage clusters across infrastructure providers.

## Configuring `cluster-api-provider-aws` controllers

- Create the namespace that `cluster-api-provider-aws` controller will watch for
cluster-api objects

```(bash)
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Namespace
metadata:
name: my-pet-clusters #edit if necessary
detiber marked this conversation as resolved.
Show resolved Hide resolved
EOF
```

- Deploy/edit `aws-provider-controller-manager` controller statefulset

Specifically, edit the container spec for `cluster-api-aws-controller`, in the
`aws-provider-controller-manager` statefulset, to pass a value to the `namespace`
CLI flag.

```(bash)
- -namespace=my-pet-clusters # edit this if necessary
```

Once the `aws-provider-controller-manager-0` pod restarts,
`cluster-api-provider-aws` controllers will only reconcile the cluster-api
objects in the `my-pet-clusters` namespace.