Skip to content

Commit a9d98ac

Browse files
authored
Merge branch 'aws-controllers-k8s:main' into main
2 parents 9d977c9 + 582e181 commit a9d98ac

File tree

6 files changed

+181
-8
lines changed

6 files changed

+181
-8
lines changed

.github/workflows/issue-response.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Issue Responder
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
permissions:
8+
issues: write
9+
10+
jobs:
11+
add-sla-comment:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check if issue opener is an org member
15+
id: check_membership
16+
uses: actions/github-script@v6
17+
with:
18+
script: |
19+
const authorAssociation = context.payload.issue.author_association;
20+
console.log("Author association:", authorAssociation);
21+
22+
// Check if user is a MEMBER or OWNER
23+
const isMember = ['OWNER', 'MEMBER'].includes(authorAssociation);
24+
console.log("Is member:", isMember);
25+
return isMember;
26+
- name: Add SLA Comment if Not Org Member
27+
if: steps.check_membership.outputs.result == 'false'
28+
uses: actions/github-script@v6
29+
with:
30+
github-token: ${{ secrets.GITHUB_TOKEN }}
31+
script: |
32+
const issue = context.payload.issue;
33+
const issueNumber = issue.number;
34+
const username = issue.user.login;
35+
36+
const slaMessage = `Hello @${username} 👋 Thank you for opening an issue in ACK! A maintainer will triage this issue soon.\n\nWe encourage community contributions, so if you're interested in tackling this yourself or suggesting a solution, please check out our [Contribution](https://github.com/aws-controllers-k8s/community/blob/main/CONTRIBUTING.md) and [Code of Conduct](https://github.com/aws-controllers-k8s/community/blob/main/CODE_OF_CONDUCT.md) guidelines.\n\nYou can find more information about ACK on our [website](https://aws-controllers-k8s.github.io/community/).`;
37+
38+
await github.rest.issues.createComment({
39+
owner: context.repo.owner,
40+
repo: context.repo.repo,
41+
issue_number: issueNumber,
42+
body: slaMessage
43+
});

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ 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)
13+
{{% hint type="warning" title="Warning" %}}
14+
This is no longer the recommended approach for adopting resources in ACK. The
15+
recommended feature can be found [HERE](https://aws-controllers-k8s.github.io/community/docs/user-docs/features/#resourceadoption)
16+
{{% /hint %}}
1517

1618
The ACK controllers are intended to manage the complete lifecycle of an AWS
1719
resource, from creation through deletion. However, you may already be

docs/content/docs/user-docs/features.md

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ toc: true
1111
---
1212

1313
Currently we support 4 feature gates for our controllers.
14+
To use these feature, ensure you enable the [feature gates](https://github.com/aws-controllers-k8s/ec2-controller/blob/b6dff777c35d03335ebb0c3ffca5ee7577e70f18/helm/values.yaml#L164-L172) during helm install, as they are disabled by default.
1415

1516
### 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+
This feature allows users to adopt AWS resources by specifying the adoption policy as an annotation `services.k8s.aws/adoption-policy`.
18+
This annotation currently supports two values, `adopt` and `adopt-or-create`.
19+
`adopt` adoption policy strictly adopts resources as they are in AWS, and it is highly recommended to provide an empty spec (as it will be overriden
20+
if adoption is successful) and `services.k8s.aws/adoption-fields` annotation with all the fields necessary to retrieve the resource from AWS
21+
(this would be the `name` for EKS cluster, `queueURL` for SQS queues, `vpcID` for VPCs, or `arn` for SNS Topic, etc.)
1722
Here's an example for how to adopt an EKS cluster:
1823

1924
```yaml
@@ -29,8 +34,54 @@ metadata:
2934
}
3035
```
3136
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
37+
After reconciliation, all the fields in the spec and status will be populated by the controller.
38+
39+
When you want the controller to create resources if they don't exist, you can set
40+
`adopt-or-create` adoption policy. With this policy, as the name suggests, the controller
41+
will adopt the resource if it exists, or create it if it doesn't.
42+
For `adopt-or-create` the controller expects the spec to be populated by the user with all the
43+
fields necessary for a find/create. If the read operation required field is in the status
44+
the `adoption-fields` annotation will be used to retrieve such fields.
45+
If the adoption is successful for `adopt-or-create`, the controller will attempt updating
46+
your AWS resource, to ensure your ACK manifest is the source of truth.
47+
Here are some sample manifests:
48+
EKS Cluster
49+
```yaml
50+
apiVersion: eks.services.k8s.aws/v1alpha1
51+
kind: Cluster
52+
metadata:
53+
name: my-cluster
54+
annotations:
55+
services.k8s.aws/adoption-policy: "adopt-or-create"
56+
spec:
57+
name: my-cluster
58+
roleARN: arn:role:123456789/myrole
59+
version: "1.32"
60+
resourcesVPCConfig:
61+
endpointPrivateAccess: true
62+
endpointPublicAccess: true
63+
subnetIDs:
64+
- subnet-312ensdj2313dnsa2
65+
- subnet-1e323124ewqe43213
66+
67+
```
68+
VPC
69+
```yaml
70+
apiVersion: ec2.services.k8s.aws/v1alpha1
71+
kind: VPC
72+
metadata:
73+
name: hello
74+
annotations:
75+
services.k8s.aws/adoption-policy: adopt-or-create
76+
services.k8s.aws/adoption-fields: |
77+
{"vpcID": "vpc-123456789012"}
78+
spec:
79+
cidrBlocks:
80+
- "2.0.0.0/16"
81+
tags:
82+
- key: k1
83+
value: v1
84+
```
3485

3586
### ReadOnlyResources
3687
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.
@@ -100,4 +151,4 @@ data:
100151
team-a: "arn:aws:iam::111111111111:role/team-a-global-role"
101152
s3.team-a: "arn:aws:iam::111111111111:role/team-a-s3-role"
102153
dynamodb.team-a: "arn:aws:iam::111111111111:role/team-a-dynamodb-role"
103-
```
154+
```

docs/content/docs/user-docs/openshift.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ ACK_RESOURCE_TAGS=hellofromocp
7575
ENABLE_LEADER_ELECTION=true
7676
LEADER_ELECTION_NAMESPACE=
7777
RECONCILE_DEFAULT_MAX_CONCURRENT_SYNCS=1
78+
FEATURE_FLAGS=
7879
```
7980

8081
Now use `config.txt` to create a `ConfigMap` in your OpenShift cluster:

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

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,83 @@ kubectl delete -f bucket.yaml
7373
kubectl get bucket/$BUCKET_NAME
7474
```
7575

76+
77+
## Understanding ACK Controller Conditons
78+
79+
80+
ACK controllers use conditions to indicate the state of custom resources and their corresponding AWS service resources. These conditions are exposed in the `Status.Conditions` collection of each custom resource.
81+
82+
### Condition Types
83+
84+
#### ACK.Adopted
85+
86+
Indicates that an adopted resource custom resource has been successfully reconciled and the target has been created.
87+
88+
* **True**: Resource has been successfully adopted
89+
* **False**: Resource adoption failed
90+
* **Unknown**: Resource adoption status cannot be determined
91+
92+
#### ACK.ResourceSynced
93+
94+
Indicates whether the state of the resource in the backend AWS service is in sync with the ACK service controller.
95+
96+
* **True**: Resource is fully synced
97+
* **False**: Resource is out of sync
98+
* **Unknown**: Sync status cannot be determined
99+
100+
#### ACK.Terminal
101+
102+
Indicates that the custom resource Spec needs to be updated before any further sync can occur.
103+
104+
* **True**: Resource is in terminal state
105+
* **False**: Resource is not in terminal state
106+
* **Unknown**: Terminal state cannot be determined
107+
108+
Possible Causes:
109+
* Invalid arguments in input YAML
110+
* Resource creation failed in AWS
111+
112+
#### ACK.Recoverable
113+
114+
Indicates errors that may be resolved without updating the custom resource spec.
115+
116+
* **True**: Error is recoverable
117+
* **False**: Error is not recoverable
118+
* **Unknown**: Recovery status cannot be determined
119+
120+
Possible Causes:
121+
* Transient AWS service unavailability
122+
* Access denied exceptions requiring credential updates
123+
124+
#### ACK.Advisory
125+
126+
Indicates advisory information present in the resource.
127+
128+
* **True**: Advisory condition exists
129+
* **False**: No advisory condition
130+
* **Unknown**: Advisory status cannot be determined
131+
132+
Possible Causes:
133+
* Attempting to modify an immutable field after resource creation
134+
135+
#### ACK.LateInitialized
136+
137+
Indicates the status of late initialization of fields.
138+
139+
* **True**: Late initialization completed
140+
* **False**: Late initialization in progress
141+
* Not present: No late initialization needed
142+
143+
#### ACK.ReferencesResolved
144+
145+
Indicates whether all AWSResourceReference type references have been resolved.
146+
147+
* **True**: All references resolved
148+
* **False**: Reference resolution failed
149+
* **Unknown**: Resolution status cannot be determined
150+
* Not present: No references to resolve
151+
76152
## Next Steps
77153

78154
Now that you have verified ACK service controller functionality, [checkout ACK
79-
functionality for creating resources in multiple AWS regions.](../multi-region-resource-management)
155+
functionality for creating resources in multiple AWS regions.](../multi-region-resource-management)

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
acktools @ git+https://github.com/aws-controllers-k8s/test-infra.git@0585d0671b593e1b1a1d070614af41eb022c695a#subdirectory=tools
1+
acktools @ git+https://github.com/aws-controllers-k8s/test-infra.git@817a75417079e595b394e175c1463ebcec958f97#subdirectory=tools
22
PyGitHub==1.55
33
Jinja2==3.0.1

0 commit comments

Comments
 (0)