kubectl add-ons

0

We are trying to install kubecost Add-ons in the EKS cluster while installing we are getting this issue

{An error occurred (InvalidParameterException) when calling the CreateAddon operation: ConfigurationValue provided in request is not supported: Yaml schema validation failed with error: [$.kubecostAggregator: is not defined in the schema and the schema does not allow additional properties]

admission webhook "opa-validating.kube-yahoo.hookfg" denied the request with the message: "DENY: missing spec.containers[].resources.limits.cpu kubecost/cost-analyzer container; aggregator: DENY: missing spec.containers[].resources.limits.cpu kubecost/cost-analyzer container; cloud-cost" }

We tried with the yaml configuration policy but it shows the access policy issue

Yaml #

apiVersion: v1 kind: ConfigMap metadata: name: kubecost-configmap data: example-json-file: | { "containers": [ { "name":"aggregated" "resources": { "limits": { "cpu": "2000m", "memory": "2Gi" }, "requests": { "cpu": "1000m", "memory": "1Gi" } } }, { "name": "cloud-cost" "resources": { "limits": { "cpu": "2000m", "memory": "2Gi" }, "requests": { "cpu": "1000m", "memory": "1Gi" } } ] } }

An error occurred (InvalidParameterException) when calling the CreateAddon operation: ConfigurationValue provided in request is not supported: Yaml schema validation failed with error: [$.kubecostAggregator: is not defined in the schema and the schema does not allow additional properties]

2 Answers
3
Accepted Answer

In your YAML configuration, there are syntax errors such as missing commas between elements in the JSON array and incorrect indentation. Additionally, the JSON format should be properly formatted within the YAML file

Could you please correct your Yaml config and try again

apiVersion: v1
kind: ConfigMap
metadata:
  name: kubecost-configmap
data:
  example-json-file: |
    {
      "containers": [
        {
          "name": "aggregated",
          "resources": {
            "limits": {
              "cpu": "2000m",
              "memory": "2Gi"
            },
            "requests": {
              "cpu": "1000m",
              "memory": "1Gi"
            }
          }
        },
        {
          "name": "cloud-cost",
          "resources": {
            "limits": {
              "cpu": "2000m",
              "memory": "2Gi"
            },
            "requests": {
              "cpu": "1000m",
              "memory": "1Gi"
            }
          }
        }
      ]
    }

Make sure to adjust the configuration according to the requirements and schema expected by the Kubecost addon. Additionally, ensure that you have proper permissions and access policies to create the addon in your EKS cluster. You can find some useful info here :- https://github.com/kubecost/kubecost-eks-blueprints-addon

profile picture
EXPERT
answered 13 days ago
profile picture
EXPERT
reviewed 12 days ago
  • We corrected the yaml file we applied the yaml file still we are facing the same issue apiVersion: v1 kind: ConfigMap metadata: name: kubecost-configmap data: configuration.yaml: | containers: - name: aggregator resources: limits: cpu: "2000m" memory: "2Gi" requests: cpu: "1000m" memory: "1Gi" - name: cloud-cost resources: limits: cpu: "2000m" memory: "2Gi" requests: cpu: "1000m" memory: "1Gi"

  • " [$.kubecostAggregator: is not defined in the schema and the schema does not allow additional properties] The error message indicates that the kubecostAggregator property is not defined in the schema. This suggests that the kubecostAggregator property is not recognized or expected in the configuration. Make sure you are using the correct property names and schema for the Kubecost addon configuration

0

@Adeleke Adebowale J We have removed the indentations and formatted the JSON but still getting the same error. An error occurred (InvalidParameterException) when calling the CreateAddon operation: ConfigurationValue provided in request is not supported: Json schema validation failed with error:

"DENY: missing spec.containers[].resources.limits.cpu kubecost/cost-analyzer container; aggregator: DENY: missing spec.containers[].resources.limits.cpu kubecost/cost-analyzer container; cloud-cost" }

Can you help us how can we configure the values for above missing CPU limits for containers that could help in creating add-on. We tried multiple ways but getting the same schema validation failed.

answered 12 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions