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

Improve karpenter-convert input format requirement #6130

Open
hybby opened this issue May 2, 2024 · 1 comment
Open

Improve karpenter-convert input format requirement #6130

hybby opened this issue May 2, 2024 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@hybby
Copy link

hybby commented May 2, 2024

Description

How can the docs be improved?
Posting this mostly just to help other people who stumble up against "error: no objects passed to convert" when using karpenter-convert :)

The karpenter-convert tool is great - but from the usage information (and the v1beta1 upgrade docs, it's not clear what the required input format for AWSNodeTemplate and Provisioners should be.

I found myself butting up against an error in the tool by trying what I thought made sense while following the docs:

# my inferral
❯ k get awsnodetemplate -o yaml > awsnodetemplate.yaml

# commands in docs (https://karpenter.sh/v0.32/upgrading/v1beta1-migration/#upgrade-procedure)
❯ CLUSTER_NAME=mycluster
❯ export KARPENTER_NODE_ROLE="KarpenterNodeRole-${CLUSTER_NAME}"
❯ karpenter-convert -f awsnodetemplate.yaml | envsubst
error: no objects passed to convert

It took a bit of diving through the code to find out that the tool didn't like lists of objects being passed, like -o yaml outputs:

❯ head awsnodetemplate.yaml
apiVersion: v1
items:
- apiVersion: karpenter.k8s.aws/v1alpha1
  kind: AWSNodeTemplate

Instead, the tool wanted flattened manifests - I grabbed each one individually and processed each file using the directory processing feature of the tool:

❯ for awsnodetemplate in $(kubectl get awsnodetemplates --no-headers | awk '{print $1}') ; do kubectl get awsnodetemplate ${awsnodetemplate} -o yaml > ${awsnodetemplate}.yaml ; done

❯ head foo.yaml
apiVersion: karpenter.k8s.aws/v1alpha1
kind: AWSNodeTemplate
...

❯ karpenter-convert -f foo.yaml
apiVersion: karpenter.k8s.aws/v1beta1
kind: EC2NodeClass
  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@hybby hybby added documentation Improvements or additions to documentation needs-triage Issues that need to be triaged labels May 2, 2024
@engedaam
Copy link
Contributor

engedaam commented May 2, 2024

@hybby are you will to add this guidance as part of the does for v0.32?

@engedaam engedaam removed the needs-triage Issues that need to be triaged label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants