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

[Docs]: configuration_values in aws_eks_addon uses Helm Chart, not aws eks describe-addon-configuration #29215

Open
johnny-nguyen-gusto opened this issue Feb 2, 2023 · 5 comments
Labels
documentation Introduces or discusses updates to documentation.

Comments

@johnny-nguyen-gusto
Copy link

Documentation Link

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon#example-add-on-usage-with-custom-configuration_values

Description

As noted in the title, the example uses the following config for parameter configuration_values for addon coredns:

{
  "replicaCount": 4,
  "resources": {
    "limits": {
      "cpu": "100m",
      "memory": "150Mi"
    },
    "requests": {
      "cpu": "100m",
      "memory": "150Mi"
    }
  }
}

Documentation notes that this comes from schema from following command:

 aws eks describe-addon-configuration \
 --addon-name coredns \
 --addon-version v1.8.7-eksbuild.2

However, this yields an incorrect schema:

addonName: coredns
addonVersion: v1.8.7-eksbuild.2
configurationSchema: 
{
  "$ref": "#/definitions/Coredns",
  "$schema": "http://json-schema.org/draft-06/schema#",
  "definitions": {
    "Coredns": {
      "additionalProperties": false,
      "properties": {
        "computeType": {
          "type": "string"
        },
        "corefile": {
          "description": "Entire corefile contents to use with installation",
          "type": "string"
        },
        "nodeSelector": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        "replicaCount": {
          "type": "integer"
        },
        "resources": {
          "$ref": "#/definitions/Resources"
        }
      },
      "title": "Coredns",
      "type": "object"
    },
    "Limits": {
      "additionalProperties": false,
      "properties": {
        "cpu": {
          "type": "string"
        },
        "memory": {
          "type": "string"
        }
      },
      "title": "Limits",
      "type": "object"
    },
    "Resources": {
      "additionalProperties": false,
      "properties": {
        "limits": {
          "$ref": "#/definitions/Limits"
        },
        "requests": {
          "$ref": "#/definitions/Limits"
        }
      },
      "title": "Resources",
      "type": "object"
    }
  }
}

Marcin Cuber correctly notes core-dns addon used helm under the hood. This follows the values.yaml from helm chart:

replicaCount: 1

resources:
  limits:
    cpu: 100m
    memory: 128Mi
  requests:
    cpu: 100m
    memory: 128Mi

I have also tested this using aws helm chart here for vpc cni and verified this as well.

The Terraform Page should update the instructions for configuration_values to match the addon corresponding helm instead of the schema from aws command

References

No response

Would you like to implement a fix?

None

@johnny-nguyen-gusto johnny-nguyen-gusto added documentation Introduces or discusses updates to documentation. needs-triage Waiting for first response or review from a maintainer. labels Feb 2, 2023
@github-actions
Copy link

github-actions bot commented Feb 2, 2023

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@nwhobart
Copy link

nwhobart commented Mar 14, 2023

@johnny-nguyen-gusto I can verify this as well. I tested using:

resource "aws_eks_addon" "cni" {

  addon_name        = "vpc-cni"
  addon_version     = "v1.12.5-eksbuild.2"
  cluster_name      = "fun-cluster"
  resolve_conflicts = "OVERWRITE"

  configuration_values = "{\"env\": {\"AWS_VPC_K8S_CNI_CUSTOM_NETWORK_CFG\": \"true\",}}"
}

and it yielded the expected result:

 Environment:
   LOT_OF_KEYS_BEFORE: true
   AWS_VPC_K8S_CNI_CUSTOM_NETWORK_CFG: true
   LOTS_OF_KEYS_AFTER: true

However, and this is not exclusively related to your issue, removing the configuration_values key does not prompt a state change:

$ cat cni_addon.tf
resource "aws_eks_addon" "cni" {

  addon_name        = "vpc-cni"
  addon_version     = "v1.12.5-eksbuild.2"
  cluster_name      = "fun-cluster"
  resolve_conflicts = "OVERWRITE"
}

$ terraform plan
...
No changes. Your infrastructure matches the configuration.

@bryantbiggs
Copy link
Contributor

@johnny-nguyen-gusto I'm not following your request here - what EKS uses under the hood to deploy/manage EKS addons shouldn't be relevant to users; its an implementation detail that is not exposed and therefore could change in the future.

The configuration values schema is the source of truth for addon configuration values, NOT any helm chart values files. Therefore, the way the documentation is currently written is correct

@justinretzolk justinretzolk added waiting-response Maintainers are waiting on response from community or contributor. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 27, 2023
@ozydingo
Copy link

ozydingo commented Oct 3, 2023

@nwhobart I'm trying to understand, since I'm a terraform newbie, but I believe I'm running into what you describe:

removing the configuration_values key does not prompt a state change

No matter what I do to configuration_values, terraform tells me no changes. I can change other values, including the addon_version, resolve_conflicts, etc, and these all get planned, but all I'm trying to do is modify the podAnnotations and I'm getting no plan. I'm at a loss for how to proceed; have you dug into this issue more since your post above?

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Oct 3, 2023
@nwhobart
Copy link

nwhobart commented Oct 3, 2023

@ozydingo sorry I haven't really dug into it very much since posting. Apologies.

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

No branches or pull requests

5 participants