diff --git a/go.mod b/go.mod index 9aa0835498..3e44d4f9c7 100644 --- a/go.mod +++ b/go.mod @@ -29,6 +29,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/ssm v1.49.5 github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 github.com/aws/smithy-go v1.20.2 + github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20240508073157-fbfa1bc129f5 github.com/benjamintf1/unmarshalledmatchers v1.0.0 github.com/blang/semver v3.5.1+incompatible github.com/bxcodec/faker v2.0.1+incompatible @@ -77,16 +78,16 @@ require ( golang.org/x/tools v0.20.0 gopkg.in/yaml.v2 v2.4.0 helm.sh/helm/v3 v3.14.3 - k8s.io/api v0.29.0 + k8s.io/api v0.29.1 k8s.io/apiextensions-apiserver v0.29.0 - k8s.io/apimachinery v0.29.0 + k8s.io/apimachinery v0.29.1 k8s.io/cli-runtime v0.29.0 k8s.io/client-go v0.29.0 k8s.io/cloud-provider v0.28.0 k8s.io/code-generator v0.29.0 k8s.io/kops v1.28.4 - k8s.io/kubelet v0.28.1 - k8s.io/utils v0.0.0-20230726121419-3b25d923346b + k8s.io/kubelet v0.29.1 + k8s.io/utils v0.0.0-20240102154912-e7106e64919e sigs.k8s.io/mdtoc v1.1.0 sigs.k8s.io/yaml v1.4.0 ) @@ -157,7 +158,7 @@ require ( github.com/chigopher/pathlib v0.17.0 // indirect github.com/ckaznocha/intrange v0.1.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect - github.com/containerd/containerd v1.7.12 // indirect + github.com/containerd/containerd v1.7.13 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect @@ -283,7 +284,7 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mgechev/revive v1.3.7 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect @@ -319,10 +320,10 @@ require ( github.com/pkg/sftp v1.13.6 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/polyfloyd/go-errorlint v1.4.8 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/quasilyte/go-ruleguard v0.4.2 // indirect github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect @@ -391,10 +392,9 @@ require ( go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect - go.uber.org/atomic v1.11.0 // indirect go.uber.org/automaxprocs v1.5.3 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.24.0 // indirect + go.uber.org/zap v1.26.0 // indirect golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.24.0 // indirect @@ -415,7 +415,7 @@ require ( honnef.co/go/tools v0.4.7 // indirect k8s.io/apiserver v0.29.0 // indirect k8s.io/cloud-provider-aws v1.28.1 // indirect - k8s.io/component-base v0.29.0 // indirect + k8s.io/component-base v0.29.1 // indirect k8s.io/component-helpers v0.29.0 // indirect k8s.io/csi-translation-lib v0.28.0 // indirect k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 // indirect @@ -425,6 +425,7 @@ require ( mvdan.cc/gofumpt v0.6.0 // indirect mvdan.cc/unparam v0.0.0-20240104100049-c549a3470d14 // indirect oras.land/oras-go v1.2.4 // indirect + sigs.k8s.io/controller-runtime v0.17.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect diff --git a/go.sum b/go.sum index 20cb1a6233..bf0a457bfe 100644 --- a/go.sum +++ b/go.sum @@ -775,13 +775,13 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.28.6/go.mod h1:FZf1/nKNEkHdGGJP/cI2M github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= +github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20240508073157-fbfa1bc129f5 h1:F80UWAvCDH3PgWIkMhwhKN7FRlkn9MhI+nBHFq739ZM= +github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20240508073157-fbfa1bc129f5/go.mod h1:wLKtvVfT0IdSJ3Pf6QoeLN+UTUeU28CmSAnoja6/l5s= github.com/awslabs/goformation/v4 v4.19.5 h1:Y+Tzh01tWg8gf//AgGKUamaja7Wx9NPiJf1FpZu4/iU= github.com/awslabs/goformation/v4 v4.19.5/go.mod h1:JoNpnVCBOUtEz9bFxc9sjy8uBUCLF5c4D1L7RhRTVM8= github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benjamintf1/unmarshalledmatchers v1.0.0 h1:JUhctHQVNarMXg5x3m0Tkp7WnDLzNVxeWc1qbKQPylI= github.com/benjamintf1/unmarshalledmatchers v1.0.0/go.mod h1:IVZdtAzpNyBTuhobduAjo5CjTLczWWbiXnWDVxIgSko= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -875,8 +875,8 @@ github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHq github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= -github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0= -github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk= +github.com/containerd/containerd v1.7.13 h1:wPYKIeGMN8vaggSKuV1X0wZulpMz4CrgEsZdaCyB6Is= +github.com/containerd/containerd v1.7.13/go.mod h1:zT3up6yTRfEUa6+GsITYIJNgSVL9NQ4x4h1RPzk0Wu4= github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= @@ -1446,8 +1446,8 @@ github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4 github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOjvxI= github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1 h1:NicmruxkeqHjDv03SfSxqmaLuisddudfP3h5wdXFbhM= github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1/go.mod h1:eyp4DdUJAKkr9tvxR3jWhw2mDK7CWABMG5r9uyaKC7I= github.com/mgechev/revive v1.3.7 h1:502QY0vQGe9KtYJ9FpxMz9rL+Fc/P13CI5POL4uHCcE= @@ -1622,30 +1622,30 @@ github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/quasilyte/go-ruleguard v0.4.2 h1:htXcXDK6/rO12kiTHKfHuqR4kr3Y4M0J0rOL6CH/BYs= github.com/quasilyte/go-ruleguard v0.4.2/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo= @@ -1884,16 +1884,14 @@ go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY= go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/dl v0.0.0-20190829154251-82a15e2f2ead/go.mod h1:IUMfjQLJQd4UTqG1Z90tenwKoCX93Gn3MAQJMOSBsDQ= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -2743,8 +2741,9 @@ k8s.io/kubectl v0.29.0/go.mod h1:0jMjGWIcMIQzmUaMgAzhSELv5WtHo2a8pq67DtviAJs= k8s.io/kubelet v0.29.0 h1:SX5hlznTBcGIrS1scaf8r8p6m3e475KMifwt9i12iOk= k8s.io/kubelet v0.29.0/go.mod h1:kvKS2+Bz2tgDOG1S1q0TH2z1DasNuVF+8p6Aw7xvKkI= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= +k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= @@ -2789,6 +2788,8 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/controller-runtime v0.17.0 h1:fjJQf8Ukya+VjogLO6/bNX9HE6Y2xpsO5+fyS26ur/s= +sigs.k8s.io/controller-runtime v0.17.0/go.mod h1:+MngTvIQQQhfXtwfdGw/UOQ/aIaqsYywfCINOtwMO/s= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 h1:XX3Ajgzov2RKUdc5jW3t5jwY7Bo7dcRm+tFxT+NfgY0= diff --git a/pkg/apis/eksctl.io/v1alpha5/validation.go b/pkg/apis/eksctl.io/v1alpha5/validation.go index 618da3dd70..5a71fc2dcf 100644 --- a/pkg/apis/eksctl.io/v1alpha5/validation.go +++ b/pkg/apis/eksctl.io/v1alpha5/validation.go @@ -869,9 +869,6 @@ func ValidateNodeGroup(i int, ng *NodeGroup, cfg *ClusterConfig) error { return fieldNotSupported("kubeletExtraConfig") } } else if ng.AMIFamily == NodeImageFamilyAmazonLinux2023 { - if ng.KubeletExtraConfig != nil { - return fieldNotSupported("kubeletExtraConfig") - } if ng.PreBootstrapCommands != nil { return fieldNotSupported("preBootstrapCommands") } diff --git a/pkg/nodebootstrap/al2023.go b/pkg/nodebootstrap/al2023.go index d5747b25d4..be587be681 100644 --- a/pkg/nodebootstrap/al2023.go +++ b/pkg/nodebootstrap/al2023.go @@ -3,6 +3,14 @@ package nodebootstrap import ( "bytes" "encoding/base64" + "encoding/json" + "fmt" + "strconv" + + nodeadmapi "github.com/awslabs/amazon-eks-ami/nodeadm/api" + nodeadm "github.com/awslabs/amazon-eks-ami/nodeadm/api/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5" "github.com/weaveworks/eksctl/pkg/nodebootstrap/assets" @@ -11,13 +19,11 @@ import ( type AL2023 struct { cfg *api.ClusterConfig - ng *api.NodeGroupBase - taints []api.NodeGroupTaint + nodePool api.NodePool clusterDNS string - scripts []string - cloudboot []string - nodeConfig *NodeConfig + scripts []string + cloudboot []string UserDataMimeBoundary string } @@ -27,9 +33,6 @@ func NewManagedAL2023Bootstrapper(cfg *api.ClusterConfig, mng *api.ManagedNodeGr if api.IsEnabled(mng.EFAEnabled) { al2023.cloudboot = append(al2023.cloudboot, assets.EfaManagedAL2023Boothook) } - if api.IsAMI(mng.AMI) { - al2023.setNodeConfig() - } return al2023 } @@ -38,84 +41,91 @@ func NewAL2023Bootstrapper(cfg *api.ClusterConfig, ng *api.NodeGroup, clusterDNS if api.IsEnabled(ng.EFAEnabled) { al2023.scripts = append(al2023.scripts, assets.EfaAl2023Sh) } - al2023.setNodeConfig() return al2023 } func newAL2023Bootstrapper(cfg *api.ClusterConfig, np api.NodePool, clusterDNS string) *AL2023 { return &AL2023{ cfg: cfg, - ng: np.BaseNodeGroup(), - taints: np.NGTaints(), + nodePool: np, clusterDNS: clusterDNS, } } func (m *AL2023) UserData() (string, error) { - var buf bytes.Buffer - - if len(m.scripts) == 0 && len(m.cloudboot) == 0 && m.nodeConfig == nil { + nodeConfig, err := m.createNodeConfig() + if err != nil { + return "", fmt.Errorf("generating node config: %w", err) + } + if len(m.scripts) == 0 && len(m.cloudboot) == 0 && nodeConfig == nil { return "", nil } - if err := createMimeMessage(&buf, m.scripts, m.cloudboot, m.nodeConfig, m.UserDataMimeBoundary); err != nil { + var buf bytes.Buffer + if err := createMimeMessage(&buf, m.scripts, m.cloudboot, nodeConfig, m.UserDataMimeBoundary); err != nil { return "", err } - return base64.StdEncoding.EncodeToString(buf.Bytes()), nil } -func (m *AL2023) setNodeConfig() { - m.nodeConfig = &NodeConfig{ - APIVersion: "node.eks.aws/v1alpha1", - Kind: "NodeConfig", - Spec: NodeSpec{ - Cluster: ClusterSpec{ - Name: m.cfg.Metadata.Name, - APIServerEndpoint: m.cfg.Status.Endpoint, - CertificateAuthority: base64.StdEncoding.EncodeToString(m.cfg.Status.CertificateAuthorityData), - CIDR: m.cfg.Status.KubernetesNetworkConfig.ServiceIPv4CIDR, - }, - Kubelet: KubeletSpec{ - Config: KubeletConfig{ - ClusterDNS: []string{m.clusterDNS}, - }, - Flags: []string{"--node-labels=" + formatLabels(m.ng.Labels)}, - }, - }, +func (m *AL2023) createNodeConfig() (*nodeadm.NodeConfig, error) { + kubeletConfig := api.InlineDocument{} + switch nodeGroup := m.nodePool.(type) { + case *api.ManagedNodeGroup: + if !api.IsAMI(nodeGroup.AMI) { + return nil, nil + } + case *api.NodeGroup: + if nodeGroup.KubeletExtraConfig != nil { + kubeletConfig = *nodeGroup.KubeletExtraConfig.DeepCopy() + } } - if m.ng.MaxPodsPerNode > 0 { - m.nodeConfig.Spec.Kubelet.Config.MaxPods = &m.ng.MaxPodsPerNode + + kubeletConfig["clusterDNS"] = []string{m.clusterDNS} + ng := m.nodePool.BaseNodeGroup() + if ng.MaxPodsPerNode > 0 { + kubeletConfig["maxPods"] = strconv.Itoa(ng.MaxPodsPerNode) } - if len(m.taints) > 0 { - m.nodeConfig.Spec.Kubelet.Flags = append(m.nodeConfig.Spec.Kubelet.Flags, "--register-with-taints="+utils.FormatTaints(m.taints)) + nodeKubeletConfig, err := ToKubeletConfig(kubeletConfig) + if err != nil { + return nil, err } -} -type NodeConfig struct { - APIVersion string `yaml:"apiVersion"` - Kind string `yaml:"kind"` - Spec NodeSpec `yaml:"spec"` -} - -type NodeSpec struct { - Cluster ClusterSpec `yaml:"cluster"` - Kubelet KubeletSpec `yaml:"kubelet"` -} - -type ClusterSpec struct { - APIServerEndpoint string `yaml:"apiServerEndpoint"` - CertificateAuthority string `yaml:"certificateAuthority"` - CIDR string `yaml:"cidr"` - Name string `yaml:"name"` -} + kubeletOptions := nodeadm.KubeletOptions{ + Flags: []string{"--node-labels=" + formatLabels(ng.Labels)}, + Config: nodeKubeletConfig, + } + if taints := m.nodePool.NGTaints(); len(taints) > 0 { + kubeletOptions.Flags = append(kubeletOptions.Flags, "--register-with-taints="+utils.FormatTaints(taints)) + } -type KubeletSpec struct { - Config KubeletConfig `yaml:"config"` - Flags []string `yaml:"flags"` + clusterStatus := m.cfg.Status + return &nodeadm.NodeConfig{ + TypeMeta: metav1.TypeMeta{ + Kind: nodeadmapi.KindNodeConfig, + APIVersion: nodeadm.GroupVersion.String(), + }, + Spec: nodeadm.NodeConfigSpec{ + Cluster: nodeadm.ClusterDetails{ + Name: m.cfg.Metadata.Name, + APIServerEndpoint: clusterStatus.Endpoint, + CertificateAuthority: clusterStatus.CertificateAuthorityData, + CIDR: clusterStatus.KubernetesNetworkConfig.ServiceIPv4CIDR, + }, + Kubelet: kubeletOptions, + }, + }, nil } -type KubeletConfig struct { - MaxPods *int `yaml:"maxPods,omitempty"` - ClusterDNS []string `yaml:"clusterDNS"` +// ToKubeletConfig generates a kubelet config that can be used with nodeadm.NodeConfig. +func ToKubeletConfig(kubeletExtraConfig api.InlineDocument) (map[string]runtime.RawExtension, error) { + kubeletConfig := map[string]runtime.RawExtension{} + for k, v := range kubeletExtraConfig { + raw, err := json.Marshal(v) + if err != nil { + return nil, err + } + kubeletConfig[k] = runtime.RawExtension{Raw: raw} + } + return kubeletConfig, nil } diff --git a/pkg/nodebootstrap/al2023_test.go b/pkg/nodebootstrap/al2023_test.go index bfe1016403..5b62bffe9e 100644 --- a/pkg/nodebootstrap/al2023_test.go +++ b/pkg/nodebootstrap/al2023_test.go @@ -1,13 +1,23 @@ package nodebootstrap_test import ( + "bytes" "encoding/base64" "fmt" + "io" + "mime/multipart" "strings" "github.com/aws/aws-sdk-go-v2/aws" + nodeadmapi "github.com/awslabs/amazon-eks-ami/nodeadm/api" + nodeadm "github.com/awslabs/amazon-eks-ami/nodeadm/api/v1alpha1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/yaml" + api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5" "github.com/weaveworks/eksctl/pkg/nodebootstrap" "github.com/weaveworks/eksctl/pkg/nodebootstrap/assets" @@ -96,6 +106,145 @@ var _ = DescribeTable("Managed AL2023", func(e al2023Entry) { }), ) +type al2023KubeletEntry struct { + updateNodeGroup func(*api.NodeGroup) + expectedNodeConfig nodeadm.NodeConfig +} + +func mustToKubeletConfig(kubeletExtraConfig api.InlineDocument) map[string]runtime.RawExtension { + kubeletConfig, err := nodebootstrap.ToKubeletConfig(kubeletExtraConfig) + if err != nil { + Expect(err).NotTo(HaveOccurred()) + } + return kubeletConfig +} + +var _ = DescribeTable("AL2023 kubeletExtraConfig", func(e al2023KubeletEntry) { + cfg, dns := makeDefaultClusterSettings() + ng := api.NewNodeGroup() + if e.updateNodeGroup != nil { + e.updateNodeGroup(ng) + } + + al2023BS := nodebootstrap.NewAL2023Bootstrapper(cfg, ng, dns) + al2023BS.UserDataMimeBoundary = "//" + + userData, err := al2023BS.UserData() + Expect(err).NotTo(HaveOccurred()) + decoded, err := base64.StdEncoding.DecodeString(userData) + Expect(err).NotTo(HaveOccurred()) + reader := multipart.NewReader(bytes.NewReader(decoded), al2023BS.UserDataMimeBoundary) + foundNodeConfig := false + for { + part, err := reader.NextPart() + if errors.Is(err, io.EOF) { + break + } + Expect(err).NotTo(HaveOccurred()) + if part.Header.Get("Content-Type") != "application/node.eks.aws" { + continue + } + foundNodeConfig = true + var nodeConfigBuf bytes.Buffer + _, err = io.Copy(&nodeConfigBuf, part) + Expect(err).NotTo(HaveOccurred()) + var nodeConfig nodeadm.NodeConfig + Expect(yaml.Unmarshal(nodeConfigBuf.Bytes(), &nodeConfig)).To(Succeed()) + Expect(nodeConfig).To(Equal(e.expectedNodeConfig)) + } + Expect(foundNodeConfig).To(BeTrue(), "expected to find NodeConfig in user data") +}, + Entry("nodegroup with maxPods and taints", al2023KubeletEntry{ + updateNodeGroup: func(ng *api.NodeGroup) { + ng.MaxPodsPerNode = 11 + ng.Labels = map[string]string{"alpha.eksctl.io/nodegroup-name": "al2023-mng-test"} + ng.Taints = []api.NodeGroupTaint{ + { + Key: "special", + Value: "true", + Effect: "NoSchedule", + }, + } + }, + + expectedNodeConfig: nodeadm.NodeConfig{ + TypeMeta: metav1.TypeMeta{ + Kind: nodeadmapi.KindNodeConfig, + APIVersion: nodeadm.GroupVersion.String(), + }, + Spec: nodeadm.NodeConfigSpec{ + Cluster: nodeadm.ClusterDetails{ + APIServerEndpoint: "https://test.xxx.us-west-2.eks.amazonaws.com", + CertificateAuthority: []byte("test CA"), + CIDR: "10.100.0.0/16", + Name: "al2023-test", + }, + Kubelet: nodeadm.KubeletOptions{ + Config: mustToKubeletConfig(map[string]interface{}{ + "clusterDNS": []string{"10.100.0.10"}, + "maxPods": "11", + }), + Flags: []string{ + "--node-labels=alpha.eksctl.io/nodegroup-name=al2023-mng-test", + "--register-with-taints=special=true:NoSchedule", + }, + }, + }, + }, + }), + + Entry("nodegroup with maxPods, taints and kubeletExtraConfig", al2023KubeletEntry{ + updateNodeGroup: func(ng *api.NodeGroup) { + ng.MaxPodsPerNode = 11 + ng.Labels = map[string]string{"alpha.eksctl.io/nodegroup-name": "al2023-mng-test"} + ng.Taints = []api.NodeGroupTaint{ + { + Key: "special", + Value: "true", + Effect: "NoSchedule", + }, + } + ng.KubeletExtraConfig = &api.InlineDocument{ + "shutdownGracePeriod": "5m", + "kubeReserved": map[string]interface{}{ + "cpu": "500m", + "memory": "250Mi", + }, + } + }, + + expectedNodeConfig: nodeadm.NodeConfig{ + TypeMeta: metav1.TypeMeta{ + Kind: nodeadmapi.KindNodeConfig, + APIVersion: nodeadm.GroupVersion.String(), + }, + Spec: nodeadm.NodeConfigSpec{ + Cluster: nodeadm.ClusterDetails{ + APIServerEndpoint: "https://test.xxx.us-west-2.eks.amazonaws.com", + CertificateAuthority: []byte("test CA"), + CIDR: "10.100.0.0/16", + Name: "al2023-test", + }, + Kubelet: nodeadm.KubeletOptions{ + Config: mustToKubeletConfig(map[string]interface{}{ + "clusterDNS": []string{"10.100.0.10"}, + "maxPods": "11", + "shutdownGracePeriod": "5m", + "kubeReserved": map[string]interface{}{ + "cpu": "500m", + "memory": "250Mi", + }, + }), + Flags: []string{ + "--node-labels=alpha.eksctl.io/nodegroup-name=al2023-mng-test", + "--register-with-taints=special=true:NoSchedule", + }, + }, + }, + }, + }), +) + var ( makeDefaultClusterSettings = func() (*api.ClusterConfig, string) { clusterConfig := api.NewClusterConfig() @@ -112,7 +261,6 @@ var ( makeDefaultNPSettings = func(np api.NodePool) { baseNg := np.BaseNodeGroup() - baseNg.MaxPodsPerNode = 4 baseNg.Labels = map[string]string{ "alpha.eksctl.io/nodegroup-name": "al2023-mng-test", } @@ -145,15 +293,19 @@ Content-Type: application/node.eks.aws apiVersion: node.eks.aws/v1alpha1 kind: NodeConfig +metadata: + creationTimestamp: null spec: cluster: apiServerEndpoint: https://test.xxx.us-west-2.eks.amazonaws.com certificateAuthority: dGVzdCBDQQ== cidr: 10.100.0.0/16 name: al2023-test + containerd: {} + instance: + localStorage: {} kubelet: config: - maxPods: 4 clusterDNS: - 10.100.0.10 flags: @@ -165,15 +317,19 @@ Content-Type: application/node.eks.aws apiVersion: node.eks.aws/v1alpha1 kind: NodeConfig +metadata: + creationTimestamp: null spec: cluster: apiServerEndpoint: https://test.xxx.us-west-2.eks.amazonaws.com certificateAuthority: dGVzdCBDQQ== cidr: 10.100.0.0/16 name: al2023-test + containerd: {} + instance: + localStorage: {} kubelet: config: - maxPods: 4 clusterDNS: - 10.100.0.10 flags: diff --git a/pkg/nodebootstrap/managed_al2.go b/pkg/nodebootstrap/managed_al2.go index a047354b92..dd635791d3 100644 --- a/pkg/nodebootstrap/managed_al2.go +++ b/pkg/nodebootstrap/managed_al2.go @@ -8,8 +8,9 @@ import ( "mime/multipart" "strings" + nodeadm "github.com/awslabs/amazon-eks-ami/nodeadm/api/v1alpha1" "github.com/pkg/errors" - "gopkg.in/yaml.v2" + "sigs.k8s.io/yaml" api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5" "github.com/weaveworks/eksctl/pkg/nodebootstrap/assets" @@ -101,7 +102,7 @@ set -ex return script } -func createMimeMessage(writer io.Writer, scripts, cloudboots []string, nodeConfig *NodeConfig, mimeBoundary string) error { +func createMimeMessage(writer io.Writer, scripts, cloudboots []string, nodeConfig *nodeadm.NodeConfig, mimeBoundary string) error { mw := multipart.NewWriter(writer) if mimeBoundary != "" { if err := mw.SetBoundary(mimeBoundary); err != nil {