You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds explanation in the authorization.md document about the difference
between Cluster Mode and Namespace Mode when starting an ACK controller
including language that describes the various ClusterRole or Role
permissions required for controllers started in either mode.
Issue: #1173
Signed-off-by: Jay Pipes <jaypipes@gmail.com>
Copy file name to clipboardExpand all lines: docs/content/docs/user-docs/authorization.md
+72-1Lines changed: 72 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,78 @@ Refer to the following diagram for more details on running a Kubernetes API serv
40
40
41
41
You will need to configure Kubernetes RBAC and AWS IAM permissions before using ACK service controllers.
42
42
43
-
## Kubernetes RBAC for ACK controller
43
+
## Kubernetes RBAC
44
+
45
+
### Permissions required for the ACK service controller
46
+
47
+
ACK service controllers may be started in either *Cluster Mode* or *Namespace
48
+
Mode*. Controllers started in Cluster Mode watch for new, updated and deleted
49
+
custom resources (CRs) in all Kubernetes `Namespaces`. Conversely, controllers
50
+
started in Namespace Mode only watch for CRs in a single Kubernetes `Namespace`
51
+
identified by the `--watch-namespace` flag.
52
+
53
+
#### Namespace Mode
54
+
55
+
When a service controller is started in Namespace Mode, the `--watch-namespace`
56
+
flag is supplied and the controller will *only* watch for custom resources
57
+
(CRs) in that Kubernetes Namespace.
58
+
59
+
Controllers started in Namespace Mode require that the Kubernetes `Service
60
+
Account` associated with the controller's `Deployment` have a `Role` with
61
+
permissions to create, update/patch, delete, read, list and watch ACK custom
62
+
resources matching the associated AWS service in the specific Kubernetes
63
+
`Namespace` identified by the `--watch-namespace` flag.
64
+
65
+
{{% hint type="info" title="The `installScope: namespace` Helm Chart value" %}}
66
+
If you are installing an ACK service controller via the associated Helm Chart,
67
+
you can simplify a Namespace Mode installation by setting the `installScope`
68
+
value to `namespace`. This will cause the Helm Chart to install a
69
+
namespace-scoped `RoleBinding` with the necessary permissions the controller
70
+
needs to create, update, read, list and watch the ACK custom resources managed
71
+
by the controller.
72
+
{{% /hint %}}
73
+
74
+
### Cluster Mode
75
+
76
+
When a service controller is started in Cluster Mode, the `--watch-namespace`
77
+
flag is not supplied and the controller will watch for ACK custom resources
78
+
(CRs) across *all* Kubernetes `Namespaces`.
79
+
80
+
Controllers started in Cluster Mode require that the Kubernetes `Service
81
+
Account` associated with the controller's `Deployment` have a `ClusterRole`
82
+
with permissions to create, update/patch, delete, read, list and watch ACK
83
+
custom resources matching the associated AWS service in *all* Kubernetes
84
+
`Namespaces`.
85
+
86
+
To support cross-account resource management, controllers started in Cluster
87
+
Mode require that the Kubernetes `Service Account` associated with the
88
+
controller's `Deployment` have a `ClusterRole` with permissions to read, list
89
+
and watch *all*`Namespace` objects.
90
+
91
+
Additionally, the `ClusterRole` will need permissions to read `ConfigMap`
92
+
resources in a specific Kubernetes `Namespace` identified by the environment
93
+
variable `ACK_SYSTEM_NAMESPACE`, defaulting to `ack-system`.
94
+
95
+
{{% hint type="info" title="Cross-account resource management requires Cluster Mode" %}}
96
+
If you plan to use an ACK service controller to manage resources across many
97
+
AWS accounts (cross-account resource management, or CARM), you *must* start the
98
+
controller in Cluster Mode.
99
+
{{% /hint %}}
100
+
101
+
### Permission to read `Secret` objects
102
+
103
+
Some ACK service controllers will replace plain-text values for some resource
104
+
fields with the value of Kubernetes `Secret` keys.
105
+
106
+
For controllers started in Namespace Mode, the `Role` must have permissions to
107
+
read `Secret` objects in the Kubernetes `Namespace` identified by the
108
+
`--watch-namespace` flag.
109
+
110
+
For controllers started in Cluster Mode, the `ClusterRole` must have
111
+
permissions to read `Secret` resources in *any Kubernetes `Namespace` within
112
+
which ACK custom resources may be launched*.
113
+
114
+
### Roles for reading and writing ACK custom resources
44
115
45
116
As part of installation, Kubernetes `Role` resources are automatically created. These roles contain permissions to modify the Kubernetes custom resources (CRs) that the ACK service controller is responsible for.
Copy file name to clipboardExpand all lines: docs/content/docs/user-docs/cross-account-resource-management.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: "Manage Resources In Multiple AWS Accounts (CARM)"
2
+
title: "Manage Resources In Multiple AWS Accounts"
3
3
description: "Managing resources in different AWS accounts"
4
4
lead: ""
5
5
draft: false
@@ -18,6 +18,10 @@ ACK service controllers can manage resources in different AWS accounts. To enabl
18
18
19
19
For detailed information about how ACK service controllers manage resources in multiple AWS accounts, please refer to the Cross-Account Resource Management (CARM) [design document](https://github.com/aws-controllers-k8s/community/blob/main/docs/design/proposals/carm/cross-account-resource-management.md).
20
20
21
+
{{% hint type="note" title="To use CARM, `--watch-namespace` must be empty" %}}
22
+
ACK service controllers may be started in either Cluster Mode or Namespace Mode. When a service controller is started in Namespace Mode, the `--watch-namespace` flag is supplied and the controller will *only* watch for custom resources (CRs) in that Kubernetes Namespace. Because the cross-account resource management feature requires the controller to watch for custom resources on many Kubernetes Namespaces, this feature is incompatible with the Namespace Mode of running a controller and thus the `--watch-namespace` flag must not be set (or be set to an empty string).
23
+
{{% /hint %}}
24
+
21
25
## Step 1: Configure your AWS accounts
22
26
23
27
AWS account administrators should create and configure IAM roles to allow ACK service controllers to assume roles in different AWS accounts.
Before installing a Helm chart, you must first make the Helm chart available on the `Deployment` host. To do so, use the `helm pull` command and then extract the chart:
41
+
Before installing a Helm chart, you must first make the Helm chart available on the dDeployment host. To do so, use the `helm pull` command and then extract the chart:
42
42
43
43
```bash
44
44
export HELM_EXPERIMENTAL_OCI=1
@@ -63,16 +63,16 @@ different version, change the `RELEASE_VERSION` variable and execute the command
63
63
Once the Helm chart is downloaded and exported, you can install a particular ACK service controller using the `helm install` command:
{{% hint type="info" title="Specify your region" %}}
75
-
The commands above set the service region of the S3 controller to `us-west-2`. Be sure to specify your region in the `AWS_REGION` variable.
74
+
{{% hint type="info" title="Specify your target service region" %}}
75
+
The commands above set the target service region of the S3 controller to `us-west-2`. Be sure to specify your target service region in the `AWS_REGION` variable. This will be the *default* AWS region in which resources will be created by the ACK service controller. Note that a single ACK service controller can manage the lifecycle of resources in multiple AWS regions: simply add the `services.k8s.aws/region=$REGION` annotation to your resource. Alternately, you can add the `services.k8s.aws/region=$REGION` annotation to a Kubernetes `Namespace` and any resource launched in that `Namespace` will be created in that region by default.
76
76
{{% /hint %}}
77
77
78
78
The `helm install` command should return relevant installation information:
@@ -89,7 +89,7 @@ TEST SUITE: None
89
89
To verify that the Helm chart was installed, use the `helm list` command:
90
90
91
91
```bash
92
-
helm list --namespace $ACK_K8S_NAMESPACE -o yaml
92
+
helm list --namespace $ACK_SYSTEM_NAMESPACE -o yaml
93
93
```
94
94
95
95
The `helm list` command should return your newly-deployed Helm chart release information:
0 commit comments