Skip to content

Commit 8e79969

Browse files
authored
Merge pull request #2224 from michaelhtm/add/feature-flags
Add doc for alpha features
2 parents 2481ffc + 2da8132 commit 8e79969

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed

docs/content/docs/user-docs/adopted-resource.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ weight: 66
1010
toc: true
1111
---
1212

13+
**WARNING** This is no longer the recommended approach for adopting resources.
14+
The recommended feature can be found [HERE](features#resourceadoption)
15+
1316
The ACK controllers are intended to manage the complete lifecycle of an AWS
1417
resource, from creation through deletion. However, you may already be
1518
managing those resources using other tools - such as CloudFormation or
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
title : "Alpha Features"
3+
description: ""
4+
lead: ""
5+
draft: false
6+
menu:
7+
docs:
8+
parent: "getting-started"
9+
weight: 30
10+
toc: true
11+
---
12+
13+
Currently we support 4 feature gates for our controllers.
14+
15+
### ResourceAdoption
16+
This feature allows users to adopt AWS resources by specifying the adoption policy as an annotation `services.k8s.aws/adoption-policyy` (currently only supporting `adopt` as a value), and providing the fields required for a read operation in an annotation called `services.k8s.aws/adoption-fields` in json format, and an empty spec.
17+
Here's an example for how to adopt an EKS cluster:
18+
19+
```yaml
20+
apiVersion: eks.services.k8s.aws/v1alpha1
21+
kind: Cluster
22+
metadata:
23+
name: my-cluster
24+
annotations:
25+
services.k8s.aws/adoption-policy: "adopt"
26+
services.k8s.aws/adoption-fields: |
27+
{
28+
"name": "my-cluster"
29+
}
30+
```
31+
Applying the above manifest allows users to adopt an existing EKS cluster named `my-cluster`.
32+
After reconciliation, all the fields in the spec and status will be filled by the controleler.
33+
This feature is currently available for the s3 controller, and we'll see more releases in the future for other controllers
34+
35+
### ReadOnlyResources
36+
This feature allows users to mark a resource as read only, as in, it would ensure that the resource will not call any update operation, and will not be patching anything in the spec, but instead, it will be reconciling the status and ensuring it matches the resource it points to.
37+
To ensure this feature works, the resource should first exist, hence the annotation either needs to be created and later marked as read only, or it can be adopted and reconciled as a read-only resource.
38+
Here's an example of a manifest that adopts, and manages the resource as read-only:
39+
40+
```yaml
41+
apiVersion: eks.services.k8s.aws/v1alpha1
42+
kind: Cluster
43+
metadata:
44+
name: my-cluster
45+
annotations:
46+
services.k8s.aws/read-only: "true"
47+
services.k8s.aws/adoption-policy: "adopt"
48+
services.k8s.aws/adoption-fields: |
49+
{
50+
"name": "my-cluster"
51+
}
52+
```
53+
Applying the above manifest allows users to adopt an existing EKS cluster named `my-cluster` and manage it as a read-only resource.
54+
55+
56+
### TeamLevelCARM and ServiceLevelCARM
57+
The TeamLevelCARM feature builds on [`Manage Resources In Multiple AWS Accounts`](cross-account-resource-management). It allows teams using the same account to annotate a different namespaces with a team ID, and each team ID is associated with a specific AWS role ARN, specified in a config map named `ack-role-team-map`, allowing the controller to have different roles for different namespaces.
58+
59+
Here's an example:
60+
`ack-role-team-map` config-map
61+
```yaml
62+
data:
63+
team-a: "arn:aws:iam::111111111111:role/team-a-global-role"
64+
team-b: "arn:aws:iam::111111111111:role/team-b-global-role"
65+
```
66+
67+
`team-a` namespace
68+
```yaml
69+
metadata:
70+
name: testing-a
71+
annotations:
72+
services.k8s.aws/team-id: "team-a"
73+
```
74+
`team-b` namespace
75+
```yaml
76+
---
77+
metadata:
78+
name: testing-b
79+
annotations:
80+
services.k8s.aws/team-id: "team-b"
81+
```
82+
83+
The ServiceLevelCARM feature allows users to speciy different IAM roles for different service controllers within the same team and AWS Account.
84+
85+
For example, you might want the s3 controller to assume a different IAM Role than the dynamodb controller, even when managing resources in the same team/aws account.
86+
87+
Here's an example:
88+
89+
`team-a` namespace
90+
```yaml
91+
metadata:
92+
annotations:
93+
services.k8s.aws/team-id: "team-a-global"
94+
services.k8s.aws/team-id: "team-a"
95+
```
96+
97+
`ack-role-account-map` config-map
98+
```yaml
99+
data:
100+
team-a: "arn:aws:iam::111111111111:role/team-a-global-role"
101+
s3.team-a: "arn:aws:iam::111111111111:role/team-a-s3-role"
102+
dynamodb.team-a: "arn:aws:iam::111111111111:role/team-a-dynamodb-role"
103+
```

0 commit comments

Comments
 (0)