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

Adding AL2 UserData Merge Support #1861

Merged
merged 6 commits into from Jun 10, 2022
Merged

Adding AL2 UserData Merge Support #1861

merged 6 commits into from Jun 10, 2022

Conversation

suket22
Copy link
Contributor

@suket22 suket22 commented May 26, 2022

  • Adding AL2 Merge Support

1. Issue, if available:
#885

2. Description of changes:

  • Adds UserData support for AL2. This is the first step for the support, where we merge UserData contents in the MIME multi part sequence of Customer Managed -> Karpenter Managed.
    • In a subsequent PR, I'll enable the ability to override kubeletConfiguration and container-runtimeConfiguration as well.

3. How was this change tested?
I tested this locally by creating the necessary resources and scaling the inflate pods. Also verified that the docs links were correct.

> cat provisionerAl2.yaml
apiVersion: karpenter.sh/v1alpha5
kind: Provisioner
metadata:
  name: default
spec:
  limits:
    resources:
      cpu: 20
  provider:
    amiFamily: AL2
    instanceProfile: KarpenterNodeInstanceProfile-karp-cluster
    subnetSelector:
      karpenter.sh/discovery: karp-cluster
    securityGroupSelector:
      karpenter.sh/discovery: karp-cluster
  providerRef:
    name: al2
  ttlSecondsAfterEmpty: 30
---
apiVersion: karpenter.k8s.aws/v1alpha1
kind: AWSNodeTemplate
metadata:
  name: al2
spec:
  userData: |
    MIME-Version: 1.0
    Content-Type: multipart/mixed; boundary="BOUNDARY"

    --BOUNDARY
    Content-Type: text/x-shellscript; charset="us-ascii"

    #!/bin/bash
    echo "Running custom user data script"

    --BOUNDARY--

4. Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: link to issue
  • No

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

@netlify
Copy link

netlify bot commented May 26, 2022

Deploy Preview for karpenter-docs-prod ready!

Name Link
🔨 Latest commit f428c11
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/62a2851d53f2e100082022ce
😎 Deploy Preview https://deploy-preview-1861--karpenter-docs-prod.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@suket22 suket22 marked this pull request as ready for review May 26, 2022 01:15
@suket22 suket22 requested a review from a team as a code owner May 26, 2022 01:15
@suket22 suket22 requested a review from dewjam May 26, 2022 01:15
@suket22 suket22 requested a review from ellistarn June 2, 2022 17:39
@suket22 suket22 requested a review from ellistarn June 8, 2022 16:15
@@ -243,75 +243,10 @@ spec:

### UserData

In order to specify custom user data, you must include it within the AWSNodeTemplate resource. You can then reference the AWSNodeTemplate resource through `spec.providerRef` in your provisioner.
You can control the UserData that needs to be applied to your worker nodes via the `spec.providerRef` field in your provisioner.
Review the [Custom UserData documentation](../user-data/) to learn the necessary steps.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we frame this page as a single "launch templates" story that talks about everything? To start, we can just include the content you have and elaborate from there.

Suggested change
Review the [Custom UserData documentation](../user-data/) to learn the necessary steps.
Review [Custom Launch Templates](../launch-templates/) to learn the necessary steps.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I called it Custom UserData to distinguish it from this doc https://karpenter.sh/v0.10.1/aws/launch-templates/ that's titled Launch Templates and Custom Images.

Not sure what terminology would fit better.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's collapse it later.

```
spec:
provider:
amiFamily: Bottlerocket
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From our discussion, I thought provider and providerRef was an OR semantic. The user would need to specify these in in the AWSNodeTemplate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a much larger change to make. I can work on it in a separate PR - do you think we should disable this feature until that's complete?

Copy link
Contributor

@ellistarn ellistarn Jun 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah probably. Only because it will break early adopters.

ellistarn
ellistarn previously approved these changes Jun 9, 2022
Copy link
Contributor

@ellistarn ellistarn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. A few minor comments.

suket22 and others added 2 commits June 9, 2022 16:38
@suket22 suket22 merged commit 4b3553a into aws:main Jun 10, 2022
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.

None yet

2 participants