Skip to content

Commit 0c4c67f

Browse files
authored
Update to ACK runtime v0.28.0, code-generator v0.28.0 (#7)
### Update to ACK runtime `v0.28.0`, code-generator `v0.28.0` ---------- * ACK code-generator `v0.28.0` [release notes](https://github.com/aws-controllers-k8s/code-generator/releases/tag/v0.28.0) * ACK runtime `v0.28.0` [release notes](https://github.com/aws-controllers-k8s/runtime/releases/tag/v0.28.0) ---------- NOTE: This PR increments the release version of service controller from `v0.0.2` to `v0.0.3` Once this PR is merged, release `v0.0.3` will be automatically created for `cloudwatch-controller` **Please close this PR, if you do not want the new patch release for `cloudwatch-controller`** ---------- #### stdout for `make build-controller`: ``` building ack-generate ... ok. ==== building cloudwatch-controller ==== Copying common custom resource definitions into cloudwatch Building Kubernetes API objects for cloudwatch Generating deepcopy code for cloudwatch Generating custom resource definitions for cloudwatch Building service controller for cloudwatch Generating RBAC manifests for cloudwatch Running gofmt against generated code for cloudwatch Updating additional GitHub repository maintenance files ==== building cloudwatch-controller release artifacts ==== Building release artifacts for cloudwatch-v0.0.3 Generating common custom resource definitions Generating custom resource definitions for cloudwatch Generating RBAC manifests for cloudwatch ``` ---------- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent b28ea0e commit 0c4c67f

21 files changed

+352
-149
lines changed

apis/v1alpha1/ack-generate-metadata.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
ack_generate_info:
2-
build_date: "2023-08-04T16:51:02Z"
3-
build_hash: e9b68590da73ce9143ba1e4361cebdc1d876c81e
4-
go_version: go1.20.7
5-
version: v0.26.1-7-ge9b6859-dirty
6-
api_directory_checksum: e21bfad36ac581912d611c9c390ab4bd2c2fb46d
2+
build_date: "2023-12-14T21:33:50Z"
3+
build_hash: 1f16813c807af6889060b4ce7ded2a69dc027d8c
4+
go_version: go1.21.5
5+
version: v0.28.0
6+
api_directory_checksum: 5a8c4d91df5604e5364afdecbc88814f06a8ab26
77
api_version: v1alpha1
8-
aws_sdk_go_version: v1.44.303
8+
aws_sdk_go_version: v1.49.0
99
generator_config_info:
1010
file_checksum: 2440ba630b0f66b3e92fd740afcafbd79da6b0c4
1111
original_file_name: generator.yaml

apis/v1alpha1/enums.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/metric_alarm.go

Lines changed: 40 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/controller/main.go

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/controller/deployment.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ spec:
2929
- "$(AWS_REGION)"
3030
- --aws-endpoint-url
3131
- "$(AWS_ENDPOINT_URL)"
32-
- --enable-development-logging
33-
- "$(ACK_ENABLE_DEVELOPMENT_LOGGING)"
32+
- --enable-development-logging=$(ACK_ENABLE_DEVELOPMENT_LOGGING)
3433
- --log-level
3534
- "$(ACK_LOG_LEVEL)"
3635
- --resource-tags
3736
- "$(ACK_RESOURCE_TAGS)"
3837
- --watch-namespace
3938
- "$(ACK_WATCH_NAMESPACE)"
39+
- --enable-leader-election=$(ENABLE_LEADER_ELECTION)
40+
- --leader-election-namespace
41+
- "$(LEADER_ELECTION_NAMESPACE)"
4042
image: controller:latest
4143
name: controller
4244
ports:
@@ -66,6 +68,10 @@ spec:
6668
value: "info"
6769
- name: ACK_RESOURCE_TAGS
6870
value: "services.k8s.aws/controller-version=%CONTROLLER_SERVICE%-%CONTROLLER_VERSION%,services.k8s.aws/namespace=%K8S_NAMESPACE%"
71+
- name: ENABLE_LEADER_ELECTION
72+
value: "false"
73+
- name: LEADER_ELECTION_NAMESPACE
74+
value: "ack-system"
6975
securityContext:
7076
allowPrivilegeEscalation: false
7177
privileged: false
@@ -79,5 +85,6 @@ spec:
7985
terminationGracePeriodSeconds: 10
8086
serviceAccountName: ack-cloudwatch-controller
8187
hostIPC: false
82-
hostNetwork: false
8388
hostPID: false
89+
hostNetwork: false
90+
dnsPolicy: ClusterFirst

config/controller/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ kind: Kustomization
66
images:
77
- name: controller
88
newName: public.ecr.aws/aws-controllers-k8s/cloudwatch-controller
9-
newTag: 0.0.2
9+
newTag: 0.0.3

config/crd/bases/cloudwatch.services.k8s.aws_metricalarms.yaml

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,17 @@ spec:
113113
format: int64
114114
type: integer
115115
extendedStatistic:
116-
description: The percentile statistic for the metric specified in
117-
MetricName. Specify a value between p0.0 and p100. When you call
118-
PutMetricAlarm and specify a MetricName, you must specify either
119-
Statistic or ExtendedStatistic, but not both.
116+
description: "The extended statistic for the metric specified in MetricName.
117+
When you call PutMetricAlarm and specify a MetricName, you must
118+
specify either Statistic or ExtendedStatistic but not both. \n If
119+
you specify ExtendedStatistic, the following are valid values: \n
120+
* p90 \n * tm90 \n * tc90 \n * ts90 \n * wm90 \n * IQM \n * PR(n:m)
121+
where n and m are values of the metric \n * TC(X%:X%) where X is
122+
between 10 and 90 inclusive. \n * TM(X%:X%) where X is between 10
123+
and 90 inclusive. \n * TS(X%:X%) where X is between 10 and 90 inclusive.
124+
\n * WM(X%:X%) where X is between 10 and 90 inclusive. \n For more
125+
information about these extended statistics, see CloudWatch statistics
126+
definitions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html)."
120127
type: string
121128
insufficientDataActions:
122129
description: "The actions to execute when this alarm transitions to
@@ -139,9 +146,9 @@ spec:
139146
description: "The name for the metric associated with the alarm. For
140147
each PutMetricAlarm operation, you must specify either MetricName
141148
or a Metrics array. \n If you are creating an alarm based on a math
142-
expression, you cannot specify this parameter, or any of the Dimensions,
143-
Period, Namespace, Statistic, or ExtendedStatistic parameters. Instead,
144-
you specify all this information in the Metrics array."
149+
expression, you cannot specify this parameter, or any of the Namespace,
150+
Dimensions, Period, Unit, Statistic, or ExtendedStatistic parameters.
151+
Instead, you specify all this information in the Metrics array."
145152
type: string
146153
metrics:
147154
description: "An array of MetricDataQuery structures that enable you
@@ -152,11 +159,11 @@ spec:
152159
array is the expression that the alarm watches. You designate this
153160
expression by setting ReturnData to true for this object in the
154161
array. For more information, see MetricDataQuery (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDataQuery.html).
155-
\n If you use the Metrics parameter, you cannot include the MetricName,
156-
Dimensions, Period, Namespace, Statistic, or ExtendedStatistic parameters
157-
of PutMetricAlarm in the same operation. Instead, you retrieve the
158-
metrics you are using in your math expression as part of the Metrics
159-
array."
162+
\n If you use the Metrics parameter, you cannot include the Namespace,
163+
MetricName, Dimensions, Period, Unit, Statistic, or ExtendedStatistic
164+
parameters of PutMetricAlarm in the same operation. Instead, you
165+
retrieve the metrics you are using in your math expression as part
166+
of the Metrics array."
160167
items:
161168
description: "This structure is used in both GetMetricData and PutMetricAlarm.
162169
The supported use of this structure is different for those two
@@ -290,13 +297,15 @@ spec:
290297
type: string
291298
tags:
292299
description: "A list of key-value pairs to associate with the alarm.
293-
You can associate as many as 50 tags with an alarm. \n Tags can
294-
help you organize and categorize your resources. You can also use
295-
them to scope user permissions by granting a user permission to
296-
access or change only resources with certain tag values. \n If you
297-
are using this operation to update an existing alarm, any tags you
298-
specify in this parameter are ignored. To change the tags of an
299-
existing alarm, use TagResource (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html)
300+
You can associate as many as 50 tags with an alarm. To be able to
301+
associate tags with the alarm when you create the alarm, you must
302+
have the cloudwatch:TagResource permission. \n Tags can help you
303+
organize and categorize your resources. You can also use them to
304+
scope user permissions by granting a user permission to access or
305+
change only resources with certain tag values. \n If you are using
306+
this operation to update an existing alarm, any tags you specify
307+
in this parameter are ignored. To change the tags of an existing
308+
alarm, use TagResource (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html)
300309
or UntagResource (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_UntagResource.html)."
301310
items:
302311
description: A key-value pair associated with a CloudWatch resource.
@@ -337,16 +346,18 @@ spec:
337346
all network interfaces. You can also specify a unit when you create
338347
a custom metric. Units help provide conceptual meaning to your data.
339348
Metric data points that specify a unit of measure, such as Percent,
340-
are aggregated separately. \n If you don't specify Unit, CloudWatch
341-
retrieves all unit types that have been published for the metric
342-
and attempts to evaluate the alarm. Usually, metrics are published
343-
with only one unit, so the alarm works as intended. \n However,
344-
if the metric is published with multiple types of units and you
345-
don't specify a unit, the alarm's behavior is not defined and it
346-
behaves unpredictably. \n We recommend omitting Unit so that you
347-
don't inadvertently specify an incorrect unit that is not published
348-
for this metric. Doing so causes the alarm to be stuck in the INSUFFICIENT
349-
DATA state."
349+
are aggregated separately. If you are creating an alarm based on
350+
a metric math expression, you can specify the unit for each metric
351+
(if needed) within the objects in the Metrics array. \n If you don't
352+
specify Unit, CloudWatch retrieves all unit types that have been
353+
published for the metric and attempts to evaluate the alarm. Usually,
354+
metrics are published with only one unit, so the alarm works as
355+
intended. \n However, if the metric is published with multiple types
356+
of units and you don't specify a unit, the alarm's behavior is not
357+
defined and it behaves unpredictably. \n We recommend omitting Unit
358+
so that you don't inadvertently specify an incorrect unit that is
359+
not published for this metric. Doing so causes the alarm to be stuck
360+
in the INSUFFICIENT DATA state."
350361
type: string
351362
required:
352363
- comparisonOperator

config/rbac/kustomization.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ resources:
44
- role-reader.yaml
55
- role-writer.yaml
66
- service-account.yaml
7-
7+
- leader-election-role.yaml
8+
- leader-election-role-binding.yaml
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: RoleBinding
4+
metadata:
5+
namespace: ack-system
6+
name: cloudwatch-leader-election-rolebinding
7+
roleRef:
8+
apiGroup: rbac.authorization.k8s.io
9+
kind: Role
10+
name: cloudwatch-leader-election-role
11+
subjects:
12+
- kind: ServiceAccount
13+
name: ack-cloudwatch-controller
14+
namespace: ack-system
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: Role
4+
metadata:
5+
name: cloudwatch-leader-election-role
6+
namespace: ack-system
7+
rules:
8+
- apiGroups:
9+
- coordination.k8s.io
10+
resources:
11+
- leases
12+
verbs:
13+
- get
14+
- list
15+
- watch
16+
- create
17+
- update
18+
- patch
19+
- delete
20+
- apiGroups:
21+
- ""
22+
resources:
23+
- events
24+
verbs:
25+
- create
26+
- patch

0 commit comments

Comments
 (0)