-
Notifications
You must be signed in to change notification settings - Fork 0
🌱 feat: adds new nodeadm bootstrap type #1
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
Conversation
cb41c5b
to
51ce7b1
Compare
ci: adds unit tests
51ce7b1
to
3b4537a
Compare
How to run this. check out branch $ k apply -f _artifacts/image-patch/infrastructure-components/source-manifest.yaml run apply some manifests apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: default
spec:
clusterNetwork:
pods:
cidrBlocks:
- 192.168.0.0/16
services:
cidrBlocks:
- 10.96.0.0/12
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
kind: AWSManagedControlPlane
name: default-control-plane
infrastructureRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
kind: AWSManagedControlPlane
name: default-control-plane
---
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
kind: AWSManagedControlPlane
metadata:
name: default-control-plane
spec:
addons:
- name: kube-proxy
version: v1.32.0-eksbuild.2
network:
cni:
cniIngressRules:
- description: kube-proxy metrics
fromPort: 10249
protocol: tcp
toPort: 10249
- description: NVIDIA Data Center GPU Manager metrics
fromPort: 9400
protocol: tcp
toPort: 9400
- description: Prometheus node exporter metrics
fromPort: 9100
protocol: tcp
toPort: 9100
region: us-west-2
sshKeyName: ""
version: v1.33.0
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: AWSMachineTemplate
metadata:
name: default2
spec:
template:
spec:
cloudInit:
insecureSkipSecretsManager: true
ami:
eksLookupType: AmazonLinux2023
instanceMetadataOptions:
httpTokens: required
httpPutResponseHopLimit: 2
iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io
instanceType: m5a.16xlarge
rootVolume:
size: 80
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2 # needs to match this thing
kind: NodeadmConfigTemplate
metadata:
name: default
spec:
template:
spec:
files:
- path: /etc/yum.repos.d/centos-9.repo
owner: root:root
permissions: "0755"
content: |-
[baseos]
name=CentOS Stream 9 - BaseOS
baseurl=https://mirror.stream.centos.org/9-stream/BaseOS/$basearch/os/
gpgkey=https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1
[appstream]
name=CentOS Stream 9 - AppStream
baseurl=https://mirror.stream.centos.org/9-stream/AppStream/$basearch/os/
gpgkey=https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1
kubelet:
config:
evictionHard:
memory.available: "2000Mi"
preBootstrapCommands:
- yum -y update; yum -y install iscsi-initiator-utils nfs-utils lvm2 xfsprogs ipvsadm sysstat lsscsi
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
name: default
spec:
clusterName: default
replicas: 3
template:
spec:
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
kind: NodeadmConfigTemplate
name: default
clusterName: test
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: AWSMachineTemplate
name: default2
version: v1.33.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just a few questions
b37b672
to
3537aa5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for implementing and driving this. 🙌
76a95a8
to
c434fec
Compare
@faiq , hello! Are you planning to merge this to upstream? |
{{- end }} | ||
{{- end }} | ||
{{- if .KubeletConfig }} | ||
kubelet: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will result in incorrect NodeConfig generation if only kubelet flags have been provided
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried this out? I can give it a try as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it generates "flags" section under "cluster", but should be inside "kubelet".
"kubelet:" will be rendered only if config privided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
kind: NodeadmConfig
metadata:
annotations:
cluster.x-k8s.io/cloned-from-groupkind: NodeadmConfigTemplate.bootstrap.cluster.x-k8s.io
cluster.x-k8s.io/cloned-from-name: my-eks-cluster3-md-0-lxc6k
cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "1"
cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "1"
creationTimestamp: "2025-10-06T18:16:18Z"
generation: 1
labels:
cluster.x-k8s.io/cluster-name: my-eks-cluster3
cluster.x-k8s.io/deployment-name: my-eks-cluster3-md-0-ph4nh
cluster.x-k8s.io/set-name: my-eks-cluster3-md-0-ph4nh-fbpgq
machine-template-hash: 1201924711-fbpgq
topology.cluster.x-k8s.io/deployment-name: md-0
topology.cluster.x-k8s.io/owned: ""
name: my-eks-cluster3-md-0-ph4nh-fbpgq-dgzhn
namespace: default
ownerReferences:
- apiVersion: cluster.x-k8s.io/v1beta1
blockOwnerDeletion: true
controller: true
kind: Machine
name: my-eks-cluster3-md-0-ph4nh-fbpgq-dgzhn
uid: c9a7a946-21ff-43ee-bf77-d3bf7f925094
resourceVersion: "24606"
uid: 59ad882d-9f02-4288-8d03-88bdf7dd0391
spec:
kubelet:
flags:
- --register-with-taints=key=value:NoExecute
this works fine
@faiq , if aws secret manager is used (which is true by default), userdata will not be updated in case bootstrap change to NodeadmConfigTemplate. Need to update secret manager userdata also. |
What type of PR is this?
/kind feature
Adds the new nodeadm type to provision EKS nodes that use nodeadm -- mostly used by AL2023 nodes. See KEP for more details and motivations.
The controller code largely resembles the existing code for EKSConfig reconciliation.
New unit tests and e2e tests were added to check logic. As well as a new e2e test to exercise upgrading.
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Checklist:
Release note: