diff --git a/UPSTREAM_PROJECTS.yaml b/UPSTREAM_PROJECTS.yaml index 8120e6395e..8010a1da8c 100644 --- a/UPSTREAM_PROJECTS.yaml +++ b/UPSTREAM_PROJECTS.yaml @@ -181,8 +181,8 @@ projects: repos: - name: cluster-api versions: - - tag: v1.5.1 - go_version: "1.20" + - tag: v1.4.6 + go_version: "1.19" - name: cluster-api-provider-cloudstack versions: - tag: v0.4.9-rc6 diff --git a/projects/kubernetes-sigs/cluster-api/ATTRIBUTION.txt b/projects/kubernetes-sigs/cluster-api/ATTRIBUTION.txt index 310a7b75e7..189c2ae297 100644 --- a/projects/kubernetes-sigs/cluster-api/ATTRIBUTION.txt +++ b/projects/kubernetes-sigs/cluster-api/ATTRIBUTION.txt @@ -11,7 +11,7 @@ https://github.com/coreos/go-semver ** github.com/coreos/go-systemd/unit; version v0.0.0-20191104093116-d3cd4ed1dbcf -- https://github.com/coreos/go-systemd -** github.com/coreos/go-systemd/v22/journal; version v22.4.0 -- +** github.com/coreos/go-systemd/v22/journal; version v22.3.2 -- https://github.com/coreos/go-systemd/v22 ** github.com/docker/distribution; version v2.8.2+incompatible -- @@ -23,16 +23,16 @@ https://github.com/flatcar/container-linux-config-transpiler ** github.com/flatcar/ignition/config; version v0.36.2 -- https://github.com/flatcar/ignition -** github.com/go-logr/logr; version v1.2.4 -- +** github.com/go-logr/logr; version v1.2.3 -- https://github.com/go-logr/logr -** github.com/go-logr/zapr; version v1.2.4 -- +** github.com/go-logr/zapr; version v1.2.3 -- https://github.com/go-logr/zapr -** github.com/go-openapi/jsonpointer; version v0.19.6 -- +** github.com/go-openapi/jsonpointer; version v0.19.5 -- https://github.com/go-openapi/jsonpointer -** github.com/go-openapi/jsonreference; version v0.20.1 -- +** github.com/go-openapi/jsonreference; version v0.20.0 -- https://github.com/go-openapi/jsonreference ** github.com/go-openapi/swag; version v0.22.3 -- @@ -56,19 +56,16 @@ https://github.com/google/gofuzz ** github.com/google/shlex; version v0.0.0-20191202100458-e7afc7fbc510 -- https://github.com/google/shlex -** github.com/jonboulle/clockwork; version v0.2.2 -- -https://github.com/jonboulle/clockwork - ** github.com/Masterminds/goutils; version v1.1.1 -- https://github.com/Masterminds/goutils -** github.com/matttproud/golang_protobuf_extensions/pbutil; version v1.0.4 -- +** github.com/matttproud/golang_protobuf_extensions/pbutil; version v1.0.2 -- https://github.com/matttproud/golang_protobuf_extensions ** github.com/moby/spdystream; version v0.2.0 -- https://github.com/moby/spdystream -** github.com/moby/term; version v0.0.0-20221205130635-1aeaba878587 -- +** github.com/moby/term; version v0.0.0-20220808134915-39b0c02b01ae -- https://github.com/moby/term ** github.com/modern-go/concurrent; version v0.0.0-20180306012644-bacd9c7ef1dd -- @@ -80,40 +77,40 @@ https://github.com/modern-go/reflect2 ** github.com/opencontainers/go-digest; version v1.0.0 -- https://github.com/opencontainers/go-digest -** github.com/prometheus/client_golang/prometheus; version v1.16.0 -- +** github.com/prometheus/client_golang/prometheus; version v1.14.0 -- https://github.com/prometheus/client_golang -** github.com/prometheus/client_model/go; version v0.4.0 -- +** github.com/prometheus/client_model/go; version v0.3.0 -- https://github.com/prometheus/client_model -** github.com/prometheus/common; version v0.42.0 -- +** github.com/prometheus/common; version v0.37.0 -- https://github.com/prometheus/common -** github.com/prometheus/procfs; version v0.10.1 -- +** github.com/prometheus/procfs; version v0.8.0 -- https://github.com/prometheus/procfs -** github.com/spf13/afero; version v1.9.5 -- +** github.com/spf13/afero; version v1.9.3 -- https://github.com/spf13/afero -** github.com/spf13/cobra; version v1.7.0 -- +** github.com/spf13/cobra; version v1.6.1 -- https://github.com/spf13/cobra -** go.etcd.io/etcd/api/v3; version v3.5.9 -- +** go.etcd.io/etcd/api/v3; version v3.5.6 -- https://github.com/etcd-io/etcd -** go.etcd.io/etcd/client/pkg/v3; version v3.5.9 -- +** go.etcd.io/etcd/client/pkg/v3; version v3.5.6 -- https://github.com/etcd-io/etcd -** go.etcd.io/etcd/client/v3; version v3.5.9 -- +** go.etcd.io/etcd/client/v3; version v3.5.6 -- https://github.com/etcd-io/etcd ** go4.org/errorutil; version v0.0.0-20201209231011-d4a079459e60 -- https://github.com/go4org/go4 -** gomodules.xyz/jsonpatch/v2; version v2.3.0 -- +** gomodules.xyz/jsonpatch/v2; version v2.2.0 -- https://github.com/gomodules/jsonpatch -** google.golang.org/genproto/googleapis; version v0.0.0-20230410155749-daa745c078e1 -- +** google.golang.org/genproto/googleapis; version v0.0.0-20230306155012-7f2fa6fef1f4 -- https://github.com/googleapis/go-genproto ** google.golang.org/grpc; version v1.55.0 -- @@ -125,76 +122,67 @@ https://gopkg.in/ini.v1 ** gopkg.in/yaml.v2; version v2.4.0 -- https://gopkg.in/yaml.v2 -** k8s.io/api; version v0.27.2 -- +** k8s.io/api; version v0.26.1 -- https://github.com/kubernetes/api -** k8s.io/apiextensions-apiserver/pkg; version v0.27.2 -- +** k8s.io/apiextensions-apiserver/pkg; version v0.26.1 -- https://github.com/kubernetes/apiextensions-apiserver -** k8s.io/apimachinery/pkg; version v0.27.2 -- +** k8s.io/apimachinery/pkg; version v0.26.1 -- https://github.com/kubernetes/apimachinery -** k8s.io/apiserver/pkg; version v0.27.2 -- +** k8s.io/apiserver/pkg; version v0.26.1 -- https://github.com/kubernetes/apiserver -** k8s.io/cli-runtime/pkg; version v0.27.2 -- +** k8s.io/cli-runtime/pkg; version v0.25.0 -- https://github.com/kubernetes/cli-runtime -** k8s.io/client-go; version v0.27.2 -- +** k8s.io/client-go; version v0.26.1 -- https://github.com/kubernetes/client-go -** k8s.io/cluster-bootstrap/token; version v0.27.2 -- +** k8s.io/cluster-bootstrap/token; version v0.25.0 -- https://github.com/kubernetes/cluster-bootstrap -** k8s.io/component-base; version v0.27.2 -- +** k8s.io/component-base; version v0.26.1 -- https://github.com/kubernetes/component-base -** k8s.io/component-helpers/auth/rbac; version v0.27.2 -- -https://github.com/kubernetes/component-helpers - -** k8s.io/klog/v2; version v2.90.1 -- +** k8s.io/klog/v2; version v2.80.1 -- https://github.com/kubernetes/klog -** k8s.io/kube-openapi/pkg; version v0.0.0-20230501164219-8b0f38b5fd1f -- +** k8s.io/kube-openapi/pkg; version v0.0.0-20221012153701-172d655c2280 -- https://github.com/kubernetes/kube-openapi -** k8s.io/kube-openapi/pkg/validation/errors; version v0.0.0-20230501164219-8b0f38b5fd1f -- +** k8s.io/kube-openapi/pkg/validation/errors; version v0.0.0-20221012153701-172d655c2280 -- https://github.com/kubernetes/kube-openapi -** k8s.io/kube-openapi/pkg/validation/spec; version v0.0.0-20230501164219-8b0f38b5fd1f -- +** k8s.io/kube-openapi/pkg/validation/spec; version v0.0.0-20221012153701-172d655c2280 -- https://github.com/kubernetes/kube-openapi -** k8s.io/kube-openapi/pkg/validation/strfmt; version v0.0.0-20230501164219-8b0f38b5fd1f -- +** k8s.io/kube-openapi/pkg/validation/strfmt; version v0.0.0-20221012153701-172d655c2280 -- https://github.com/kubernetes/kube-openapi -** k8s.io/kube-openapi/pkg/validation/validate; version v0.0.0-20230501164219-8b0f38b5fd1f -- +** k8s.io/kube-openapi/pkg/validation/validate; version v0.0.0-20221012153701-172d655c2280 -- https://github.com/kubernetes/kube-openapi -** k8s.io/kubectl/pkg; version v0.27.2 -- +** k8s.io/kubectl/pkg; version v0.25.0 -- https://github.com/kubernetes/kubectl -** k8s.io/metrics/pkg; version v0.27.2 -- -https://github.com/kubernetes/metrics - -** k8s.io/utils; version v0.0.0-20230209194617-a36077c30491 -- +** k8s.io/utils; version v0.0.0-20221128185143-99ec85e7a448 -- https://github.com/kubernetes/utils -** sigs.k8s.io/cluster-api; version v1.5.1 -- +** sigs.k8s.io/cluster-api; version v1.4.6 -- https://github.com/kubernetes-sigs/cluster-api -** sigs.k8s.io/controller-runtime; version v0.15.1 -- +** sigs.k8s.io/controller-runtime; version v0.14.5 -- https://github.com/kubernetes-sigs/controller-runtime -** sigs.k8s.io/json; version v0.0.0-20221116044647-bc3834ca7abd -- +** sigs.k8s.io/json; version v0.0.0-20220713155537-f223a00ba0e2 -- https://github.com/kubernetes-sigs/json -** sigs.k8s.io/kustomize/api; version v0.13.2 -- +** sigs.k8s.io/kustomize/api; version v0.12.1 -- https://github.com/kubernetes-sigs/kustomize -** sigs.k8s.io/kustomize/kustomize/v5/commands/build; version v5.0.1 -- -https://github.com/kubernetes-sigs/kustomize - -** sigs.k8s.io/kustomize/kyaml; version v0.14.1 -- +** sigs.k8s.io/kustomize/kyaml; version v0.13.9 -- https://github.com/kubernetes-sigs/kustomize ** sigs.k8s.io/structured-merge-diff/v4; version v4.2.3 -- @@ -584,8 +572,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------ -** github.com/russross/blackfriday/v2; version v2.1.0 -- -https://github.com/russross/blackfriday/v2 +** github.com/russross/blackfriday; version v1.5.2 -- +https://github.com/russross/blackfriday Blackfriday is distributed under the Simplified BSD License: @@ -622,7 +610,7 @@ Blackfriday is distributed under the Simplified BSD License: ** github.com/ajeddeloh/go-json; version v0.0.0-20200220154158-5ae607161559 -- https://github.com/coreos/go-json -** k8s.io/utils/internal/third_party/forked/golang/net; version v0.0.0-20230209194617-a36077c30491 -- +** k8s.io/utils/internal/third_party/forked/golang/net; version v0.0.0-20221128185143-99ec85e7a448 -- https://github.com/kubernetes/utils Copyright (c) 2012 The Go Authors. All rights reserved. @@ -1029,7 +1017,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** github.com/liggitt/tabwriter; version v0.0.0-20181228230101-89fcab3d43de -- https://github.com/liggitt/tabwriter -** golang.org/go; version go1.20.7 -- +** golang.org/go; version go1.19.12 -- https://github.com/golang/go ** golang.org/x/crypto; version v0.11.0 -- @@ -1038,7 +1026,7 @@ https://golang.org/x/crypto ** golang.org/x/net; version v0.13.0 -- https://golang.org/x/net -** golang.org/x/oauth2; version v0.10.0 -- +** golang.org/x/oauth2; version v0.6.0 -- https://golang.org/x/oauth2 ** golang.org/x/sys/unix; version v0.10.0 -- @@ -1053,10 +1041,10 @@ https://golang.org/x/text ** golang.org/x/time/rate; version v0.3.0 -- https://golang.org/x/time -** k8s.io/apimachinery/third_party/forked/golang; version v0.27.2 -- +** k8s.io/apimachinery/third_party/forked/golang; version v0.26.1 -- https://github.com/kubernetes/apimachinery -** k8s.io/client-go/third_party/forked/golang/template; version v0.27.2 -- +** k8s.io/client-go/third_party/forked/golang/template; version v0.26.1 -- https://github.com/kubernetes/client-go Copyright (c) 2009 The Go Authors. All rights reserved. @@ -1126,42 +1114,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------ -** github.com/mxk/go-flowrate/flowrate; version v0.0.0-20140419014527-cca7078d478f -- -https://github.com/mxk/go-flowrate - -Copyright (c) 2014 The Go-FlowRate Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the - distribution. - - * Neither the name of the go-flowrate project nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------- - -** github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg; version v0.42.0 -- +** github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg; version v0.37.0 -- https://github.com/prometheus/common Copyright (c) 2011, Open Knowledge Foundation Ltd. @@ -1266,7 +1219,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------ -** google.golang.org/protobuf; version v1.31.0 -- +** google.golang.org/protobuf; version v1.30.0 -- https://go.googlesource.com/protobuf Copyright (c) 2018 The Go Authors. All rights reserved. @@ -1333,7 +1286,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------ -** k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json; version v0.0.0-20230501164219-8b0f38b5fd1f -- +** k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json; version v0.0.0-20221012153701-172d655c2280 -- https://github.com/kubernetes/kube-openapi Copyright (c) 2020 The Go Authors. All rights reserved. @@ -1387,11 +1340,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ------ -** github.com/adrg/xdg; version v0.4.0 -- -https://github.com/adrg/xdg -Copyright (c) 2014 Adrian-George Bostan - -** github.com/alecthomas/units; version v0.0.0-20211218093645-b94a6e3cc137 -- +** github.com/alecthomas/units; version v0.0.0-20210208195552-ff826a37aa15 -- https://github.com/alecthomas/units Copyright (C) 2014 Alec Thomas @@ -1427,19 +1376,11 @@ Copyright (c) 2012,2013 Ernest Micklei https://github.com/exponent-io/jsonpath Copyright (c) 2015 Exponent Labs LLC -** github.com/fatih/camelcase; version v1.0.0 -- -https://github.com/fatih/camelcase -Copyright (c) 2015 Fatih Arslan - ** github.com/fatih/color; version v1.15.0 -- https://github.com/fatih/color Copyright (c) 2013 Fatih Arslan -** github.com/fvbommel/sortorder; version v1.0.1 -- -https://github.com/fvbommel/sortorder -Copyright (c) 2015 Frits van Bommel - -** github.com/go-errors/errors; version v1.4.2 -- +** github.com/go-errors/errors; version v1.0.1 -- https://github.com/go-errors/errors Copyright (c) 2015 Conrad Irwin @@ -1459,10 +1400,6 @@ Copyright (c) 2019 Josh Bleecher Snyder https://github.com/json-iterator/go Copyright (c) 2016 json-iterator -** github.com/lithammer/dedent; version v1.1.0 -- -https://github.com/lithammer/dedent -Copyright (c) 2018 Peter Lithammer - ** github.com/mailru/easyjson; version v0.7.7 -- https://github.com/mailru/easyjson Copyright (c) 2016 Mail.Ru Group @@ -1515,11 +1452,11 @@ Copyright (c) [2015] [go-gitignore] https://github.com/olekukonko/tablewriter Copyright (C) 2014 by Oleku Konko -** github.com/onsi/gomega; version v1.27.8 -- +** github.com/onsi/gomega; version v1.27.5 -- https://github.com/onsi/gomega Copyright (c) 2013-2014 Onsi Fakhouri -** github.com/pelletier/go-toml/v2; version v2.0.8 -- +** github.com/pelletier/go-toml/v2; version v2.0.6 -- https://github.com/pelletier/go-toml/v2 Copyright (c) 2013 - 2022 Thomas Pelletier, Eric Anderton @@ -1531,7 +1468,7 @@ Copyright (c) 2011-2012 Peter Bourgon https://github.com/rivo/uniseg Copyright (c) 2019 Oliver Kuederle -** github.com/spf13/cast; version v1.5.1 -- +** github.com/spf13/cast; version v1.5.0 -- https://github.com/spf13/cast Copyright (c) 2014 Steve Francia @@ -1539,7 +1476,7 @@ Copyright (c) 2014 Steve Francia https://github.com/spf13/jwalterweatherman Copyright (c) 2014 Steve Francia -** github.com/spf13/viper; version v1.16.0 -- +** github.com/spf13/viper; version v1.15.0 -- https://github.com/spf13/viper Copyright (c) 2014 Steve Francia @@ -1571,77 +1508,16 @@ Copyright (c) 2017-2021 Uber Technologies, Inc. https://github.com/uber-go/zap Copyright (c) 2016-2017 Uber Technologies, Inc. -** sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/qri-io/starlib/util; version v0.14.1 -- +** sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/qri-io/starlib/util; version v0.13.9 -- https://github.com/kubernetes-sigs/kustomize Copyright (c) 2018 QRI, Inc. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. ------- - -** github.com/daviddengcn/go-colortext; version v1.0.0 -- -https://github.com/daviddengcn/go-colortext -Copyright (c) 2016, David Deng -Copyright (c) 2016 David Deng - -BSD License -=========== - - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -* Neither the name of go-colortext nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - -=========== - - - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. @@ -1745,7 +1621,7 @@ Copyright (c) 2006-2010 Kirill Simonov Copyright (c) 2006-2011 Kirill Simonov Copyright (c) 2011-2019 Canonical Ltd -** sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml; version v0.14.1 -- +** sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml; version v0.13.9 -- https://github.com/kubernetes-sigs/kustomize Copyright (c) 2006-2010 Kirill Simonov Copyright (c) 2006-2011 Kirill Simonov diff --git a/projects/kubernetes-sigs/cluster-api/CAPD_ATTRIBUTION.txt b/projects/kubernetes-sigs/cluster-api/CAPD_ATTRIBUTION.txt index 397d04da7f..87188e38f5 100644 --- a/projects/kubernetes-sigs/cluster-api/CAPD_ATTRIBUTION.txt +++ b/projects/kubernetes-sigs/cluster-api/CAPD_ATTRIBUTION.txt @@ -20,16 +20,16 @@ https://github.com/docker/go-units ** github.com/flatcar/ignition/config; version v0.36.2 -- https://github.com/flatcar/ignition -** github.com/go-logr/logr; version v1.2.4 -- +** github.com/go-logr/logr; version v1.2.3 -- https://github.com/go-logr/logr -** github.com/go-logr/zapr; version v1.2.4 -- +** github.com/go-logr/zapr; version v1.2.3 -- https://github.com/go-logr/zapr -** github.com/go-openapi/jsonpointer; version v0.19.6 -- +** github.com/go-openapi/jsonpointer; version v0.19.5 -- https://github.com/go-openapi/jsonpointer -** github.com/go-openapi/jsonreference; version v0.20.1 -- +** github.com/go-openapi/jsonreference; version v0.20.0 -- https://github.com/go-openapi/jsonreference ** github.com/go-openapi/swag; version v0.22.3 -- @@ -44,7 +44,7 @@ https://github.com/google/gnostic ** github.com/google/gofuzz; version v1.2.0 -- https://github.com/google/gofuzz -** github.com/matttproud/golang_protobuf_extensions/pbutil; version v1.0.4 -- +** github.com/matttproud/golang_protobuf_extensions/pbutil; version v1.0.2 -- https://github.com/matttproud/golang_protobuf_extensions ** github.com/modern-go/concurrent; version v0.0.0-20180306012644-bacd9c7ef1dd -- @@ -59,73 +59,73 @@ https://github.com/opencontainers/go-digest ** github.com/opencontainers/image-spec/specs-go; version v1.0.2 -- https://github.com/opencontainers/image-spec -** github.com/prometheus/client_golang/prometheus; version v1.16.0 -- +** github.com/prometheus/client_golang/prometheus; version v1.14.0 -- https://github.com/prometheus/client_golang -** github.com/prometheus/client_model/go; version v0.4.0 -- +** github.com/prometheus/client_model/go; version v0.3.0 -- https://github.com/prometheus/client_model -** github.com/prometheus/common; version v0.42.0 -- +** github.com/prometheus/common; version v0.37.0 -- https://github.com/prometheus/common -** github.com/prometheus/procfs; version v0.10.1 -- +** github.com/prometheus/procfs; version v0.8.0 -- https://github.com/prometheus/procfs -** github.com/spf13/cobra; version v1.7.0 -- +** github.com/spf13/cobra; version v1.6.1 -- https://github.com/spf13/cobra -** gomodules.xyz/jsonpatch/v2; version v2.3.0 -- +** gomodules.xyz/jsonpatch/v2; version v2.2.0 -- https://github.com/gomodules/jsonpatch ** gopkg.in/yaml.v2; version v2.4.0 -- https://gopkg.in/yaml.v2 -** k8s.io/api; version v0.27.2 -- +** k8s.io/api; version v0.26.1 -- https://github.com/kubernetes/api -** k8s.io/apiextensions-apiserver/pkg/apis/apiextensions; version v0.27.2 -- +** k8s.io/apiextensions-apiserver/pkg/apis/apiextensions; version v0.26.1 -- https://github.com/kubernetes/apiextensions-apiserver -** k8s.io/apimachinery/pkg; version v0.27.2 -- +** k8s.io/apimachinery/pkg; version v0.26.1 -- https://github.com/kubernetes/apimachinery -** k8s.io/client-go; version v0.27.2 -- +** k8s.io/client-go; version v0.26.1 -- https://github.com/kubernetes/client-go -** k8s.io/cluster-bootstrap/token; version v0.27.2 -- +** k8s.io/cluster-bootstrap/token; version v0.25.0 -- https://github.com/kubernetes/cluster-bootstrap -** k8s.io/component-base; version v0.27.2 -- +** k8s.io/component-base; version v0.26.1 -- https://github.com/kubernetes/component-base -** k8s.io/klog/v2; version v2.90.1 -- +** k8s.io/klog/v2; version v2.80.1 -- https://github.com/kubernetes/klog -** k8s.io/kube-openapi/pkg; version v0.0.0-20230501164219-8b0f38b5fd1f -- +** k8s.io/kube-openapi/pkg; version v0.0.0-20221012153701-172d655c2280 -- https://github.com/kubernetes/kube-openapi -** k8s.io/kube-openapi/pkg/validation/spec; version v0.0.0-20230501164219-8b0f38b5fd1f -- +** k8s.io/kube-openapi/pkg/validation/spec; version v0.0.0-20221012153701-172d655c2280 -- https://github.com/kubernetes/kube-openapi -** k8s.io/utils; version v0.0.0-20230209194617-a36077c30491 -- +** k8s.io/utils; version v0.0.0-20221128185143-99ec85e7a448 -- https://github.com/kubernetes/utils ** sigs.k8s.io/cluster-api; version v0.0.0-00010101000000-000000000000 -- https://github.com/kubernetes-sigs/cluster-api -** sigs.k8s.io/cluster-api/test/infrastructure/container; version v1.5.1 -- +** sigs.k8s.io/cluster-api/test/infrastructure/container; version v1.4.6 -- https://github.com/kubernetes-sigs/cluster-api -** sigs.k8s.io/cluster-api/test/infrastructure/docker; version v1.5.1 -- +** sigs.k8s.io/cluster-api/test/infrastructure/docker; version v1.4.6 -- https://github.com/kubernetes-sigs/cluster-api -** sigs.k8s.io/cluster-api/test/infrastructure/kind; version v1.5.1 -- +** sigs.k8s.io/cluster-api/test/infrastructure/kind; version v1.4.6 -- https://github.com/kubernetes-sigs/cluster-api -** sigs.k8s.io/controller-runtime; version v0.15.1 -- +** sigs.k8s.io/controller-runtime; version v0.14.5 -- https://github.com/kubernetes-sigs/controller-runtime -** sigs.k8s.io/json; version v0.0.0-20221116044647-bc3834ca7abd -- +** sigs.k8s.io/json; version v0.0.0-20220713155537-f223a00ba0e2 -- https://github.com/kubernetes-sigs/json ** sigs.k8s.io/kind/pkg; version v0.20.0 -- @@ -760,7 +760,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------ -** github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg; version v0.42.0 -- +** github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg; version v0.37.0 -- https://github.com/prometheus/common Copyright (c) 2011, Open Knowledge Foundation Ltd. @@ -830,13 +830,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------ -** golang.org/go; version go1.20.7 -- +** golang.org/go; version go1.19.12 -- https://github.com/golang/go ** golang.org/x/net; version v0.13.0 -- https://golang.org/x/net -** golang.org/x/oauth2; version v0.10.0 -- +** golang.org/x/oauth2; version v0.6.0 -- https://golang.org/x/oauth2 ** golang.org/x/sys/unix; version v0.10.0 -- @@ -851,7 +851,7 @@ https://golang.org/x/text ** golang.org/x/time/rate; version v0.3.0 -- https://golang.org/x/time -** k8s.io/apimachinery/third_party/forked/golang; version v0.27.2 -- +** k8s.io/apimachinery/third_party/forked/golang; version v0.26.1 -- https://github.com/kubernetes/apimachinery Copyright (c) 2009 The Go Authors. All rights reserved. @@ -884,7 +884,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------ -** google.golang.org/protobuf; version v1.31.0 -- +** google.golang.org/protobuf; version v1.30.0 -- https://go.googlesource.com/protobuf Copyright (c) 2018 The Go Authors. All rights reserved. @@ -951,7 +951,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------ -** k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json; version v0.0.0-20230501164219-8b0f38b5fd1f -- +** k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json; version v0.0.0-20221012153701-172d655c2280 -- https://github.com/kubernetes/kube-openapi Copyright (c) 2020 The Go Authors. All rights reserved. @@ -984,7 +984,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------ -** k8s.io/utils/internal/third_party/forked/golang/net; version v0.0.0-20230209194617-a36077c30491 -- +** k8s.io/utils/internal/third_party/forked/golang/net; version v0.0.0-20221128185143-99ec85e7a448 -- https://github.com/kubernetes/utils Copyright (c) 2012 The Go Authors. All rights reserved. @@ -1054,7 +1054,7 @@ Copyright (c) 2014 Benedikt Lang https://github.com/cespare/xxhash/v2 Copyright (c) 2016 Caleb Spare -** github.com/emicklei/go-restful/v3; version v3.10.2 -- +** github.com/emicklei/go-restful/v3; version v3.9.0 -- https://github.com/emicklei/go-restful/v3 Copyright (c) 2012,2013 Ernest Micklei @@ -1074,7 +1074,7 @@ Copyright (c) 2016 json-iterator https://github.com/mailru/easyjson Copyright (c) 2016 Mail.Ru Group -** github.com/onsi/gomega; version v1.27.8 -- +** github.com/onsi/gomega; version v1.27.5 -- https://github.com/onsi/gomega Copyright (c) 2013-2014 Onsi Fakhouri diff --git a/projects/kubernetes-sigs/cluster-api/CHECKSUMS b/projects/kubernetes-sigs/cluster-api/CHECKSUMS index ad938b4ebc..a21f4e46ae 100644 --- a/projects/kubernetes-sigs/cluster-api/CHECKSUMS +++ b/projects/kubernetes-sigs/cluster-api/CHECKSUMS @@ -1,10 +1,10 @@ -427463ed1e799d1e217f1bb37f24462e89359d3765d0db4ed96d02a6a0640718 _output/bin/cluster-api/linux-amd64/cluster-api-provider-docker-manager -3fb1ff732357b21cab692406dfd6c452d28820d48734404521f5c0a355c6e99b _output/bin/cluster-api/linux-amd64/clusterctl -c6995e80dde3db2573bb488172f84776c139e1457500961a1e139e24ca3752c4 _output/bin/cluster-api/linux-amd64/kubeadm-bootstrap-manager -b5df0d28ec5d3ee73b20257cd44629ee3fa2458dcbbbdf63de53ee232eeeee4e _output/bin/cluster-api/linux-amd64/kubeadm-control-plane-manager -258ba41bcbfa7cac30db6db795e99c2d48d72aaebab6591d17998e80c6e0d5d8 _output/bin/cluster-api/linux-amd64/manager -9eef2aa5960a9fb3656e85fd131357679583ed01729aa6c807ac9830ccd1241c _output/bin/cluster-api/linux-arm64/cluster-api-provider-docker-manager -65fa0fbd96dd2b678186bc75c623bdd75646bd0c63bceefab75ad8500f957336 _output/bin/cluster-api/linux-arm64/clusterctl -8b17dee4d499abe94c9c78aab5d635e8222ebfc5b2541e89a58d5c5e66df93ca _output/bin/cluster-api/linux-arm64/kubeadm-bootstrap-manager -a7b59514bfb10a12fcc89fa9a7823bef06acb20836c4f24135ea4a822d5b42d6 _output/bin/cluster-api/linux-arm64/kubeadm-control-plane-manager -9bb129b753f7e1afeb246ed4e3d8aeb9aad11f2399fe06e1c5b3b3665e93556f _output/bin/cluster-api/linux-arm64/manager +c274617a04555d1f2cc504188ef2964dde8c89a1751c2acd56954837db85f42e _output/bin/cluster-api/linux-amd64/cluster-api-provider-docker-manager +6afd6a06651f5cb46d2b8e92becb73dd952ea4fac34fe9de78a284dbab514c20 _output/bin/cluster-api/linux-amd64/clusterctl +8a6f824ae5bf41a9f9f353445099483af3ba983d5807d817c0893e2de3a6f62a _output/bin/cluster-api/linux-amd64/kubeadm-bootstrap-manager +9e1230bb9ca76899f259c6f23c69db719f3f229d77b01468223a0d7150f3be7e _output/bin/cluster-api/linux-amd64/kubeadm-control-plane-manager +339f3ca34088edbb4f03cd3d4851372e213cd82e17951cf9f2ed55e1d12b437c _output/bin/cluster-api/linux-amd64/manager +12c19f80ff004b94e9ceddb3ab37a821bc380ffaf6096732369887fb90457d19 _output/bin/cluster-api/linux-arm64/cluster-api-provider-docker-manager +c2b225c13ca11ce5e1c26aca84ae834f0a427b99529a97c8321073dded41277d _output/bin/cluster-api/linux-arm64/clusterctl +cb51f74b3d3c19237c25b6359965e24e420207b1d60e312bbaf93377d90afac3 _output/bin/cluster-api/linux-arm64/kubeadm-bootstrap-manager +24e5697b9f7f885687e2c1115b0f02bb046a9bcf3f464784d4520a351a2be322 _output/bin/cluster-api/linux-arm64/kubeadm-control-plane-manager +3c980bb5da050c081dc6d41abdbefffb07bc82bf01ad5eb82e9716eb5077feeb _output/bin/cluster-api/linux-arm64/manager diff --git a/projects/kubernetes-sigs/cluster-api/GIT_TAG b/projects/kubernetes-sigs/cluster-api/GIT_TAG index 53b5bbb127..2aca8c01f5 100644 --- a/projects/kubernetes-sigs/cluster-api/GIT_TAG +++ b/projects/kubernetes-sigs/cluster-api/GIT_TAG @@ -1 +1 @@ -v1.5.1 +v1.4.6 diff --git a/projects/kubernetes-sigs/cluster-api/GOLANG_VERSION b/projects/kubernetes-sigs/cluster-api/GOLANG_VERSION index 5fb5a6b4f5..bc4493477a 100644 --- a/projects/kubernetes-sigs/cluster-api/GOLANG_VERSION +++ b/projects/kubernetes-sigs/cluster-api/GOLANG_VERSION @@ -1 +1 @@ -1.20 +1.19 diff --git a/projects/kubernetes-sigs/cluster-api/Makefile b/projects/kubernetes-sigs/cluster-api/Makefile index 3d63a1e667..5b28efb923 100644 --- a/projects/kubernetes-sigs/cluster-api/Makefile +++ b/projects/kubernetes-sigs/cluster-api/Makefile @@ -44,7 +44,7 @@ cluster-api-docker-controller/images/%: BASE_IMAGE_NAME=eks-distro-minimal-base .PHONY: create-manifests create-manifests: tarballs - build/create_manifests.sh $(REPO) $(OUTPUT_DIR) $(ARTIFACTS_PATH) $(GIT_TAG) $(IMAGE_REPO) $(IMAGE_TAG) $(GOLANG_VERSION) + build/create_manifests.sh $(REPO) $(OUTPUT_DIR) $(ARTIFACTS_PATH) $(GIT_TAG) $(IMAGE_REPO) $(IMAGE_TAG) $(FIX_LICENSES_GO_JSON_TARGET): | $(GO_MOD_DOWNLOAD_TARGETS) # The ajeddeloh/go-json dependency github repo does not have a license, however it redirects to coreos/go-json repo diff --git a/projects/kubernetes-sigs/cluster-api/README.md b/projects/kubernetes-sigs/cluster-api/README.md index 4d2514a1b1..26f4795b0a 100644 --- a/projects/kubernetes-sigs/cluster-api/README.md +++ b/projects/kubernetes-sigs/cluster-api/README.md @@ -1,5 +1,5 @@ ## **Cluster API** -![Version](https://img.shields.io/badge/version-v1.5.1-blue) +![Version](https://img.shields.io/badge/version-v1.4.6-blue) ![Build Status](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiQVZ3TDBZZVVXZUZiVmtqLzVoOVcrV2FaMmxRRzJXRmJCRlZtQkNodXdWZ0FrNm0zQ3l5UzNqTkdsQXgwdzc0bTBZc1RIcjBhMUVFbEhIK3d2VDVPek1rPSIsIml2UGFyYW1ldGVyU3BlYyI6IkVuOGJxNXBPZEtDek81Q3giLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=main) [Cluster API](https://github.com/kubernetes-sigs/cluster-api) is a Kubernetes sub-project focused on providing declarative APIs and tooling to simplify provisioning, upgrading, and operating multiple Kubernetes clusters. It uses Kubernetes-style APIs and patterns to automate cluster lifecycle management for platform operators. The supporting infrastructure, like virtual machines, networks, load balancers, and VPCs, as well as the Kubernetes cluster configuration are all defined in the same way that application developers operate deploying and managing their workloads. This enables consistent and repeatable cluster deployments across a wide variety of infrastructure environments. Cluster API can be extended to support any infrastructure provider (AWS, Azure, vSphere, etc.) or bootstrap provider (kubeadm is default) as required by the customer. diff --git a/projects/kubernetes-sigs/cluster-api/build/create_manifests.sh b/projects/kubernetes-sigs/cluster-api/build/create_manifests.sh index 0a85fe2db7..db653fa818 100755 --- a/projects/kubernetes-sigs/cluster-api/build/create_manifests.sh +++ b/projects/kubernetes-sigs/cluster-api/build/create_manifests.sh @@ -23,13 +23,10 @@ ARTIFACTS_PATH="$3" TAG="$4" IMAGE_REPO="$5" IMAGE_TAG="$6" -GOLANG_VERSION="$7" MAKE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" source "${MAKE_ROOT}/../../../build/lib/common.sh" -build::common::use_go_version ${GOLANG_VERSION} - cd $REPO CAPI_REGISTRY_PREFIX="${IMAGE_REPO}/kubernetes-sigs/cluster-api" diff --git a/projects/kubernetes-sigs/cluster-api/patches/0001-Adding-capi-support-for-Bottlerocket.patch b/projects/kubernetes-sigs/cluster-api/patches/0001-Adding-capi-support-for-Bottlerocket.patch index a9ffacfe36..d8e2c8151c 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0001-Adding-capi-support-for-Bottlerocket.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0001-Adding-capi-support-for-Bottlerocket.patch @@ -1,4 +1,4 @@ -From f711603e87012e0101ca86a70942477fd3fea11a Mon Sep 17 00:00:00 2001 +From 6d2dbd024cec295812d19a491ed18bb54c3e3134 Mon Sep 17 00:00:00 2001 From: Vignesh Goutham Ganesh Date: Fri, 11 Jun 2021 10:43:09 -0700 Subject: [PATCH 01/36] Adding capi support for Bottlerocket @@ -77,7 +77,7 @@ index e1f023426..1c95079f7 100644 in, out := &in.InfrastructureRef, &out.InfrastructureRef *out = new(v1.ObjectReference) diff --git a/bootstrap/kubeadm/api/v1alpha3/kubeadmconfig_types.go b/bootstrap/kubeadm/api/v1alpha3/kubeadmconfig_types.go -index ffca6a5a5..f0577f74e 100644 +index 843ca08ed..6daf0dd64 100644 --- a/bootstrap/kubeadm/api/v1alpha3/kubeadmconfig_types.go +++ b/bootstrap/kubeadm/api/v1alpha3/kubeadmconfig_types.go @@ -24,12 +24,15 @@ import ( @@ -199,7 +199,7 @@ index fc6ebee0d..079b96fe7 100644 // KubeadmConfigSpec defines the desired state of KubeadmConfig. diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml -index a24d72abc..c95422c6b 100644 +index d4b6ce502..c9a3c1cea 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -103,6 +103,21 @@ spec: @@ -447,7 +447,7 @@ index a24d72abc..c95422c6b 100644 description: SkipPhases is a list of phases to skip during command execution. The list of phases can be obtained with the "kubeadm diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml -index e8b897862..983e3788a 100644 +index 2899e336a..348bc8362 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -111,6 +111,22 @@ spec: @@ -1152,10 +1152,10 @@ index c2f158f7c..aaf8c5dc0 100644 if input.UseExperimentalRetry { input.KubeadmCommand = retriableJoinScriptName diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index 53eb5c4c8..9dc3d19c1 100644 +index 04f93612e..ab0dd4391 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -41,6 +41,7 @@ import ( +@@ -42,6 +42,7 @@ import ( clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" @@ -1163,7 +1163,7 @@ index 53eb5c4c8..9dc3d19c1 100644 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/internal/cloudinit" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/internal/ignition" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/internal/locking" -@@ -439,6 +440,46 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -429,6 +430,46 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex // injects into config.ClusterConfiguration values from top level object r.reconcileTopLevelObjectSettings(ctx, scope.Cluster, machine, scope.Config) @@ -1210,7 +1210,7 @@ index 53eb5c4c8..9dc3d19c1 100644 clusterdata, err := kubeadmtypes.MarshalClusterConfigurationForVersion(scope.Config.Spec.ClusterConfiguration, parsedVersion) if err != nil { scope.Error(err, "Failed to marshal cluster configuration") -@@ -510,6 +551,12 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -498,6 +539,12 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex ControlPlaneInput: controlPlaneInput, Ignition: scope.Config.Spec.Ignition, }) @@ -1223,7 +1223,7 @@ index 53eb5c4c8..9dc3d19c1 100644 default: bootstrapInitData, err = cloudinit.NewInitControlPlane(controlPlaneInput) } -@@ -618,6 +665,19 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) +@@ -605,6 +652,19 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) NodeInput: nodeInput, Ignition: scope.Config.Spec.Ignition, }) @@ -1243,7 +1243,7 @@ index 53eb5c4c8..9dc3d19c1 100644 default: bootstrapJoinData, err = cloudinit.NewNode(nodeInput) } -@@ -722,6 +782,19 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S +@@ -708,6 +768,19 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S ControlPlaneJoinInput: controlPlaneJoinInput, Ignition: scope.Config.Spec.Ignition, }) @@ -1428,7 +1428,7 @@ index 2eebc2402..e924a4a4b 100644 + return out +} diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml -index f9ac22eb3..5b20fb215 100644 +index 94952c5cd..f7418dfa5 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -178,6 +178,22 @@ spec: @@ -1688,7 +1688,7 @@ index f9ac22eb3..5b20fb215 100644 description: SkipPhases is a list of phases to skip during command execution. The list of phases can be obtained with diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml -index 1a6d560e9..68484236f 100644 +index 4e182d911..5a1623e9f 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -1309,6 +1309,24 @@ spec: @@ -1826,25 +1826,25 @@ index 1a6d560e9..68484236f 100644 description: SkipPhases is a list of phases to skip during command execution. The list of phases can diff --git a/go.mod b/go.mod -index 347b9c697..4c653ad98 100644 +index d8509544b..8117ae43e 100644 --- a/go.mod +++ b/go.mod -@@ -33,6 +33,7 @@ require ( +@@ -32,6 +32,7 @@ require ( golang.org/x/net v0.13.0 // indirect - golang.org/x/oauth2 v0.10.0 + golang.org/x/oauth2 v0.6.0 google.golang.org/grpc v1.55.0 + gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.27.2 - k8s.io/apiextensions-apiserver v0.27.2 - k8s.io/apimachinery v0.27.2 + k8s.io/api v0.26.1 + k8s.io/apiextensions-apiserver v0.26.1 + k8s.io/apimachinery v0.26.1 @@ -133,7 +134,6 @@ require ( - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.30.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/cli-runtime v0.27.2 // indirect - k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f + k8s.io/cli-runtime v0.25.0 // indirect + k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0002-Add-unstacked-etcd-support.patch b/projects/kubernetes-sigs/cluster-api/patches/0002-Add-unstacked-etcd-support.patch index 7964e59a1f..d0dfbfd529 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0002-Add-unstacked-etcd-support.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0002-Add-unstacked-etcd-support.patch @@ -1,4 +1,4 @@ -From 1fd9c28a602af9f49d542471310b520463a6d949 Mon Sep 17 00:00:00 2001 +From 911175166aa2f7388dd340cb837c562a5bfeeeb9 Mon Sep 17 00:00:00 2001 From: Rajashree Mandaogane Date: Mon, 28 Jun 2021 13:44:50 -0700 Subject: [PATCH 02/36] Add unstacked etcd support @@ -80,8 +80,8 @@ commits on the new 1.0.1 branch. This commit adds back the permission. controllers/external/util.go | 10 ++ .../v1beta1/kubeadm_control_plane_webhook.go | 1 + controlplane/kubeadm/config/rbac/role.yaml | 9 ++ - .../internal/controllers/controller.go | 39 +++++ - .../controllers/cluster/cluster_controller.go | 90 ++++++++++- + .../internal/controllers/controller.go | 40 +++++ + .../controllers/cluster/cluster_controller.go | 89 ++++++++++- .../cluster/cluster_controller_phases.go | 108 +++++++++++++ .../cluster/cluster_controller_test.go | 134 ++++++++++++++++ .../machine/machine_controller_noderef.go | 8 + @@ -95,7 +95,7 @@ commits on the new 1.0.1 branch. This commit adds back the permission. 26 files changed, 856 insertions(+), 20 deletions(-) diff --git a/api/v1alpha3/cluster_types.go b/api/v1alpha3/cluster_types.go -index 2421a2796..88f945742 100644 +index 66dd8458a..503de063a 100644 --- a/api/v1alpha3/cluster_types.go +++ b/api/v1alpha3/cluster_types.go @@ -55,6 +55,11 @@ type ClusterSpec struct { @@ -159,7 +159,7 @@ index 3c0b6195e..4120ef162 100644 + EtcdHealthCheckFailedReason = "EtcdMemberHealthCheckFailed" +) diff --git a/api/v1alpha3/machine_types.go b/api/v1alpha3/machine_types.go -index 69b0e1b30..2210bc3ea 100644 +index 9b4fa2a13..5b62c87cf 100644 --- a/api/v1alpha3/machine_types.go +++ b/api/v1alpha3/machine_types.go @@ -30,7 +30,10 @@ const ( @@ -207,10 +207,10 @@ index 254b2874b..00d19fac8 100644 // ANCHOR_END: ClusterStatus diff --git a/api/v1beta1/cluster_types.go b/api/v1beta1/cluster_types.go -index d9ceff05c..9c3d2c919 100644 +index 9a72b5a90..8c345b75d 100644 --- a/api/v1beta1/cluster_types.go +++ b/api/v1beta1/cluster_types.go -@@ -60,6 +60,11 @@ type ClusterSpec struct { +@@ -57,6 +57,11 @@ type ClusterSpec struct { // +optional ControlPlaneRef *corev1.ObjectReference `json:"controlPlaneRef,omitempty"` @@ -222,7 +222,7 @@ index d9ceff05c..9c3d2c919 100644 // InfrastructureRef is a reference to a provider-specific resource that holds the details // for provisioning infrastructure for a cluster in said provider. // +optional -@@ -352,6 +357,15 @@ type ClusterStatus struct { +@@ -349,6 +354,15 @@ type ClusterStatus struct { // ObservedGeneration is the latest generation observed by the controller. // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty"` @@ -239,10 +239,10 @@ index d9ceff05c..9c3d2c919 100644 // ANCHOR_END: ClusterStatus diff --git a/api/v1beta1/condition_consts.go b/api/v1beta1/condition_consts.go -index 7b1a5483b..6499b703b 100644 +index c0c5de162..4182a5db2 100644 --- a/api/v1beta1/condition_consts.go +++ b/api/v1beta1/condition_consts.go -@@ -269,6 +269,22 @@ const ( +@@ -265,6 +265,22 @@ const ( ScalingDownReason = "ScalingDown" ) @@ -266,7 +266,7 @@ index 7b1a5483b..6499b703b 100644 const ( // TopologyReconciledCondition provides evidence about the reconciliation of a Cluster topology into diff --git a/api/v1beta1/machine_types.go b/api/v1beta1/machine_types.go -index ee9597306..2da343ae2 100644 +index 21bfa548f..ee4c40b5a 100644 --- a/api/v1beta1/machine_types.go +++ b/api/v1beta1/machine_types.go @@ -30,6 +30,9 @@ const ( @@ -293,10 +293,10 @@ index edf555b8c..8f9b6e12e 100644 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/internal/cloudinit" ) diff --git a/cmd/clusterctl/client/cluster/mover.go b/cmd/clusterctl/client/cluster/mover.go -index 433651d7d..3ea19a800 100644 +index 6d88b5891..c65e8691a 100644 --- a/cmd/clusterctl/client/cluster/mover.go +++ b/cmd/clusterctl/client/cluster/mover.go -@@ -268,7 +268,8 @@ func (o *objectMover) checkProvisioningCompleted(graph *objectGraph) error { +@@ -263,7 +263,8 @@ func (o *objectMover) checkProvisioningCompleted(graph *objectGraph) error { return err } @@ -307,7 +307,7 @@ index 433651d7d..3ea19a800 100644 } } diff --git a/config/crd/bases/cluster.x-k8s.io_clusters.yaml b/config/crd/bases/cluster.x-k8s.io_clusters.yaml -index a625583fa..3ba047074 100644 +index a696a2256..ec0f3b2db 100644 --- a/config/crd/bases/cluster.x-k8s.io_clusters.yaml +++ b/config/crd/bases/cluster.x-k8s.io_clusters.yaml @@ -169,6 +169,45 @@ spec: @@ -541,10 +541,10 @@ index 896474544..7e0fd392a 100644 + return endpoints, found, nil +} diff --git a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go -index 89eed1776..633a1f7d1 100644 +index 437a7aa99..88293c005 100644 --- a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go +++ b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go -@@ -145,6 +145,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) (admission.War +@@ -144,6 +144,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error { {spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "imageTag"}, {spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "extraArgs"}, {spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "extraArgs", "*"}, @@ -570,19 +570,20 @@ index ec2334e96..5c7e70401 100644 + - update + - watch diff --git a/controlplane/kubeadm/internal/controllers/controller.go b/controlplane/kubeadm/internal/controllers/controller.go -index 73c2ae7b9..ed84db02c 100644 +index 131347515..098de41e6 100644 --- a/controlplane/kubeadm/internal/controllers/controller.go +++ b/controlplane/kubeadm/internal/controllers/controller.go -@@ -19,6 +19,8 @@ package controllers +@@ -19,6 +19,9 @@ package controllers import ( "context" "fmt" + "reflect" + "sort" - "strings" ++ "strings" "time" -@@ -40,6 +42,7 @@ import ( + "github.com/blang/semver" +@@ -40,6 +43,7 @@ import ( clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" @@ -590,7 +591,7 @@ index 73c2ae7b9..ed84db02c 100644 "sigs.k8s.io/cluster-api/controllers/remote" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" -@@ -68,6 +71,7 @@ const ( +@@ -68,6 +72,7 @@ const ( // +kubebuilder:rbac:groups=cluster.x-k8s.io,resources=clusters;clusters/status,verbs=get;list;watch // +kubebuilder:rbac:groups=cluster.x-k8s.io,resources=machines;machines/status,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get;list;watch @@ -598,7 +599,7 @@ index 73c2ae7b9..ed84db02c 100644 // KubeadmControlPlaneReconciler reconciles a KubeadmControlPlane object. type KubeadmControlPlaneReconciler struct { -@@ -175,6 +179,32 @@ func (r *KubeadmControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl. +@@ -173,6 +178,32 @@ func (r *KubeadmControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl. return ctrl.Result{Requeue: true}, nil } @@ -628,38 +629,30 @@ index 73c2ae7b9..ed84db02c 100644 + } + } + - // Add finalizer first if not set to avoid the race condition between init and delete. - // Note: Finalizers in general can only be added when the deletionTimestamp is not set. - if kcp.ObjectMeta.DeletionTimestamp.IsZero() && !controllerutil.ContainsFinalizer(kcp, controlplanev1.KubeadmControlPlaneFinalizer) { -@@ -520,6 +550,15 @@ func (r *KubeadmControlPlaneReconciler) reconcileDelete(ctx context.Context, con - log := ctrl.LoggerFrom(ctx) - log.Info("Reconcile KubeadmControlPlane deletion") + // Add finalizer first if not exist to avoid the race condition between init and delete + if !controllerutil.ContainsFinalizer(kcp, controlplanev1.KubeadmControlPlaneFinalizer) { + controllerutil.AddFinalizer(kcp, controlplanev1.KubeadmControlPlaneFinalizer) +@@ -475,6 +506,15 @@ func (r *KubeadmControlPlaneReconciler) reconcileDelete(ctx context.Context, clu + } + ownedMachines := allMachines.Filter(collections.OwnedMachines(kcp)) -+ if controlPlane.Cluster.Spec.ManagedExternalEtcdRef != nil { -+ for _, machine := range controlPlane.Machines { ++ if cluster.Spec.ManagedExternalEtcdRef != nil { ++ for _, machine := range allMachines { + if util.IsEtcdMachine(machine) { -+ // remove external etcd-only machines from the "Machines" collection so that the controlplane machines don't wait for etcd to be deleted first -+ delete(controlPlane.Machines, machine.Name) ++ // remove external etcd-only machines from the "allMachines" collection so that the controlplane machines don't wait for etcd to be deleted first ++ delete(allMachines, machine.Name) + } + } + } + // If no control plane machines remain, remove the finalizer - if len(controlPlane.Machines) == 0 { - controllerutil.RemoveFinalizer(controlPlane.KCP, controlplanev1.KubeadmControlPlaneFinalizer) + if len(ownedMachines) == 0 { + controllerutil.RemoveFinalizer(kcp, controlplanev1.KubeadmControlPlaneFinalizer) diff --git a/internal/controllers/cluster/cluster_controller.go b/internal/controllers/cluster/cluster_controller.go -index 7654b788a..269007490 100644 +index ae6127537..6e80c6922 100644 --- a/internal/controllers/cluster/cluster_controller.go +++ b/internal/controllers/cluster/cluster_controller.go -@@ -36,6 +36,7 @@ import ( - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/reconcile" -+ "sigs.k8s.io/controller-runtime/pkg/source" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - "sigs.k8s.io/cluster-api/controllers/external" -@@ -59,7 +60,7 @@ const ( +@@ -60,7 +60,7 @@ const ( // +kubebuilder:rbac:groups=core,resources=events,verbs=get;list;watch;create;patch // +kubebuilder:rbac:groups=core,resources=secrets,verbs=get;list;watch;create;patch // +kubebuilder:rbac:groups=core,resources=nodes,verbs=get;list;watch;create;update;patch;delete @@ -668,12 +661,12 @@ index 7654b788a..269007490 100644 // +kubebuilder:rbac:groups=cluster.x-k8s.io,resources=clusters;clusters/status;clusters/finalizers,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get;list;watch -@@ -91,6 +92,15 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt +@@ -91,6 +91,15 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt return errors.Wrap(err, "failed setting up with a controller manager") } + err = c.Watch( -+ source.Kind(mgr.GetCache(), &clusterv1.Machine{}), ++ &source.Kind{Type: &clusterv1.Machine{}}, + handler.EnqueueRequestsFromMapFunc(r.etcdMachineToCluster), + ) + @@ -684,7 +677,7 @@ index 7654b788a..269007490 100644 r.recorder = mgr.GetEventRecorderFor("cluster-controller") r.externalTracker = external.ObjectTracker{ Controller: c, -@@ -164,6 +174,7 @@ func patchCluster(ctx context.Context, patchHelper *patch.Helper, cluster *clust +@@ -162,6 +171,7 @@ func patchCluster(ctx context.Context, patchHelper *patch.Helper, cluster *clust conditions.WithConditions( clusterv1.ControlPlaneReadyCondition, clusterv1.InfrastructureReadyCondition, @@ -692,7 +685,7 @@ index 7654b788a..269007490 100644 ), ) -@@ -175,6 +186,7 @@ func patchCluster(ctx context.Context, patchHelper *patch.Helper, cluster *clust +@@ -173,6 +183,7 @@ func patchCluster(ctx context.Context, patchHelper *patch.Helper, cluster *clust clusterv1.ReadyCondition, clusterv1.ControlPlaneReadyCondition, clusterv1.InfrastructureReadyCondition, @@ -700,7 +693,7 @@ index 7654b788a..269007490 100644 }}, ) return patchHelper.Patch(ctx, cluster, options...) -@@ -197,6 +209,7 @@ func (r *Reconciler) reconcile(ctx context.Context, cluster *clusterv1.Cluster) +@@ -195,6 +206,7 @@ func (r *Reconciler) reconcile(ctx context.Context, cluster *clusterv1.Cluster) r.reconcileControlPlane, r.reconcileKubeconfig, r.reconcileControlPlaneInitialized, @@ -708,7 +701,7 @@ index 7654b788a..269007490 100644 } res := ctrl.Result{} -@@ -302,6 +315,37 @@ func (r *Reconciler) reconcileDelete(ctx context.Context, cluster *clusterv1.Clu +@@ -300,6 +312,37 @@ func (r *Reconciler) reconcileDelete(ctx context.Context, cluster *clusterv1.Clu } } @@ -744,9 +737,9 @@ index 7654b788a..269007490 100644 + } + if cluster.Spec.InfrastructureRef != nil { - obj, err := external.Get(ctx, r.UnstructuredCachingClient, cluster.Spec.InfrastructureRef, cluster.Namespace) + obj, err := external.Get(ctx, r.Client, cluster.Spec.InfrastructureRef, cluster.Namespace) switch { -@@ -344,6 +388,7 @@ type clusterDescendants struct { +@@ -342,6 +385,7 @@ type clusterDescendants struct { controlPlaneMachines clusterv1.MachineList workerMachines clusterv1.MachineList machinePools expv1.MachinePoolList @@ -754,7 +747,7 @@ index 7654b788a..269007490 100644 } // length returns the number of descendants. -@@ -364,6 +409,13 @@ func (c *clusterDescendants) descendantNames() string { +@@ -362,6 +406,13 @@ func (c *clusterDescendants) descendantNames() string { if len(controlPlaneMachineNames) > 0 { descendants = append(descendants, "Control plane machines: "+strings.Join(controlPlaneMachineNames, ",")) } @@ -768,7 +761,7 @@ index 7654b788a..269007490 100644 machineDeploymentNames := make([]string, len(c.machineDeployments.Items)) for i, machineDeployment := range c.machineDeployments.Items { machineDeploymentNames[i] = machineDeployment.Name -@@ -427,7 +479,8 @@ func (r *Reconciler) listDescendants(ctx context.Context, cluster *clusterv1.Clu +@@ -425,7 +476,8 @@ func (r *Reconciler) listDescendants(ctx context.Context, cluster *clusterv1.Clu // Split machines into control plane and worker machines so we make sure we delete control plane machines last machineCollection := collections.FromMachineList(&machines) controlPlaneMachines := machineCollection.Filter(collections.ControlPlaneMachines(cluster.Name)) @@ -778,7 +771,7 @@ index 7654b788a..269007490 100644 descendants.workerMachines = collections.ToMachineList(workerMachines) // Only count control plane machines as descendants if there is no control plane provider. if cluster.Spec.ControlPlaneRef == nil { -@@ -461,6 +514,9 @@ func (c clusterDescendants) filterOwnedDescendants(cluster *clusterv1.Cluster) ( +@@ -459,6 +511,9 @@ func (c clusterDescendants) filterOwnedDescendants(cluster *clusterv1.Cluster) ( &c.workerMachines, &c.controlPlaneMachines, } @@ -788,14 +781,14 @@ index 7654b788a..269007490 100644 if feature.Gates.Enabled(feature.MachinePool) { lists = append([]client.ObjectList{&c.machinePools}, lists...) } -@@ -536,3 +592,33 @@ func (r *Reconciler) controlPlaneMachineToCluster(ctx context.Context, o client. +@@ -534,3 +589,33 @@ func (r *Reconciler) controlPlaneMachineToCluster(o client.Object) []ctrl.Reques NamespacedName: util.ObjectKey(cluster), }} } + +// etcdMachineToCluster is a handler.ToRequestsFunc to be used to enqueue requests for reconciliation +// for Cluster to update its status.ManagedExternalEtcdInitialized field -+func (r *Reconciler) etcdMachineToCluster(ctx context.Context, o client.Object) []ctrl.Request { ++func (r *Reconciler) etcdMachineToCluster(o client.Object) []ctrl.Request { + m, ok := o.(*clusterv1.Machine) + if !ok { + panic(fmt.Sprintf("Expected a Machine but got a %T", o)) @@ -823,7 +816,7 @@ index 7654b788a..269007490 100644 + }} +} diff --git a/internal/controllers/cluster/cluster_controller_phases.go b/internal/controllers/cluster/cluster_controller_phases.go -index 4266a212d..590967dd6 100644 +index 8e1501901..9572a8ebd 100644 --- a/internal/controllers/cluster/cluster_controller_phases.go +++ b/internal/controllers/cluster/cluster_controller_phases.go @@ -19,6 +19,8 @@ package cluster @@ -956,10 +949,10 @@ index 4266a212d..590967dd6 100644 log := ctrl.LoggerFrom(ctx) diff --git a/internal/controllers/cluster/cluster_controller_test.go b/internal/controllers/cluster/cluster_controller_test.go -index 5d5ec9ed7..d5bcc106e 100644 +index 2b5721693..9d13518f7 100644 --- a/internal/controllers/cluster/cluster_controller_test.go +++ b/internal/controllers/cluster/cluster_controller_test.go -@@ -537,6 +537,125 @@ func TestClusterReconcilerNodeRef(t *testing.T) { +@@ -534,6 +534,125 @@ func TestClusterReconcilerNodeRef(t *testing.T) { }) } @@ -1074,7 +1067,7 @@ index 5d5ec9ed7..d5bcc106e 100644 + Client: fake.NewClientBuilder().WithObjects(clusterEtcdNotInitialized, clusterEtcdInitialized, etcdMachineNoAddress, etcdMachineWithAddress, etcdMachineNoAddressForInitializedCluster).Build(), + } + -+ requests := r.etcdMachineToCluster(ctx, tt.o) ++ requests := r.etcdMachineToCluster(tt.o) + g.Expect(requests).To(Equal(tt.want)) + }) + } @@ -1085,7 +1078,7 @@ index 5d5ec9ed7..d5bcc106e 100644 type machineDeploymentBuilder struct { md clusterv1.MachineDeployment } -@@ -616,6 +735,11 @@ func (b *machineBuilder) controlPlane() *machineBuilder { +@@ -613,6 +732,11 @@ func (b *machineBuilder) controlPlane() *machineBuilder { return b } @@ -1097,7 +1090,7 @@ index 5d5ec9ed7..d5bcc106e 100644 func (b *machineBuilder) build() clusterv1.Machine { return b.m } -@@ -682,6 +806,9 @@ func TestFilterOwnedDescendants(t *testing.T) { +@@ -679,6 +803,9 @@ func TestFilterOwnedDescendants(t *testing.T) { mp3NotOwnedByCluster := newMachinePoolBuilder().named("mp3").build() mp4OwnedByCluster := newMachinePoolBuilder().named("mp4").ownedBy(&c).build() @@ -1107,7 +1100,7 @@ index 5d5ec9ed7..d5bcc106e 100644 d := clusterDescendants{ machineDeployments: clusterv1.MachineDeploymentList{ Items: []clusterv1.MachineDeployment{ -@@ -721,6 +848,12 @@ func TestFilterOwnedDescendants(t *testing.T) { +@@ -718,6 +845,12 @@ func TestFilterOwnedDescendants(t *testing.T) { mp4OwnedByCluster, }, }, @@ -1120,7 +1113,7 @@ index 5d5ec9ed7..d5bcc106e 100644 } actual, err := d.filterOwnedDescendants(&c) -@@ -737,6 +870,7 @@ func TestFilterOwnedDescendants(t *testing.T) { +@@ -734,6 +867,7 @@ func TestFilterOwnedDescendants(t *testing.T) { &m5OwnedByCluster, &m3ControlPlaneOwnedByCluster, &m6ControlPlaneOwnedByCluster, @@ -1129,10 +1122,10 @@ index 5d5ec9ed7..d5bcc106e 100644 g.Expect(actual).To(Equal(expected)) diff --git a/internal/controllers/machine/machine_controller_noderef.go b/internal/controllers/machine/machine_controller_noderef.go -index 7f32c72c4..e6a9374f6 100644 +index 2df5c4da4..6e6b4b677 100644 --- a/internal/controllers/machine/machine_controller_noderef.go +++ b/internal/controllers/machine/machine_controller_noderef.go -@@ -53,6 +53,14 @@ func (r *Reconciler) reconcileNode(ctx context.Context, s *scope) (ctrl.Result, +@@ -49,6 +49,14 @@ func (r *Reconciler) reconcileNode(ctx context.Context, cluster *clusterv1.Clust return ctrl.Result{}, err } @@ -1148,10 +1141,10 @@ index 7f32c72c4..e6a9374f6 100644 if machine.Spec.ProviderID == nil || *machine.Spec.ProviderID == "" { log.Info("Waiting for infrastructure provider to report spec.providerID", machine.Spec.InfrastructureRef.Kind, klog.KRef(machine.Spec.InfrastructureRef.Namespace, machine.Spec.InfrastructureRef.Name)) diff --git a/internal/controllers/machine/machine_controller_noderef_test.go b/internal/controllers/machine/machine_controller_noderef_test.go -index 0bcaaa1d0..f3586efa5 100644 +index d1e35459f..540521c38 100644 --- a/internal/controllers/machine/machine_controller_noderef_test.go +++ b/internal/controllers/machine/machine_controller_noderef_test.go -@@ -35,6 +35,7 @@ import ( +@@ -33,6 +33,7 @@ import ( clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/util" @@ -1159,7 +1152,7 @@ index 0bcaaa1d0..f3586efa5 100644 "sigs.k8s.io/cluster-api/util/kubeconfig" ) -@@ -770,3 +771,45 @@ func TestPatchNode(t *testing.T) { +@@ -721,3 +722,45 @@ func TestPatchNode(t *testing.T) { }) } } @@ -1206,7 +1199,7 @@ index 0bcaaa1d0..f3586efa5 100644 + } +} diff --git a/internal/controllers/machine/machine_controller_phases.go b/internal/controllers/machine/machine_controller_phases.go -index 5e34f8904..8eae496e0 100644 +index 83c493afc..03806a1b7 100644 --- a/internal/controllers/machine/machine_controller_phases.go +++ b/internal/controllers/machine/machine_controller_phases.go @@ -19,6 +19,7 @@ package machine @@ -1231,7 +1224,7 @@ index 5e34f8904..8eae496e0 100644 // Set the phase to "failed" if any of Status.FailureReason or Status.FailureMessage is not-nil. if m.Status.FailureReason != nil || m.Status.FailureMessage != nil { m.Status.SetTypedPhase(clusterv1.MachinePhaseFailed) -@@ -307,6 +315,113 @@ func (r *Reconciler) reconcileInfrastructure(ctx context.Context, s *scope) (ctr +@@ -301,6 +309,113 @@ func (r *Reconciler) reconcileInfrastructure(ctx context.Context, cluster *clust return ctrl.Result{}, errors.Wrapf(err, "failed to retrieve addresses from infrastructure provider for Machine %q in namespace %q", m.Name, m.Namespace) } @@ -1346,10 +1339,10 @@ index 5e34f8904..8eae496e0 100644 var failureDomain string err = util.UnstructuredUnmarshalField(infraConfig, &failureDomain, "spec", "failureDomain") diff --git a/test/infrastructure/docker/internal/controllers/dockermachine_controller.go b/test/infrastructure/docker/internal/controllers/dockermachine_controller.go -index 8936020eb..5905e95f2 100644 +index 9991b03d1..decaafda4 100644 --- a/test/infrastructure/docker/internal/controllers/dockermachine_controller.go +++ b/test/infrastructure/docker/internal/controllers/dockermachine_controller.go -@@ -363,23 +363,27 @@ func (r *DockerMachineReconciler) reconcileNormal(ctx context.Context, cluster * +@@ -360,23 +360,27 @@ func (r *DockerMachineReconciler) reconcileNormal(ctx context.Context, cluster * // set to true after a control plane machine has a node ref. If we would requeue here in this case, the // Machine will never get a node ref as ProviderID is required to set the node ref, so we would get a deadlock. if cluster.Spec.ControlPlaneRef != nil && @@ -1366,7 +1359,7 @@ index 8936020eb..5905e95f2 100644 - if err != nil { - return ctrl.Result{}, errors.Wrap(err, "failed to generate workload cluster client") - } -- if err := externalMachine.CloudProviderNodePatch(ctx, remoteClient, dockerMachine); err != nil { +- if err := externalMachine.SetNodeProviderID(ctx, remoteClient); err != nil { - if errors.As(err, &docker.ContainerNotRunningError{}) { - return ctrl.Result{}, errors.Wrap(err, "failed to patch the Kubernetes node with the machine providerID") + // In case of an etcd cluster, there is no concept of kubernetes node. So we can generate the node Provider ID and set it on machine spec directly @@ -1378,7 +1371,7 @@ index 8936020eb..5905e95f2 100644 + if err != nil { + return ctrl.Result{}, errors.Wrap(err, "failed to generate workload cluster client") + } -+ if err := externalMachine.CloudProviderNodePatch(ctx, remoteClient, dockerMachine); err != nil { ++ if err := externalMachine.SetNodeProviderID(ctx, remoteClient); err != nil { + if errors.As(err, &docker.ContainerNotRunningError{}) { + return ctrl.Result{}, errors.Wrap(err, "failed to patch the Kubernetes node with the machine providerID") + } @@ -1390,8 +1383,8 @@ index 8936020eb..5905e95f2 100644 } // Set ProviderID so the Cluster API Machine Controller can pull it providerID := externalMachine.ProviderID() -@@ -535,3 +539,8 @@ func setMachineAddress(ctx context.Context, dockerMachine *infrav1.DockerMachine - +@@ -530,3 +534,8 @@ func setMachineAddress(ctx context.Context, dockerMachine *infrav1.DockerMachine + } return nil } + @@ -1444,10 +1437,10 @@ index d85661012..009071cd8 100644 func MatchesKubernetesVersion(kubernetesVersion string) Func { return func(machine *clusterv1.Machine) bool { diff --git a/util/secret/certificates.go b/util/secret/certificates.go -index 7e9d211dc..60f37ced3 100644 +index 14857be01..3002591ae 100644 --- a/util/secret/certificates.go +++ b/util/secret/certificates.go -@@ -427,6 +427,9 @@ func (c Certificates) AsFiles() []bootstrapv1.File { +@@ -387,6 +387,9 @@ func (c Certificates) AsFiles() []bootstrapv1.File { if serviceAccountKey := c.GetByPurpose(ServiceAccount); serviceAccountKey != nil { certFiles = append(certFiles, serviceAccountKey.AsFiles()...) } @@ -1471,7 +1464,7 @@ index d50062da3..043764325 100644 var ( diff --git a/util/util.go b/util/util.go -index 93267f160..a85a7a11d 100644 +index e6737ab7a..00da78f90 100644 --- a/util/util.go +++ b/util/util.go @@ -146,6 +146,12 @@ func IsNodeReady(node *corev1.Node) bool { @@ -1488,5 +1481,5 @@ index 93267f160..a85a7a11d 100644 func GetClusterFromMetadata(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*clusterv1.Cluster, error) { if obj.Labels[clusterv1.ClusterNameLabel] == "" { -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0003-Unstacked-etcd-and-controlplane-upgrade.patch b/projects/kubernetes-sigs/cluster-api/patches/0003-Unstacked-etcd-and-controlplane-upgrade.patch index 72be42920a..e4f3188e8e 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0003-Unstacked-etcd-and-controlplane-upgrade.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0003-Unstacked-etcd-and-controlplane-upgrade.patch @@ -1,4 +1,4 @@ -From 97ce4360ab41418520cd442cc90cc53e05a1d6f3 Mon Sep 17 00:00:00 2001 +From 3094feac635239c5d81d21377334103d13486420 Mon Sep 17 00:00:00 2001 From: Rajashree Mandaogane Date: Fri, 6 Aug 2021 17:16:39 -0700 Subject: [PATCH 03/36] Unstacked etcd and controlplane upgrade @@ -44,7 +44,7 @@ ready. We make this behavior opt-out to maintain compatibility with previous clients that expect this orchestration by default. --- api/v1alpha3/common_types.go | 3 + - api/v1beta1/common_types.go | 7 + + api/v1beta1/common_types.go | 8 + controllers/external/util.go | 29 ++ .../kubeadm/api/v1alpha3/condition_consts.go | 8 + .../kubeadm/api/v1beta1/condition_consts.go | 8 + @@ -56,11 +56,10 @@ previous clients that expect this orchestration by default. .../controllers/cluster/cluster_controller.go | 2 +- .../cluster/cluster_controller_phases.go | 104 +++---- .../cluster/cluster_controller_test.go | 265 +++++++++++++++++- - .../machine_controller_noderef_test.go | 6 +- internal/test/builder/builders.go | 10 + internal/test/builder/etcd.go | 80 ++++++ util/annotations/helpers.go | 5 + - 17 files changed, 795 insertions(+), 73 deletions(-) + 16 files changed, 791 insertions(+), 72 deletions(-) create mode 100644 internal/test/builder/etcd.go diff --git a/api/v1alpha3/common_types.go b/api/v1alpha3/common_types.go @@ -78,10 +77,10 @@ index 58ef4a74e..1c7d411bd 100644 // MachineAddressType describes a valid MachineAddress type. diff --git a/api/v1beta1/common_types.go b/api/v1beta1/common_types.go -index 6edc7e5be..0bf8f5578 100644 +index 947ce108c..d170e41ca 100644 --- a/api/v1beta1/common_types.go +++ b/api/v1beta1/common_types.go -@@ -154,6 +154,9 @@ const ( +@@ -142,6 +142,9 @@ const ( // will receive the resulting object. TopologyDryRunAnnotation = "topology.cluster.x-k8s.io/dry-run" @@ -91,17 +90,18 @@ index 6edc7e5be..0bf8f5578 100644 // ReplicasManagedByAnnotation is an annotation that indicates external (non-Cluster API) management of infra scaling. // The practical effect of this is that the capi "replica" count should be passively derived from the number of observed infra machines, // instead of being a source of truth for eventual consistency. -@@ -183,6 +186,10 @@ const ( +@@ -151,6 +154,11 @@ const ( // VariableDefinitionFromInline indicates a patch or variable was defined in the `.spec` of a ClusterClass // rather than from an external patch extension. VariableDefinitionFromInline = "inline" + ++ + // SkipControlPlanePauseManagedEtcdAnnotation indicates that the cluster controller should not pause or unpause + // the control plane after the managed etcd cluster becomes not-ready/ready. + SkipControlPlanePauseManagedEtcdAnnotation = "cluster.x-k8s.io/skip-pause-cp-managed-etcd" ) - // MachineSetPreflightCheck defines a valid MachineSet preflight check. + // NodeUninitializedTaint can be added to Nodes at creation by the bootstrap provider, e.g. the diff --git a/controllers/external/util.go b/controllers/external/util.go index 7e0fd392a..5b6443c78 100644 --- a/controllers/external/util.go @@ -178,7 +178,7 @@ index e9870d34c..adc1b2a0a 100644 const ( diff --git a/controlplane/kubeadm/internal/controllers/controller.go b/controlplane/kubeadm/internal/controllers/controller.go -index ed84db02c..df63ef602 100644 +index 098de41e6..0a3557b28 100644 --- a/controlplane/kubeadm/internal/controllers/controller.go +++ b/controlplane/kubeadm/internal/controllers/controller.go @@ -25,6 +25,7 @@ import ( @@ -189,7 +189,7 @@ index ed84db02c..df63ef602 100644 "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" -@@ -180,28 +181,12 @@ func (r *KubeadmControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl. +@@ -179,28 +180,12 @@ func (r *KubeadmControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl. } if cluster.Spec.ManagedExternalEtcdRef != nil { @@ -221,8 +221,8 @@ index ed84db02c..df63ef602 100644 } } -@@ -340,6 +325,80 @@ func (r *KubeadmControlPlaneReconciler) initControlPlaneScope(ctx context.Contex - return controlPlane, false, nil +@@ -281,6 +266,80 @@ func (r *KubeadmControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl. + return res, err } +func (r *KubeadmControlPlaneReconciler) updateManagedExternalEtcdEndpoints( @@ -302,7 +302,7 @@ index ed84db02c..df63ef602 100644 func patchKubeadmControlPlane(ctx context.Context, patchHelper *patch.Helper, kcp *controlplanev1.KubeadmControlPlane) error { // Always update the readyCondition by summarizing the state of other conditions. conditions.SetSummary(kcp, -@@ -449,6 +508,25 @@ func (r *KubeadmControlPlaneReconciler) reconcile(ctx context.Context, controlPl +@@ -424,6 +483,25 @@ func (r *KubeadmControlPlaneReconciler) reconcile(ctx context.Context, cluster * // NOTE: we are checking the condition already exists in order to avoid to set this condition at the first // reconciliation/before a rolling upgrade actually starts. if conditions.Has(controlPlane.KCP, controlplanev1.MachinesSpecUpToDateCondition) { @@ -310,9 +310,9 @@ index ed84db02c..df63ef602 100644 + /* Once KCP upgrade has completed, the controller will annotate the external etcd object to indicate that the older KCP machines + are no longer part of the cluster, and so any older out-of-date etcd members and machines can be deleted + */ -+ if controlPlane.Cluster.Spec.ManagedExternalEtcdRef != nil { -+ etcdRef := controlPlane.Cluster.Spec.ManagedExternalEtcdRef -+ externalEtcd, err := external.Get(ctx, r.Client, etcdRef, controlPlane.Cluster.Namespace) ++ if cluster.Spec.ManagedExternalEtcdRef != nil { ++ etcdRef := cluster.Spec.ManagedExternalEtcdRef ++ externalEtcd, err := external.Get(ctx, r.Client, etcdRef, cluster.Namespace) + if err != nil { + return ctrl.Result{}, err + } @@ -329,7 +329,7 @@ index ed84db02c..df63ef602 100644 } } diff --git a/controlplane/kubeadm/internal/controllers/controller_test.go b/controlplane/kubeadm/internal/controllers/controller_test.go -index 606e30d1c..37720ef1d 100644 +index 70b15b95b..315b6050b 100644 --- a/controlplane/kubeadm/internal/controllers/controller_test.go +++ b/controlplane/kubeadm/internal/controllers/controller_test.go @@ -24,6 +24,7 @@ import ( @@ -358,7 +358,7 @@ index 606e30d1c..37720ef1d 100644 }, } -@@ -2252,6 +2255,210 @@ func TestKubeadmControlPlaneReconciler_reconcileDelete(t *testing.T) { +@@ -2187,6 +2190,210 @@ func TestKubeadmControlPlaneReconciler_reconcileDelete(t *testing.T) { }) } @@ -570,21 +570,21 @@ index 606e30d1c..37720ef1d 100644 func newFakeClient(initObjs ...client.Object) client.Client { diff --git a/controlplane/kubeadm/internal/controllers/upgrade.go b/controlplane/kubeadm/internal/controllers/upgrade.go -index b1528283d..200a27174 100644 +index a3c0a6f8e..cde7f6ba0 100644 --- a/controlplane/kubeadm/internal/controllers/upgrade.go +++ b/controlplane/kubeadm/internal/controllers/upgrade.go -@@ -99,6 +99,12 @@ func (r *KubeadmControlPlaneReconciler) upgradeControlPlane( +@@ -102,6 +102,12 @@ func (r *KubeadmControlPlaneReconciler) upgradeControlPlane( } } -+ if controlPlane.KCP.Spec.KubeadmConfigSpec.ClusterConfiguration != nil && controlPlane.KCP.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External != nil { -+ if err := workloadCluster.UpdateExternalEtcdEndpointsInKubeadmConfigMap(ctx, controlPlane.KCP.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External.Endpoints, parsedVersion); err != nil { ++ if kcp.Spec.KubeadmConfigSpec.ClusterConfiguration != nil && kcp.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External != nil { ++ if err := workloadCluster.UpdateExternalEtcdEndpointsInKubeadmConfigMap(ctx, kcp.Spec.KubeadmConfigSpec.ClusterConfiguration.Etcd.External.Endpoints, parsedVersion); err != nil { + return ctrl.Result{}, errors.Wrap(err, "failed to update the external etcd endpoints in the kubeadm config map") + } + } + - if controlPlane.KCP.Spec.KubeadmConfigSpec.ClusterConfiguration != nil { - if err := workloadCluster.UpdateAPIServerInKubeadmConfigMap(ctx, controlPlane.KCP.Spec.KubeadmConfigSpec.ClusterConfiguration.APIServer, parsedVersion); err != nil { + if kcp.Spec.KubeadmConfigSpec.ClusterConfiguration != nil { + if err := workloadCluster.UpdateAPIServerInKubeadmConfigMap(ctx, kcp.Spec.KubeadmConfigSpec.ClusterConfiguration.APIServer, parsedVersion); err != nil { return ctrl.Result{}, errors.Wrap(err, "failed to update api server in the kubeadm config map") diff --git a/controlplane/kubeadm/internal/workload_cluster.go b/controlplane/kubeadm/internal/workload_cluster.go index 4112106f5..329ae81b1 100644 @@ -626,10 +626,10 @@ index 3b3662a29..6c814656e 100644 // Removing the last remaining member of the cluster is not supported. func (w *Workload) RemoveEtcdMemberForMachine(ctx context.Context, machine *clusterv1.Machine) error { diff --git a/internal/controllers/cluster/cluster_controller.go b/internal/controllers/cluster/cluster_controller.go -index 269007490..b41895e51 100644 +index 6e80c6922..af23d897d 100644 --- a/internal/controllers/cluster/cluster_controller.go +++ b/internal/controllers/cluster/cluster_controller.go -@@ -206,10 +206,10 @@ func (r *Reconciler) reconcile(ctx context.Context, cluster *clusterv1.Cluster) +@@ -203,10 +203,10 @@ func (r *Reconciler) reconcile(ctx context.Context, cluster *clusterv1.Cluster) phases := []func(context.Context, *clusterv1.Cluster) (ctrl.Result, error){ r.reconcileInfrastructure, @@ -642,7 +642,7 @@ index 269007490..b41895e51 100644 res := ctrl.Result{} diff --git a/internal/controllers/cluster/cluster_controller_phases.go b/internal/controllers/cluster/cluster_controller_phases.go -index 590967dd6..cb6e878e8 100644 +index 9572a8ebd..60baf7024 100644 --- a/internal/controllers/cluster/cluster_controller_phases.go +++ b/internal/controllers/cluster/cluster_controller_phases.go @@ -19,13 +19,13 @@ package cluster @@ -785,7 +785,7 @@ index 590967dd6..cb6e878e8 100644 conditions.SetMirror(cluster, clusterv1.ManagedExternalEtcdClusterReadyCondition, conditions.UnstructuredGetter(etcdPlaneConfig), diff --git a/internal/controllers/cluster/cluster_controller_test.go b/internal/controllers/cluster/cluster_controller_test.go -index d5bcc106e..cd9b5788d 100644 +index 9d13518f7..e9d8fd160 100644 --- a/internal/controllers/cluster/cluster_controller_test.go +++ b/internal/controllers/cluster/cluster_controller_test.go @@ -18,16 +18,21 @@ package cluster @@ -818,7 +818,7 @@ index d5bcc106e..cd9b5788d 100644 "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" ) -@@ -653,7 +659,6 @@ func TestClusterReconcilerEtcdMachineToCluster(t *testing.T) { +@@ -650,7 +656,6 @@ func TestClusterReconcilerEtcdMachineToCluster(t *testing.T) { }) } }) @@ -826,7 +826,7 @@ index d5bcc106e..cd9b5788d 100644 } type machineDeploymentBuilder struct { -@@ -782,6 +787,11 @@ func TestFilterOwnedDescendants(t *testing.T) { +@@ -779,6 +784,11 @@ func TestFilterOwnedDescendants(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "c", }, @@ -838,7 +838,7 @@ index d5bcc106e..cd9b5788d 100644 } md1NotOwnedByCluster := newMachineDeploymentBuilder().named("md1").build() -@@ -873,7 +883,7 @@ func TestFilterOwnedDescendants(t *testing.T) { +@@ -870,7 +880,7 @@ func TestFilterOwnedDescendants(t *testing.T) { &me1EtcdOwnedByCluster, } @@ -847,8 +847,8 @@ index d5bcc106e..cd9b5788d 100644 } func TestDescendantsLength(t *testing.T) { -@@ -942,3 +952,254 @@ func TestReconcileControlPlaneInitializedControlPlaneRef(t *testing.T) { - g.Expect(err).ToNot(HaveOccurred()) +@@ -939,3 +949,254 @@ func TestReconcileControlPlaneInitializedControlPlaneRef(t *testing.T) { + g.Expect(err).NotTo(HaveOccurred()) g.Expect(conditions.Has(c, clusterv1.ControlPlaneInitializedCondition)).To(BeFalse()) } + @@ -1102,24 +1102,6 @@ index d5bcc106e..cd9b5788d 100644 + g.Expect(err).NotTo(HaveOccurred()) + }) +} -diff --git a/internal/controllers/machine/machine_controller_noderef_test.go b/internal/controllers/machine/machine_controller_noderef_test.go -index f3586efa5..465b837a3 100644 ---- a/internal/controllers/machine/machine_controller_noderef_test.go -+++ b/internal/controllers/machine/machine_controller_noderef_test.go -@@ -807,8 +807,12 @@ func TestReconcileNodeForEtcdMachines(t *testing.T) { - t.Run(tc.name, func(t *testing.T) { - g := NewWithT(t) - r := Reconciler{Client: env} -+ s := &scope{ -+ cluster: &clusterv1.Cluster{}, -+ machine: tc.machine, -+ } - -- g.Expect(r.reconcileNode(ctx, &clusterv1.Cluster{}, tc.machine)).To(Equal(ctrl.Result{})) -+ g.Expect(r.reconcileNode(ctx, s)).To(Equal(ctrl.Result{})) - g.Expect(conditions.Get(tc.machine, clusterv1.MachineNodeHealthyCondition)).To(BeNil()) - }) - } diff --git a/internal/test/builder/builders.go b/internal/test/builder/builders.go index 49f1b3ea3..a215d515b 100644 --- a/internal/test/builder/builders.go @@ -1258,5 +1240,5 @@ index 47dc7fc6b..e611502ae 100644 func hasAnnotation(o metav1.Object, annotation string) bool { annotations := o.GetAnnotations() -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0004-Patch-config-path-in-kubevip-manifest-for-kubeadm-co.patch b/projects/kubernetes-sigs/cluster-api/patches/0004-Patch-config-path-in-kubevip-manifest-for-kubeadm-co.patch index 53aac64938..55a7f8f5fe 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0004-Patch-config-path-in-kubevip-manifest-for-kubeadm-co.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0004-Patch-config-path-in-kubevip-manifest-for-kubeadm-co.patch @@ -1,4 +1,4 @@ -From 2d4381a10806cfbb162087902c154490d70ef5d2 Mon Sep 17 00:00:00 2001 +From 9aae1d45c739458c492a91a63e3c66a260eb8de0 Mon Sep 17 00:00:00 2001 From: Guillermo Gaston Date: Thu, 19 Aug 2021 21:52:52 +0000 Subject: [PATCH 04/36] Patch config path in kubevip manifest for kubeadm @@ -27,5 +27,5 @@ index b93e1164b..aecbda8f4 100644 if err != nil { return nil, errors.Wrapf(err, "failed to generate user data for machine joining control plane") -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0005-Make-pause-and-bottlerocket-bootstrap-images-updatab.patch b/projects/kubernetes-sigs/cluster-api/patches/0005-Make-pause-and-bottlerocket-bootstrap-images-updatab.patch index 1c8b4c0f47..b9bdabb09f 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0005-Make-pause-and-bottlerocket-bootstrap-images-updatab.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0005-Make-pause-and-bottlerocket-bootstrap-images-updatab.patch @@ -1,4 +1,4 @@ -From 42fab735e575e90e5cfe7964225c7152370bafde Mon Sep 17 00:00:00 2001 +From afb41ed7f1590eeb3726614e31ddecc25acf97e3 Mon Sep 17 00:00:00 2001 From: Guillermo Gaston Date: Tue, 31 Aug 2021 15:56:28 +0000 Subject: [PATCH 05/36] Make pause and bottlerocket bootstrap images updatable @@ -11,10 +11,10 @@ cr: https://code.amazon.com/reviews/CR-56335855 2 files changed, 41 insertions(+) diff --git a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go -index 633a1f7d1..3d2e056ea 100644 +index 88293c005..15b2301e3 100644 --- a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go +++ b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go -@@ -141,6 +141,8 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) (admission.War +@@ -140,6 +140,8 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error { allowedPaths := [][]string{ {"metadata", "*"}, {spec, kubeadmConfigSpec, "useExperimentalRetryJoin"}, @@ -23,7 +23,7 @@ index 633a1f7d1..3d2e056ea 100644 {spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "imageRepository"}, {spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "imageTag"}, {spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "extraArgs"}, -@@ -163,6 +165,8 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) (admission.War +@@ -162,6 +164,8 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error { {spec, kubeadmConfigSpec, joinConfiguration, nodeRegistration, "*"}, {spec, kubeadmConfigSpec, joinConfiguration, patches, directory}, {spec, kubeadmConfigSpec, joinConfiguration, skipPhases}, @@ -33,10 +33,10 @@ index 633a1f7d1..3d2e056ea 100644 {spec, kubeadmConfigSpec, postKubeadmCommands}, {spec, kubeadmConfigSpec, files}, diff --git a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go -index b5d678d89..38946192d 100644 +index a1d85d452..3eaa8e8f0 100644 --- a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go +++ b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go -@@ -649,6 +649,18 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { +@@ -647,6 +647,18 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { Directory: "/tmp/patches", } @@ -55,7 +55,7 @@ index b5d678d89..38946192d 100644 updateInitConfigurationSkipPhases := before.DeepCopy() updateInitConfigurationSkipPhases.Spec.KubeadmConfigSpec.InitConfiguration.SkipPhases = []string{"addon/kube-proxy"} -@@ -1027,6 +1039,30 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { +@@ -1025,6 +1037,30 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { before: beforeUseExperimentalRetryJoin, kcp: updateUseExperimentalRetryJoin, }, @@ -86,7 +86,7 @@ index b5d678d89..38946192d 100644 } for _, tt := range tests { -@@ -1206,6 +1242,7 @@ func TestValidateVersion(t *testing.T) { +@@ -1203,6 +1239,7 @@ func TestValidateVersion(t *testing.T) { }) } } @@ -95,5 +95,5 @@ index b5d678d89..38946192d 100644 before := &KubeadmControlPlane{ ObjectMeta: metav1.ObjectMeta{ -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0006-add-support-for-registry-mirror-for-bottlerocket.patch b/projects/kubernetes-sigs/cluster-api/patches/0006-add-support-for-registry-mirror-for-bottlerocket.patch index eb9d3d08d8..0b6210c099 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0006-add-support-for-registry-mirror-for-bottlerocket.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0006-add-support-for-registry-mirror-for-bottlerocket.patch @@ -1,4 +1,4 @@ -From 29fdd123bbd6fca4ce09b014526a771ae3b4cec7 Mon Sep 17 00:00:00 2001 +From 262ce54c2232d192c22995ccb7adfdeed7323116 Mon Sep 17 00:00:00 2001 From: Abhinav Pandey Date: Tue, 21 Sep 2021 08:57:56 -0700 Subject: [PATCH 06/36] add support for registry mirror for bottlerocket @@ -1076,7 +1076,7 @@ index 11aa737a7..9676d26a8 100644 // When used in the context of control plane nodes, NodeRegistration should remain consistent // across both InitConfiguration and JoinConfiguration diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml -index c95422c6b..9efeed257 100644 +index c9a3c1cea..15413b5dc 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -349,6 +349,18 @@ spec: @@ -1156,7 +1156,7 @@ index c95422c6b..9efeed257 100644 description: SkipPhases is a list of phases to skip during command execution. The list of phases can be obtained with the "kubeadm diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml -index 983e3788a..541668cc0 100644 +index 348bc8362..b4f286dd6 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -373,6 +373,19 @@ spec: @@ -1328,10 +1328,10 @@ index d35016276..f127ec4f1 100644 bottlerocketNodeUserData, err := generateNodeUserData("InitBottlerocketNode", bottlerocketNodeInitSettingsTemplate, bottlerocketInput) diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index 9dc3d19c1..e9bdf5205 100644 +index ab0dd4391..4fd2eae4c 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -478,6 +478,9 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -468,6 +468,9 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex if scope.Config.Spec.ClusterConfiguration.Proxy.HTTPSProxy != "" { bottlerocketConfig.ProxyConfiguration = scope.Config.Spec.ClusterConfiguration.Proxy } @@ -1341,7 +1341,7 @@ index 9dc3d19c1..e9bdf5205 100644 } clusterdata, err := kubeadmtypes.MarshalClusterConfigurationForVersion(scope.Config.Spec.ClusterConfiguration, parsedVersion) -@@ -673,6 +676,9 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) +@@ -660,6 +663,9 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) if scope.Config.Spec.JoinConfiguration.Proxy.HTTPSProxy != "" { bottlerocketConfig.ProxyConfiguration = scope.Config.Spec.JoinConfiguration.Proxy } @@ -1351,7 +1351,7 @@ index 9dc3d19c1..e9bdf5205 100644 bootstrapJoinData, err = bottlerocket.NewNode(nodeInput, bottlerocketConfig) if err != nil { scope.Error(err, "Failed to create a worker bottlerocket join configuration") -@@ -790,6 +796,9 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S +@@ -776,6 +782,9 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S if scope.Config.Spec.JoinConfiguration.Proxy.HTTPSProxy != "" { bottlerocketConfig.ProxyConfiguration = scope.Config.Spec.JoinConfiguration.Proxy } @@ -1445,7 +1445,7 @@ index e924a4a4b..71e769f0f 100644 + return out +} diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml -index 5b20fb215..181e8022f 100644 +index f7418dfa5..a552a9b25 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -433,6 +433,19 @@ spec: @@ -1529,7 +1529,7 @@ index 5b20fb215..181e8022f 100644 description: SkipPhases is a list of phases to skip during command execution. The list of phases can be obtained with diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml -index 68484236f..f53cb9179 100644 +index 5a1623e9f..5410d4145 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -1587,6 +1587,19 @@ spec: @@ -1573,5 +1573,5 @@ index 68484236f..f53cb9179 100644 description: SkipPhases is a list of phases to skip during command execution. The list of phases can -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0007-Fix-proxy-template-for-bottlerocket-bootstrap.patch b/projects/kubernetes-sigs/cluster-api/patches/0007-Fix-proxy-template-for-bottlerocket-bootstrap.patch index e5c38e9f4e..71a81110ac 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0007-Fix-proxy-template-for-bottlerocket-bootstrap.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0007-Fix-proxy-template-for-bottlerocket-bootstrap.patch @@ -1,4 +1,4 @@ -From c0c0fd9f1c09e9db8dd4c47198292534676aebb1 Mon Sep 17 00:00:00 2001 +From 529f8706815252f24e4d7865e58e492c9b91c5ab Mon Sep 17 00:00:00 2001 From: Rajashree Mandaogane Date: Thu, 30 Sep 2021 14:04:36 -0700 Subject: [PATCH 07/36] Fix proxy template for bottlerocket bootstrap @@ -67,5 +67,5 @@ index f127ec4f1..9e4f8d4a5 100644 bottlerocketInput.RegistryMirrorCACert = base64.StdEncoding.EncodeToString([]byte(config.RegistryMirrorConfiguration.CACert)) } -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0008-Update-core-conversion-spoke-versions.patch b/projects/kubernetes-sigs/cluster-api/patches/0008-Update-core-conversion-spoke-versions.patch index 0bc5dd1415..5500fee920 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0008-Update-core-conversion-spoke-versions.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0008-Update-core-conversion-spoke-versions.patch @@ -1,4 +1,4 @@ -From 07ca2ce1d145334a17daf0bf8286a646a297b796 Mon Sep 17 00:00:00 2001 +From 2545dccf9b6dbf868248aed6713fab45cac614e7 Mon Sep 17 00:00:00 2001 From: Rajashree Mandaogane Date: Sun, 21 Nov 2021 01:16:11 -0800 Subject: [PATCH 08/36] Update core conversion spoke versions @@ -116,5 +116,5 @@ index 1f0c12a79..0abe06592 100644 } -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0009-Add-bottlerocket-changes-to-capbk-v1alpha4-api.patch b/projects/kubernetes-sigs/cluster-api/patches/0009-Add-bottlerocket-changes-to-capbk-v1alpha4-api.patch index d3fda8115a..ac68e94a13 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0009-Add-bottlerocket-changes-to-capbk-v1alpha4-api.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0009-Add-bottlerocket-changes-to-capbk-v1alpha4-api.patch @@ -1,4 +1,4 @@ -From 354b12e767000b25ef93d7fdb21c72a7e3452956 Mon Sep 17 00:00:00 2001 +From 92940b3be06a8b61070e58b83b431aeffb36bcbe Mon Sep 17 00:00:00 2001 From: Rajashree Mandaogane Date: Sun, 21 Nov 2021 20:59:58 -0800 Subject: [PATCH 09/36] Add bottlerocket changes to capbk v1alpha4 api @@ -321,7 +321,7 @@ index 588c218d2..a77749836 100644 func (in *SecretFileSource) DeepCopyInto(out *SecretFileSource) { *out = *in diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml -index 9efeed257..c64938ee6 100644 +index 15413b5dc..2b856fa95 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -1209,6 +1209,21 @@ spec: @@ -463,7 +463,7 @@ index 9efeed257..c64938ee6 100644 mounts: description: Mounts specifies a list of mount points to be setup. diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml -index 541668cc0..69523c0a9 100644 +index b4f286dd6..72ba11e8e 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -1213,6 +1213,22 @@ spec: @@ -807,7 +807,7 @@ index abc993a88..42bda5ca0 100644 // +optional NodeRegistration NodeRegistrationOptions `json:"nodeRegistration,omitempty"` diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml -index 181e8022f..527c3f953 100644 +index a552a9b25..f00836a83 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -1437,6 +1437,22 @@ spec: @@ -957,7 +957,7 @@ index 181e8022f..527c3f953 100644 mounts: description: Mounts specifies a list of mount points to be setup. diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml -index f53cb9179..178656dee 100644 +index 5410d4145..c96b0409c 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -125,6 +125,24 @@ spec: @@ -1113,5 +1113,5 @@ index f53cb9179..178656dee 100644 mounts: description: Mounts specifies a list of mount points to -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0010-Update-capbk-converions-spoke-version.patch b/projects/kubernetes-sigs/cluster-api/patches/0010-Update-capbk-converions-spoke-version.patch index bbfbf138ae..b5ca12124b 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0010-Update-capbk-converions-spoke-version.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0010-Update-capbk-converions-spoke-version.patch @@ -1,4 +1,4 @@ -From 193d8f0a7dc652d866d9671a74acadabf1234abc Mon Sep 17 00:00:00 2001 +From 66c9eb1f570ad1aee22bea28021f474c3fe46ccf Mon Sep 17 00:00:00 2001 From: Rajashree Mandaogane Date: Sun, 21 Nov 2021 21:00:31 -0800 Subject: [PATCH 10/36] Update capbk converions spoke version @@ -938,5 +938,5 @@ index d849616cb..9b0c13356 100644 + return autoConvert_v1beta1_RegistryMirrorConfiguration_To_upstreamv1beta3_RegistryMirrorConfiguration(in, out, s) +} -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0011-Add-status.version-to-list-of-fields-to-ignore-for-u.patch b/projects/kubernetes-sigs/cluster-api/patches/0011-Add-status.version-to-list-of-fields-to-ignore-for-u.patch index c49246b1d2..1142f49ed1 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0011-Add-status.version-to-list-of-fields-to-ignore-for-u.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0011-Add-status.version-to-list-of-fields-to-ignore-for-u.patch @@ -1,4 +1,4 @@ -From 484b558b84e7bff4dc0a08b488d068d30ed55084 Mon Sep 17 00:00:00 2001 +From fc5811034d00720438cd96aa77b2c98f9a9a4856 Mon Sep 17 00:00:00 2001 From: Vivek Koppuru Date: Wed, 12 Jan 2022 19:04:15 -0800 Subject: [PATCH 11/36] Add status.version to list of fields to ignore for @@ -9,10 +9,10 @@ Subject: [PATCH 11/36] Add status.version to list of fields to ignore for 1 file changed, 2 insertions(+) diff --git a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go -index 3d2e056ea..bd79f2322 100644 +index 15b2301e3..98f268c30 100644 --- a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go +++ b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go -@@ -112,6 +112,7 @@ func (in *KubeadmControlPlane) ValidateCreate() (admission.Warnings, error) { +@@ -111,6 +111,7 @@ func (in *KubeadmControlPlane) ValidateCreate() error { const ( spec = "spec" @@ -20,7 +20,7 @@ index 3d2e056ea..bd79f2322 100644 kubeadmConfigSpec = "kubeadmConfigSpec" clusterConfiguration = "clusterConfiguration" initConfiguration = "initConfiguration" -@@ -197,6 +198,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) (admission.War +@@ -196,6 +197,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error { {spec, "rolloutBefore", "*"}, {spec, "rolloutStrategy"}, {spec, "rolloutStrategy", "*"}, @@ -29,5 +29,5 @@ index 3d2e056ea..bd79f2322 100644 allErrs := validateKubeadmControlPlaneSpec(in.Spec, in.Namespace, field.NewPath("spec")) -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0012-Add-node-labels-support-for-bottlerocket.patch b/projects/kubernetes-sigs/cluster-api/patches/0012-Add-node-labels-support-for-bottlerocket.patch index 1e45ebe9fa..8f89392b0c 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0012-Add-node-labels-support-for-bottlerocket.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0012-Add-node-labels-support-for-bottlerocket.patch @@ -1,4 +1,4 @@ -From 58039a0eea156986dbf7b21da828ded8fe6b54d6 Mon Sep 17 00:00:00 2001 +From d2cc86ca3a67a21a904003d46965ef56bd8e3d89 Mon Sep 17 00:00:00 2001 From: Vivek Koppuru Date: Mon, 24 Jan 2022 00:46:44 -0800 Subject: [PATCH 12/36] Add node labels support for bottlerocket @@ -105,10 +105,10 @@ index 9e4f8d4a5..0ba4318c5 100644 func getAllAuthorizedKeys(users []bootstrapv1.User) string { var sshAuthorizedKeys []string diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index e9bdf5205..66f4501a8 100644 +index 4fd2eae4c..03f8aa831 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -481,6 +481,9 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -471,6 +471,9 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex if scope.Config.Spec.ClusterConfiguration.RegistryMirror.Endpoint != "" { bottlerocketConfig.RegistryMirrorConfiguration = scope.Config.Spec.ClusterConfiguration.RegistryMirror } @@ -118,7 +118,7 @@ index e9bdf5205..66f4501a8 100644 } clusterdata, err := kubeadmtypes.MarshalClusterConfigurationForVersion(scope.Config.Spec.ClusterConfiguration, parsedVersion) -@@ -679,6 +682,9 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) +@@ -666,6 +669,9 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) if scope.Config.Spec.JoinConfiguration.RegistryMirror.Endpoint != "" { bottlerocketConfig.RegistryMirrorConfiguration = scope.Config.Spec.JoinConfiguration.RegistryMirror } @@ -128,7 +128,7 @@ index e9bdf5205..66f4501a8 100644 bootstrapJoinData, err = bottlerocket.NewNode(nodeInput, bottlerocketConfig) if err != nil { scope.Error(err, "Failed to create a worker bottlerocket join configuration") -@@ -799,6 +805,9 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S +@@ -785,6 +791,9 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S if scope.Config.Spec.ClusterConfiguration.RegistryMirror.Endpoint != "" { bottlerocketConfig.RegistryMirrorConfiguration = scope.Config.Spec.ClusterConfiguration.RegistryMirror } @@ -139,5 +139,5 @@ index e9bdf5205..66f4501a8 100644 if err != nil { scope.Error(err, "Failed to generate cloud init for bottlerocket bootstrap control plane") -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0013-Support-worker-node-taints.patch b/projects/kubernetes-sigs/cluster-api/patches/0013-Support-worker-node-taints.patch index 1e24326c77..47a7ee52d7 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0013-Support-worker-node-taints.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0013-Support-worker-node-taints.patch @@ -1,4 +1,4 @@ -From d926e9c8a7a9e9783fe302f4764d84b4d2e5a6c2 Mon Sep 17 00:00:00 2001 +From 99cbfde09226669bc64361e09d8d6aab49008760 Mon Sep 17 00:00:00 2001 From: Daniel Budris Date: Fri, 17 Dec 2021 13:38:39 -0800 Subject: [PATCH 13/36] Support worker node taints @@ -137,10 +137,10 @@ index 0ba4318c5..36c3f67a7 100644 if nodeLabels == "" { return "" diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index 66f4501a8..bd7f5a26c 100644 +index 03f8aa831..082a10c29 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -685,6 +685,9 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) +@@ -672,6 +672,9 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) if scope.Config.Spec.JoinConfiguration.NodeRegistration.KubeletExtraArgs != nil { bottlerocketConfig.KubeletExtraArgs = scope.Config.Spec.JoinConfiguration.NodeRegistration.KubeletExtraArgs } @@ -151,5 +151,5 @@ index 66f4501a8..bd7f5a26c 100644 if err != nil { scope.Error(err, "Failed to create a worker bottlerocket join configuration") -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0014-support-bottle-rocket-control-plane-taints.patch b/projects/kubernetes-sigs/cluster-api/patches/0014-support-bottle-rocket-control-plane-taints.patch index 27a6cc7324..c021358a13 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0014-support-bottle-rocket-control-plane-taints.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0014-support-bottle-rocket-control-plane-taints.patch @@ -1,4 +1,4 @@ -From b377d525bde10a373994e13d7e24a8b672b1028e Mon Sep 17 00:00:00 2001 +From 27216298d53fbb18e6841b3263f5383ba347ed3b Mon Sep 17 00:00:00 2001 From: danbudris Date: Fri, 18 Feb 2022 09:24:32 -0500 Subject: [PATCH 14/36] support bottle rocket control plane taints @@ -8,10 +8,10 @@ Subject: [PATCH 14/36] support bottle rocket control plane taints 1 file changed, 6 insertions(+) diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index bd7f5a26c..694bbbd5c 100644 +index 082a10c29..2fc27bacb 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -484,6 +484,9 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -474,6 +474,9 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex if scope.Config.Spec.InitConfiguration.NodeRegistration.KubeletExtraArgs != nil { bottlerocketConfig.KubeletExtraArgs = scope.Config.Spec.InitConfiguration.NodeRegistration.KubeletExtraArgs } @@ -21,7 +21,7 @@ index bd7f5a26c..694bbbd5c 100644 } clusterdata, err := kubeadmtypes.MarshalClusterConfigurationForVersion(scope.Config.Spec.ClusterConfiguration, parsedVersion) -@@ -811,6 +814,9 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S +@@ -797,6 +800,9 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S if scope.Config.Spec.JoinConfiguration.NodeRegistration.KubeletExtraArgs != nil { bottlerocketConfig.KubeletExtraArgs = scope.Config.Spec.JoinConfiguration.NodeRegistration.KubeletExtraArgs } @@ -32,5 +32,5 @@ index bd7f5a26c..694bbbd5c 100644 if err != nil { scope.Error(err, "Failed to generate cloud init for bottlerocket bootstrap control plane") -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0015-Support-configuring-bottlerocket-control-container-u.patch b/projects/kubernetes-sigs/cluster-api/patches/0015-Support-configuring-bottlerocket-control-container-u.patch index c45d61e21d..7c110ec11d 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0015-Support-configuring-bottlerocket-control-container-u.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0015-Support-configuring-bottlerocket-control-container-u.patch @@ -1,4 +1,4 @@ -From 5e3e7d7f1c36184479a395bdd96c003d8d70d2c6 Mon Sep 17 00:00:00 2001 +From 8b9f1762776a2f859dc981fbdfc6a19a6cc40e0e Mon Sep 17 00:00:00 2001 From: Michael Chu Date: Mon, 28 Feb 2022 09:51:25 -0800 Subject: [PATCH 15/36] Support configuring bottlerocket control container uri @@ -328,7 +328,7 @@ index a77749836..921e6b0ea 100644 out.RegistryMirror = in.RegistryMirror in.NodeRegistration.DeepCopyInto(&out.NodeRegistration) diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml -index c64938ee6..5caa222d1 100644 +index 2b856fa95..c98744828 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -118,6 +118,21 @@ spec: @@ -464,7 +464,7 @@ index c64938ee6..5caa222d1 100644 description: 'CACertPath is the path to the SSL certificate authority used to secure comunications between node and control-plane. diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml -index 69523c0a9..b6eadd65f 100644 +index 72ba11e8e..1ffc551c9 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -127,6 +127,22 @@ spec: @@ -675,10 +675,10 @@ index 36c3f67a7..e635308ea 100644 for _, noProxy := range config.ProxyConfiguration.NoProxy { bottlerocketInput.NoProxyEndpoints = append(bottlerocketInput.NoProxyEndpoints, strconv.Quote(noProxy)) diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index 694bbbd5c..6e74f3c5a 100644 +index 2fc27bacb..cd327e38b 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -474,6 +474,7 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -464,6 +464,7 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex bottlerocketConfig = &bottlerocket.BottlerocketConfig{ Pause: scope.Config.Spec.ClusterConfiguration.Pause, BottlerocketBootstrap: scope.Config.Spec.ClusterConfiguration.BottlerocketBootstrap, @@ -686,7 +686,7 @@ index 694bbbd5c..6e74f3c5a 100644 } if scope.Config.Spec.ClusterConfiguration.Proxy.HTTPSProxy != "" { bottlerocketConfig.ProxyConfiguration = scope.Config.Spec.ClusterConfiguration.Proxy -@@ -678,6 +679,7 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) +@@ -665,6 +666,7 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) bottlerocketConfig := &bottlerocket.BottlerocketConfig{ Pause: scope.Config.Spec.JoinConfiguration.Pause, BottlerocketBootstrap: scope.Config.Spec.JoinConfiguration.BottlerocketBootstrap, @@ -1536,10 +1536,10 @@ index 5153d834a..dfbbc0839 100644 }, want: &bootstrapv1.ClusterConfiguration{}, diff --git a/cmd/clusterctl/client/cluster/mover_test.go b/cmd/clusterctl/client/cluster/mover_test.go -index a1995f477..ba3d2da0e 100644 +index 56b10250d..c5281a30a 100644 --- a/cmd/clusterctl/client/cluster/mover_test.go +++ b/cmd/clusterctl/client/cluster/mover_test.go -@@ -689,7 +689,7 @@ var backupRestoreTests = []struct { +@@ -614,7 +614,7 @@ var backupRestoreTests = []struct { objs: test.NewFakeCluster("ns1", "foo").Objs(), }, files: map[string]string{ @@ -1548,7 +1548,7 @@ index a1995f477..ba3d2da0e 100644 "Secret_ns1_foo-kubeconfig.yaml": `{"apiVersion":"v1","kind":"Secret","metadata":{"creationTimestamp":null,"name":"foo-kubeconfig","namespace":"ns1","ownerReferences":[{"apiVersion":"cluster.x-k8s.io/v1beta1","kind":"Cluster","name":"foo","uid":"cluster.x-k8s.io/v1beta1, Kind=Cluster, ns1/foo"}],"resourceVersion":"999","uid":"/v1, Kind=Secret, ns1/foo-kubeconfig"}}` + "\n", "Secret_ns1_foo-ca.yaml": `{"apiVersion":"v1","kind":"Secret","metadata":{"creationTimestamp":null,"name":"foo-ca","namespace":"ns1","resourceVersion":"999","uid":"/v1, Kind=Secret, ns1/foo-ca"}}` + "\n", "GenericInfrastructureCluster_ns1_foo.yaml": `{"apiVersion":"infrastructure.cluster.x-k8s.io/v1beta1","kind":"GenericInfrastructureCluster","metadata":{"creationTimestamp":null,"labels":{"cluster.x-k8s.io/cluster-name":"foo"},"name":"foo","namespace":"ns1","ownerReferences":[{"apiVersion":"cluster.x-k8s.io/v1beta1","kind":"Cluster","name":"foo","uid":"cluster.x-k8s.io/v1beta1, Kind=Cluster, ns1/foo"}],"resourceVersion":"999","uid":"infrastructure.cluster.x-k8s.io/v1beta1, Kind=GenericInfrastructureCluster, ns1/foo"}}` + "\n", -@@ -707,11 +707,11 @@ var backupRestoreTests = []struct { +@@ -632,11 +632,11 @@ var backupRestoreTests = []struct { }(), }, files: map[string]string{ @@ -1563,7 +1563,7 @@ index a1995f477..ba3d2da0e 100644 "Secret_ns2_bar-ca.yaml": `{"apiVersion":"v1","kind":"Secret","metadata":{"creationTimestamp":null,"name":"bar-ca","namespace":"ns2","resourceVersion":"999","uid":"/v1, Kind=Secret, ns2/bar-ca"}}` + "\n", "GenericInfrastructureCluster_ns2_bar.yaml": `{"apiVersion":"infrastructure.cluster.x-k8s.io/v1beta1","kind":"GenericInfrastructureCluster","metadata":{"creationTimestamp":null,"labels":{"cluster.x-k8s.io/cluster-name":"bar"},"name":"bar","namespace":"ns2","ownerReferences":[{"apiVersion":"cluster.x-k8s.io/v1beta1","kind":"Cluster","name":"bar","uid":"cluster.x-k8s.io/v1beta1, Kind=Cluster, ns2/bar"}],"resourceVersion":"999","uid":"infrastructure.cluster.x-k8s.io/v1beta1, Kind=GenericInfrastructureCluster, ns2/bar"}}` + "\n", diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml -index 527c3f953..4a1a462e3 100644 +index f00836a83..2fc03f208 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -194,6 +194,22 @@ spec: @@ -1705,7 +1705,7 @@ index 527c3f953..4a1a462e3 100644 description: 'CACertPath is the path to the SSL certificate authority used to secure comunications between node and diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml -index 178656dee..42e376b34 100644 +index c96b0409c..e11d335ee 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -143,6 +143,23 @@ spec: @@ -1870,7 +1870,7 @@ index 9972cd283..966c503ca 100644 `), }, diff --git a/controlplane/kubeadm/internal/workload_cluster_test.go b/controlplane/kubeadm/internal/workload_cluster_test.go -index f1540168a..a492095d5 100644 +index 63bbea586..0fede6ce6 100644 --- a/controlplane/kubeadm/internal/workload_cluster_test.go +++ b/controlplane/kubeadm/internal/workload_cluster_test.go @@ -625,12 +625,17 @@ func TestUpdateUpdateClusterConfigurationInKubeadmConfigMap(t *testing.T) { @@ -1963,5 +1963,5 @@ index f1540168a..a492095d5 100644 extraArgs: bar: baz -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0016-Change-format-for-storing-etcd-machine-address.patch b/projects/kubernetes-sigs/cluster-api/patches/0016-Change-format-for-storing-etcd-machine-address.patch index 8063beb368..840316d00c 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0016-Change-format-for-storing-etcd-machine-address.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0016-Change-format-for-storing-etcd-machine-address.patch @@ -1,4 +1,4 @@ -From fc24b8117ea24ba5e14562a559fd3bae26f03c70 Mon Sep 17 00:00:00 2001 +From 1079c6aa300ce52d2cb6856e8e0619374c08c6e3 Mon Sep 17 00:00:00 2001 From: Rajashree Mandaogane Date: Thu, 3 Mar 2022 15:01:35 -0800 Subject: [PATCH 16/36] Change format for storing etcd machine address @@ -19,10 +19,10 @@ condition needs to be set based on the existence of this Secret. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/controllers/machine/machine_controller_phases.go b/internal/controllers/machine/machine_controller_phases.go -index 8eae496e0..9b251469e 100644 +index 03806a1b7..4181ca366 100644 --- a/internal/controllers/machine/machine_controller_phases.go +++ b/internal/controllers/machine/machine_controller_phases.go -@@ -362,7 +362,6 @@ func (r *Reconciler) reconcileInfrastructure(ctx context.Context, s *scope) (ctr +@@ -356,7 +356,6 @@ func (r *Reconciler) reconcileInfrastructure(ctx context.Context, cluster *clust if machineIP == "" { return ctrl.Result{}, fmt.Errorf("error getting etcd init IP address: %v", err) } @@ -30,7 +30,7 @@ index 8eae496e0..9b251469e 100644 secret := &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: etcdSecretName, -@@ -381,6 +380,7 @@ func (r *Reconciler) reconcileInfrastructure(ctx context.Context, s *scope) (ctr +@@ -375,6 +374,7 @@ func (r *Reconciler) reconcileInfrastructure(ctx context.Context, cluster *clust }, Data: map[string][]byte{ "address": []byte(machineIP), @@ -39,5 +39,5 @@ index 8eae496e0..9b251469e 100644 Type: clusterv1.ClusterSecretType, } -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0017-Parse-provider-id-from-kubelet-extra-args.patch b/projects/kubernetes-sigs/cluster-api/patches/0017-Parse-provider-id-from-kubelet-extra-args.patch index 37fa085ce3..24d1d0b851 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0017-Parse-provider-id-from-kubelet-extra-args.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0017-Parse-provider-id-from-kubelet-extra-args.patch @@ -1,4 +1,4 @@ -From c445db4badd881a71634ef8855ff2e881e316220 Mon Sep 17 00:00:00 2001 +From 9cf025d648cdd29a10d42351dec2210c7a2881cb Mon Sep 17 00:00:00 2001 From: Vignesh Goutham Ganesh Date: Wed, 8 Jun 2022 10:27:26 -0700 Subject: [PATCH 17/36] Parse provider-id from kubelet extra args @@ -44,5 +44,5 @@ index e635308ea..3a760d51a 100644 if config.BottlerocketControl.ImageRepository != "" && config.BottlerocketControl.ImageTag != "" { bottlerocketInput.ControlContainerSource = fmt.Sprintf("%s:%s", config.BottlerocketControl.ImageRepository, config.BottlerocketControl.ImageTag) -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0018-Add-bottlerocket-control-image-on-nodes-joining-a-ne.patch b/projects/kubernetes-sigs/cluster-api/patches/0018-Add-bottlerocket-control-image-on-nodes-joining-a-ne.patch index 59e91dd689..5ec298e038 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0018-Add-bottlerocket-control-image-on-nodes-joining-a-ne.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0018-Add-bottlerocket-control-image-on-nodes-joining-a-ne.patch @@ -1,4 +1,4 @@ -From 0e3b14732b35394faa12684b2eaae1bdca92217f Mon Sep 17 00:00:00 2001 +From 72a88c94a904f0882dad971da5874c31f3e4a061 Mon Sep 17 00:00:00 2001 From: Victor Pineda Date: Sun, 19 Jun 2022 10:39:50 -0700 Subject: [PATCH 18/36] Add bottlerocket control image on nodes joining a new @@ -9,10 +9,10 @@ Subject: [PATCH 18/36] Add bottlerocket control image on nodes joining a new 1 file changed, 1 insertion(+) diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index 6e74f3c5a..320a224b0 100644 +index cd327e38b..2c5095fb9 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -806,6 +806,7 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S +@@ -792,6 +792,7 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S bottlerocketConfig := &bottlerocket.BottlerocketConfig{ Pause: scope.Config.Spec.JoinConfiguration.Pause, BottlerocketBootstrap: scope.Config.Spec.JoinConfiguration.BottlerocketBootstrap, @@ -21,5 +21,5 @@ index 6e74f3c5a..320a224b0 100644 if scope.Config.Spec.JoinConfiguration.Proxy.HTTPSProxy != "" { bottlerocketConfig.ProxyConfiguration = scope.Config.Spec.JoinConfiguration.Proxy -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0019-Add-feature-to-specifiy-additional-host-containers-i.patch b/projects/kubernetes-sigs/cluster-api/patches/0019-Add-feature-to-specifiy-additional-host-containers-i.patch index 1195801ebe..a3e0dbcec9 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0019-Add-feature-to-specifiy-additional-host-containers-i.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0019-Add-feature-to-specifiy-additional-host-containers-i.patch @@ -1,4 +1,4 @@ -From 24386cba94d014b98d6f54b59c9c62899f533534 Mon Sep 17 00:00:00 2001 +From f16e14099f7e5d5419227c01705505e392a1d1bf Mon Sep 17 00:00:00 2001 From: Victor Pineda Date: Tue, 21 Jun 2022 07:50:19 -0700 Subject: [PATCH 19/36] Add feature to specifiy additional host containers in @@ -234,7 +234,7 @@ index 921e6b0ea..1a6861a8f 100644 // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoinConfiguration. diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml -index 5caa222d1..8d8d294ab 100644 +index c98744828..15536cd1d 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -2397,6 +2397,48 @@ spec: @@ -336,7 +336,7 @@ index 5caa222d1..8d8d294ab 100644 description: 'CACertPath is the path to the SSL certificate authority used to secure comunications between node and control-plane. diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml -index b6eadd65f..6f28ffc38 100644 +index 1ffc551c9..19b364d72 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -2430,6 +2430,49 @@ spec: @@ -663,10 +663,10 @@ index 3a760d51a..73d35963e 100644 var taintsToml strings.Builder diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index 320a224b0..8bf6171f0 100644 +index 2c5095fb9..c726835c8 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -472,9 +472,10 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -462,9 +462,10 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex } bottlerocketConfig = &bottlerocket.BottlerocketConfig{ @@ -680,7 +680,7 @@ index 320a224b0..8bf6171f0 100644 } if scope.Config.Spec.ClusterConfiguration.Proxy.HTTPSProxy != "" { bottlerocketConfig.ProxyConfiguration = scope.Config.Spec.ClusterConfiguration.Proxy -@@ -677,9 +678,10 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) +@@ -664,9 +665,10 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) }) case bootstrapv1.Bottlerocket: bottlerocketConfig := &bottlerocket.BottlerocketConfig{ @@ -694,7 +694,7 @@ index 320a224b0..8bf6171f0 100644 } if scope.Config.Spec.JoinConfiguration.Proxy.HTTPSProxy != "" { bottlerocketConfig.ProxyConfiguration = scope.Config.Spec.JoinConfiguration.Proxy -@@ -804,9 +806,10 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S +@@ -790,9 +792,10 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S }) case bootstrapv1.Bottlerocket: bottlerocketConfig := &bottlerocket.BottlerocketConfig{ @@ -937,7 +937,7 @@ index 197c2ef74..d290e4d94 100644 if err := Convert_upstreamv1beta3_APIEndpoint_To_v1beta1_APIEndpoint(&in.LocalAPIEndpoint, &out.LocalAPIEndpoint, s); err != nil { return err diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml -index 4a1a462e3..b7b9e8131 100644 +index 2fc03f208..2f5b8f610 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -2871,6 +2871,49 @@ spec: @@ -1041,7 +1041,7 @@ index 4a1a462e3..b7b9e8131 100644 description: 'CACertPath is the path to the SSL certificate authority used to secure comunications between node and diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml -index 42e376b34..a13059793 100644 +index e11d335ee..1cf471a08 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -1502,6 +1502,51 @@ spec: @@ -1149,5 +1149,5 @@ index 42e376b34..a13059793 100644 description: 'CACertPath is the path to the SSL certificate authority used to secure comunications between node -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0020-Add-bottlerocket-custom-bootstrap-containers-config-.patch b/projects/kubernetes-sigs/cluster-api/patches/0020-Add-bottlerocket-custom-bootstrap-containers-config-.patch index aaf2b54740..e670af4bb0 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0020-Add-bottlerocket-custom-bootstrap-containers-config-.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0020-Add-bottlerocket-custom-bootstrap-containers-config-.patch @@ -1,4 +1,4 @@ -From 7c8392744147b3e2fde64fe3cccd121bc1ba1389 Mon Sep 17 00:00:00 2001 +From e0f7386f5e827ae861d32dc567790e0763b8edfe Mon Sep 17 00:00:00 2001 From: Jiayi Wang Date: Mon, 21 Nov 2022 17:31:22 -0500 Subject: [PATCH 20/36] Add bottlerocket custom bootstrap containers config @@ -187,7 +187,7 @@ index 1a6861a8f..f408188c5 100644 // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoinConfiguration. diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml -index 8d8d294ab..148372523 100644 +index 15536cd1d..44057be54 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -2397,6 +2397,48 @@ spec: @@ -289,7 +289,7 @@ index 8d8d294ab..148372523 100644 description: BottlerocketCustomHostContainers contains the information of any additional images that we will deploy as host containers diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml -index 6f28ffc38..38a1e8edf 100644 +index 19b364d72..6279dedee 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -2430,6 +2430,53 @@ spec: @@ -609,10 +609,10 @@ index 73d35963e..caea3a597 100644 if len(config.ProxyConfiguration.NoProxy) > 0 { diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index 8bf6171f0..15b11621c 100644 +index c726835c8..819126a94 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -472,10 +472,11 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -462,10 +462,11 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex } bottlerocketConfig = &bottlerocket.BottlerocketConfig{ @@ -628,7 +628,7 @@ index 8bf6171f0..15b11621c 100644 } if scope.Config.Spec.ClusterConfiguration.Proxy.HTTPSProxy != "" { bottlerocketConfig.ProxyConfiguration = scope.Config.Spec.ClusterConfiguration.Proxy -@@ -678,10 +679,11 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) +@@ -665,10 +666,11 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) }) case bootstrapv1.Bottlerocket: bottlerocketConfig := &bottlerocket.BottlerocketConfig{ @@ -644,7 +644,7 @@ index 8bf6171f0..15b11621c 100644 } if scope.Config.Spec.JoinConfiguration.Proxy.HTTPSProxy != "" { bottlerocketConfig.ProxyConfiguration = scope.Config.Spec.JoinConfiguration.Proxy -@@ -806,10 +808,11 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S +@@ -792,10 +794,11 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S }) case bootstrapv1.Bottlerocket: bottlerocketConfig := &bottlerocket.BottlerocketConfig{ @@ -721,7 +721,7 @@ index d290e4d94..1b2d94a1d 100644 } diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml -index b7b9e8131..deecdb0ec 100644 +index 2f5b8f610..b6325ac35 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -2871,6 +2871,52 @@ spec: @@ -831,7 +831,7 @@ index b7b9e8131..deecdb0ec 100644 description: BottlerocketCustomHostContainers contains the information of any additional images that we will deploy diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml -index a13059793..da60ec648 100644 +index 1cf471a08..235ff121f 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -1502,6 +1502,56 @@ spec: @@ -949,5 +949,5 @@ index a13059793..da60ec648 100644 description: BottlerocketCustomHostContainers contains the information of any additional images that we -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0021-Support-configuring-bottlerocket-admin-container-ima.patch b/projects/kubernetes-sigs/cluster-api/patches/0021-Support-configuring-bottlerocket-admin-container-ima.patch index a5406dcc55..b4a4cee5ee 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0021-Support-configuring-bottlerocket-admin-container-ima.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0021-Support-configuring-bottlerocket-admin-container-ima.patch @@ -1,4 +1,4 @@ -From 5bbb5d26343ab7904e5f3368d786d32341a70783 Mon Sep 17 00:00:00 2001 +From d0c189685bc3683c89076eab7a7ea08a5e8ef002 Mon Sep 17 00:00:00 2001 From: Jiayi Wang Date: Wed, 23 Nov 2022 09:26:28 -0500 Subject: [PATCH 21/36] Support configuring bottlerocket admin container image @@ -125,7 +125,7 @@ index f408188c5..12b57078d 100644 in.Proxy.DeepCopyInto(&out.Proxy) out.RegistryMirror = in.RegistryMirror diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml -index 148372523..ca6fb35a1 100644 +index 44057be54..388e41cfd 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -2367,6 +2367,21 @@ spec: @@ -173,7 +173,7 @@ index 148372523..ca6fb35a1 100644 description: BottlerocketBootstrap holds the image source for kubeadm bootstrap container This is only for bottlerocket diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml -index 38a1e8edf..b48076d41 100644 +index 6279dedee..67a8e8111 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -2398,6 +2398,22 @@ spec: @@ -350,10 +350,10 @@ index caea3a597..1859a4816 100644 }, { diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index 15b11621c..ef1db81f7 100644 +index 819126a94..aa5ebdd30 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -474,6 +474,7 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -464,6 +464,7 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex bottlerocketConfig = &bottlerocket.BottlerocketConfig{ Pause: scope.Config.Spec.ClusterConfiguration.Pause, BottlerocketBootstrap: scope.Config.Spec.ClusterConfiguration.BottlerocketBootstrap, @@ -361,7 +361,7 @@ index 15b11621c..ef1db81f7 100644 BottlerocketControl: scope.Config.Spec.ClusterConfiguration.BottlerocketControl, BottlerocketCustomHostContainers: scope.Config.Spec.ClusterConfiguration.BottlerocketHostContainers, BottlerocketCustomBootstrapContainers: scope.Config.Spec.ClusterConfiguration.BottlerocketCustomBootstrapContainers, -@@ -681,6 +682,7 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) +@@ -668,6 +669,7 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) bottlerocketConfig := &bottlerocket.BottlerocketConfig{ Pause: scope.Config.Spec.JoinConfiguration.Pause, BottlerocketBootstrap: scope.Config.Spec.JoinConfiguration.BottlerocketBootstrap, @@ -369,7 +369,7 @@ index 15b11621c..ef1db81f7 100644 BottlerocketControl: scope.Config.Spec.JoinConfiguration.BottlerocketControl, BottlerocketCustomHostContainers: scope.Config.Spec.JoinConfiguration.BottlerocketCustomHostContainers, BottlerocketCustomBootstrapContainers: scope.Config.Spec.JoinConfiguration.BottlerocketCustomBootstrapContainers, -@@ -810,6 +812,7 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S +@@ -796,6 +798,7 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S bottlerocketConfig := &bottlerocket.BottlerocketConfig{ Pause: scope.Config.Spec.JoinConfiguration.Pause, BottlerocketBootstrap: scope.Config.Spec.JoinConfiguration.BottlerocketBootstrap, @@ -438,7 +438,7 @@ index 1b2d94a1d..4584e6266 100644 return err } diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml -index deecdb0ec..408c6e3ee 100644 +index b6325ac35..8e1d920b2 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -2839,6 +2839,22 @@ spec: @@ -488,7 +488,7 @@ index deecdb0ec..408c6e3ee 100644 description: BottlerocketBootstrap holds the image source for kubeadm bootstrap container This is only for bottlerocket diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml -index da60ec648..0091bd97a 100644 +index 235ff121f..e435df3e1 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -1467,6 +1467,23 @@ spec: @@ -540,5 +540,5 @@ index da60ec648..0091bd97a 100644 description: BottlerocketBootstrap holds the image source for kubeadm bootstrap container This is only -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0022-Make-bottlerocket-admin-control-custom-bootstrap-con.patch b/projects/kubernetes-sigs/cluster-api/patches/0022-Make-bottlerocket-admin-control-custom-bootstrap-con.patch index 078538cf8f..259f423b8e 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0022-Make-bottlerocket-admin-control-custom-bootstrap-con.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0022-Make-bottlerocket-admin-control-custom-bootstrap-con.patch @@ -1,4 +1,4 @@ -From cb49ca2a5c8ed241952402a4ecdf2ed2c74651af Mon Sep 17 00:00:00 2001 +From 57afd8157092da54ea2a0ca4c092c72cc68ed123 Mon Sep 17 00:00:00 2001 From: Jiayi Wang Date: Thu, 5 Jan 2023 14:56:09 -0500 Subject: [PATCH 22/36] Make bottlerocket admin, control, custom bootstrap @@ -10,10 +10,10 @@ Subject: [PATCH 22/36] Make bottlerocket admin, control, custom bootstrap 2 files changed, 60 insertions(+) diff --git a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go -index bd79f2322..b1391f1ad 100644 +index 98f268c30..0ed26c19d 100644 --- a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go +++ b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go -@@ -143,6 +143,9 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) (admission.War +@@ -142,6 +142,9 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error { {"metadata", "*"}, {spec, kubeadmConfigSpec, "useExperimentalRetryJoin"}, {spec, kubeadmConfigSpec, clusterConfiguration, "bottlerocketBootstrap", "*"}, @@ -23,7 +23,7 @@ index bd79f2322..b1391f1ad 100644 {spec, kubeadmConfigSpec, clusterConfiguration, "pause", "*"}, {spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "imageRepository"}, {spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "imageTag"}, -@@ -168,6 +171,9 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) (admission.War +@@ -167,6 +170,9 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error { {spec, kubeadmConfigSpec, joinConfiguration, skipPhases}, {spec, kubeadmConfigSpec, joinConfiguration, "bottlerocketBootstrap", "*"}, {spec, kubeadmConfigSpec, joinConfiguration, "pause", "*"}, @@ -34,10 +34,10 @@ index bd79f2322..b1391f1ad 100644 {spec, kubeadmConfigSpec, postKubeadmCommands}, {spec, kubeadmConfigSpec, files}, diff --git a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go -index 38946192d..deac82cba 100644 +index 3eaa8e8f0..03ea2b8c2 100644 --- a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go +++ b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go -@@ -661,6 +661,24 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { +@@ -659,6 +659,24 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { validUpdateJoinConfBRBootstrapImage := before.DeepCopy() validUpdateJoinConfBRBootstrapImage.Spec.KubeadmConfigSpec.JoinConfiguration.BottlerocketBootstrap = bootstrapv1.BottlerocketBootstrap{ImageMeta: bootstrapv1.ImageMeta{ImageTag: "v1.1.0+new"}} @@ -62,7 +62,7 @@ index 38946192d..deac82cba 100644 updateInitConfigurationSkipPhases := before.DeepCopy() updateInitConfigurationSkipPhases.Spec.KubeadmConfigSpec.InitConfiguration.SkipPhases = []string{"addon/kube-proxy"} -@@ -1051,6 +1069,24 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { +@@ -1049,6 +1067,24 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { before: before, kcp: validUpdateClusterConfBRBootstrapImage, }, @@ -87,7 +87,7 @@ index 38946192d..deac82cba 100644 { name: "should allow changes to join configuration pause image", expectErr: false, -@@ -1063,6 +1099,24 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { +@@ -1061,6 +1097,24 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { before: before, kcp: validUpdateJoinConfBRBootstrapImage, }, @@ -113,5 +113,5 @@ index 38946192d..deac82cba 100644 for _, tt := range tests { -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0023-Mark-etcd-machine-status-to-running-after-etcd-contr.patch b/projects/kubernetes-sigs/cluster-api/patches/0023-Mark-etcd-machine-status-to-running-after-etcd-contr.patch index ef62d9956e..710cb8f7dd 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0023-Mark-etcd-machine-status-to-running-after-etcd-contr.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0023-Mark-etcd-machine-status-to-running-after-etcd-contr.patch @@ -1,4 +1,4 @@ -From 9607ce2f650fee1f9efa03153652f812374b0bc7 Mon Sep 17 00:00:00 2001 +From 64637c53d359c58379ecbdeb4bb87398b57d72b6 Mon Sep 17 00:00:00 2001 From: Jiayi Wang Date: Mon, 9 Jan 2023 15:41:05 -0500 Subject: [PATCH 23/36] Mark etcd machine status to running after etcd @@ -10,7 +10,7 @@ Subject: [PATCH 23/36] Mark etcd machine status to running after etcd 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/api/v1beta1/machine_types.go b/api/v1beta1/machine_types.go -index 2da343ae2..3d437200f 100644 +index ee4c40b5a..76d235a38 100644 --- a/api/v1beta1/machine_types.go +++ b/api/v1beta1/machine_types.go @@ -30,9 +30,12 @@ const ( @@ -28,7 +28,7 @@ index 2da343ae2..3d437200f 100644 ExcludeNodeDrainingAnnotation = "machine.cluster.x-k8s.io/exclude-node-draining" diff --git a/internal/controllers/machine/machine_controller_phases.go b/internal/controllers/machine/machine_controller_phases.go -index 9b251469e..e17031c99 100644 +index 4181ca366..5e846594a 100644 --- a/internal/controllers/machine/machine_controller_phases.go +++ b/internal/controllers/machine/machine_controller_phases.go @@ -72,8 +72,7 @@ func (r *Reconciler) reconcilePhase(_ context.Context, m *clusterv1.Machine) { @@ -42,5 +42,5 @@ index 9b251469e..e17031c99 100644 } } -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0024-add-support-for-registry-credentials.patch b/projects/kubernetes-sigs/cluster-api/patches/0024-add-support-for-registry-credentials.patch index ec4830beab..de6cc975e6 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0024-add-support-for-registry-credentials.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0024-add-support-for-registry-credentials.patch @@ -1,4 +1,4 @@ -From 00293957a8f3a1cc230c42d2f6e1070487c60cd7 Mon Sep 17 00:00:00 2001 +From 45396ea5fa25c6a32286adfa164d95a01e748223 Mon Sep 17 00:00:00 2001 From: Ahree Hong Date: Wed, 14 Dec 2022 12:47:42 -0800 Subject: [PATCH 24/36] add support for registry credentials @@ -6,12 +6,12 @@ Subject: [PATCH 24/36] add support for registry credentials Signed-off-by: Ahree Hong --- .../internal/bottlerocket/bootstrap.go | 18 +++++++ - .../internal/bottlerocket/bottlerocket.go | 16 +++++++ - .../controllers/kubeadmconfig_controller.go | 48 +++++++++++++++++++ + .../internal/bottlerocket/bottlerocket.go | 16 ++++++ + .../controllers/kubeadmconfig_controller.go | 49 +++++++++++++++++++ .../types/upstreamv1beta1/conversion.go | 2 +- .../types/upstreamv1beta3/conversion.go | 2 +- util/secret/consts.go | 3 ++ - 6 files changed, 87 insertions(+), 2 deletions(-) + 6 files changed, 88 insertions(+), 2 deletions(-) diff --git a/bootstrap/kubeadm/internal/bottlerocket/bootstrap.go b/bootstrap/kubeadm/internal/bottlerocket/bootstrap.go index fe280e091..58f38ca34 100644 @@ -105,10 +105,10 @@ index 1859a4816..c37713406 100644 if err != nil { return nil, err diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index ef1db81f7..e0373ead5 100644 +index aa5ebdd30..f4d14d0e7 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -65,6 +65,11 @@ const ( +@@ -70,6 +70,11 @@ const ( DefaultTokenTTL = 15 * time.Minute ) @@ -120,7 +120,7 @@ index ef1db81f7..e0373ead5 100644 // InitLocker is a lock that is used around kubeadm init. type InitLocker interface { Lock(ctx context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine) bool -@@ -484,6 +489,13 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -474,6 +479,13 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex } if scope.Config.Spec.ClusterConfiguration.RegistryMirror.Endpoint != "" { bottlerocketConfig.RegistryMirrorConfiguration = scope.Config.Spec.ClusterConfiguration.RegistryMirror @@ -134,7 +134,7 @@ index ef1db81f7..e0373ead5 100644 } if scope.Config.Spec.InitConfiguration.NodeRegistration.KubeletExtraArgs != nil { bottlerocketConfig.KubeletExtraArgs = scope.Config.Spec.InitConfiguration.NodeRegistration.KubeletExtraArgs -@@ -491,6 +503,7 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -481,6 +493,7 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex if len(scope.Config.Spec.InitConfiguration.NodeRegistration.Taints) > 0 { bottlerocketConfig.Taints = scope.Config.Spec.InitConfiguration.NodeRegistration.Taints } @@ -142,7 +142,7 @@ index ef1db81f7..e0373ead5 100644 } clusterdata, err := kubeadmtypes.MarshalClusterConfigurationForVersion(scope.Config.Spec.ClusterConfiguration, parsedVersion) -@@ -692,6 +705,13 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) +@@ -679,6 +692,13 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) } if scope.Config.Spec.JoinConfiguration.RegistryMirror.Endpoint != "" { bottlerocketConfig.RegistryMirrorConfiguration = scope.Config.Spec.JoinConfiguration.RegistryMirror @@ -156,7 +156,7 @@ index ef1db81f7..e0373ead5 100644 } if scope.Config.Spec.JoinConfiguration.NodeRegistration.KubeletExtraArgs != nil { bottlerocketConfig.KubeletExtraArgs = scope.Config.Spec.JoinConfiguration.NodeRegistration.KubeletExtraArgs -@@ -822,6 +842,13 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S +@@ -808,6 +828,13 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S } if scope.Config.Spec.ClusterConfiguration.RegistryMirror.Endpoint != "" { bottlerocketConfig.RegistryMirrorConfiguration = scope.Config.Spec.ClusterConfiguration.RegistryMirror @@ -170,7 +170,7 @@ index ef1db81f7..e0373ead5 100644 } if scope.Config.Spec.JoinConfiguration.NodeRegistration.KubeletExtraArgs != nil { bottlerocketConfig.KubeletExtraArgs = scope.Config.Spec.JoinConfiguration.NodeRegistration.KubeletExtraArgs -@@ -928,6 +955,27 @@ func (r *KubeadmConfigReconciler) resolveSecretPasswordContent(ctx context.Conte +@@ -914,6 +941,28 @@ func (r *KubeadmConfigReconciler) resolveSecretPasswordContent(ctx context.Conte return data, nil } @@ -194,10 +194,11 @@ index ef1db81f7..e0373ead5 100644 + } + return username, password, nil +} ++ + // ClusterToKubeadmConfigs is a handler.ToRequestsFunc to be used to enqueue // requests for reconciliation of KubeadmConfigs. - func (r *KubeadmConfigReconciler) ClusterToKubeadmConfigs(ctx context.Context, o client.Object) []ctrl.Request { + func (r *KubeadmConfigReconciler) ClusterToKubeadmConfigs(o client.Object) []ctrl.Request { diff --git a/bootstrap/kubeadm/types/upstreamv1beta1/conversion.go b/bootstrap/kubeadm/types/upstreamv1beta1/conversion.go index 6cfa9628b..2be0950c7 100644 --- a/bootstrap/kubeadm/types/upstreamv1beta1/conversion.go @@ -235,5 +236,5 @@ index 043764325..17abd5d70 100644 // Purpose is the name to append to the secret generated for a cluster. -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0025-Add-support-for-configuring-NTP-servers-on-bottleroc.patch b/projects/kubernetes-sigs/cluster-api/patches/0025-Add-support-for-configuring-NTP-servers-on-bottleroc.patch index 69c10d5676..f4e0ad957f 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0025-Add-support-for-configuring-NTP-servers-on-bottleroc.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0025-Add-support-for-configuring-NTP-servers-on-bottleroc.patch @@ -1,4 +1,4 @@ -From ee81b4261cbd94b7b21521de59180e169c7a94c8 Mon Sep 17 00:00:00 2001 +From ac1fb06eef70de7624e30cf195b01ac77542a66a Mon Sep 17 00:00:00 2001 From: Abhinav Date: Wed, 1 Feb 2023 16:34:23 -0800 Subject: [PATCH 25/36] Add support for configuring NTP servers on bottlerocket @@ -9,8 +9,8 @@ Signed-off-by: Abhinav .../internal/bottlerocket/bootstrap.go | 10 ++++++++++ .../internal/bottlerocket/bootstrap_test.go | 19 ++++++++++++++++++- .../internal/bottlerocket/bottlerocket.go | 15 ++++++++++++--- - .../controllers/kubeadmconfig_controller.go | 9 +++++++++ - 4 files changed, 49 insertions(+), 4 deletions(-) + .../controllers/kubeadmconfig_controller.go | 10 +++++++++- + 4 files changed, 49 insertions(+), 5 deletions(-) diff --git a/bootstrap/kubeadm/internal/bottlerocket/bootstrap.go b/bootstrap/kubeadm/internal/bottlerocket/bootstrap.go index 58f38ca34..cd70d69a8 100644 @@ -138,10 +138,10 @@ index c37713406..05e441723 100644 bottlerocketNodeUserData, err := generateNodeUserData("InitBottlerocketNode", bottlerocketNodeInitSettingsTemplate, bottlerocketInput) if err != nil { diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index e0373ead5..b4474d27f 100644 +index f4d14d0e7..427dbab92 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -503,6 +503,9 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -493,6 +493,9 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex if len(scope.Config.Spec.InitConfiguration.NodeRegistration.Taints) > 0 { bottlerocketConfig.Taints = scope.Config.Spec.InitConfiguration.NodeRegistration.Taints } @@ -151,7 +151,7 @@ index e0373ead5..b4474d27f 100644 } -@@ -719,6 +722,9 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) +@@ -706,6 +709,9 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) if len(scope.Config.Spec.JoinConfiguration.NodeRegistration.Taints) > 0 { bottlerocketConfig.Taints = scope.Config.Spec.JoinConfiguration.NodeRegistration.Taints } @@ -161,7 +161,7 @@ index e0373ead5..b4474d27f 100644 bootstrapJoinData, err = bottlerocket.NewNode(nodeInput, bottlerocketConfig) if err != nil { scope.Error(err, "Failed to create a worker bottlerocket join configuration") -@@ -856,6 +862,9 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S +@@ -842,6 +848,9 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S if len(scope.Config.Spec.JoinConfiguration.NodeRegistration.Taints) > 0 { bottlerocketConfig.Taints = scope.Config.Spec.JoinConfiguration.NodeRegistration.Taints } @@ -171,6 +171,14 @@ index e0373ead5..b4474d27f 100644 bootstrapJoinData, err = bottlerocket.NewJoinControlPlane(controlPlaneJoinInput, bottlerocketConfig) if err != nil { scope.Error(err, "Failed to generate cloud init for bottlerocket bootstrap control plane") +@@ -962,7 +971,6 @@ func (r *KubeadmConfigReconciler) resolveRegistryCredentials(ctx context.Context + return username, password, nil + } + +- + // ClusterToKubeadmConfigs is a handler.ToRequestsFunc to be used to enqueue + // requests for reconciliation of KubeadmConfigs. + func (r *KubeadmConfigReconciler) ClusterToKubeadmConfigs(o client.Object) []ctrl.Request { -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0026-set-hostname-for-BR-nodes.patch b/projects/kubernetes-sigs/cluster-api/patches/0026-set-hostname-for-BR-nodes.patch index ca704d473e..12e77354dc 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0026-set-hostname-for-BR-nodes.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0026-set-hostname-for-BR-nodes.patch @@ -1,4 +1,4 @@ -From f098bdc6907053c10453f84710210f35edf79de0 Mon Sep 17 00:00:00 2001 +From 1d67442ed4a54888beeff15b72f06142e17db3b3 Mon Sep 17 00:00:00 2001 From: Ahree Hong Date: Tue, 7 Feb 2023 14:26:36 -0800 Subject: [PATCH 26/36] set hostname for BR nodes @@ -202,10 +202,10 @@ index 05e441723..e2611c1ca 100644 BootstrapContainers: config.BottlerocketCustomBootstrapContainers, } diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index b4474d27f..351150d32 100644 +index 427dbab92..1e50adb4d 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -483,6 +483,7 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -473,6 +473,7 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex BottlerocketControl: scope.Config.Spec.ClusterConfiguration.BottlerocketControl, BottlerocketCustomHostContainers: scope.Config.Spec.ClusterConfiguration.BottlerocketHostContainers, BottlerocketCustomBootstrapContainers: scope.Config.Spec.ClusterConfiguration.BottlerocketCustomBootstrapContainers, @@ -213,7 +213,7 @@ index b4474d27f..351150d32 100644 } if scope.Config.Spec.ClusterConfiguration.Proxy.HTTPSProxy != "" { bottlerocketConfig.ProxyConfiguration = scope.Config.Spec.ClusterConfiguration.Proxy -@@ -630,6 +631,11 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) +@@ -617,6 +618,11 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) return res, nil } @@ -225,7 +225,7 @@ index b4474d27f..351150d32 100644 kubernetesVersion := scope.ConfigOwner.KubernetesVersion() parsedVersion, err := semver.ParseTolerant(kubernetesVersion) if err != nil { -@@ -702,6 +708,7 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) +@@ -689,6 +695,7 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) BottlerocketControl: scope.Config.Spec.JoinConfiguration.BottlerocketControl, BottlerocketCustomHostContainers: scope.Config.Spec.JoinConfiguration.BottlerocketCustomHostContainers, BottlerocketCustomBootstrapContainers: scope.Config.Spec.JoinConfiguration.BottlerocketCustomBootstrapContainers, @@ -233,7 +233,7 @@ index b4474d27f..351150d32 100644 } if scope.Config.Spec.JoinConfiguration.Proxy.HTTPSProxy != "" { bottlerocketConfig.ProxyConfiguration = scope.Config.Spec.JoinConfiguration.Proxy -@@ -757,6 +764,11 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S +@@ -744,6 +751,11 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S scope.Config.Spec.JoinConfiguration.ControlPlane = &bootstrapv1.JoinControlPlane{} } @@ -243,9 +243,9 @@ index b4474d27f..351150d32 100644 + } + certificates := secret.NewControlPlaneJoinCerts(scope.Config.Spec.ClusterConfiguration) - err := certificates.LookupCached( + err := certificates.Lookup( ctx, -@@ -842,6 +854,7 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S +@@ -828,6 +840,7 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S BottlerocketControl: scope.Config.Spec.JoinConfiguration.BottlerocketControl, BottlerocketCustomHostContainers: scope.Config.Spec.JoinConfiguration.BottlerocketCustomHostContainers, BottlerocketCustomBootstrapContainers: scope.Config.Spec.JoinConfiguration.BottlerocketCustomBootstrapContainers, @@ -254,5 +254,5 @@ index b4474d27f..351150d32 100644 if scope.Config.Spec.JoinConfiguration.Proxy.HTTPSProxy != "" { bottlerocketConfig.ProxyConfiguration = scope.Config.Spec.JoinConfiguration.Proxy -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0027-Add-bottlerocket-k8s-settings-support.patch b/projects/kubernetes-sigs/cluster-api/patches/0027-Add-bottlerocket-k8s-settings-support.patch index 322110b24c..260c3e6cde 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0027-Add-bottlerocket-k8s-settings-support.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0027-Add-bottlerocket-k8s-settings-support.patch @@ -1,4 +1,4 @@ -From 1caf2f91a2602d5831103b6710d25c6de1369e7d Mon Sep 17 00:00:00 2001 +From 0a57c2073159e4071a38311a1022e194a80ccd4b Mon Sep 17 00:00:00 2001 From: Abhinav Pandey Date: Thu, 2 Mar 2023 10:18:07 -0800 Subject: [PATCH 27/36] Add bottlerocket k8s settings support @@ -26,7 +26,7 @@ Signed-off-by: Abhinav Pandey 18 files changed, 741 insertions(+), 189 deletions(-) diff --git a/api/v1beta1/zz_generated.openapi.go b/api/v1beta1/zz_generated.openapi.go -index 71ea0311f..53ab5f4e1 100644 +index e97701dcf..ec3381651 100644 --- a/api/v1beta1/zz_generated.openapi.go +++ b/api/v1beta1/zz_generated.openapi.go @@ -716,6 +716,12 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterSpec(ref common.ReferenceCa @@ -214,7 +214,7 @@ index 12b57078d..400e2c343 100644 // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoinConfiguration. diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml -index ca6fb35a1..253f4d76b 100644 +index 388e41cfd..c26623a66 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -2367,6 +2367,32 @@ spec: @@ -284,7 +284,7 @@ index ca6fb35a1..253f4d76b 100644 description: BottlerocketAdmin holds the image source for admin container This is only for bottlerocket diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml -index b48076d41..4bd8d7874 100644 +index 67a8e8111..40dda4464 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -2398,6 +2398,33 @@ spec: @@ -1160,10 +1160,10 @@ index e2611c1ca..f21247061 100644 // bottlerocket configuration accepts taints in the format diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index 351150d32..3bc99e008 100644 +index 1e50adb4d..9d7d597d0 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -483,6 +483,7 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -473,6 +473,7 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex BottlerocketControl: scope.Config.Spec.ClusterConfiguration.BottlerocketControl, BottlerocketCustomHostContainers: scope.Config.Spec.ClusterConfiguration.BottlerocketHostContainers, BottlerocketCustomBootstrapContainers: scope.Config.Spec.ClusterConfiguration.BottlerocketCustomBootstrapContainers, @@ -1171,7 +1171,7 @@ index 351150d32..3bc99e008 100644 Hostname: machine.Name, } if scope.Config.Spec.ClusterConfiguration.Proxy.HTTPSProxy != "" { -@@ -507,7 +508,6 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -497,7 +498,6 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex if scope.Config.Spec.NTP != nil && scope.Config.Spec.NTP.Enabled != nil && *scope.Config.Spec.NTP.Enabled { bottlerocketConfig.NTPServers = scope.Config.Spec.NTP.Servers } @@ -1179,7 +1179,7 @@ index 351150d32..3bc99e008 100644 } clusterdata, err := kubeadmtypes.MarshalClusterConfigurationForVersion(scope.Config.Spec.ClusterConfiguration, parsedVersion) -@@ -708,6 +708,7 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) +@@ -695,6 +695,7 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) BottlerocketControl: scope.Config.Spec.JoinConfiguration.BottlerocketControl, BottlerocketCustomHostContainers: scope.Config.Spec.JoinConfiguration.BottlerocketCustomHostContainers, BottlerocketCustomBootstrapContainers: scope.Config.Spec.JoinConfiguration.BottlerocketCustomBootstrapContainers, @@ -1187,7 +1187,7 @@ index 351150d32..3bc99e008 100644 Hostname: machine.Name, } if scope.Config.Spec.JoinConfiguration.Proxy.HTTPSProxy != "" { -@@ -854,6 +855,7 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S +@@ -840,6 +841,7 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S BottlerocketControl: scope.Config.Spec.JoinConfiguration.BottlerocketControl, BottlerocketCustomHostContainers: scope.Config.Spec.JoinConfiguration.BottlerocketCustomHostContainers, BottlerocketCustomBootstrapContainers: scope.Config.Spec.JoinConfiguration.BottlerocketCustomBootstrapContainers, @@ -1282,10 +1282,10 @@ index 8acd51a25..bcff12e91 100644 apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" ) diff --git a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go -index b1391f1ad..88b1df8f6 100644 +index 0ed26c19d..729c964e8 100644 --- a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go +++ b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go -@@ -146,6 +146,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) (admission.War +@@ -145,6 +145,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error { {spec, kubeadmConfigSpec, clusterConfiguration, "bottlerocketAdmin", "*"}, {spec, kubeadmConfigSpec, clusterConfiguration, "bottlerocketControl", "*"}, {spec, kubeadmConfigSpec, clusterConfiguration, "bottlerocketCustomBootstrapContainers"}, @@ -1293,7 +1293,7 @@ index b1391f1ad..88b1df8f6 100644 {spec, kubeadmConfigSpec, clusterConfiguration, "pause", "*"}, {spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "imageRepository"}, {spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "imageTag"}, -@@ -174,6 +175,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) (admission.War +@@ -173,6 +174,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error { {spec, kubeadmConfigSpec, joinConfiguration, "bottlerocketAdmin", "*"}, {spec, kubeadmConfigSpec, joinConfiguration, "bottlerocketControl", "*"}, {spec, kubeadmConfigSpec, joinConfiguration, "bottlerocketCustomBootstrapContainers"}, @@ -1302,7 +1302,7 @@ index b1391f1ad..88b1df8f6 100644 {spec, kubeadmConfigSpec, postKubeadmCommands}, {spec, kubeadmConfigSpec, files}, diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml -index 408c6e3ee..a98fb7ab6 100644 +index 8e1d920b2..077d7493a 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -2839,6 +2839,32 @@ spec: @@ -1372,7 +1372,7 @@ index 408c6e3ee..a98fb7ab6 100644 description: BottlerocketAdmin holds the image source for admin container This is only for bottlerocket diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml -index 0091bd97a..1f25a4320 100644 +index e435df3e1..1302cc4e1 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -1467,6 +1467,34 @@ spec: @@ -1446,5 +1446,5 @@ index 0091bd97a..1f25a4320 100644 description: BottlerocketAdmin holds the image source for admin container This is only for bottlerocket -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0028-add-br-kernel.sysctl-settings.patch b/projects/kubernetes-sigs/cluster-api/patches/0028-add-br-kernel.sysctl-settings.patch index 900b49a61a..14055d35fd 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0028-add-br-kernel.sysctl-settings.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0028-add-br-kernel.sysctl-settings.patch @@ -1,4 +1,4 @@ -From d712e63b352509bdb8f23620a535bfcd07df34e8 Mon Sep 17 00:00:00 2001 +From 1ab5bbc4031d1bfda31a5e3f480ecd81b42b8468 Mon Sep 17 00:00:00 2001 From: Ahree Hong Date: Tue, 7 Mar 2023 14:01:39 -0800 Subject: [PATCH 28/36] add br kernel.sysctl settings @@ -92,7 +92,7 @@ index 400e2c343..51c1ed776 100644 // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BottlerocketSettings. diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml -index 253f4d76b..e16a25850 100644 +index c26623a66..a7ae704ec 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -2371,6 +2371,17 @@ spec: @@ -132,7 +132,7 @@ index 253f4d76b..e16a25850 100644 description: Kubernetes holds the kubernetes settings for bottlerocket nodes. diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml -index 4bd8d7874..e9c8a5cb2 100644 +index 40dda4464..acf42f3ab 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -2402,6 +2402,17 @@ spec: @@ -360,7 +360,7 @@ index bcff12e91..8acd51a25 100644 apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" ) diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml -index a98fb7ab6..7cdf977db 100644 +index 077d7493a..2f1f65012 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -2843,6 +2843,17 @@ spec: @@ -400,7 +400,7 @@ index a98fb7ab6..7cdf977db 100644 description: Kubernetes holds the kubernetes settings for bottlerocket nodes. diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml -index 1f25a4320..1ac579b26 100644 +index 1302cc4e1..933f00038 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -1472,6 +1472,18 @@ spec: @@ -442,5 +442,5 @@ index 1f25a4320..1ac579b26 100644 description: Kubernetes holds the kubernetes settings for bottlerocket nodes. -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0029-add-boot-kernel-settings-for-BR.patch b/projects/kubernetes-sigs/cluster-api/patches/0029-add-boot-kernel-settings-for-BR.patch index 860bff11c8..03ace53638 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0029-add-boot-kernel-settings-for-BR.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0029-add-boot-kernel-settings-for-BR.patch @@ -1,4 +1,4 @@ -From e3bfbd6a3fbe053533bf0cf2bc2efd92e4e274cb Mon Sep 17 00:00:00 2001 +From 37e18ad2e39afa46965b6dd8f74a4b89d9e1d79a Mon Sep 17 00:00:00 2001 From: Ahree Hong Date: Thu, 23 Mar 2023 01:51:16 -0700 Subject: [PATCH 29/36] add boot kernel settings for BR @@ -97,7 +97,7 @@ index 51c1ed776..306ba8931 100644 // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BottlerocketSettings. diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml -index e16a25850..00ada8cc3 100644 +index a7ae704ec..df745e7f2 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -2371,6 +2371,17 @@ spec: @@ -137,7 +137,7 @@ index e16a25850..00ada8cc3 100644 description: KernelSettings contains additional kernel settings for Bottlerocket. diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml -index e9c8a5cb2..08960d475 100644 +index acf42f3ab..9c4514353 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -2402,6 +2402,17 @@ spec: @@ -342,7 +342,7 @@ index fb6a771f6..b588f943e 100644 func getAllAuthorizedKeys(users []bootstrapv1.User) string { var sshAuthorizedKeys []string diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml -index 7cdf977db..9243c5e91 100644 +index 2f1f65012..7b74847bc 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -2843,6 +2843,17 @@ spec: @@ -382,7 +382,7 @@ index 7cdf977db..9243c5e91 100644 description: KernelSettings contains additional kernel settings for Bottlerocket. diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml -index 1ac579b26..ce3f8afd0 100644 +index 933f00038..a79e90dea 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -1472,6 +1472,17 @@ spec: @@ -422,7 +422,7 @@ index 1ac579b26..ce3f8afd0 100644 description: KernelSettings contains additional kernel settings for Bottlerocket. diff --git a/internal/controllers/machine/machine_controller_phases.go b/internal/controllers/machine/machine_controller_phases.go -index e17031c99..4ad429a45 100644 +index 5e846594a..9be6ddb34 100644 --- a/internal/controllers/machine/machine_controller_phases.go +++ b/internal/controllers/machine/machine_controller_phases.go @@ -19,9 +19,10 @@ package machine @@ -437,7 +437,7 @@ index e17031c99..4ad429a45 100644 "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" -@@ -378,7 +379,7 @@ func (r *Reconciler) reconcileInfrastructure(ctx context.Context, s *scope) (ctr +@@ -372,7 +373,7 @@ func (r *Reconciler) reconcileInfrastructure(ctx context.Context, cluster *clust }, }, Data: map[string][]byte{ @@ -447,5 +447,5 @@ index e17031c99..4ad429a45 100644 }, Type: clusterv1.ClusterSecretType, -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0030-Patch-haproxy-maxconn-value-to-avoid-ulimit-issue.patch b/projects/kubernetes-sigs/cluster-api/patches/0030-Patch-haproxy-maxconn-value-to-avoid-ulimit-issue.patch index aff8309e6d..3684ec01e7 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0030-Patch-haproxy-maxconn-value-to-avoid-ulimit-issue.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0030-Patch-haproxy-maxconn-value-to-avoid-ulimit-issue.patch @@ -1,4 +1,4 @@ -From d3b4d90b5b18eaa738c615d4a1ee049d4371ee37 Mon Sep 17 00:00:00 2001 +From bf93dc94e84c0f5cf17e16a6a5f0a0c8de7892cf Mon Sep 17 00:00:00 2001 From: Jackson West Date: Sat, 6 May 2023 14:08:17 -0500 Subject: [PATCH 30/36] Patch haproxy maxconn value to avoid ulimit issue @@ -29,5 +29,5 @@ index 8d2f70a02..1c6e7a68e 100644 resolvers docker nameserver dns 127.0.0.11:53 -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0031-Add-support-for-custom-cert-bundles-in-BR-21.patch b/projects/kubernetes-sigs/cluster-api/patches/0031-Add-support-for-custom-cert-bundles-in-BR-21.patch index cf8f22e4bc..d0a939d09e 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0031-Add-support-for-custom-cert-bundles-in-BR-21.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0031-Add-support-for-custom-cert-bundles-in-BR-21.patch @@ -1,4 +1,4 @@ -From 0dff33731726496deb620e97a23dfcda29077cdd Mon Sep 17 00:00:00 2001 +From 778b59cbbb4535aa1194561b8b6058b5eb18f878 Mon Sep 17 00:00:00 2001 From: ahreehong <46465244+ahreehong@users.noreply.github.com> Date: Fri, 19 May 2023 16:29:08 -0400 Subject: [PATCH 31/36] Add support for custom cert bundles in BR (#21) @@ -138,7 +138,7 @@ index 306ba8931..6b722fd0f 100644 // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoinConfiguration. diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml -index 00ada8cc3..47849938f 100644 +index df745e7f2..a41d3aa0b 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -2544,6 +2544,22 @@ spec: @@ -188,7 +188,7 @@ index 00ada8cc3..47849938f 100644 description: ControlPlane defines the additional control plane instance to be deployed on the joining node. If nil, no additional diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml -index 08960d475..db4f1336e 100644 +index 9c4514353..984715e30 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -2585,6 +2585,23 @@ spec: @@ -390,10 +390,10 @@ index b588f943e..13eb02007 100644 return generateNodeUserData("InitBottlerocketNode", bottlerocketNodeInitSettingsTemplate, bottlerocketInput) } diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -index 3bc99e008..e60b2a3cf 100644 +index 9d7d597d0..eaaa2bea3 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go -@@ -508,6 +508,9 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex +@@ -498,6 +498,9 @@ func (r *KubeadmConfigReconciler) handleClusterNotInitialized(ctx context.Contex if scope.Config.Spec.NTP != nil && scope.Config.Spec.NTP.Enabled != nil && *scope.Config.Spec.NTP.Enabled { bottlerocketConfig.NTPServers = scope.Config.Spec.NTP.Servers } @@ -403,7 +403,7 @@ index 3bc99e008..e60b2a3cf 100644 } clusterdata, err := kubeadmtypes.MarshalClusterConfigurationForVersion(scope.Config.Spec.ClusterConfiguration, parsedVersion) -@@ -733,6 +736,9 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) +@@ -720,6 +723,9 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) if scope.Config.Spec.NTP != nil && scope.Config.Spec.NTP.Enabled != nil && *scope.Config.Spec.NTP.Enabled { bottlerocketConfig.NTPServers = scope.Config.Spec.NTP.Servers } @@ -413,7 +413,7 @@ index 3bc99e008..e60b2a3cf 100644 bootstrapJoinData, err = bottlerocket.NewNode(nodeInput, bottlerocketConfig) if err != nil { scope.Error(err, "Failed to create a worker bottlerocket join configuration") -@@ -880,6 +886,9 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S +@@ -866,6 +872,9 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S if scope.Config.Spec.NTP != nil && scope.Config.Spec.NTP.Enabled != nil && *scope.Config.Spec.NTP.Enabled { bottlerocketConfig.NTPServers = scope.Config.Spec.NTP.Servers } @@ -484,7 +484,7 @@ index c613bdd12..6d812f516 100644 } diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml -index 9243c5e91..5beada8df 100644 +index 7b74847bc..2063177dc 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -3024,6 +3024,22 @@ spec: @@ -534,7 +534,7 @@ index 9243c5e91..5beada8df 100644 description: ControlPlane defines the additional control plane instance to be deployed on the joining node. If nil, no diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml -index ce3f8afd0..89e09758b 100644 +index a79e90dea..7821a39d5 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -1665,6 +1665,23 @@ spec: @@ -586,5 +586,5 @@ index ce3f8afd0..89e09758b 100644 description: ControlPlane defines the additional control plane instance to be deployed on the joining node. -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0032-CAPI-Move-Cluster-Filter.patch b/projects/kubernetes-sigs/cluster-api/patches/0032-CAPI-Move-Cluster-Filter.patch index 20923ccd3b..d6b4bb8302 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0032-CAPI-Move-Cluster-Filter.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0032-CAPI-Move-Cluster-Filter.patch @@ -1,4 +1,4 @@ -From 2ec78e02a46eebae56ae1d17cadd5d2bc2180e6f Mon Sep 17 00:00:00 2001 +From f5db792f5f1c8e9d9d7a7d63bcb5b336f06aab24 Mon Sep 17 00:00:00 2001 From: Vignesh Goutham Ganesh Date: Tue, 16 May 2023 11:03:09 -0500 Subject: [PATCH 32/36] CAPI Move Cluster Filter @@ -6,48 +6,47 @@ Subject: [PATCH 32/36] CAPI Move Cluster Filter Signed-off-by: Vignesh Goutham Ganesh --- cmd/clusterctl/client/cluster/mover.go | 32 +++-- - cmd/clusterctl/client/cluster/mover_test.go | 18 +-- + cmd/clusterctl/client/cluster/mover_test.go | 16 +-- cmd/clusterctl/client/cluster/objectgraph.go | 40 +++++- .../client/cluster/objectgraph_test.go | 130 +++++++++++++++++- cmd/clusterctl/client/move.go | 10 +- - cmd/clusterctl/client/move_test.go | 6 +- cmd/clusterctl/cmd/move.go | 4 + - 7 files changed, 211 insertions(+), 29 deletions(-) + 6 files changed, 207 insertions(+), 25 deletions(-) diff --git a/cmd/clusterctl/client/cluster/mover.go b/cmd/clusterctl/client/cluster/mover.go -index 3ea19a800..1904472ff 100644 +index c65e8691a..d16ebfeaf 100644 --- a/cmd/clusterctl/client/cluster/mover.go +++ b/cmd/clusterctl/client/cluster/mover.go -@@ -49,13 +49,16 @@ type ResourceMutatorFunc func(u *unstructured.Unstructured) error +@@ -44,13 +44,16 @@ import ( // ObjectMover defines methods for moving Cluster API objects to another management cluster. type ObjectMover interface { // Move moves all the Cluster API objects existing in a namespace (or from all the namespaces if empty) to a target management cluster. -- Move(namespace string, toCluster Client, dryRun bool, mutators ...ResourceMutatorFunc) error +- Move(namespace string, toCluster Client, dryRun bool) error + // If `clusterName` is specified (not empty string), only objects belonging to the cluster will be moved. -+ Move(namespace string, toCluster Client, clusterName string, dryRun bool, mutators ...ResourceMutatorFunc) error ++ Move(namespace string, toCluster Client, clusterName string, dryRun bool) error // ToDirectory writes all the Cluster API objects existing in a namespace (or from all the namespaces if empty) to a target directory. - ToDirectory(namespace string, directory string) error + // If `clusterName` is specified (not empty string), only objects belonging to the cluster will be moved. -+ ToDirectory(namespace string, directory string, clusterName string) error ++ ToDirectory(namespace string, directory, clusterName string) error // FromDirectory reads all the Cluster API objects existing in a configured directory to a target management cluster. - FromDirectory(toCluster Client, directory string) error + // If `clusterName` is specified (not empty string), only objects belonging to the cluster will be moved. -+ FromDirectory(toCluster Client, directory string, clusterName string) error ++ FromDirectory(toCluster Client, directory, clusterName string) error } // objectMover implements the ObjectMover interface. -@@ -68,7 +71,7 @@ type objectMover struct { +@@ -63,7 +66,7 @@ type objectMover struct { // ensure objectMover implements the ObjectMover interface. var _ ObjectMover = &objectMover{} --func (o *objectMover) Move(namespace string, toCluster Client, dryRun bool, mutators ...ResourceMutatorFunc) error { -+func (o *objectMover) Move(namespace string, toCluster Client, clusterName string, dryRun bool, mutators ...ResourceMutatorFunc) error { +-func (o *objectMover) Move(namespace string, toCluster Client, dryRun bool) error { ++func (o *objectMover) Move(namespace string, toCluster Client, clusterName string, dryRun bool) error { log := logf.Log log.Info("Performing move...") o.dryRun = dryRun -@@ -85,7 +88,7 @@ func (o *objectMover) Move(namespace string, toCluster Client, dryRun bool, muta +@@ -80,7 +83,7 @@ func (o *objectMover) Move(namespace string, toCluster Client, dryRun bool) erro } } @@ -56,12 +55,12 @@ index 3ea19a800..1904472ff 100644 if err != nil { return errors.Wrap(err, "failed to get object graph") } -@@ -99,11 +102,11 @@ func (o *objectMover) Move(namespace string, toCluster Client, dryRun bool, muta - return o.move(objectGraph, proxy, mutators...) +@@ -94,11 +97,11 @@ func (o *objectMover) Move(namespace string, toCluster Client, dryRun bool) erro + return o.move(objectGraph, proxy) } -func (o *objectMover) ToDirectory(namespace string, directory string) error { -+func (o *objectMover) ToDirectory(namespace string, directory string, clusterName string) error { ++func (o *objectMover) ToDirectory(namespace, directory, clusterName string) error { log := logf.Log log.Info("Moving to directory...") @@ -70,7 +69,7 @@ index 3ea19a800..1904472ff 100644 if err != nil { return errors.Wrap(err, "failed to get object graph") } -@@ -111,7 +114,7 @@ func (o *objectMover) ToDirectory(namespace string, directory string) error { +@@ -106,7 +109,7 @@ func (o *objectMover) ToDirectory(namespace string, directory string) error { return o.toDirectory(objectGraph, directory) } @@ -79,7 +78,7 @@ index 3ea19a800..1904472ff 100644 log := logf.Log log.Info("Moving from directory...") -@@ -145,6 +148,14 @@ func (o *objectMover) FromDirectory(toCluster Client, directory string) error { +@@ -140,6 +143,14 @@ func (o *objectMover) FromDirectory(toCluster Client, directory string) error { // Check whether nodes are not included in GVK considered for fromDirectory. objectGraph.checkVirtualNode() @@ -94,7 +93,7 @@ index 3ea19a800..1904472ff 100644 // Restore the objects to the target cluster. proxy := toCluster.Proxy() -@@ -182,7 +193,7 @@ func (o *objectMover) filesToObjs(dir string) ([]unstructured.Unstructured, erro +@@ -177,7 +188,7 @@ func (o *objectMover) filesToObjs(dir string) ([]unstructured.Unstructured, erro return objs, nil } @@ -103,7 +102,7 @@ index 3ea19a800..1904472ff 100644 objectGraph := newObjectGraph(o.fromProxy, o.fromProviderInventory) // Gets all the types defined by the CRDs installed by clusterctl plus the ConfigMap/Secret core types. -@@ -194,7 +205,8 @@ func (o *objectMover) getObjectGraph(namespace string) (*objectGraph, error) { +@@ -189,7 +200,8 @@ func (o *objectMover) getObjectGraph(namespace string) (*objectGraph, error) { // Discovery the object graph for the selected types: // - Nodes are defined the Kubernetes objects (Clusters, Machines etc.) identified during the discovery process. // - Edges are derived by the OwnerReferences between nodes. @@ -114,10 +113,10 @@ index 3ea19a800..1904472ff 100644 } diff --git a/cmd/clusterctl/client/cluster/mover_test.go b/cmd/clusterctl/client/cluster/mover_test.go -index ba3d2da0e..7d43c5e50 100644 +index c5281a30a..c6ef110b7 100644 --- a/cmd/clusterctl/client/cluster/mover_test.go +++ b/cmd/clusterctl/client/cluster/mover_test.go -@@ -733,7 +733,7 @@ func Test_objectMover_backupTargetObject(t *testing.T) { +@@ -658,7 +658,7 @@ func Test_objectMover_backupTargetObject(t *testing.T) { g.Expect(getFakeDiscoveryTypes(graph)).To(Succeed()) // trigger discovery the content of the source cluster @@ -126,7 +125,7 @@ index ba3d2da0e..7d43c5e50 100644 // Run backupTargetObject on nodes in graph mover := objectMover{ -@@ -822,7 +822,7 @@ func Test_objectMover_restoreTargetObject(t *testing.T) { +@@ -747,7 +747,7 @@ func Test_objectMover_restoreTargetObject(t *testing.T) { g.Expect(getFakeDiscoveryTypes(graph)).To(Succeed()) // trigger discovery the content of the source cluster @@ -135,7 +134,7 @@ index ba3d2da0e..7d43c5e50 100644 // gets a fakeProxy to an empty cluster with all the required CRDs toProxy := getFakeProxyWithCRDs() -@@ -928,7 +928,7 @@ func Test_objectMover_toDirectory(t *testing.T) { +@@ -853,7 +853,7 @@ func Test_objectMover_toDirectory(t *testing.T) { g.Expect(getFakeDiscoveryTypes(graph)).To(Succeed()) // trigger discovery the content of the source cluster @@ -144,7 +143,7 @@ index ba3d2da0e..7d43c5e50 100644 // Run toDirectory mover := objectMover{ -@@ -1145,7 +1145,7 @@ func Test_getMoveSequence(t *testing.T) { +@@ -1070,7 +1070,7 @@ func Test_getMoveSequence(t *testing.T) { g.Expect(getFakeDiscoveryTypes(graph)).To(Succeed()) // trigger discovery the content of the source cluster @@ -153,7 +152,7 @@ index ba3d2da0e..7d43c5e50 100644 moveSequence := getMoveSequence(graph) g.Expect(moveSequence.groups).To(HaveLen(len(tt.wantMoveGroups))) -@@ -1176,7 +1176,7 @@ func Test_objectMover_move_dryRun(t *testing.T) { +@@ -1101,7 +1101,7 @@ func Test_objectMover_move_dryRun(t *testing.T) { g.Expect(getFakeDiscoveryTypes(graph)).To(Succeed()) // trigger discovery the content of the source cluster @@ -162,7 +161,7 @@ index ba3d2da0e..7d43c5e50 100644 // gets a fakeProxy to an empty cluster with all the required CRDs toProxy := getFakeProxyWithCRDs() -@@ -1249,7 +1249,7 @@ func Test_objectMover_move(t *testing.T) { +@@ -1174,7 +1174,7 @@ func Test_objectMover_move(t *testing.T) { g.Expect(getFakeDiscoveryTypes(graph)).To(Succeed()) // trigger discovery the content of the source cluster @@ -171,16 +170,7 @@ index ba3d2da0e..7d43c5e50 100644 // gets a fakeProxy to an empty cluster with all the required CRDs toProxy := getFakeProxyWithCRDs() -@@ -1358,7 +1358,7 @@ func Test_objectMover_move_with_Mutator(t *testing.T) { - g.Expect(getFakeDiscoveryTypes(graph)).To(Succeed()) - - // trigger discovery the content of the source cluster -- g.Expect(graph.Discovery("")).To(Succeed()) -+ g.Expect(graph.Discovery("", "")).To(Succeed()) - - // gets a fakeProxy to an empty cluster with all the required CRDs - toProxy := getFakeProxyWithCRDs() -@@ -1641,7 +1641,7 @@ func Test_objectMover_checkProvisioningCompleted(t *testing.T) { +@@ -1445,7 +1445,7 @@ func Test_objectMover_checkProvisioningCompleted(t *testing.T) { g.Expect(getFakeDiscoveryTypes(graph)).To(Succeed()) // trigger discovery the content of the source cluster @@ -189,7 +179,7 @@ index ba3d2da0e..7d43c5e50 100644 o := &objectMover{ fromProxy: graph.proxy, -@@ -1881,7 +1881,7 @@ func Test_objectMoverService_ensureNamespaces(t *testing.T) { +@@ -1685,7 +1685,7 @@ func Test_objectMoverService_ensureNamespaces(t *testing.T) { g.Expect(getFakeDiscoveryTypes(graph)).To(Succeed()) // Trigger discovery the content of the source cluster @@ -257,11 +247,11 @@ index b0934b45c..a14de3ac6 100644 } diff --git a/cmd/clusterctl/client/cluster/objectgraph_test.go b/cmd/clusterctl/client/cluster/objectgraph_test.go -index df835eea4..04ef6721b 100644 +index dcd856f48..46572d62f 100644 --- a/cmd/clusterctl/client/cluster/objectgraph_test.go +++ b/cmd/clusterctl/client/cluster/objectgraph_test.go -@@ -1797,7 +1797,7 @@ func TestObjectGraph_Discovery(t *testing.T) { - g.Expect(err).ToNot(HaveOccurred()) +@@ -1720,7 +1720,7 @@ func TestObjectGraph_Discovery(t *testing.T) { + g.Expect(err).NotTo(HaveOccurred()) // finally test discovery - err = graph.Discovery("") @@ -269,8 +259,8 @@ index df835eea4..04ef6721b 100644 if tt.wantErr { g.Expect(err).To(HaveOccurred()) return -@@ -1953,7 +1953,133 @@ func TestObjectGraph_DiscoveryByNamespace(t *testing.T) { - g.Expect(err).ToNot(HaveOccurred()) +@@ -1876,7 +1876,133 @@ func TestObjectGraph_DiscoveryByNamespace(t *testing.T) { + g.Expect(err).NotTo(HaveOccurred()) // finally test discovery - err = graph.Discovery(tt.args.namespace) @@ -405,7 +395,7 @@ index df835eea4..04ef6721b 100644 g.Expect(err).To(HaveOccurred()) return diff --git a/cmd/clusterctl/client/move.go b/cmd/clusterctl/client/move.go -index 386171432..813a8b352 100644 +index 32d90c65a..500f1e19b 100644 --- a/cmd/clusterctl/client/move.go +++ b/cmd/clusterctl/client/move.go @@ -38,6 +38,10 @@ type MoveOptions struct { @@ -416,19 +406,19 @@ index 386171432..813a8b352 100644 + // all the clusters will be moved. + ClusterName string + - // ExperimentalResourceMutatorFn accepts any number of resource mutator functions that are applied on all resources being moved. - // This is an experimental feature and is exposed only from the library and not (yet) through the CLI. - ExperimentalResourceMutators []cluster.ResourceMutatorFunc -@@ -98,7 +102,7 @@ func (c *clusterctlClient) move(options MoveOptions) error { + // FromDirectory apply configuration from directory. + FromDirectory string + +@@ -94,7 +98,7 @@ func (c *clusterctlClient) move(options MoveOptions) error { } } -- return fromCluster.ObjectMover().Move(options.Namespace, toCluster, options.DryRun, options.ExperimentalResourceMutators...) -+ return fromCluster.ObjectMover().Move(options.Namespace, toCluster, options.ClusterName, options.DryRun, options.ExperimentalResourceMutators...) +- return fromCluster.ObjectMover().Move(options.Namespace, toCluster, options.DryRun) ++ return fromCluster.ObjectMover().Move(options.Namespace, toCluster, options.ClusterName, options.DryRun) } func (c *clusterctlClient) fromDirectory(options MoveOptions) error { -@@ -111,7 +115,7 @@ func (c *clusterctlClient) fromDirectory(options MoveOptions) error { +@@ -107,7 +111,7 @@ func (c *clusterctlClient) fromDirectory(options MoveOptions) error { return err } @@ -437,7 +427,7 @@ index 386171432..813a8b352 100644 } func (c *clusterctlClient) toDirectory(options MoveOptions) error { -@@ -133,7 +137,7 @@ func (c *clusterctlClient) toDirectory(options MoveOptions) error { +@@ -129,7 +133,7 @@ func (c *clusterctlClient) toDirectory(options MoveOptions) error { return err } @@ -446,33 +436,6 @@ index 386171432..813a8b352 100644 } func (c *clusterctlClient) getClusterClient(kubeconfig Kubeconfig) (cluster.Client, error) { -diff --git a/cmd/clusterctl/client/move_test.go b/cmd/clusterctl/client/move_test.go -index 8bf911b45..c2d07f9b5 100644 ---- a/cmd/clusterctl/client/move_test.go -+++ b/cmd/clusterctl/client/move_test.go -@@ -298,11 +298,11 @@ type fakeObjectMover struct { - fromDirectoryErr error - } - --func (f *fakeObjectMover) Move(_ string, _ cluster.Client, _ bool, _ ...cluster.ResourceMutatorFunc) error { -+func (f *fakeObjectMover) Move(_ string, _ cluster.Client, _ string, _ bool, _ ...cluster.ResourceMutatorFunc) error { - return f.moveErr - } - --func (f *fakeObjectMover) ToDirectory(_ string, _ string) error { -+func (f *fakeObjectMover) ToDirectory(_ string, _ string, _ string) error { - return f.toDirectoryErr - } - -@@ -310,7 +310,7 @@ func (f *fakeObjectMover) Backup(_ string, _ string) error { - return f.toDirectoryErr - } - --func (f *fakeObjectMover) FromDirectory(_ cluster.Client, _ string) error { -+func (f *fakeObjectMover) FromDirectory(_ cluster.Client, _ string, _ string) error { - return f.fromDirectoryErr - } - diff --git a/cmd/clusterctl/cmd/move.go b/cmd/clusterctl/cmd/move.go index c75557e0a..04b1ef8fe 100644 --- a/cmd/clusterctl/cmd/move.go @@ -503,5 +466,5 @@ index c75557e0a..04b1ef8fe 100644 }) } -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0033-Move-objects-with-force-move-label-and-no-cluster-te.patch b/projects/kubernetes-sigs/cluster-api/patches/0033-Move-objects-with-force-move-label-and-no-cluster-te.patch index c174e67522..3f7c4db07a 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0033-Move-objects-with-force-move-label-and-no-cluster-te.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0033-Move-objects-with-force-move-label-and-no-cluster-te.patch @@ -1,4 +1,4 @@ -From b10c2210be1ca26cab2c8cff6a6bc82ca14c6076 Mon Sep 17 00:00:00 2001 +From 1af4bcd11ca0d9a1ad64f510f2e28098742d00cb Mon Sep 17 00:00:00 2001 From: Vignesh Goutham Ganesh Date: Tue, 30 May 2023 10:14:31 -0500 Subject: [PATCH 33/36] Move objects with force move label and no cluster @@ -30,10 +30,10 @@ index a14de3ac6..d1b884d3a 100644 if _, ok := o.uidToNode[object.identity.UID]; ok { delete(o.uidToNode, object.identity.UID) diff --git a/cmd/clusterctl/client/cluster/objectgraph_test.go b/cmd/clusterctl/client/cluster/objectgraph_test.go -index 04ef6721b..ffd6439e8 100644 +index 46572d62f..9100880e1 100644 --- a/cmd/clusterctl/client/cluster/objectgraph_test.go +++ b/cmd/clusterctl/client/cluster/objectgraph_test.go -@@ -1939,6 +1939,49 @@ func TestObjectGraph_DiscoveryByNamespace(t *testing.T) { +@@ -1988,6 +1988,49 @@ func TestObjectGraph_DiscoveryByCluster(t *testing.T) { }, }, }, @@ -84,5 +84,5 @@ index 04ef6721b..ffd6439e8 100644 for _, tt := range tests { -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0034-allow-registry-mirror-configurations-to-be-mutable-f.patch b/projects/kubernetes-sigs/cluster-api/patches/0034-allow-registry-mirror-configurations-to-be-mutable-f.patch index f837f89e97..a3059e58c9 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0034-allow-registry-mirror-configurations-to-be-mutable-f.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0034-allow-registry-mirror-configurations-to-be-mutable-f.patch @@ -1,4 +1,4 @@ -From 6b29e8b329c5beee8c417640b7db7f42f93b5d9e Mon Sep 17 00:00:00 2001 +From bafedebcc847920f5e1c8e3a1fca82c3fd5238eb Mon Sep 17 00:00:00 2001 From: Cavaughn Browne Date: Thu, 20 Jul 2023 11:05:49 -0500 Subject: [PATCH 34/36] allow registry mirror configurations to be mutable for @@ -10,10 +10,10 @@ Subject: [PATCH 34/36] allow registry mirror configurations to be mutable for 2 files changed, 47 insertions(+) diff --git a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go -index 88b1df8f6..83bf26356 100644 +index 729c964e8..312226cf8 100644 --- a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go +++ b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go -@@ -162,6 +162,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) (admission.War +@@ -161,6 +161,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error { {spec, kubeadmConfigSpec, clusterConfiguration, controllerManager, "*"}, {spec, kubeadmConfigSpec, clusterConfiguration, scheduler}, {spec, kubeadmConfigSpec, clusterConfiguration, scheduler, "*"}, @@ -21,7 +21,7 @@ index 88b1df8f6..83bf26356 100644 {spec, kubeadmConfigSpec, initConfiguration, nodeRegistration}, {spec, kubeadmConfigSpec, initConfiguration, nodeRegistration, "*"}, {spec, kubeadmConfigSpec, initConfiguration, patches, directory}, -@@ -176,6 +177,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) (admission.War +@@ -175,6 +176,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error { {spec, kubeadmConfigSpec, joinConfiguration, "bottlerocketControl", "*"}, {spec, kubeadmConfigSpec, joinConfiguration, "bottlerocketCustomBootstrapContainers"}, {spec, kubeadmConfigSpec, joinConfiguration, "bottlerocketSettings", "*"}, @@ -30,10 +30,10 @@ index 88b1df8f6..83bf26356 100644 {spec, kubeadmConfigSpec, postKubeadmCommands}, {spec, kubeadmConfigSpec, files}, diff --git a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go -index deac82cba..d0d07ffa8 100644 +index 03ea2b8c2..25d5c36da 100644 --- a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go +++ b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go -@@ -304,6 +304,10 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { +@@ -302,6 +302,10 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { ImageTag: "1.6.5", }, }, @@ -44,7 +44,7 @@ index deac82cba..d0d07ffa8 100644 }, JoinConfiguration: &bootstrapv1.JoinConfiguration{ Discovery: bootstrapv1.Discovery{ -@@ -314,6 +318,10 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { +@@ -312,6 +316,10 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { NodeRegistration: bootstrapv1.NodeRegistrationOptions{ Name: "test", }, @@ -55,7 +55,7 @@ index deac82cba..d0d07ffa8 100644 }, PreKubeadmCommands: []string{ "test", "foo", -@@ -706,6 +714,18 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { +@@ -704,6 +712,18 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { updateUseExperimentalRetryJoin := before.DeepCopy() updateUseExperimentalRetryJoin.Spec.KubeadmConfigSpec.UseExperimentalRetryJoin = false //nolint:staticcheck @@ -74,7 +74,7 @@ index deac82cba..d0d07ffa8 100644 tests := []struct { name string enableIgnitionFeature bool -@@ -1117,6 +1137,31 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { +@@ -1115,6 +1135,31 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) { before: before, kcp: validUpdateJoinConfBRCustomBootstrapContainers, }, @@ -107,5 +107,5 @@ index deac82cba..d0d07ffa8 100644 for _, tt := range tests { -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0035-Add-support-for-external-etcd-machines-in-Kind-mappe.patch b/projects/kubernetes-sigs/cluster-api/patches/0035-Add-support-for-external-etcd-machines-in-Kind-mappe.patch index ab5769b7bf..670acbafe0 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0035-Add-support-for-external-etcd-machines-in-Kind-mappe.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0035-Add-support-for-external-etcd-machines-in-Kind-mappe.patch @@ -1,30 +1,16 @@ -From 377ee1cd715461499c7bae4016dbbbaf681683e3 Mon Sep 17 00:00:00 2001 +From 7e4d97db5b757fc3ed5bc447ece4e0010e0ddc8b Mon Sep 17 00:00:00 2001 From: Prow Bot Date: Wed, 16 Aug 2023 19:58:01 -0700 Subject: [PATCH 35/36] Add support for external etcd machines in Kind mapper --- - .../client/cluster/objectgraph_test.go | 2 +- .../docker/exp/internal/docker/nodepool.go | 4 +- .../controllers/dockermachine_controller.go | 13 ++-- .../docker/internal/docker/machine.go | 69 +++++++++++++------ - 4 files changed, 55 insertions(+), 33 deletions(-) + 3 files changed, 54 insertions(+), 32 deletions(-) -diff --git a/cmd/clusterctl/client/cluster/objectgraph_test.go b/cmd/clusterctl/client/cluster/objectgraph_test.go -index ffd6439e8..739e163b4 100644 ---- a/cmd/clusterctl/client/cluster/objectgraph_test.go -+++ b/cmd/clusterctl/client/cluster/objectgraph_test.go -@@ -1942,7 +1942,7 @@ func TestObjectGraph_DiscoveryByNamespace(t *testing.T) { - { - name: "two clusters with external force object, read only 1 cluster & both external objects", - args: args{ -- cluster: "cluster1", // read only from ns1 -+ namespace: "ns1", // read only from ns1 - objs: func() []client.Object { - objs := []client.Object{} - objs = append(objs, test.NewFakeCluster("ns1", "cluster1").Objs()...) diff --git a/test/infrastructure/docker/exp/internal/docker/nodepool.go b/test/infrastructure/docker/exp/internal/docker/nodepool.go -index 08683dea8..b8cb3cb1d 100644 +index 1a46d283a..9e1705cac 100644 --- a/test/infrastructure/docker/exp/internal/docker/nodepool.go +++ b/test/infrastructure/docker/exp/internal/docker/nodepool.go @@ -219,7 +219,7 @@ func (np *NodePool) addMachine(ctx context.Context) error { @@ -46,10 +32,10 @@ index 08683dea8..b8cb3cb1d 100644 } // Check for bootstrap success diff --git a/test/infrastructure/docker/internal/controllers/dockermachine_controller.go b/test/infrastructure/docker/internal/controllers/dockermachine_controller.go -index 5905e95f2..2350ffb13 100644 +index decaafda4..00cbe0d39 100644 --- a/test/infrastructure/docker/internal/controllers/dockermachine_controller.go +++ b/test/infrastructure/docker/internal/controllers/dockermachine_controller.go -@@ -255,7 +255,7 @@ func (r *DockerMachineReconciler) reconcileNormal(ctx context.Context, cluster * +@@ -252,7 +252,7 @@ func (r *DockerMachineReconciler) reconcileNormal(ctx context.Context, cluster * if !externalMachine.Exists() { // NOTE: FailureDomains don't mean much in CAPD since it's all local, but we are setting a label on // each container, so we can check placement. @@ -58,7 +44,7 @@ index 5905e95f2..2350ffb13 100644 return ctrl.Result{}, errors.Wrap(err, "failed to create worker DockerMachine") } } -@@ -335,7 +335,7 @@ func (r *DockerMachineReconciler) reconcileNormal(ctx context.Context, cluster * +@@ -332,7 +332,7 @@ func (r *DockerMachineReconciler) reconcileNormal(ctx context.Context, cluster * }() // Run the bootstrap script. Simulates cloud-init/Ignition. @@ -67,7 +53,7 @@ index 5905e95f2..2350ffb13 100644 conditions.MarkFalse(dockerMachine, infrav1.BootstrapExecSucceededCondition, infrav1.BootstrapFailedReason, clusterv1.ConditionSeverityWarning, "Repeating bootstrap") return ctrl.Result{}, errors.Wrap(err, "failed to exec DockerMachine bootstrap") } -@@ -364,12 +364,12 @@ func (r *DockerMachineReconciler) reconcileNormal(ctx context.Context, cluster * +@@ -361,12 +361,12 @@ func (r *DockerMachineReconciler) reconcileNormal(ctx context.Context, cluster * // Machine will never get a node ref as ProviderID is required to set the node ref, so we would get a deadlock. if cluster.Spec.ControlPlaneRef != nil && !conditions.IsTrue(cluster, clusterv1.ControlPlaneInitializedCondition) && @@ -82,8 +68,8 @@ index 5905e95f2..2350ffb13 100644 // Usually a cloud provider will do this, but there is no docker-cloud provider. // Requeue if there is an error, as this is likely momentary load balancer // state changes during control plane provisioning. -@@ -539,8 +539,3 @@ func setMachineAddress(ctx context.Context, dockerMachine *infrav1.DockerMachine - +@@ -534,8 +534,3 @@ func setMachineAddress(ctx context.Context, dockerMachine *infrav1.DockerMachine + } return nil } - @@ -92,18 +78,18 @@ index 5905e95f2..2350ffb13 100644 - return ok -} diff --git a/test/infrastructure/docker/internal/docker/machine.go b/test/infrastructure/docker/internal/docker/machine.go -index c65c9a882..f37071c2d 100644 +index 12bda2cb2..d36e122ca 100644 --- a/test/infrastructure/docker/internal/docker/machine.go +++ b/test/infrastructure/docker/internal/docker/machine.go -@@ -48,6 +48,7 @@ import ( +@@ -47,6 +47,7 @@ import ( "sigs.k8s.io/cluster-api/test/infrastructure/docker/internal/provisioning/ignition" "sigs.k8s.io/cluster-api/test/infrastructure/kind" "sigs.k8s.io/cluster-api/util/patch" + versionutil "sigs.k8s.io/cluster-api/util/version" ) - var ( -@@ -201,23 +202,35 @@ func (m *Machine) ContainerImage() string { + type nodeCreator interface { +@@ -192,23 +193,35 @@ func (m *Machine) ContainerImage() string { } // Create creates a docker container hosting a Kubernetes node. @@ -150,7 +136,7 @@ index c65c9a882..f37071c2d 100644 } kindMapping := kind.GetMapping(semVer, image) -@@ -329,23 +342,37 @@ func (m *Machine) PreloadLoadImages(ctx context.Context, images []string) error +@@ -320,23 +333,37 @@ func (m *Machine) PreloadLoadImages(ctx context.Context, images []string) error } // ExecBootstrap runs bootstrap on a node, this is generally `kubeadm `. @@ -199,5 +185,5 @@ index c65c9a882..f37071c2d 100644 kindMapping := kind.GetMapping(semVer, image) -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0036-disable-cgroupns-private-to-fix-AL2.patch b/projects/kubernetes-sigs/cluster-api/patches/0036-disable-cgroupns-private-to-fix-AL2.patch index f218a45bf5..3d53d65c37 100644 --- a/projects/kubernetes-sigs/cluster-api/patches/0036-disable-cgroupns-private-to-fix-AL2.patch +++ b/projects/kubernetes-sigs/cluster-api/patches/0036-disable-cgroupns-private-to-fix-AL2.patch @@ -1,4 +1,4 @@ -From 9cc0f2b3429cfe29f4dd1fbc30f6ec12a9f691d3 Mon Sep 17 00:00:00 2001 +From be2cbf0bc0f887c9c230d061be380c349fc06261 Mon Sep 17 00:00:00 2001 From: Jackson West Date: Sat, 19 Aug 2023 09:35:39 -0500 Subject: [PATCH 36/36] disable cgroupns=private to fix AL2 @@ -8,10 +8,10 @@ Subject: [PATCH 36/36] disable cgroupns=private to fix AL2 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/infrastructure/container/docker.go b/test/infrastructure/container/docker.go -index f2de71416..e06e2f3fb 100644 +index 8030a4f26..dba7945b7 100644 --- a/test/infrastructure/container/docker.go +++ b/test/infrastructure/container/docker.go -@@ -41,7 +41,6 @@ import ( +@@ -40,7 +40,6 @@ import ( "k8s.io/utils/pointer" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" @@ -19,7 +19,7 @@ index f2de71416..e06e2f3fb 100644 ) const ( -@@ -411,9 +410,11 @@ func (d *dockerRuntime) RunContainer(ctx context.Context, runConfig *RunContaine +@@ -405,9 +404,11 @@ func (d *dockerRuntime) RunContainer(ctx context.Context, runConfig *RunContaine networkConfig := network.NetworkingConfig{} // NOTE: starting from Kind 0.20 kind requires CgroupnsMode to be set to private. @@ -32,8 +32,8 @@ index f2de71416..e06e2f3fb 100644 + // hostConfig.CgroupnsMode = "private" + // } - if runConfig.IPFamily == clusterv1.IPv6IPFamily || runConfig.IPFamily == clusterv1.DualStackIPFamily { + if runConfig.IPFamily == clusterv1.IPv6IPFamily { hostConfig.Sysctls = map[string]string{ -- -2.42.0 +2.34.1 diff --git a/projects/kubernetes-sigs/cluster-api/patches/0037-Add-flags-for-configuring-rate-limits.patch b/projects/kubernetes-sigs/cluster-api/patches/0037-Add-flags-for-configuring-rate-limits.patch new file mode 100644 index 0000000000..cba2e59675 --- /dev/null +++ b/projects/kubernetes-sigs/cluster-api/patches/0037-Add-flags-for-configuring-rate-limits.patch @@ -0,0 +1,183 @@ +From ba34136c11580c8cba752a3dd1a408cd8b2a7769 Mon Sep 17 00:00:00 2001 +From: Lennart Jern +Date: Thu, 27 Apr 2023 14:03:23 +0300 +Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20flags=20for=20configuring=20r?= + =?UTF-8?q?ate=20limits?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +All the controllers have built-in rate limits. They throttle themselves +if they hit this limit. So far it has not been possible to configure +these limits. This commit adds flags to the controllers for setting both +the QPS and the burst for the rate limits. The default remains the same +as before (20 QPS, 30 burst). + +New flags (for each controller, including CAPD): + +--kube-api-qps +--kube-api-burst + +Also adds .devcontainer to .gitignore. + +Signed-off-by: Vignesh Goutham Ganesh +--- + .gitignore | 3 +++ + bootstrap/kubeadm/main.go | 10 ++++++++++ + controlplane/kubeadm/main.go | 10 ++++++++++ + main.go | 10 ++++++++++ + test/infrastructure/docker/main.go | 8 ++++++++ + 5 files changed, 41 insertions(+) + +diff --git a/.gitignore b/.gitignore +index 35833619a..687dead39 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -89,3 +89,6 @@ tmp + + # asdf (not a typo! ;) used to manage multiple versions of tools + .tool-versions ++ ++# Development container configurations (https://containers.dev/) ++.devcontainer +diff --git a/bootstrap/kubeadm/main.go b/bootstrap/kubeadm/main.go +index cbbd39495..9a0d26c92 100644 +--- a/bootstrap/kubeadm/main.go ++++ b/bootstrap/kubeadm/main.go +@@ -84,6 +84,8 @@ var ( + profilerAddress string + kubeadmConfigConcurrency int + syncPeriod time.Duration ++ restConfigQPS float32 ++ restConfigBurst int + webhookPort int + webhookCertDir string + healthAddr string +@@ -123,6 +125,12 @@ func InitFlags(fs *pflag.FlagSet) { + fs.DurationVar(&syncPeriod, "sync-period", 10*time.Minute, + "The minimum interval at which watched resources are reconciled (e.g. 15m)") + ++ fs.Float32Var(&restConfigQPS, "kube-api-qps", 20, ++ "Maximum queries per second from the controller client to the Kubernetes API server. Defaults to 20") ++ ++ fs.IntVar(&restConfigBurst, "kube-api-burst", 30, ++ "Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server. Default 30") ++ + fs.DurationVar(&tokenTTL, "bootstrap-token-ttl", kubeadmbootstrapcontrollers.DefaultTokenTTL, + "The amount of time the bootstrap token will be valid") + +@@ -167,6 +175,8 @@ func main() { + } + + restConfig := ctrl.GetConfigOrDie() ++ restConfig.QPS = restConfigQPS ++ restConfig.Burst = restConfigBurst + restConfig.UserAgent = remote.DefaultClusterAPIUserAgent("cluster-api-kubeadm-bootstrap-manager") + + tlsOptionOverrides, err := flags.GetTLSOptionOverrideFuncs(tlsOptions) +diff --git a/controlplane/kubeadm/main.go b/controlplane/kubeadm/main.go +index 36b2e745a..1dd0599e2 100644 +--- a/controlplane/kubeadm/main.go ++++ b/controlplane/kubeadm/main.go +@@ -89,6 +89,8 @@ var ( + profilerAddress string + kubeadmControlPlaneConcurrency int + syncPeriod time.Duration ++ restConfigQPS float32 ++ restConfigBurst int + webhookPort int + webhookCertDir string + healthAddr string +@@ -129,6 +131,12 @@ func InitFlags(fs *pflag.FlagSet) { + fs.DurationVar(&syncPeriod, "sync-period", 10*time.Minute, + "The minimum interval at which watched resources are reconciled (e.g. 15m)") + ++ fs.Float32Var(&restConfigQPS, "kube-api-qps", 20, ++ "Maximum queries per second from the controller client to the Kubernetes API server. Defaults to 20") ++ ++ fs.IntVar(&restConfigBurst, "kube-api-burst", 30, ++ "Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server. Default 30") ++ + fs.StringVar(&watchFilterValue, "watch-filter", "", + fmt.Sprintf("Label value that the controller watches to reconcile cluster-api objects. Label key is always %s. If unspecified, the controller watches for all cluster-api objects.", clusterv1.WatchLabel)) + +@@ -176,6 +184,8 @@ func main() { + } + + restConfig := ctrl.GetConfigOrDie() ++ restConfig.QPS = restConfigQPS ++ restConfig.Burst = restConfigBurst + restConfig.UserAgent = remote.DefaultClusterAPIUserAgent("cluster-api-kubeadm-control-plane-manager") + + tlsOptionOverrides, err := flags.GetTLSOptionOverrideFuncs(tlsOptions) +diff --git a/main.go b/main.go +index f93e58361..1efcb3aec 100644 +--- a/main.go ++++ b/main.go +@@ -99,6 +99,8 @@ var ( + clusterResourceSetConcurrency int + machineHealthCheckConcurrency int + syncPeriod time.Duration ++ restConfigQPS float32 ++ restConfigBurst int + webhookPort int + webhookCertDir string + healthAddr string +@@ -192,6 +194,12 @@ func InitFlags(fs *pflag.FlagSet) { + fs.DurationVar(&syncPeriod, "sync-period", 10*time.Minute, + "The minimum interval at which watched resources are reconciled (e.g. 15m)") + ++ fs.Float32Var(&restConfigQPS, "kube-api-qps", 20, ++ "Maximum queries per second from the controller client to the Kubernetes API server. Defaults to 20") ++ ++ fs.IntVar(&restConfigBurst, "kube-api-burst", 30, ++ "Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server. Default 30") ++ + fs.IntVar(&webhookPort, "webhook-port", 9443, + "Webhook Server port") + +@@ -231,6 +239,8 @@ func main() { + } + + restConfig := ctrl.GetConfigOrDie() ++ restConfig.QPS = restConfigQPS ++ restConfig.Burst = restConfigBurst + restConfig.UserAgent = remote.DefaultClusterAPIUserAgent("cluster-api-controller-manager") + + minVer := version.MinimumKubernetesVersion +diff --git a/test/infrastructure/docker/main.go b/test/infrastructure/docker/main.go +index 195ded75c..2b4bb432b 100644 +--- a/test/infrastructure/docker/main.go ++++ b/test/infrastructure/docker/main.go +@@ -67,6 +67,8 @@ var ( + profilerAddress string + syncPeriod time.Duration + concurrency int ++ restConfigQPS float32 ++ restConfigBurst int + healthAddr string + webhookPort int + webhookCertDir string +@@ -99,6 +101,10 @@ func initFlags(fs *pflag.FlagSet) { + "Bind address to expose the pprof profiler (e.g. localhost:6060)") + fs.DurationVar(&syncPeriod, "sync-period", 10*time.Minute, + "The minimum interval at which watched resources are reconciled (e.g. 15m)") ++ fs.Float32Var(&restConfigQPS, "kube-api-qps", 20, ++ "Maximum queries per second from the controller client to the Kubernetes API server. Defaults to 20") ++ fs.IntVar(&restConfigBurst, "kube-api-burst", 30, ++ "Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server. Default 30") + fs.StringVar(&healthAddr, "health-addr", ":9440", + "The address the health endpoint binds to.") + fs.IntVar(&webhookPort, "webhook-port", 9443, +@@ -139,6 +145,8 @@ func main() { + } + + restConfig := ctrl.GetConfigOrDie() ++ restConfig.QPS = restConfigQPS ++ restConfig.Burst = restConfigBurst + restConfig.UserAgent = remote.DefaultClusterAPIUserAgent("cluster-api-docker-controller-manager") + ctrlOptions := ctrl.Options{ + Scheme: myscheme, +-- +2.39.2 (Apple Git-143) +