Skip to content

Commit

Permalink
Increment k8s version with cloudwatch agent for releasing (aws-sample…
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhntd authored Mar 15, 2023
1 parent d2569cb commit b986133
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 43 deletions.
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*Issue #, if available:*

*Description of changes:*
# Issue

# Description of changes:

# License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
26 changes: 13 additions & 13 deletions container-insights-manifest-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,49 @@ cd "$(dirname "$0")"
k8sDirPrefix="./k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring"
ecsDirPrefix="./ecs-task-definition-templates/deployment-mode/daemon-service/cwagent-ecs-instance-metric"

newK8sVersion="k8s/1.3.12"
agentVersion="public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247357.0b252275"
newK8sVersion="k8s/1.3.13"
agentVersion="public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247358.0b252413"
fluentdVersion="fluent/fluentd-kubernetes-daemonset:v1.7.3-debian-cloudwatch-1.0"
fluentBitVersion="public.ecr.aws/aws-observability/aws-for-fluent-bit:stable"

k8sPrometheusDirPrefix="./k8s-deployment-manifest-templates/deployment-mode/service/cwagent-prometheus"
ecsPrometheusDirPrefix="./ecs-task-definition-templates/deployment-mode/replica-service/cwagent-prometheus"

# replace agent version for ECS Prometheus
sed -i'.bak' "s|public\.ecr\.aws/cloudwatch-agent/cloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*\(-prometheus\)\?|${agentVersion}|g" ${ecsPrometheusDirPrefix}/cwagent-prometheus-task-definition.json
sed -i'.bak' "s|public\.ecr\.aws/cloudwatch-agent/cloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*|${agentVersion}|g" ${ecsPrometheusDirPrefix}/cwagent-prometheus-task-definition.json
rm ${ecsPrometheusDirPrefix}/cwagent-prometheus-task-definition.json.bak
sed -i'.bak' "s|public\.ecr\.aws/cloudwatch-agent/cloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*\(-prometheus\)\?|${agentVersion}|g" ${ecsPrometheusDirPrefix}/cloudformation-quickstart/cwagent-ecs-prometheus-metric-for-awsvpc.yaml
sed -i'.bak' "s|public\.ecr\.aws/cloudwatch-agent/cloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*|${agentVersion}|g" ${ecsPrometheusDirPrefix}/cloudformation-quickstart/cwagent-ecs-prometheus-metric-for-awsvpc.yaml
rm ${ecsPrometheusDirPrefix}/cloudformation-quickstart/cwagent-ecs-prometheus-metric-for-awsvpc.yaml.bak
sed -i'.bak' "s|public.ecr.aws/cloudwatch-agentcloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*\(-prometheus\)\?|${agentVersion}|g" ${ecsPrometheusDirPrefix}/cloudformation-quickstart/cwagent-ecs-prometheus-metric-for-bridge-host.yaml
sed -i'.bak' "s|public\.ecr\.aws/cloudwatch-agent/cloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*|${agentVersion}|g" ${ecsPrometheusDirPrefix}/cloudformation-quickstart/cwagent-ecs-prometheus-metric-for-bridge-host.yaml
rm ${ecsPrometheusDirPrefix}/cloudformation-quickstart/cwagent-ecs-prometheus-metric-for-bridge-host.yaml.bak

# replace agent and k8s version for K8s Prometheus
sed -i'.bak' "s|k8s/[0-9]*\.[0-9]*\.[0-9a-z]*\(-prometheus\)\?|${newK8sVersion}|g;s|public.ecr.aws/cloudwatch-agentcloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*\(-prometheus\)\?|${agentVersion}|g" ${k8sPrometheusDirPrefix}/prometheus-eks.yaml
sed -i'.bak' "s|k8s/[0-9]*\.[0-9]*\.[0-9a-z]*|${newK8sVersion}|g;s|public\.ecr\.aws/cloudwatch-agent/cloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*|${agentVersion}|g" ${k8sPrometheusDirPrefix}/prometheus-eks.yaml
rm ${k8sPrometheusDirPrefix}/prometheus-eks.yaml.bak
sed -i'.bak' "s|k8s/[0-9]*\.[0-9]*\.[0-9a-z]*\(-prometheus\)\?|${newK8sVersion}|g;s|public.ecr.aws/cloudwatch-agentcloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*\(-prometheus\)\?|${agentVersion}|g" ${k8sPrometheusDirPrefix}/prometheus-eks-fargate.yaml
sed -i'.bak' "s|k8s/[0-9]*\.[0-9]*\.[0-9a-z]*|${newK8sVersion}|g;s|public\.ecr\.aws/cloudwatch-agent/cloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*|${agentVersion}|g" ${k8sPrometheusDirPrefix}/prometheus-eks-fargate.yaml
rm ${k8sPrometheusDirPrefix}/prometheus-eks-fargate.yaml.bak
sed -i'.bak' "s|k8s/[0-9]*\.[0-9]*\.[0-9a-z]*\(-prometheus\)\?|${newK8sVersion}|g;s|public.ecr.aws/cloudwatch-agentcloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*\(-prometheus\)\?|${agentVersion}|g" ${k8sPrometheusDirPrefix}/prometheus-k8s.yaml
sed -i'.bak' "s|k8s/[0-9]*\.[0-9]*\.[0-9a-z]*|${newK8sVersion}|g;s|public\.ecr\.aws/cloudwatch-agent/cloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*|${agentVersion}|g" ${k8sPrometheusDirPrefix}/prometheus-k8s.yaml
rm ${k8sPrometheusDirPrefix}/prometheus-k8s.yaml.bak


# replace agent version for ECS
sed -i'.bak' "s|public.ecr.aws/cloudwatch-agentcloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*|${agentVersion}|g" ${ecsDirPrefix}/cwagent-ecs-instance-metric.json
sed -i'.bak' "s|public\.ecr\.aws/cloudwatch-agent/cloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*|${agentVersion}|g" ${ecsDirPrefix}/cwagent-ecs-instance-metric.json
rm ${ecsDirPrefix}/cwagent-ecs-instance-metric.json.bak

sed -i'.bak' "s|public.ecr.aws/cloudwatch-agentcloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*|${agentVersion}|g" ${ecsDirPrefix}/cloudformation-quickstart/cwagent-ecs-instance-metric-cfn.json
sed -i'.bak' "s|public\.ecr\.aws/cloudwatch-agent/cloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*|${agentVersion}|g" ${ecsDirPrefix}/cloudformation-quickstart/cwagent-ecs-instance-metric-cfn.json
rm ${ecsDirPrefix}/cloudformation-quickstart/cwagent-ecs-instance-metric-cfn.json.bak

# replace agent, fluentD and fluent-bit version for K8s
sed -i'.bak' "s|k8s/[0-9]*\.[0-9]*\.[0-9a-z]*|${newK8sVersion}|g;s|public.ecr.aws/cloudwatch-agentcloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*|${agentVersion}|g" ${k8sDirPrefix}/cwagent/cwagent-daemonset.yaml
sed -i'.bak' "s|k8s/[0-9]*\.[0-9]*\.[0-9a-z]*|${newK8sVersion}|g;s|public\.ecr\.aws/cloudwatch-agent/cloudwatch-agent:[0-9]*\.[0-9]*\.[0-9a-z]*|${agentVersion}|g" ${k8sDirPrefix}/cwagent/cwagent-daemonset.yaml
rm ${k8sDirPrefix}/cwagent/cwagent-daemonset.yaml.bak

sed -i'.bak' "s|k8s/[0-9]*\.[0-9]*\.[0-9a-z]*|${newK8sVersion}|g;s|fluent/fluentd-kubernetes-daemonset:.*|${fluentdVersion}|g" ${k8sDirPrefix}/fluentd/fluentd.yaml
rm ${k8sDirPrefix}/fluentd/fluentd.yaml.bak

sed -i'.bak' "s|k8s/[0-9]*\.[0-9]*\.[0-9a-z]*|${newK8sVersion}|g;s|public.ecr.aws/aws-observability/aws-for-fluent-bit.*|${fluentBitVersion}|g" ${k8sDirPrefix}/fluent-bit/fluent-bit.yaml
sed -i'.bak' "s|k8s/[0-9]*\.[0-9]*\.[0-9a-z]*|${newK8sVersion}|g;s|public\.ecr\.aws/aws-observability/aws-for-fluent-bit.*|${fluentBitVersion}|g" ${k8sDirPrefix}/fluent-bit/fluent-bit.yaml
rm ${k8sDirPrefix}/fluent-bit/fluent-bit.yaml.bak

sed -i'.bak' "s|k8s/[0-9]*\.[0-9]*\.[0-9a-z]*|${newK8sVersion}|g;s|public.ecr.aws/aws-observability/aws-for-fluent-bit.*|${fluentBitVersion}|g" ${k8sDirPrefix}/fluent-bit/fluent-bit-compatible.yaml
sed -i'.bak' "s|k8s/[0-9]*\.[0-9]*\.[0-9a-z]*|${newK8sVersion}|g;s|public\.ecr\.aws/aws-observability/aws-for-fluent-bit.*|${fluentBitVersion}|g" ${k8sDirPrefix}/fluent-bit/fluent-bit-compatible.yaml
rm ${k8sDirPrefix}/fluent-bit/fluent-bit-compatible.yaml.bak

# generate quickstart manifest for K8s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"ContainerDefinitions": [
{
"Name": "cloudwatch-agent",
"Image": "public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247357.0b252275",
"Image": "public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247358.0b252413",
"MountPoints": [
{
"ReadOnly": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"containerDefinitions": [
{
"name": "cloudwatch-agent",
"image": "public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247357.0b252275",
"image": "public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247358.0b252413",
"mountPoints": [
{
"readOnly": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ Resources:
NetworkMode: awsvpc
ContainerDefinitions:
- Name: cloudwatch-agent-prometheus
Image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247357.0b252275
Image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247358.0b252413
Essential: true
MountPoints: []
PortMappings: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ Resources:
NetworkMode: !Ref ECSNetworkMode
ContainerDefinitions:
- Name: cloudwatch-agent-prometheus
Image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247357.0b252275
Image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247358.0b252413
Essential: true
MountPoints: []
PortMappings: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"containerDefinitions": [
{
"name": "cloudwatch-agent-prometheus",
"image": "public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247357.0b252275",
"image": "public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247358.0b252413",
"essential": true,
"mountPoints": [
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: cloudwatch-agent
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247357.0b252275
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247358.0b252413
#ports:
# - containerPort: 8125
# hostPort: 8125
Expand All @@ -42,7 +42,7 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: CI_VERSION
value: "k8s/1.3.12"
value: "k8s/1.3.13"
# Please don't change the mountPath
volumeMounts:
- name: cwagentconfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ spec:
fieldRef:
fieldPath: spec.nodeName
- name: CI_VERSION
value: "k8s/1.3.12"
value: "k8s/1.3.13"
resources:
limits:
memory: 200Mi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ spec:
apiVersion: v1
fieldPath: metadata.name
- name: CI_VERSION
value: "k8s/1.3.12"
value: "k8s/1.3.13"
resources:
limits:
memory: 200Mi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ spec:
name: cluster-info
key: cluster.name
- name: CI_VERSION
value: "k8s/1.3.12"
value: "k8s/1.3.13"
- name: FLUENT_CONTAINER_TAIL_PARSER_TYPE
value: /^(?<time>.+) (?<stream>stdout|stderr) (?<logtag>[FP]) (?<log>.*)$/
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ spec:
spec:
containers:
- name: cloudwatch-agent
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247357.0b252275
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247358.0b252413
#ports:
# - containerPort: 8125
# hostPort: 8125
Expand All @@ -125,7 +125,7 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: CI_VERSION
value: "k8s/1.3.12"
value: "k8s/1.3.13"
# Please don't change the mountPath
volumeMounts:
- name: cwagentconfig
Expand Down Expand Up @@ -500,7 +500,7 @@ spec:
apiVersion: v1
fieldPath: metadata.name
- name: CI_VERSION
value: "k8s/1.3.12"
value: "k8s/1.3.13"
resources:
limits:
memory: 200Mi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ spec:
spec:
containers:
- name: cloudwatch-agent
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247357.0b252275
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247358.0b252413
#ports:
# - containerPort: 8125
# hostPort: 8125
Expand All @@ -125,7 +125,7 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: CI_VERSION
value: "k8s/1.3.12"
value: "k8s/1.3.13"
# Please don't change the mountPath
volumeMounts:
- name: cwagentconfig
Expand Down Expand Up @@ -589,7 +589,7 @@ spec:
name: cluster-info
key: cluster.name
- name: CI_VERSION
value: "k8s/1.3.12"
value: "k8s/1.3.13"
- name: FLUENT_CONTAINER_TAIL_PARSER_TYPE
value: /^(?<time>.+) (?<stream>stdout|stderr) (?<logtag>[FP]) (?<log>.*)$/
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ spec:
spec:
containers:
- name: cloudwatch-agent
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247357.0b252275
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247358.0b252413
imagePullPolicy: Always
resources:
limits:
Expand All @@ -410,7 +410,7 @@ spec:
# Please don't change below envs
env:
- name: CI_VERSION
value: "k8s/1.3.11"
value: "k8s/1.3.13"
- name: RUN_IN_AWS
value: "True"
# Please don't change the mountPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ spec:
spec:
containers:
- name: cloudwatch-agent
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247357.0b252275
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247358.0b252413
imagePullPolicy: Always
resources:
limits:
Expand All @@ -461,7 +461,7 @@ spec:
# Please don't change below envs
env:
- name: CI_VERSION
value: "k8s/1.3.11"
value: "k8s/1.3.13"
# Please don't change the mountPath
volumeMounts:
- name: prometheus-cwagentconfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ spec:
spec:
containers:
- name: cloudwatch-agent
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247357.0b252275
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.247358.0b252413
imagePullPolicy: Always
resources:
limits:
Expand All @@ -408,7 +408,7 @@ spec:
# Please don't change below envs
env:
- name: CI_VERSION
value: "k8s/1.3.11"
value: "k8s/1.3.13"
# Please don't change the mountPath
volumeMounts:
- name: prometheus-cwagentconfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: cloudwatch-agent
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.230621.0
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:latest
#ports:
# - containerPort: 8125
# hostPort: 8125
Expand Down
2 changes: 1 addition & 1 deletion k8s-yaml-templates/fluentd/fluentd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ spec:
name: cluster-info
key: cluster.name
- name: CI_VERSION
value: "k8s/1.0.1"
value: "k8s/1.3.13"
resources:
limits:
memory: 400Mi
Expand Down
6 changes: 3 additions & 3 deletions k8s-yaml-templates/quickstart/cwagent-fluentd-quickstart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ spec:
spec:
containers:
- name: cloudwatch-agent
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:1.230621.0
image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:latest
#ports:
# - containerPort: 8125
# hostPort: 8125
Expand All @@ -126,7 +126,7 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: CI_VERSION
value: "k8s/1.0.1"
value: "k8s/1.3.13"
# Please don't change the mountPath
volumeMounts:
- name: cwagentconfig
Expand Down Expand Up @@ -575,7 +575,7 @@ spec:
name: cluster-info
key: cluster.name
- name: CI_VERSION
value: "k8s/1.0.1"
value: "k8s/1.3.13"
resources:
limits:
memory: 400Mi
Expand Down

0 comments on commit b986133

Please sign in to comment.