Skip to content

Commit

Permalink
refactor cni-metrics-helper chart for eks charts release (#2201)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdn5126 authored Jan 10, 2023
1 parent f2a05b1 commit e51e7ba
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 32 deletions.
1 change: 0 additions & 1 deletion charts/aws-vpc-cni/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ WARNING: Substitute YOUR_HELM_RELEASE_NAME_HERE with the name of your helm relea
set -euo pipefail
# don't import the crd. Helm cant manage the lifecycle of it anyway.
for kind in daemonSet clusterRole clusterRoleBinding serviceAccount; do
echo "setting annotations and labels on $kind/aws-node"
kubectl -n kube-system annotate --overwrite $kind aws-node meta.helm.sh/release-name=YOUR_HELM_RELEASE_NAME_HERE
Expand Down
4 changes: 2 additions & 2 deletions charts/aws-vpc-cni/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ spec:
- mountPath: /host/etc/cni/net.d
name: cni-net-dir
{{- if .Values.cniConfig.enabled }}
# the dockerfile copies the baked in config to this location, lets overwrite it with ours
# the entrypoint.sh script will then copy our config to /host/etc/cni/net.d on boot
# The dockerfile copies the baked in config to this location, so overwrite it with ours.
# The entrypoint process will then copy our config to /host/etc/cni/net.d on boot.
- name: cni-config
mountPath: /app/10-aws.conflist
subPath: 10-aws.conflist
Expand Down
36 changes: 16 additions & 20 deletions charts/cni-metrics-helper/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
apiVersion: v2
name: cni-metrics-helper
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.14

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
version: 0.1.15
appVersion: v1.12.1
description: A Helm chart for the AWS VPC CNI Metrics Helper
icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png
home: https://github.com/aws/amazon-vpc-cni-k8s
sources:
- https://github.com/aws/amazon-vpc-cni-k8s
keywords:
- eks
- cni
- networking
- vpc
maintainers:
- name: Jayanth Varavani
url: https://github.com/jayanthvn
email: [email protected]
engine: gotpl
40 changes: 31 additions & 9 deletions charts/cni-metrics-helper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,34 @@ This chart provides a Kubernetes deployment for the Amazon VPC CNI Metrics Helpe

## Installing the Chart

Clone the Amazon VPC CNI for Kubernetes repository to your local machine.
First add the EKS repository to Helm:

```shell
helm repo add eks https://aws.github.io/eks-charts
```

To install the chart with the release name `cni-metrics-helper` and default configuration:

```shell
$ helm install cni-metrics-helper --namespace kube-system eks/cni-metrics-helper
```

To install manually, clone the Amazon VPC CNI for Kubernetes repository to your local machine:

```shell
$ git clone https://github.com/aws/amazon-vpc-cni-k8s.git
```
Use the helm install command to install the chart into your Kubernetes cluster

Use the helm install command to install the chart into your Kubernetes cluster:

```shell
$ helm install cni-metrics-helper ./amazon-vpc-cni-k8s/charts/cni-metrics-helper
$ helm install cni-metrics-helper --namespace kube-system ./charts/cni-metrics-helper
```

To uninstall:

```shell
$ helm uninstall cni-metrics-helper --namespace kube-system
```

## Configuration
Expand All @@ -33,17 +52,21 @@ The following table lists the configurable parameters for this chart and their d
| image.domain | ECR repository domain | amazonaws.com |
| env.USE_CLOUDWATCH | Whether to export CNI metrics to CloudWatch | true |
| env.AWS_CLUSTER_ID | ID of the cluster to use when exporting metrics to CloudWatch | default |
| env.METRIC_UPDATE_INTERVAL | Interval at which to update CloudWatch metrics, in seconds Metrics are published to CloudWatch at 2*METRIC_UPDATE_INTERVAL | 30 |
| env.METRIC_UPDATE_INTERVAL | Interval at which to update CloudWatch metrics, in seconds. | |
| | Metrics are published to CloudWatch at 2x the interval | 30 |
| serviceAccount.name | The name of the ServiceAccount to use | nil |
| serviceAccount.create | Specifies whether a ServiceAccount should be created | true |
| serviceAccount.annotations | Specifies the annotations for ServiceAccount | {} |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm install` or provide a YAML file containing the values for the above parameters:

```shell
$ helm install my-release ./amazon-vpc-cni-k8s/charts/cni-metrics-helper --set useCloudwatch=false --values values.yaml
$ helm install cni-metrics-handler --namespace kube-system eks/cni-metrics-handler --values values.yaml
```

Manual install:
```shell
$ helm install cni-metrics-helper --namespace kube-system ./charts/cni-metrics-helper --values values.yaml
```

## Resources
Expand All @@ -52,9 +75,8 @@ $ helm install my-release ./amazon-vpc-cni-k8s/charts/cni-metrics-helper --set u
|---------------------------|------------------------------------------------|---------|
| resources | Resources for the pods. | `{}` |


for example, to set a CPU limit of 200m and a memory limit of 256Mi for the cni-metrics-helper pods, you can use the following command:
For example, to set a CPU limit of 200m and a memory limit of 256Mi for the cni-metrics-helper pods, you can use the following command:

```shell
$ helm install my-release ./amazon-vpc-cni-k8s/charts/cni-metrics-helper --set resources.limits.cpu=200m,resources.limits.memory=256Mi
$ helm install cni-metrics-helper ./charts/cni-metrics-helper --namespace kube-system --set resources.limits.cpu=200m,resources.limits.memory=256Mi
```

0 comments on commit e51e7ba

Please sign in to comment.