Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(aws-cloudwatch-metrics): Add support for annotations #800

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcastillocano
Copy link

Issue

Annotations are not supported, even if the documentation states so.

Description of changes

I'm adding support for annotations, and also fixing a typo in the doc.

Checklist

  • Added/modified documentation as required (such as the README.md for modified charts)
  • Incremented the chart version in Chart.yaml for the modified chart(s)
  • Manually tested. Describe what testing was done in the testing section below
  • Make sure the title of the PR is a good description that can go into the release notes

Testing

Locally tested with helm template as follows:

  1. Create defaults.yaml with the following content:
image:
  tag: 1.247349.0b251399
  pullPolicy: IfNotPresent
  1. Run helm template against chart folder passing default.yaml as argument as follows: helm template aws-cloudwatch-metrics ~/git/eks-charts/stable/aws-cloudwatch-metrics --namespace amazon-cloudwatch --set clusterName=dev -f defaults.yaml
  2. Verify we don't have any annotations in aws-cloudwatch-metrics/templates/daemonset.yaml resource.
# Source: aws-cloudwatch-metrics/templates/daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: aws-cloudwatch-metrics
  labels:
    helm.sh/chart: aws-cloudwatch-metrics-0.0.8
    app.kubernetes.io/name: aws-cloudwatch-metrics
    app.kubernetes.io/version: "1.247350"
    app.kubernetes.io/managed-by: Helm
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: aws-cloudwatch-metrics
  template:
    metadata:
      labels:
        app.kubernetes.io/name: aws-cloudwatch-metrics
    spec:
  1. Amend the following lines to defaults.yaml
annotations:
  cluster-autoscaler.kubernetes.io/enable-ds-eviction: false
  cluster-autoscaler.kubernetes.io/safe-to-evict: false
  1. Run helm template command from step 2, now we can see tolerations in both resource's metadata as well as template's metadata.
# Source: aws-cloudwatch-metrics/templates/daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: aws-cloudwatch-metrics
  labels:
    helm.sh/chart: aws-cloudwatch-metrics-0.0.8
    app.kubernetes.io/name: aws-cloudwatch-metrics
    app.kubernetes.io/version: "1.247350"
    app.kubernetes.io/managed-by: Helm
  annotations:
    cluster-autoscaler.kubernetes.io/enable-ds-eviction: false
    cluster-autoscaler.kubernetes.io/safe-to-evict: false
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: aws-cloudwatch-metrics
  template:
    metadata:
      labels:
        app.kubernetes.io/name: aws-cloudwatch-metrics
      annotations:
        cluster-autoscaler.kubernetes.io/enable-ds-eviction: false
        cluster-autoscaler.kubernetes.io/safe-to-evict: false
    spec:
...

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jcastillocano
Copy link
Author

jcastillocano commented Aug 16, 2022

hi there! is there anything missing in this pr before it can be reviewed and merged? thx in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants