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

Strict parser for config file (with kube 1.16+ dependencies) #1874

Closed
wants to merge 2 commits into from

Conversation

sayboras
Copy link
Contributor

@sayboras sayboras commented Mar 2, 2020

Description

Fixes #1861 and #1602

https://github.com/kubernetes/apimachinery already supports strict parser as per kubernetes/apimachinery@162a2da. However, this is only available in kube 1.16, so I need to update all libraries to latest 1.16 version

Updated on 01-May-2020
As per today, EKS is supporting kube 1.16, so I think it's fair to upgrade the dependencies to 1.16.x, and eventually we can fix underlying validation issues.

Successfully create cluster

 ./eksctl create cluster --cfn-role-arn arn:aws:iam::335829250751:role/eks-deploy-role -f test.yaml
[ℹ]  eksctl version 0.16.0-dev+366d476b.2020-03-02T20:26:40Z
[ℹ]  using region ap-southeast-2
[✔]  using existing VPC (vpc-0a178e4feaf59402a) and subnets (private:[subnet-019189ea518da77dd subnet-091038e3e8fd3f017 subnet-01ebb50bfc820147d] public:[subnet-09d2955928d4bd27c subnet-0a07e6b103738d091 subnet-03c2160f5cef2cdd7])
[!]  custom VPC/subnets will be used; if resulting cluster doesn't function as expected, make sure to review the configuration of VPC/subnets
[ℹ]  using Kubernetes version 1.14
[ℹ]  creating EKS cluster "test-kube-1-16-7-lib" in "ap-southeast-2" region with managed nodes
[ℹ]  1 nodegroup (standard-workers) was included (based on the include/exclude rules)
[ℹ]  will create a CloudFormation stack for cluster itself and 0 nodegroup stack(s)
[ℹ]  will create a CloudFormation stack for cluster itself and 1 managed nodegroup stack(s)
[ℹ]  if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=ap-southeast-2 --cluster=test-kube-1-16-7-lib'
[ℹ]  CloudWatch logging will not be enabled for cluster "test-kube-1-16-7-lib" in "ap-southeast-2"
[ℹ]  you can enable it with 'eksctl utils update-cluster-logging --region=ap-southeast-2 --cluster=test-kube-1-16-7-lib'
[ℹ]  Kubernetes API endpoint access will use default of {publicAccess=true, privateAccess=false} for cluster "test-kube-1-16-7-lib" in "ap-southeast-2"
[ℹ]  2 sequential tasks: { create cluster control plane "test-kube-1-16-7-lib", create managed nodegroup "standard-workers" }
[ℹ]  building cluster stack "eksctl-test-kube-1-16-7-lib-cluster"
[ℹ]  deploying stack "eksctl-test-kube-1-16-7-lib-cluster"
[ℹ]  building managed nodegroup stack "eksctl-test-kube-1-16-7-lib-nodegroup-standard-workers"
[ℹ]  deploying stack "eksctl-test-kube-1-16-7-lib-nodegroup-standard-workers"
[✔]  all EKS cluster resources for "test-kube-1-16-7-lib" have been created
[✔]  saved kubeconfig as "/home/tammach/.kube/config"

Wrong case in configuration file

./eksctl create cluster -f test_invalid.yaml                                                      
Error: loading config file "test_invalid.yaml": strict decoder error for apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: eksworkshop-eksctl
  region: us-west-2

ManagedNodeGroups:
  - name: eksworkshop-eksctl-ng1
    labels: { role: workers }
    instanceType: m5.large
    desiredCapacity: 3
    minSize: 3
    maxSize: 3
    ssh:
      allow: true
    iam:
      withAddonPolicies:
        imageBuilder: true
        albIngress: true
        autoScaler: true
        appMesh: true
        xRay: true
        cloudWatch: true
        externalDNS: true
: v1alpha5.ClusterConfig.ReadObject: found unknown field: ManagedNodeGroups, error found in #10 byte of ...|odeGroups":[{"desire|..., bigger context ...|{"ManagedNodeGroups":[{"desiredCapacity":3,"iam":{"withAddonPolicies":|...

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the site/content directory)
  • Manually tested
  • Added labels for change area (e.g. area/nodegroup), target version (e.g. version/0.12.0) and kind (e.g. kind/improvement)
  • Make sure the title of the PR is a good description that can go into the release notes

@sayboras sayboras changed the title Bump the dependencies version to v1.14.10 WIP Bump the dependencies version to v1.14.10 Mar 2, 2020
@sayboras sayboras changed the title WIP Bump the dependencies version to v1.14.10 WIP Bump the dependencies version to v1.16.7 Mar 2, 2020
@sayboras sayboras force-pushed the feature/schema-validation branch 2 times, most recently from 2a5d3dd to 47e5eab Compare March 2, 2020 10:09
@sayboras sayboras changed the title WIP Bump the dependencies version to v1.16.7 Strict parser for config file Mar 2, 2020
@sayboras sayboras changed the title Strict parser for config file Strict parser for config file with kube 1.16+ only Mar 2, 2020
@sayboras sayboras changed the title Strict parser for config file with kube 1.16+ only Strict parser for config file (with kube 1.16+ dependencies only) Mar 3, 2020
@sayboras sayboras force-pushed the feature/schema-validation branch 2 times, most recently from aafe02f to add6b08 Compare March 14, 2020 08:41
@sayboras sayboras force-pushed the feature/schema-validation branch 2 times, most recently from f0aba05 to 9468fad Compare April 10, 2020 13:49
@sayboras sayboras marked this pull request as ready for review April 10, 2020 14:09
@sayboras sayboras changed the title Strict parser for config file (with kube 1.16+ dependencies only) WIP Strict parser for config file (with kube 1.16+ dependencies only) Apr 27, 2020
@sayboras sayboras force-pushed the feature/schema-validation branch from c7ba8c0 to 202d9f5 Compare May 1, 2020 11:12
@sayboras sayboras changed the title WIP Strict parser for config file (with kube 1.16+ dependencies only) Strict parser for config file (with kube 1.16+ dependencies) May 1, 2020
@sayboras
Copy link
Contributor Author

sayboras commented May 1, 2020

@martina-if @cPu1 whenever you have time, your input is highly appreciated 🎉

@martina-if
Copy link
Contributor

Hi @sayboras , I think we should not make the config file parser strict yet until we decide how we want to deal with multiple schema versions. If we make the parser strict that will make forward compatibility impossible so I think it's better to close this for now.

@sayboras
Copy link
Contributor Author

sayboras commented May 4, 2020

@martina-if I have very limited idea on supporting multiple API versions. Normally, I just go ahead with different loaders :)

Sure, let me close this one for now, I can re-open it once I have better understanding 💯

@sayboras sayboras closed this May 4, 2020
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.

create cluster -f ignored managed nodegroups
2 participants