├── .github ├── ISSUE_TEMPLATE.md └── workflows │ └── support-command.yaml ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── OWNERS ├── README.md ├── SECURITY.md ├── SECURITY_CONTACTS ├── code-of-conduct.md ├── docs ├── design │ ├── design_v1.10.md │ ├── design_v1.7.md │ ├── design_v1.8.md │ └── design_v1.9.md ├── ha-considerations.md ├── managing-e2e-tests.md ├── release-cycle.md ├── test-failures.md ├── testing-pre-releases.md └── updating-command-reference.md ├── kinder ├── .gitignore ├── OWNERS ├── README.md ├── ci │ ├── kinder-run.sh │ ├── kubeadm-periodic.tests.md │ ├── tools │ │ ├── update-workflows │ │ │ ├── README.md │ │ │ ├── cmd │ │ │ │ └── main.go │ │ │ ├── config.yaml │ │ │ ├── pkg │ │ │ │ ├── run.go │ │ │ │ ├── testinfra.go │ │ │ │ ├── types.go │ │ │ │ ├── util.go │ │ │ │ └── workflows.go │ │ │ └── templates │ │ │ │ ├── testinfra │ │ │ │ ├── kubeadm-kinder-addons.yaml │ │ │ │ ├── kubeadm-kinder-control-plane-local-kubelet-mode.yaml │ │ │ │ ├── kubeadm-kinder-discovery.yaml │ │ │ │ ├── kubeadm-kinder-dryrun.yaml │ │ │ │ ├── kubeadm-kinder-encryption-algorithm.yaml │ │ │ │ ├── kubeadm-kinder-external-ca.yaml │ │ │ │ ├── kubeadm-kinder-external-etcd.yaml │ │ │ │ ├── kubeadm-kinder-instance-config.yaml │ │ │ │ ├── kubeadm-kinder-kubelet-x-on-y.yaml │ │ │ │ ├── kubeadm-kinder-patches.yaml │ │ │ │ ├── kubeadm-kinder-rootless.yaml │ │ │ │ ├── kubeadm-kinder-super-admin.yaml │ │ │ │ ├── kubeadm-kinder-upgrade.yaml │ │ │ │ ├── kubeadm-kinder-wait-for-all-control-plane-components.yaml │ │ │ │ ├── kubeadm-kinder-x-on-y.yaml │ │ │ │ └── kubeadm-kinder.yaml │ │ │ │ └── workflows │ │ │ │ ├── control-plane-local-kubelet-mode-tasks.yaml │ │ │ │ ├── control-plane-local-kubelet-mode.yaml │ │ │ │ ├── discovery-tasks.yaml │ │ │ │ ├── discovery.yaml │ │ │ │ ├── dryrun-tasks.yaml │ │ │ │ ├── dryrun.yaml │ │ │ │ ├── encryption-algorithm-tasks.yaml │ │ │ │ ├── encryption-algorithm.yaml │ │ │ │ ├── external-ca-tasks.yaml │ │ │ │ ├── external-ca.yaml │ │ │ │ ├── external-etcd-tasks.yaml │ │ │ │ ├── external-etcd.yaml │ │ │ │ ├── instance-config-tasks.yaml │ │ │ │ ├── instance-config.yaml │ │ │ │ ├── patches-tasks.yaml │ │ │ │ ├── patches.yaml │ │ │ │ ├── presubmit-upgrade-latest.yaml │ │ │ │ ├── presubmit-upgrade-tasks.yaml │ │ │ │ ├── regular-tasks.yaml │ │ │ │ ├── regular.yaml │ │ │ │ ├── rootless-tasks.yaml │ │ │ │ ├── rootless.yaml │ │ │ │ ├── skew-kubelet-x-on-y.yaml │ │ │ │ ├── skew-x-on-y-tasks.yaml │ │ │ │ ├── skew-x-on-y.yaml │ │ │ │ ├── super-admin-tasks.yaml │ │ │ │ ├── super-admin.yaml │ │ │ │ ├── upgrade-no-addon-config-maps-tasks.yaml │ │ │ │ ├── upgrade-no-addon-config-maps.yaml │ │ │ │ ├── upgrade-tasks.yaml │ │ │ │ ├── upgrade.yaml │ │ │ │ ├── wait-for-all-control-plane-components-tasks.yaml │ │ │ │ └── wait-for-all-control-plane-components.yaml │ │ └── verify-workflow.go │ └── workflows │ │ ├── control-plane-local-kubelet-mode-latest.yaml │ │ ├── control-plane-local-kubelet-mode-tasks.yaml │ │ ├── discovery-1.30.yaml │ │ ├── discovery-1.31.yaml │ │ ├── discovery-1.32.yaml │ │ ├── discovery-1.33.yaml │ │ ├── discovery-latest.yaml │ │ ├── discovery-tasks.yaml │ │ ├── dryrun-1.30.yaml │ │ ├── dryrun-1.31.yaml │ │ ├── dryrun-1.32.yaml │ │ ├── dryrun-1.33.yaml │ │ ├── dryrun-latest.yaml │ │ ├── dryrun-tasks.yaml │ │ ├── encryption-algorithm-latest.yaml │ │ ├── encryption-algorithm-tasks.yaml │ │ ├── external-ca-1.30.yaml │ │ ├── external-ca-1.31.yaml │ │ ├── external-ca-1.32.yaml │ │ ├── external-ca-1.33.yaml │ │ ├── external-ca-latest.yaml │ │ ├── external-ca-tasks.yaml │ │ ├── external-etcd-1.30.yaml │ │ ├── external-etcd-1.31.yaml │ │ ├── external-etcd-1.32.yaml │ │ ├── external-etcd-1.33.yaml │ │ ├── external-etcd-latest.yaml │ │ ├── external-etcd-tasks.yaml │ │ ├── instance-config-latest.yaml │ │ ├── instance-config-tasks.yaml │ │ ├── patches-latest.yaml │ │ ├── patches-tasks.yaml │ │ ├── presubmit-upgrade-latest.yaml │ │ ├── presubmit-upgrade-tasks.yaml │ │ ├── regular-1.30.yaml │ │ ├── regular-1.31.yaml │ │ ├── regular-1.32.yaml │ │ ├── regular-1.33.yaml │ │ ├── regular-latest.yaml │ │ ├── regular-tasks.yaml │ │ ├── rootless-latest.yaml │ │ ├── rootless-tasks.yaml │ │ ├── skew-1.31-on-1.30.yaml │ │ ├── skew-1.32-on-1.31.yaml │ │ ├── skew-1.33-on-1.32.yaml │ │ ├── skew-kubelet-1.30-on-1.31.yaml │ │ ├── skew-kubelet-1.30-on-1.32.yaml │ │ ├── skew-kubelet-1.30-on-1.33.yaml │ │ ├── skew-kubelet-1.31-on-1.32.yaml │ │ ├── skew-kubelet-1.31-on-1.33.yaml │ │ ├── skew-kubelet-1.31-on-latest.yaml │ │ ├── skew-kubelet-1.32-on-1.33.yaml │ │ ├── skew-kubelet-1.32-on-latest.yaml │ │ ├── skew-kubelet-1.33-on-latest.yaml │ │ ├── skew-latest-on-1.33.yaml │ │ ├── skew-x-on-y-tasks.yaml │ │ ├── super-admin-latest.yaml │ │ ├── super-admin-tasks.yaml │ │ ├── upgrade-1.30-1.31.yaml │ │ ├── upgrade-1.31-1.32.yaml │ │ ├── upgrade-1.32-1.33.yaml │ │ ├── upgrade-1.33-latest.yaml │ │ ├── upgrade-no-addon-config-maps-latest.yaml │ │ ├── upgrade-no-addon-config-maps-tasks.yaml │ │ ├── upgrade-tasks.yaml │ │ ├── wait-for-all-control-plane-components-latest.yaml │ │ └── wait-for-all-control-plane-components-tasks.yaml ├── cmd │ └── kinder │ │ ├── build │ │ ├── baseimage │ │ │ └── baseimage.go │ │ ├── build.go │ │ └── nodevariant │ │ │ └── nodevariant.go │ │ ├── cp │ │ └── cp.go │ │ ├── create │ │ ├── cluster │ │ │ └── createcluster.go │ │ └── create.go │ │ ├── do │ │ └── do.go │ │ ├── exec │ │ └── exec.go │ │ ├── get │ │ ├── artifacts │ │ │ └── artifacts.go │ │ ├── clusters │ │ │ └── clusters.go │ │ ├── get.go │ │ ├── kubeconfigpath │ │ │ └── kubeconfigpath.go │ │ └── nodes │ │ │ └── nodes.go │ │ ├── kinder.go │ │ ├── test │ │ ├── e2e │ │ │ └── e2e.go │ │ ├── e2ekubeadm │ │ │ └── e2ekubeadm.go │ │ ├── test.go │ │ └── workflow │ │ │ └── workflow.go │ │ └── version │ │ └── version.go ├── doc │ ├── e2e-test.md │ ├── getting-started.md │ ├── kind-kinder.md │ ├── kinder-workflow.png │ ├── prepare-for-tests.md │ ├── reference.md │ ├── test-HA.md │ ├── test-XonY.md │ └── test-upgrades.md ├── go.mod ├── go.sum ├── hack │ ├── orderimports │ │ ├── OWNERS │ │ ├── orderimports.go │ │ ├── orderimports_test.go │ │ └── testdata │ │ │ ├── imports.golden │ │ │ └── imports.input │ ├── update-all.sh │ ├── update-deps.sh │ ├── update-gofmt.sh │ ├── update-imports-order.sh │ ├── update-workflows.sh │ ├── utils.sh │ ├── verify-all.sh │ ├── verify-boilerplate.go │ ├── verify-boilerplate.sh │ ├── verify-boilerplate_test.go │ ├── verify-build.sh │ ├── verify-deps.sh │ ├── verify-gofmt.sh │ ├── verify-golint.sh │ ├── verify-gotest.sh │ ├── verify-govet.sh │ ├── verify-imports-order.sh │ ├── verify-shellcheck.sh │ ├── verify-spelling.sh │ ├── verify-staticcheck.sh │ ├── verify-update-workflows.sh │ ├── verify-whitespace.sh │ └── verify-workflows.sh ├── images │ └── base │ │ └── docker │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── clean-install │ │ └── entrypoint │ │ └── main.go ├── main.go ├── pkg │ ├── build │ │ ├── alter │ │ │ └── alter.go │ │ ├── base │ │ │ ├── README.md │ │ │ └── base.go │ │ └── bits │ │ │ ├── binaryBits.go │ │ │ ├── imageBits.go │ │ │ ├── initBits.go │ │ │ ├── installer.go │ │ │ ├── pathBits.go │ │ │ └── upgradeBits.go │ ├── cluster │ │ ├── manager │ │ │ ├── actions │ │ │ │ ├── actions.go │ │ │ │ ├── assets │ │ │ │ │ └── kindnet.go │ │ │ │ ├── cluster-info.go │ │ │ │ ├── cluster-info_test.go │ │ │ │ ├── copy-certs.go │ │ │ │ ├── images.go │ │ │ │ ├── kubeadm-config.go │ │ │ │ ├── kubeadm-init.go │ │ │ │ ├── kubeadm-join.go │ │ │ │ ├── kubeadm-reset.go │ │ │ │ ├── kubeadm-upgrade.go │ │ │ │ ├── loadbalancer.go │ │ │ │ ├── setup-external-ca.go │ │ │ │ ├── smoke-test.go │ │ │ │ └── waiter.go │ │ │ ├── create.go │ │ │ ├── doc.go │ │ │ └── manage.go │ │ └── status │ │ │ ├── cluster.go │ │ │ ├── cri.go │ │ │ ├── doc.go │ │ │ ├── node.go │ │ │ └── nodelist.go │ ├── constants │ │ └── constants.go │ ├── cri │ │ ├── host │ │ │ ├── archive.go │ │ │ ├── doc.go │ │ │ ├── inspect.go │ │ │ ├── pull.go │ │ │ ├── run.go │ │ │ └── signal.go │ │ └── nodes │ │ │ ├── actionhelper.go │ │ │ ├── alterhelper.go │ │ │ ├── common │ │ │ └── util.go │ │ │ ├── confighelper.go │ │ │ ├── containerd │ │ │ ├── actionhelper.go │ │ │ ├── alterhelper.go │ │ │ ├── config │ │ │ │ ├── config.go │ │ │ │ └── config_test.go │ │ │ └── createhelper.go │ │ │ ├── createhelper.go │ │ │ └── docker │ │ │ ├── actionhelper.go │ │ │ ├── alterhelper.go │ │ │ ├── createhelper.go │ │ │ └── readme.md │ ├── exec │ │ ├── colors │ │ │ └── color.go │ │ ├── host-cmd.go │ │ └── node-cmd.go │ ├── extract │ │ └── extract.go │ ├── kubeadm │ │ ├── automaticcopycertspatch.go │ │ ├── componentpatches.go │ │ ├── config.go │ │ ├── discovery.go │ │ ├── doc.go │ │ ├── dockerpatch.go │ │ ├── encryptionalgorithmpatch.go │ │ ├── externaletcdpatch.go │ │ └── patch.go │ ├── loadbalancer │ │ ├── doc.go │ │ └── loadbalancer.go │ └── test │ │ ├── e2e │ │ ├── binary.go │ │ ├── flags.go │ │ └── runner.go │ │ └── workflow │ │ ├── taskCmdBuilder.go │ │ ├── taskCmdRunner.go │ │ ├── workflow.go │ │ └── workflow_test.go └── roadmap.md ├── logos ├── README.md ├── horizontal │ ├── black │ │ ├── kubeadm-horizontal-black.png │ │ └── kubeadm-horizontal-black.svg │ ├── color │ │ ├── kubeadm-horizontal-color.png │ │ └── kubeadm-horizontal-color.svg │ └── white │ │ ├── kubeadm-horizontal-white.png │ │ └── kubeadm-horizontal-white.svg ├── icon │ ├── black │ │ ├── kubeadm-icon-black.png │ │ └── kubeadm-icon-black.svg │ ├── color │ │ ├── kubeadm-icon-color.png │ │ └── kubeadm-icon-color.svg │ └── white │ │ ├── kubeadm-icon-white.png │ │ └── kubeadm-icon-white.svg └── stacked │ ├── black │ ├── kubeadm-stacked-black.png │ └── kubeadm-stacked-black.svg │ ├── color │ ├── kubeadm-stacked-color.png │ └── kubeadm-stacked-color.svg │ └── white │ ├── kubeadm-stacked-white.png │ └── kubeadm-stacked-white.svg ├── operator ├── README.md └── hack │ └── verify-all.sh └── tests └── e2e ├── README.md └── manifests ├── README.md ├── verify_manifest_lists.go ├── verify_manifest_lists.sh └── verify_manifest_lists_test.go /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 16 | 17 | ## What keywords did you search in kubeadm issues before filing this one? 18 | 19 | If you have found any duplicates, you should instead reply there and close this page. 20 | 21 | If you have not found any duplicates, delete this section and continue on. 22 | 23 | 24 | ## Is this a BUG REPORT or FEATURE REQUEST? 25 | 26 | Choose one: BUG REPORT or FEATURE REQUEST 27 | 28 | 40 | 41 | 42 | ## Versions 43 | 44 | **kubeadm version** (use `kubeadm version`): 45 | 46 | **Environment**: 47 | - **Kubernetes version** (use `kubectl version`): 48 | - **Cloud provider or hardware configuration**: 49 | - **OS** (e.g. from /etc/os-release): 50 | - **Kernel** (e.g. `uname -a`): 51 | - **Container runtime (CRI)** (e.g. containerd, cri-o): 52 | - **Container networking plugin (CNI)** (e.g. Calico, Cilium): 53 | - **Others**: 54 | 55 | 56 | ## What happened? 57 | 58 | 59 | ## What you expected to happen? 60 | 61 | 62 | ## How to reproduce it (as minimally and precisely as possible)? 63 | 64 | 65 | ## Anything else we need to know? 66 | -------------------------------------------------------------------------------- /.github/workflows/support-command.yaml: -------------------------------------------------------------------------------- 1 | on: issue_comment 2 | name: handle the /support command 3 | permissions: {} 4 | jobs: 5 | support_comment: 6 | permissions: 7 | issues: write 8 | 9 | runs-on: ubuntu-24.04 10 | steps: 11 | - name: check for the /support command 12 | id: command 13 | uses: xt0rted/slash-command-action@v2 14 | continue-on-error: true 15 | with: 16 | repo-token: ${{ secrets.GITHUB_TOKEN }} 17 | command: support 18 | reaction: "false" 19 | allow-edits: "true" 20 | permission-level: admin 21 | - name: comment with support text 22 | if: steps.command.outputs.command-name 23 | uses: ben-z/actions-comment-on-issue@1.0.3 24 | with: 25 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 26 | message: | 27 | Hello, @${{ github.event.issue.user.login }} :robot: :wave: 28 | 29 | You seem to have troubles using Kubernetes and kubeadm. 30 | Note that our issue trackers **should not** be used for providing support to users. 31 | There are special channels for that purpose. 32 | 33 | Please see: 34 | - https://github.com/kubernetes/kubeadm#support 35 | - name: add support label 36 | if: steps.command.outputs.command-name 37 | uses: actions-ecosystem/action-add-labels@v1 38 | with: 39 | labels: kind/support 40 | - name: close issue 41 | if: steps.command.outputs.command-name 42 | uses: peter-evans/close-issue@v1 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX trash 2 | .DS_Store 3 | 4 | # Eclipse files 5 | .classpath 6 | .project 7 | .settings/** 8 | 9 | # Files generated by JetBrains IDEs, e.g. IntelliJ IDEA 10 | .idea/ 11 | *.iml 12 | 13 | # Vscode files 14 | .vscode -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - neolit123 5 | - SataQiu 6 | - pacoxu 7 | - carlory 8 | - HirazawaUi 9 | reviewers: 10 | - neolit123 11 | - SataQiu 12 | - pacoxu 13 | - carlory 14 | - HirazawaUi 15 | emeritus_approvers: 16 | - fabriziopandini 17 | - luxas 18 | - timothysc 19 | - rosti 20 | - ereslibre 21 | - chendave 22 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Security Announcements 4 | 5 | Join the [kubernetes-security-announce] group for security and vulnerability announcements. 6 | 7 | You can also subscribe to an RSS feed of the above using [this link][kubernetes-security-announce-rss]. 8 | 9 | ## Reporting a Vulnerability 10 | 11 | Instructions for reporting a vulnerability can be found on the 12 | [Kubernetes Security and Disclosure Information] page. 13 | 14 | ## Supported Versions 15 | 16 | Information about supported Kubernetes versions can be found on the 17 | [Kubernetes version and version skew support policy] page on the Kubernetes website. 18 | 19 | [kubernetes-security-announce]: https://groups.google.com/forum/#!forum/kubernetes-security-announce 20 | [kubernetes-security-announce-rss]: https://groups.google.com/forum/feed/kubernetes-security-announce/msgs/rss_v2_0.xml?num=50 21 | [Kubernetes version and version skew support policy]: https://kubernetes.io/docs/setup/release/version-skew-policy/#supported-versions 22 | [Kubernetes Security and Disclosure Information]: https://kubernetes.io/docs/reference/issues-security/security/#report-a-vulnerability 23 | -------------------------------------------------------------------------------- /SECURITY_CONTACTS: -------------------------------------------------------------------------------- 1 | # Defined below are the security contacts for this repo. 2 | # 3 | # They are the contact point for the Product Security Committee to reach out 4 | # to for triaging and handling of incoming issues. 5 | # 6 | # The below names agree to abide by the 7 | # [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy) 8 | # and will be removed and replaced if they violate that agreement. 9 | # 10 | # DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE 11 | # INSTRUCTIONS AT https://kubernetes.io/security/ 12 | 13 | luxas 14 | timothysc 15 | fabriziopandini 16 | -------------------------------------------------------------------------------- /code-of-conduct.md: -------------------------------------------------------------------------------- 1 | # Kubernetes Community Code of Conduct 2 | 3 | Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) 4 | -------------------------------------------------------------------------------- /docs/updating-command-reference.md: -------------------------------------------------------------------------------- 1 | 2 | ### Updating the kubeadm command reference documentation 3 | 4 | kubeadm uses [Cobra](https://github.com/spf13/cobra) as a CLI library and the command line reference 5 | documentation is generated automatically. The generated output can be found here: 6 | * https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm/ 7 | 8 | If a command or a command flag is added or removed this has to be reflected in the documentation 9 | on a new release. Some manual steps are still required. 10 | 11 | #### Example scenario: adding a new sub-command 12 | 13 | - Implemented a new kubeadm configuration sub-command called `kubeadm config newcommand` by 14 | sending a PR for `kubernetes/kubernetes`. 15 | - Run `./hack/update-generated-docs.sh`. This will generate files in the folder `./docs/admin/`. 16 | Some of them will be for the new command - `*newcommand*`. 17 | - In your local copy of `kubernetes/website` navigate to this folder: 18 | `./content/en/docs/reference/setup-tools/kubeadm/generated` 19 | - Copy the `*newcommand*` files from `kubernetes/docs/admin/` to the folder. 20 | - Create a PR for `kubernetes/website` and add these files to your commit. 21 | - Depending on the parent command of `newcommand` (in this case `config`) import the generated 22 | sub-command in the parent command MD file like so: 23 | ``` 24 | ## kubeadm config view {#cmd-config-newcommand} 25 | {{< include "generated/kubeadm_config_newcommand.md" >}} 26 | ``` 27 | Full example: 28 | * https://git.k8s.io/website/content/en/docs/reference/setup-tools/kubeadm/kubeadm-config.md 29 | - Please note that these files will act only as placeholders with respect to the `kubernetes/website` 30 | and they will later be overwritten with generated files by a [separate tool](https://github.com/kubernetes-incubator/reference-docs) 31 | that also supports HTML styles. This process is managed by SIG Docs on each release. 32 | 33 | #### Example scenario: removing a sub-command 34 | 35 | - Remove the sub-command `kubeadm config newcommand` by sending a PR for `kubernetes/kubernetes`. 36 | - When sending a PR for `kubernetes/website` make sure that you remove files related to `*newcommand*` in: 37 | `./content/en/docs/reference/setup-tools/kubeadm/generated` 38 | - Also, remove includes and any notes about this command in the parent command MD file. 39 | - Make sure that you commit these changes in your PR for `kubernetes/website`. 40 | -------------------------------------------------------------------------------- /kinder/.gitignore: -------------------------------------------------------------------------------- 1 | # tmp folder for testing node variants 2 | /tmp 3 | /kinder 4 | /kinder-test-workflow* 5 | -------------------------------------------------------------------------------- /kinder/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS file documentation: 2 | # https://git.k8s.io/community/contributors/devel/owners.md 3 | labels: 4 | - area/kinder 5 | -------------------------------------------------------------------------------- /kinder/ci/kinder-run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | set -o errexit 17 | set -o nounset 18 | set -o pipefail 19 | 20 | echo "Starting the kinder workflow runner..." 21 | 22 | # this script should be used as a bridge between CI jobs and the kinder binary 23 | if [ "$#" -eq 0 ]; then 24 | echo "error: missing argument for workflow config" 25 | echo "usage:" 26 | echo "# to pick a workflow .yaml file by name from /ci/workflows/" 27 | echo "kinder-run.sh some-workflow" 28 | echo "# to use a file from an absolute path" 29 | echo "kinder-run.sh /some-path/some-workflow.yaml" 30 | exit 1 31 | fi 32 | 33 | # set paths 34 | CURRENT_PATH="$(pwd)" 35 | SCRIPT_PATH="$(dirname "$(readlink -f "$0")")" 36 | ROOT_PATH="$(readlink -f "${SCRIPT_PATH}/..")" 37 | WORKFLOW_BUCKET_PATH="${SCRIPT_PATH}/workflows" 38 | 39 | # build kinder 40 | pushd "${ROOT_PATH}" 41 | echo "Building kinder..." 42 | go version 43 | GO111MODULE=on go build 44 | popd 45 | 46 | # add the kinder ROOT directory to PATH 47 | # this is needed so that the workflow runner can easy call "kinder ..." commands. 48 | export PATH="${PATH}:${ROOT_PATH}" 49 | 50 | # set an optional default name for the cluster created by kinder 51 | export KINDER_CLUSTER_NAME="kinder-test" 52 | 53 | # determine if the passed config is by name or file path 54 | if [[ "$1" != *".yaml" ]] && [[ "$1" != *"/"* ]]; then 55 | echo "Using $1.yaml from the default workflow path..." 56 | WORKFLOW_PATH="${WORKFLOW_BUCKET_PATH}/$1.yaml" 57 | else 58 | WORKFLOW_PATH="$(readlink -f "${CURRENT_PATH}/$1")" 59 | fi 60 | 61 | # run the workflow 62 | KINDER_FLAGS="" 63 | kinder test workflow "${WORKFLOW_PATH}" "${KINDER_FLAGS}" --verbose 64 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/cmd/main.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package main 18 | 19 | import ( 20 | "flag" 21 | "fmt" 22 | "os" 23 | 24 | versionutil "k8s.io/apimachinery/pkg/util/version" 25 | 26 | "k8s.io/kubeadm/kinder/ci/tools/update-workflows/pkg" 27 | ) 28 | 29 | type versionValue struct { 30 | Version *versionutil.Version 31 | } 32 | 33 | func (v versionValue) String() string { 34 | if v.Version == nil { 35 | return "" 36 | } 37 | return v.Version.String() 38 | } 39 | 40 | func (v versionValue) Set(s string) error { 41 | newVer, err := versionutil.ParseGeneric(s) 42 | if err != nil { 43 | return err 44 | } 45 | *v.Version = *newVer 46 | return nil 47 | } 48 | 49 | func main() { 50 | // prepare flags 51 | settings := &pkg.Settings{} 52 | ver := versionValue{&versionutil.Version{}} 53 | flag.Var(&ver, "kubernetes-version", "Kubernetes version (e.g. v1.21.0)") 54 | flag.StringVar(&settings.PathConfig, "config", "", "config file") 55 | flag.StringVar(&settings.PathTestInfra, "path-test-infra", "", "path to the directory with test-infra kubeadm jobs") 56 | flag.StringVar(&settings.PathWorkflows, "path-workflows", "", "path to the directory with kinder workflows") 57 | flag.StringVar(&settings.ImageTestInfra, "image-test-infra", "", "image tag to use for test-infra jobs") 58 | flag.IntVar(&settings.SkewSize, "skew-size", 3, "number of prior Kubernetes minor version to be tested starting from --kubernetes-version (included)") 59 | flag.Parse() 60 | 61 | // check for flags with empty values 62 | flag.VisitAll(func(f *flag.Flag) { 63 | if len(f.Value.String()) != 0 { 64 | return 65 | } 66 | flag.PrintDefaults() 67 | fmt.Fprintf(os.Stderr, "\nerror: the flag --%s is required\n", f.Name) 68 | os.Exit(1) 69 | }) 70 | 71 | // run 72 | settings.KubernetesVersion = ver.Version 73 | if err := pkg.Run(settings); err != nil { 74 | fmt.Fprintf(os.Stderr, "error: %v\n", err) 75 | os.Exit(1) 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-addons.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-no-addons-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: 12h 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm 10 | testgrid-tab-name: kubeadm-kinder-no-addons-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster and test if 'join' and 'upgrade' works with missing addon ConfigMaps" 13 | testgrid-num-columns-recent: "20" 14 | testgrid-num-failures-to-alert: "4" 15 | testgrid-alert-stale-results-hours: "48" 16 | decoration_config: 17 | timeout: 60m 18 | extra_refs: 19 | - org: kubernetes 20 | repo: kubernetes 21 | base_ref: {{ branchFor .KubernetesVersion }} 22 | path_alias: k8s.io/kubernetes 23 | - org: kubernetes 24 | repo: kubeadm 25 | base_ref: main 26 | path_alias: k8s.io/kubeadm 27 | spec: 28 | containers: 29 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 30 | command: 31 | - runner.sh 32 | - "../kubeadm/kinder/ci/kinder-run.sh" 33 | args: 34 | - {{ .WorkflowFile }} 35 | securityContext: 36 | privileged: true 37 | resources: 38 | limits: 39 | memory: "9000Mi" 40 | cpu: 2000m 41 | requests: 42 | memory: "9000Mi" 43 | cpu: 2000m 44 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-control-plane-local-kubelet-mode.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-control-plane-kubelet-local-mode-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm 10 | testgrid-tab-name: kubeadm-kinder-control-plane-kubelet-local-mode-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster using the ControlPlaneKubeletLocalMode feature gate and run the kubeadm-e2e and the conformance suites" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-discovery.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-discovery-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm 10 | testgrid-tab-name: kubeadm-kinder-discovery-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster and test alternative discovery methods for kubeadm join" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-dryrun.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-dryrun-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm 10 | testgrid-tab-name: kubeadm-kinder-dryrun-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster and run kubeadm-e2e and the conformance suite" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-encryption-algorithm.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-encryption-algorithm-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm 10 | testgrid-tab-name: kubeadm-kinder-encryption-algorithm-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster and test the encryption algorithm functionality" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-external-ca.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-external-ca-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm 10 | testgrid-tab-name: kubeadm-kinder-external-ca-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster and tests kubeadm's support for external CA mode" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-external-etcd.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-external-etcd-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm 10 | testgrid-tab-name: kubeadm-kinder-external-etcd-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster with external etcd and run kubeadm-e2e and the conformance suite" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-instance-config.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-instance-config-{{ dashVer .KubernetesVersion }} 2 | cluster: k8s-infra-prow-build 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm 10 | testgrid-tab-name: kubeadm-kinder-instance-config-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create and upgrade a cluster using kubelet instance config and run kubeadm-e2e" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-kubelet-x-on-y.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-kubelet-{{ dashVer .KubeletVersion }}-on-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm, sig-node-kubelet 10 | testgrid-tab-name: kubeadm-kinder-kubelet-{{ dashVer .KubeletVersion }}-on-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io, kubernetes-sig-node-test-failures+testgrid@googlegroups.com 12 | description: "OWNER: sig-cluster-lifecycle (kinder), sig-node (kubelet); Uses kubeadm/kinder to create a cluster with kubelet version skew and run kubeadm-e2e and the conformance suite" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-patches.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-patches-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm 10 | testgrid-tab-name: kubeadm-kinder-patches-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster with patches on static Pod manifests" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-rootless.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-rootless-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm 10 | testgrid-tab-name: kubeadm-kinder-rootless-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster with rootless control-plane and run kubeadm-e2e and the conformance suite" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-super-admin.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-super-admin-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm 10 | testgrid-tab-name: kubeadm-kinder-super-admin-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster and test the super-admin.conf functionality" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-upgrade.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-upgrade-{{ dashVer .InitVersion }}-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm, sig-release-{{ sigReleaseVer .KubernetesVersion }}-informing 10 | testgrid-tab-name: kubeadm-kinder-upgrade-{{ dashVer .InitVersion }}-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io, release-team@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster, upgrade it and run kubeadm-e2e and the conformance suite" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-wait-for-all-control-plane-components.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-wait-for-all-control-plane-components-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm 10 | testgrid-tab-name: kubeadm-kinder-wait-for-all-control-plane-components-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster with the WaitForAllControlPlaneComponents feature gate" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder-x-on-y.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-{{ dashVer .KubeadmVersion }}-on-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm, sig-release-{{ sigReleaseVer .KubeadmVersion }}-informing 10 | testgrid-tab-name: kubeadm-kinder-{{ dashVer .KubeadmVersion }}-on-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io, release-team@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster with version skew and run kubeadm-e2e and the conformance suite" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/testinfra/kubeadm-kinder.yaml: -------------------------------------------------------------------------------- 1 | - name: ci-kubernetes-e2e-kubeadm-kinder-{{ dashVer .KubernetesVersion }} 2 | cluster: eks-prow-build-cluster 3 | interval: {{ .JobInterval }} 4 | decorate: true 5 | labels: 6 | preset-dind-enabled: "true" 7 | preset-kind-volume-mounts: "true" 8 | annotations: 9 | testgrid-dashboards: sig-cluster-lifecycle-kubeadm, sig-release-{{ sigReleaseVer .KubernetesVersion }}-informing 10 | testgrid-tab-name: kubeadm-kinder-{{ dashVer .KubernetesVersion }} 11 | testgrid-alert-email: sig-cluster-lifecycle-kubeadm-alerts@kubernetes.io, release-team@kubernetes.io 12 | description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster and run kubeadm-e2e and the conformance suite" 13 | testgrid-num-columns-recent: "20" 14 | {{ .AlertAnnotations }} 15 | decoration_config: 16 | timeout: 60m 17 | extra_refs: 18 | - org: kubernetes 19 | repo: kubernetes 20 | base_ref: {{ branchFor .KubernetesVersion }} 21 | path_alias: k8s.io/kubernetes 22 | - org: kubernetes 23 | repo: kubeadm 24 | base_ref: main 25 | path_alias: k8s.io/kubeadm 26 | spec: 27 | containers: 28 | - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:{{ .TestInfraImage }}-{{ imageVer .KubernetesVersion }} 29 | command: 30 | - runner.sh 31 | - "../kubeadm/kinder/ci/kinder-run.sh" 32 | args: 33 | - {{ .WorkflowFile }} 34 | securityContext: 35 | privileged: true 36 | resources: 37 | limits: 38 | memory: "9000Mi" 39 | cpu: 2000m 40 | requests: 41 | memory: "9000Mi" 42 | cpu: 2000m 43 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/control-plane-local-kubelet-mode.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow tests the proper functioning of the {{ .KubernetesVersion }} version of both kubeadm and Kubernetes having 4 | the ControlPlaneKubeletLocalMode feature gate set to false. 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-control-plane-local-kubelet-mode{{ dashVer .KubernetesVersion }} 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 7 | vars: 8 | kubernetesVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 9 | upgradeVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 10 | tasks: 11 | - import: control-plane-local-kubelet-mode-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/discovery.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow implements a sequence of tasks used for testing alternative 4 | discovery methods for kubeadm join. 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-discovery-{{ dashVer .KubernetesVersion }} 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 7 | vars: 8 | kubernetesVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 9 | tasks: 10 | - import: discovery-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/dryrun.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow tests the dryrun functioning of the {{ .KubernetesVersion }} version of both kubeadm and Kubernetes 4 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-dryrun-{{ dashVer .KubernetesVersion }} 5 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 6 | vars: 7 | kubernetesVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 8 | upgradeVersion: "\{\{ resolve `ci/{{ ciLabelFor .UpgradeVersion }}` \}\}" 9 | tasks: 10 | - import: dryrun-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/encryption-algorithm.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow tests the proper functioning of the {{ .KubernetesVersion }} version of both kubeadm 4 | and Kubernetes when using a specified encryption algorithm 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-super-admin-{{ dashVer .KubernetesVersion }} 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 7 | vars: 8 | kubernetesVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 9 | upgradeVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 10 | tasks: 11 | - import: encryption-algorithm-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/external-ca.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow implements a sequence of tasks for testing the external CA functionality. 4 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-external-ca-{{ dashVer .KubernetesVersion }} 5 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 6 | vars: 7 | kubernetesVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 8 | tasks: 9 | - import: external-ca-tasks.yaml 10 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/external-etcd.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow tests the proper functioning of deploying an HA 4 | cluster with secret copy using an external etcd cluster 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-external-etcd-{{ dashVer .KubernetesVersion }} 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 7 | vars: 8 | kubernetesVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 9 | tasks: 10 | - import: external-etcd-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/instance-config.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow tests the proper functioning of the {{ .KubernetesVersion }} version of both kubeadm and Kubernetes using 4 | kubelet instance configuration. 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-instance-config{{ dashVer .KubernetesVersion }} 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 7 | vars: 8 | kubernetesVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 9 | upgradeVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 10 | tasks: 11 | - import: instance-config-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/patches.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow implements a sequence of tasks for testing the patches functionality. 4 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-patches-{{ dashVer .KubernetesVersion }} 5 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 6 | vars: 7 | kubernetesVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 8 | tasks: 9 | - import: patches-tasks.yaml 10 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/presubmit-upgrade-latest.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow tests upgrades to Kubernetes ci/latest and also a set of other actions for pull requests 4 | name > pull-kubeadm-kinder-upgrade-latest 5 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/kubeadm/kubeadm-presubmits.yaml 6 | vars: 7 | initVersion: "{{ resolve `ci/latest` }}" 8 | upgradeVersion: "{{ resolve `ci/latest` }}" 9 | tasks: 10 | - import: presubmit-upgrade-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/regular.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow tests the proper functioning of the {{ .KubernetesVersion }} version of both kubeadm and Kubernetes 4 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-{{ dashVer .KubernetesVersion }} 5 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 6 | vars: 7 | kubernetesVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 8 | tasks: 9 | - import: regular-tasks.yaml 10 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/rootless.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow tests the proper functioning of the {{ .KubernetesVersion }} version of both kubeadm and Kubernetes with 4 | the control-plane running as non-root. 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-rootless{{ dashVer .KubernetesVersion }} 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 7 | vars: 8 | kubernetesVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 9 | upgradeVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 10 | tasks: 11 | - import: rootless-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/skew-kubelet-x-on-y.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow tests the proper functioning of kubeadm and control plane from {{ .KubernetesVersion }} against {{ .KubeletVersion }} kubelet 4 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-kubelet-{{ dashVer .KubeletVersion }}-on-{{ .KubernetesVersion }} 5 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 6 | vars: 7 | kubeadmVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubeadmVersion }}` \}\}" 8 | kubeletVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubeletVersion }}` \}\}" 9 | kubernetesVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 10 | ignorePreflightErrors: "KubeletVersion" 11 | ginkgoSkip: "\\[MinimumKubeletVersion:({{ .SkipVersions }})\\]" 12 | controlPlaneNodes: 3 13 | tasks: 14 | - import: skew-x-on-y-tasks.yaml 15 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/skew-x-on-y.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow tests the proper functioning of kubeadm version {{ .KubeadmVersion }} with Kubernetes {{ .KubernetesVersion }} 4 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-{{ dashVer .KubeadmVersion }}-on-{{ dashVer .KubernetesVersion }} 5 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 6 | vars: 7 | kubeadmVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubeadmVersion }}` \}\}" 8 | kubeletVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubeletVersion }}` \}\}" 9 | kubernetesVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 10 | ignorePreflightErrors: "KubeletVersion" 11 | controlPlaneNodes: 3 12 | tasks: 13 | - import: skew-x-on-y-tasks.yaml 14 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/super-admin.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow tests the proper functioning of the {{ .KubernetesVersion }} version of both kubeadm 4 | and Kubernetes when using the super-admin.conf feature. 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-super-admin-{{ dashVer .KubernetesVersion }} 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 7 | vars: 8 | kubernetesVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 9 | upgradeVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 10 | tasks: 11 | - import: super-admin-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/upgrade-no-addon-config-maps.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow implements a sequence of tasks for testing kubeadm join 4 | and upgrade when the "kube-proxy" and "coredns" ConfigMaps are missing. 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-no-addons{{ dashVer .KubernetesVersion }} 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 7 | vars: 8 | initVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 9 | tasks: 10 | - import: upgrade-no-addon-config-maps-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/upgrade.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | this workflow test kubeadm upgrades from Kubernetes {{ .InitVersion }} to {{ .KubernetesVersion }} 4 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-upgrade-{{ dashVer .InitVersion }}-{{ dashVer .KubernetesVersion }} 5 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 6 | vars: 7 | initVersion: "\{\{ resolve `ci/{{ ciLabelFor .InitVersion }}` \}\}" 8 | upgradeVersion: "\{\{ resolve `ci/{{ ciLabelFor .KubernetesVersion }}` \}\}" 9 | controlPlaneNodes: 3 10 | tasks: 11 | - import: upgrade-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/tools/update-workflows/templates/workflows/wait-for-all-control-plane-components.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | summary: | 3 | This workflow tests if kubeadm {{ .InitVersion }} can "init" and "join" nodes with the feature gate 4 | WaitForAllControlPlaneComponents feature disabled. The Kubernetes version is at {{ .KubernetesVersion }}. 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-wait-for-all-control-plane-components-{{ dashVer .KubernetesVersion }} 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }} 7 | vars: 8 | initVersion: "\{\{ resolve `ci/{{ ciLabelFor .InitVersion }}` \}\}" 9 | tasks: 10 | - import: wait-for-all-control-plane-components-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/tools/verify-workflow.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package main 18 | 19 | import ( 20 | "io" 21 | "os" 22 | 23 | log "github.com/sirupsen/logrus" 24 | 25 | ktestworkflow "k8s.io/kubeadm/kinder/pkg/test/workflow" 26 | ) 27 | 28 | func main() { 29 | if len(os.Args) < 2 { 30 | log.Infoln("error: missing file argument") 31 | log.Infoln("usage: verify-workflow some-file.yaml") 32 | os.Exit(1) 33 | } 34 | file := os.Args[1] 35 | log.Infof("Verifying %s...", file) 36 | w, err := ktestworkflow.NewWorkflow(file) 37 | if err != nil { 38 | log.Fatalf("error: failed to create workflow: %v\n", err) 39 | } 40 | if err := w.Run(io.Discard, true, false, true, "ARTIFACTS"); err != nil { 41 | log.Fatalf("error: failed to run workflow: %v\n", err) 42 | } 43 | log.Infof("%s OK", file) 44 | } 45 | -------------------------------------------------------------------------------- /kinder/ci/workflows/control-plane-local-kubelet-mode-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of the latest version of both kubeadm and Kubernetes having 5 | the ControlPlaneKubeletLocalMode feature gate set to false. 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-control-plane-local-kubelet-modelatest 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-control-plane-local-kubelet-mode.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest` }}" 10 | upgradeVersion: "{{ resolve `ci/latest` }}" 11 | tasks: 12 | - import: control-plane-local-kubelet-mode-tasks.yaml 13 | -------------------------------------------------------------------------------- /kinder/ci/workflows/discovery-1.30.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow implements a sequence of tasks used for testing alternative 5 | discovery methods for kubeadm join. 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-discovery-1-30 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-discovery.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest-1.30` }}" 10 | tasks: 11 | - import: discovery-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/discovery-1.31.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow implements a sequence of tasks used for testing alternative 5 | discovery methods for kubeadm join. 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-discovery-1-31 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-discovery.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest-1.31` }}" 10 | tasks: 11 | - import: discovery-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/discovery-1.32.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow implements a sequence of tasks used for testing alternative 5 | discovery methods for kubeadm join. 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-discovery-1-32 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-discovery.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest-1.32` }}" 10 | tasks: 11 | - import: discovery-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/discovery-1.33.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow implements a sequence of tasks used for testing alternative 5 | discovery methods for kubeadm join. 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-discovery-1-33 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-discovery.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest-1.33` }}" 10 | tasks: 11 | - import: discovery-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/discovery-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow implements a sequence of tasks used for testing alternative 5 | discovery methods for kubeadm join. 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-discovery-latest 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-discovery.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest` }}" 10 | tasks: 11 | - import: discovery-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/dryrun-1.30.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the dryrun functioning of the 1.30 version of both kubeadm and Kubernetes 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-dryrun-1-30 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-dryrun.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest-1.30` }}" 9 | upgradeVersion: "{{ resolve `ci/latest-1.31` }}" 10 | tasks: 11 | - import: dryrun-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/dryrun-1.31.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the dryrun functioning of the 1.31 version of both kubeadm and Kubernetes 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-dryrun-1-31 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-dryrun.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest-1.31` }}" 9 | upgradeVersion: "{{ resolve `ci/latest-1.32` }}" 10 | tasks: 11 | - import: dryrun-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/dryrun-1.32.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the dryrun functioning of the 1.32 version of both kubeadm and Kubernetes 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-dryrun-1-32 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-dryrun.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest-1.32` }}" 9 | upgradeVersion: "{{ resolve `ci/latest-1.33` }}" 10 | tasks: 11 | - import: dryrun-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/dryrun-1.33.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the dryrun functioning of the 1.33 version of both kubeadm and Kubernetes 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-dryrun-1-33 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-dryrun.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest-1.33` }}" 9 | upgradeVersion: "{{ resolve `ci/latest` }}" 10 | tasks: 11 | - import: dryrun-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/dryrun-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the dryrun functioning of the latest version of both kubeadm and Kubernetes 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-dryrun-latest 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-dryrun.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest` }}" 9 | upgradeVersion: "{{ resolve `ci/latest` }}" 10 | tasks: 11 | - import: dryrun-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/encryption-algorithm-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of the latest version of both kubeadm 5 | and Kubernetes when using a specified encryption algorithm 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-super-admin-latest 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-encryption-algorithm.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest` }}" 10 | upgradeVersion: "{{ resolve `ci/latest` }}" 11 | tasks: 12 | - import: encryption-algorithm-tasks.yaml 13 | -------------------------------------------------------------------------------- /kinder/ci/workflows/external-ca-1.30.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow implements a sequence of tasks for testing the external CA functionality. 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-external-ca-1-30 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-external-ca.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest-1.30` }}" 9 | tasks: 10 | - import: external-ca-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/workflows/external-ca-1.31.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow implements a sequence of tasks for testing the external CA functionality. 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-external-ca-1-31 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-external-ca.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest-1.31` }}" 9 | tasks: 10 | - import: external-ca-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/workflows/external-ca-1.32.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow implements a sequence of tasks for testing the external CA functionality. 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-external-ca-1-32 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-external-ca.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest-1.32` }}" 9 | tasks: 10 | - import: external-ca-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/workflows/external-ca-1.33.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow implements a sequence of tasks for testing the external CA functionality. 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-external-ca-1-33 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-external-ca.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest-1.33` }}" 9 | tasks: 10 | - import: external-ca-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/workflows/external-ca-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow implements a sequence of tasks for testing the external CA functionality. 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-external-ca-latest 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-external-ca.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest` }}" 9 | tasks: 10 | - import: external-ca-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/workflows/external-etcd-1.30.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of deploying an HA 5 | cluster with secret copy using an external etcd cluster 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-external-etcd-1-30 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-external-etcd.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest-1.30` }}" 10 | tasks: 11 | - import: external-etcd-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/external-etcd-1.31.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of deploying an HA 5 | cluster with secret copy using an external etcd cluster 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-external-etcd-1-31 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-external-etcd.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest-1.31` }}" 10 | tasks: 11 | - import: external-etcd-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/external-etcd-1.32.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of deploying an HA 5 | cluster with secret copy using an external etcd cluster 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-external-etcd-1-32 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-external-etcd.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest-1.32` }}" 10 | tasks: 11 | - import: external-etcd-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/external-etcd-1.33.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of deploying an HA 5 | cluster with secret copy using an external etcd cluster 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-external-etcd-1-33 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-external-etcd.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest-1.33` }}" 10 | tasks: 11 | - import: external-etcd-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/external-etcd-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of deploying an HA 5 | cluster with secret copy using an external etcd cluster 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-external-etcd-latest 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-external-etcd.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest` }}" 10 | tasks: 11 | - import: external-etcd-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/instance-config-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of the latest version of both kubeadm and Kubernetes using 5 | kubelet instance configuration. 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-instance-configlatest 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-instance-config.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest` }}" 10 | upgradeVersion: "{{ resolve `ci/latest` }}" 11 | tasks: 12 | - import: instance-config-tasks.yaml 13 | -------------------------------------------------------------------------------- /kinder/ci/workflows/patches-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow implements a sequence of tasks for testing the patches functionality. 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-patches-latest 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-patches.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest` }}" 9 | tasks: 10 | - import: patches-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/workflows/presubmit-upgrade-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests upgrades to Kubernetes ci/latest and also a set of other actions for pull requests 5 | name > pull-kubeadm-kinder-upgrade-latest 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/kubeadm/kubeadm-presubmits.yaml 7 | vars: 8 | initVersion: "{{ resolve `ci/latest` }}" 9 | upgradeVersion: "{{ resolve `ci/latest` }}" 10 | tasks: 11 | - import: presubmit-upgrade-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/regular-1.30.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of the 1.30 version of both kubeadm and Kubernetes 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-1-30 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest-1.30` }}" 9 | tasks: 10 | - import: regular-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/workflows/regular-1.31.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of the 1.31 version of both kubeadm and Kubernetes 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-1-31 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest-1.31` }}" 9 | tasks: 10 | - import: regular-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/workflows/regular-1.32.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of the 1.32 version of both kubeadm and Kubernetes 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-1-32 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest-1.32` }}" 9 | tasks: 10 | - import: regular-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/workflows/regular-1.33.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of the 1.33 version of both kubeadm and Kubernetes 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-1-33 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest-1.33` }}" 9 | tasks: 10 | - import: regular-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/workflows/regular-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of the latest version of both kubeadm and Kubernetes 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-latest 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder.yaml 7 | vars: 8 | kubernetesVersion: "{{ resolve `ci/latest` }}" 9 | tasks: 10 | - import: regular-tasks.yaml 11 | -------------------------------------------------------------------------------- /kinder/ci/workflows/rootless-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of the latest version of both kubeadm and Kubernetes with 5 | the control-plane running as non-root. 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-rootlesslatest 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-rootless.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest` }}" 10 | upgradeVersion: "{{ resolve `ci/latest` }}" 11 | tasks: 12 | - import: rootless-tasks.yaml 13 | -------------------------------------------------------------------------------- /kinder/ci/workflows/skew-1.31-on-1.30.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of kubeadm version 1.31 with Kubernetes 1.30 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-1-31-on-1-30 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-x-on-y.yaml 7 | vars: 8 | kubeadmVersion: "{{ resolve `ci/latest-1.31` }}" 9 | kubeletVersion: "{{ resolve `ci/latest-1.30` }}" 10 | kubernetesVersion: "{{ resolve `ci/latest-1.30` }}" 11 | ignorePreflightErrors: "KubeletVersion" 12 | controlPlaneNodes: 3 13 | tasks: 14 | - import: skew-x-on-y-tasks.yaml 15 | -------------------------------------------------------------------------------- /kinder/ci/workflows/skew-1.32-on-1.31.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of kubeadm version 1.32 with Kubernetes 1.31 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-1-32-on-1-31 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-x-on-y.yaml 7 | vars: 8 | kubeadmVersion: "{{ resolve `ci/latest-1.32` }}" 9 | kubeletVersion: "{{ resolve `ci/latest-1.31` }}" 10 | kubernetesVersion: "{{ resolve `ci/latest-1.31` }}" 11 | ignorePreflightErrors: "KubeletVersion" 12 | controlPlaneNodes: 3 13 | tasks: 14 | - import: skew-x-on-y-tasks.yaml 15 | -------------------------------------------------------------------------------- /kinder/ci/workflows/skew-1.33-on-1.32.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of kubeadm version 1.33 with Kubernetes 1.32 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-1-33-on-1-32 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-x-on-y.yaml 7 | vars: 8 | kubeadmVersion: "{{ resolve `ci/latest-1.33` }}" 9 | kubeletVersion: "{{ resolve `ci/latest-1.32` }}" 10 | kubernetesVersion: "{{ resolve `ci/latest-1.32` }}" 11 | ignorePreflightErrors: "KubeletVersion" 12 | controlPlaneNodes: 3 13 | tasks: 14 | - import: skew-x-on-y-tasks.yaml 15 | -------------------------------------------------------------------------------- /kinder/ci/workflows/skew-kubelet-1.30-on-1.31.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of kubeadm and control plane from 1.31 against 1.30 kubelet 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-kubelet-1-30-on-1.31 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-kubelet-x-on-y.yaml 7 | vars: 8 | kubeadmVersion: "{{ resolve `ci/latest-1.31` }}" 9 | kubeletVersion: "{{ resolve `ci/latest-1.30` }}" 10 | kubernetesVersion: "{{ resolve `ci/latest-1.31` }}" 11 | ignorePreflightErrors: "KubeletVersion" 12 | ginkgoSkip: "\\[MinimumKubeletVersion:(1.31)\\]" 13 | controlPlaneNodes: 3 14 | tasks: 15 | - import: skew-x-on-y-tasks.yaml 16 | -------------------------------------------------------------------------------- /kinder/ci/workflows/skew-kubelet-1.30-on-1.32.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of kubeadm and control plane from 1.32 against 1.30 kubelet 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-kubelet-1-30-on-1.32 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-kubelet-x-on-y.yaml 7 | vars: 8 | kubeadmVersion: "{{ resolve `ci/latest-1.32` }}" 9 | kubeletVersion: "{{ resolve `ci/latest-1.30` }}" 10 | kubernetesVersion: "{{ resolve `ci/latest-1.32` }}" 11 | ignorePreflightErrors: "KubeletVersion" 12 | ginkgoSkip: "\\[MinimumKubeletVersion:(1.31|1.32)\\]" 13 | controlPlaneNodes: 3 14 | tasks: 15 | - import: skew-x-on-y-tasks.yaml 16 | -------------------------------------------------------------------------------- /kinder/ci/workflows/skew-kubelet-1.30-on-1.33.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of kubeadm and control plane from 1.33 against 1.30 kubelet 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-kubelet-1-30-on-1.33 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-kubelet-x-on-y.yaml 7 | vars: 8 | kubeadmVersion: "{{ resolve `ci/latest-1.33` }}" 9 | kubeletVersion: "{{ resolve `ci/latest-1.30` }}" 10 | kubernetesVersion: "{{ resolve `ci/latest-1.33` }}" 11 | ignorePreflightErrors: "KubeletVersion" 12 | ginkgoSkip: "\\[MinimumKubeletVersion:(1.31|1.32|1.33)\\]" 13 | controlPlaneNodes: 3 14 | tasks: 15 | - import: skew-x-on-y-tasks.yaml 16 | -------------------------------------------------------------------------------- /kinder/ci/workflows/skew-kubelet-1.31-on-1.32.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of kubeadm and control plane from 1.32 against 1.31 kubelet 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-kubelet-1-31-on-1.32 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-kubelet-x-on-y.yaml 7 | vars: 8 | kubeadmVersion: "{{ resolve `ci/latest-1.32` }}" 9 | kubeletVersion: "{{ resolve `ci/latest-1.31` }}" 10 | kubernetesVersion: "{{ resolve `ci/latest-1.32` }}" 11 | ignorePreflightErrors: "KubeletVersion" 12 | ginkgoSkip: "\\[MinimumKubeletVersion:(1.32)\\]" 13 | controlPlaneNodes: 3 14 | tasks: 15 | - import: skew-x-on-y-tasks.yaml 16 | -------------------------------------------------------------------------------- /kinder/ci/workflows/skew-kubelet-1.31-on-1.33.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of kubeadm and control plane from 1.33 against 1.31 kubelet 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-kubelet-1-31-on-1.33 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-kubelet-x-on-y.yaml 7 | vars: 8 | kubeadmVersion: "{{ resolve `ci/latest-1.33` }}" 9 | kubeletVersion: "{{ resolve `ci/latest-1.31` }}" 10 | kubernetesVersion: "{{ resolve `ci/latest-1.33` }}" 11 | ignorePreflightErrors: "KubeletVersion" 12 | ginkgoSkip: "\\[MinimumKubeletVersion:(1.32|1.33)\\]" 13 | controlPlaneNodes: 3 14 | tasks: 15 | - import: skew-x-on-y-tasks.yaml 16 | -------------------------------------------------------------------------------- /kinder/ci/workflows/skew-kubelet-1.31-on-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of kubeadm and control plane from latest against 1.31 kubelet 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-kubelet-1-31-on-latest 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-kubelet-x-on-y.yaml 7 | vars: 8 | kubeadmVersion: "{{ resolve `ci/latest` }}" 9 | kubeletVersion: "{{ resolve `ci/latest-1.31` }}" 10 | kubernetesVersion: "{{ resolve `ci/latest` }}" 11 | ignorePreflightErrors: "KubeletVersion" 12 | ginkgoSkip: "\\[MinimumKubeletVersion:(1.33|1.34|1.35)\\]" 13 | controlPlaneNodes: 3 14 | tasks: 15 | - import: skew-x-on-y-tasks.yaml 16 | -------------------------------------------------------------------------------- /kinder/ci/workflows/skew-kubelet-1.32-on-1.33.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of kubeadm and control plane from 1.33 against 1.32 kubelet 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-kubelet-1-32-on-1.33 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-kubelet-x-on-y.yaml 7 | vars: 8 | kubeadmVersion: "{{ resolve `ci/latest-1.33` }}" 9 | kubeletVersion: "{{ resolve `ci/latest-1.32` }}" 10 | kubernetesVersion: "{{ resolve `ci/latest-1.33` }}" 11 | ignorePreflightErrors: "KubeletVersion" 12 | ginkgoSkip: "\\[MinimumKubeletVersion:(1.33)\\]" 13 | controlPlaneNodes: 3 14 | tasks: 15 | - import: skew-x-on-y-tasks.yaml 16 | -------------------------------------------------------------------------------- /kinder/ci/workflows/skew-kubelet-1.32-on-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of kubeadm and control plane from latest against 1.32 kubelet 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-kubelet-1-32-on-latest 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-kubelet-x-on-y.yaml 7 | vars: 8 | kubeadmVersion: "{{ resolve `ci/latest` }}" 9 | kubeletVersion: "{{ resolve `ci/latest-1.32` }}" 10 | kubernetesVersion: "{{ resolve `ci/latest` }}" 11 | ignorePreflightErrors: "KubeletVersion" 12 | ginkgoSkip: "\\[MinimumKubeletVersion:(1.33|1.34)\\]" 13 | controlPlaneNodes: 3 14 | tasks: 15 | - import: skew-x-on-y-tasks.yaml 16 | -------------------------------------------------------------------------------- /kinder/ci/workflows/skew-kubelet-1.33-on-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of kubeadm and control plane from latest against 1.33 kubelet 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-kubelet-1-33-on-latest 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-kubelet-x-on-y.yaml 7 | vars: 8 | kubeadmVersion: "{{ resolve `ci/latest` }}" 9 | kubeletVersion: "{{ resolve `ci/latest-1.33` }}" 10 | kubernetesVersion: "{{ resolve `ci/latest` }}" 11 | ignorePreflightErrors: "KubeletVersion" 12 | ginkgoSkip: "\\[MinimumKubeletVersion:(1.34)\\]" 13 | controlPlaneNodes: 3 14 | tasks: 15 | - import: skew-x-on-y-tasks.yaml 16 | -------------------------------------------------------------------------------- /kinder/ci/workflows/skew-latest-on-1.33.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of kubeadm version latest with Kubernetes 1.33 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-latest-on-1-33 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-x-on-y.yaml 7 | vars: 8 | kubeadmVersion: "{{ resolve `ci/latest` }}" 9 | kubeletVersion: "{{ resolve `ci/latest-1.33` }}" 10 | kubernetesVersion: "{{ resolve `ci/latest-1.33` }}" 11 | ignorePreflightErrors: "KubeletVersion" 12 | controlPlaneNodes: 3 13 | tasks: 14 | - import: skew-x-on-y-tasks.yaml 15 | -------------------------------------------------------------------------------- /kinder/ci/workflows/super-admin-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests the proper functioning of the latest version of both kubeadm 5 | and Kubernetes when using the super-admin.conf feature. 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-super-admin-latest 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-super-admin.yaml 8 | vars: 9 | kubernetesVersion: "{{ resolve `ci/latest` }}" 10 | upgradeVersion: "{{ resolve `ci/latest` }}" 11 | tasks: 12 | - import: super-admin-tasks.yaml 13 | -------------------------------------------------------------------------------- /kinder/ci/workflows/upgrade-1.30-1.31.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | this workflow test kubeadm upgrades from Kubernetes 1.30 to 1.31 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-upgrade-1-30-1-31 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-upgrade.yaml 7 | vars: 8 | initVersion: "{{ resolve `ci/latest-1.30` }}" 9 | upgradeVersion: "{{ resolve `ci/latest-1.31` }}" 10 | controlPlaneNodes: 3 11 | tasks: 12 | - import: upgrade-tasks.yaml 13 | -------------------------------------------------------------------------------- /kinder/ci/workflows/upgrade-1.31-1.32.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | this workflow test kubeadm upgrades from Kubernetes 1.31 to 1.32 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-upgrade-1-31-1-32 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-upgrade.yaml 7 | vars: 8 | initVersion: "{{ resolve `ci/latest-1.31` }}" 9 | upgradeVersion: "{{ resolve `ci/latest-1.32` }}" 10 | controlPlaneNodes: 3 11 | tasks: 12 | - import: upgrade-tasks.yaml 13 | -------------------------------------------------------------------------------- /kinder/ci/workflows/upgrade-1.32-1.33.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | this workflow test kubeadm upgrades from Kubernetes 1.32 to 1.33 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-upgrade-1-32-1-33 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-upgrade.yaml 7 | vars: 8 | initVersion: "{{ resolve `ci/latest-1.32` }}" 9 | upgradeVersion: "{{ resolve `ci/latest-1.33` }}" 10 | controlPlaneNodes: 3 11 | tasks: 12 | - import: upgrade-tasks.yaml 13 | -------------------------------------------------------------------------------- /kinder/ci/workflows/upgrade-1.33-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | this workflow test kubeadm upgrades from Kubernetes 1.33 to latest 5 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-upgrade-1-33-latest 6 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-upgrade.yaml 7 | vars: 8 | initVersion: "{{ resolve `ci/latest-1.33` }}" 9 | upgradeVersion: "{{ resolve `ci/latest` }}" 10 | controlPlaneNodes: 3 11 | tasks: 12 | - import: upgrade-tasks.yaml 13 | -------------------------------------------------------------------------------- /kinder/ci/workflows/upgrade-no-addon-config-maps-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow implements a sequence of tasks for testing kubeadm join 5 | and upgrade when the "kube-proxy" and "coredns" ConfigMaps are missing. 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-no-addonslatest 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-addons.yaml 8 | vars: 9 | initVersion: "{{ resolve `ci/latest` }}" 10 | tasks: 11 | - import: upgrade-no-addon-config-maps-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/ci/workflows/wait-for-all-control-plane-components-latest.yaml: -------------------------------------------------------------------------------- 1 | # AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows 2 | version: 1 3 | summary: | 4 | This workflow tests if kubeadm latest can "init" and "join" nodes with the feature gate 5 | WaitForAllControlPlaneComponents feature disabled. The Kubernetes version is at latest. 6 | test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-wait-for-all-control-plane-components-latest 7 | config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-wait-for-all-control-plane-components.yaml 8 | vars: 9 | initVersion: "{{ resolve `ci/latest` }}" 10 | tasks: 11 | - import: wait-for-all-control-plane-components-tasks.yaml 12 | -------------------------------------------------------------------------------- /kinder/cmd/kinder/build/baseimage/baseimage.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package baseimage 18 | 19 | import ( 20 | "strings" 21 | 22 | "github.com/pkg/errors" 23 | "github.com/spf13/cobra" 24 | "k8s.io/kubeadm/kinder/pkg/build/base" 25 | "k8s.io/kubeadm/kinder/pkg/constants" 26 | ) 27 | 28 | type flagpole struct { 29 | Source string 30 | Image string 31 | CRI string 32 | } 33 | 34 | // NewCommand returns a new cobra.Command for building the base image 35 | func NewCommand() *cobra.Command { 36 | flags := &flagpole{} 37 | cmd := &cobra.Command{ 38 | Args: cobra.NoArgs, 39 | // TODO: more detailed usage 40 | Use: "base-image", 41 | Short: "build the base node image", 42 | Long: `build the base node image for running nested containers, systemd, and kubernetes components.`, 43 | RunE: func(cmd *cobra.Command, args []string) error { 44 | return runE(flags, cmd, args) 45 | }, 46 | } 47 | cmd.Flags().StringVar( 48 | &flags.Source, "source", 49 | "", 50 | "path to the base image sources, autodetected by default", 51 | ) 52 | cmd.Flags().StringVar( 53 | &flags.Image, "image", 54 | constants.DefaultBaseImage, 55 | "name:tag of the resulting image to be built", 56 | ) 57 | cmd.Flags().StringVar( 58 | &flags.CRI, "cri", 59 | "containerd", 60 | "container runtime to be added to the image. Use one of [docker, containerd]", 61 | ) 62 | return cmd 63 | } 64 | 65 | func runE(flags *flagpole, cmd *cobra.Command, args []string) error { 66 | switch strings.ToLower(flags.CRI) { 67 | case "containerd": 68 | // Use build base image from Kind 69 | return errors.New("kinder doesn't support building base images for conainerd. Use a base image from Kind") 70 | case "docker": 71 | // Use build base image from kinder 72 | ctx := base.NewBuildContext( 73 | base.WithImage(flags.Image), 74 | base.WithSourceDir(flags.Source), 75 | ) 76 | if err := ctx.Build(); err != nil { 77 | return errors.Wrap(err, "build failed") 78 | } 79 | return nil 80 | default: 81 | return errors.Errorf("%s container runtime is not supported. Use one of [docker, containerd]", flags.CRI) 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /kinder/cmd/kinder/build/build.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package build 18 | 19 | import ( 20 | "github.com/spf13/cobra" 21 | 22 | "k8s.io/kubeadm/kinder/cmd/kinder/build/baseimage" 23 | "k8s.io/kubeadm/kinder/cmd/kinder/build/nodevariant" 24 | ) 25 | 26 | // NewCommand returns a new cobra.Command for building 27 | func NewCommand() *cobra.Command { 28 | cmd := &cobra.Command{ 29 | Args: cobra.NoArgs, 30 | Use: "build", 31 | Short: "Build one of [base-image, node-image-variant]", 32 | Long: "The 'build' command is used for creating images necessary for a Kubernetes cluster created with kinder.\n" + 33 | "It has two primary subcommands:\n" + 34 | "1. 'base-image': This command is used to build the base image for nodes in the cluster.\n" + 35 | "The base image includes all the necessary dependencies and configurations required for Kubernetes nodes.\n" + 36 | "2. 'node-image-variant': This command is used to build different variants of the node images based\n" + 37 | "on the base image. These variants may include different Kubernetes versions, CNI plugins,\n" + 38 | "or any other variations as needed for testing different Kubernetes features and behaviors.\n", 39 | } 40 | // add subcommands 41 | cmd.AddCommand(baseimage.NewCommand()) 42 | cmd.AddCommand(nodevariant.NewCommand()) 43 | return cmd 44 | } 45 | -------------------------------------------------------------------------------- /kinder/cmd/kinder/cp/cp.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package cp 18 | 19 | import ( 20 | "github.com/pkg/errors" 21 | "github.com/spf13/cobra" 22 | 23 | "k8s.io/kubeadm/kinder/pkg/cluster/manager" 24 | "k8s.io/kubeadm/kinder/pkg/constants" 25 | ) 26 | 27 | type flagpole struct { 28 | Name string 29 | } 30 | 31 | // NewCommand returns a new cobra.Command for exec 32 | func NewCommand() *cobra.Command { 33 | flags := &flagpole{} 34 | cmd := &cobra.Command{ 35 | Args: cobra.ExactArgs(2), 36 | Use: "cp [flags] [NODE_NAME|NODE_SELECTOR:]SRC_PATH DEST_PATH |-\n" + 37 | " kinder cp [flags] SRC_PATH [NODE_NAME|NODE_SELECTOR:]DEST_PATH\n\n" + 38 | "Args:\n" + 39 | " NODE_NAME is the container name without the cluster name prefix\n" + 40 | " NODE_SELECTOR can be one of:\n" + 41 | " @all all the control-plane and worker nodes \n" + 42 | " @cp* all the control-plane nodes \n" + 43 | " @cp1 the bootstrap-control plane node \n" + 44 | " @cpN the secondary control plane nodes \n" + 45 | " @w* all the worker nodes\n" + 46 | " @lb the external load balancer\n" + 47 | " @etcd the external etcd", 48 | Short: "Copy files/folders between a node and the local filesystem", 49 | Long: "kinder cp is a \"topology aware\" wrapper on docker cp", 50 | RunE: func(cmd *cobra.Command, args []string) error { 51 | return runE(flags, cmd, args) 52 | }, 53 | } 54 | cmd.Flags().StringVar( 55 | &flags.Name, "name", 56 | constants.DefaultClusterName, 57 | "cluster name", 58 | ) 59 | return cmd 60 | } 61 | 62 | func runE(flags *flagpole, cmd *cobra.Command, args []string) error { 63 | // get a kinder cluster manager 64 | o, err := manager.NewClusterManager(flags.Name) 65 | if err != nil { 66 | return errors.Wrapf(err, "failed to create a kinder cluster manager for %s", flags.Name) 67 | } 68 | 69 | // execute the copy action on selected target nodes 70 | err = o.CopyFile(args[0], args[1]) 71 | if err != nil { 72 | return errors.Wrap(err, "failed to copy files") 73 | } 74 | 75 | return nil 76 | } 77 | -------------------------------------------------------------------------------- /kinder/cmd/kinder/create/create.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package create 18 | 19 | import ( 20 | "github.com/spf13/cobra" 21 | 22 | createcluster "k8s.io/kubeadm/kinder/cmd/kinder/create/cluster" 23 | ) 24 | 25 | // NewCommand returns a new cobra.Command for cluster creation 26 | func NewCommand() *cobra.Command { 27 | cmd := &cobra.Command{ 28 | Args: cobra.NoArgs, 29 | Use: "create", 30 | Short: "Creates a cluster", 31 | Long: "Creates a local Kubernetes cluster", 32 | } 33 | cmd.AddCommand(createcluster.NewCommand()) 34 | return cmd 35 | } 36 | -------------------------------------------------------------------------------- /kinder/cmd/kinder/exec/exec.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package exec 18 | 19 | import ( 20 | "github.com/pkg/errors" 21 | "github.com/spf13/cobra" 22 | 23 | "k8s.io/kubeadm/kinder/pkg/cluster/manager" 24 | "k8s.io/kubeadm/kinder/pkg/constants" 25 | ) 26 | 27 | type flagpole struct { 28 | Name string 29 | } 30 | 31 | // NewCommand returns a new cobra.Command for exec 32 | func NewCommand() *cobra.Command { 33 | flags := &flagpole{} 34 | cmd := &cobra.Command{ 35 | Args: cobra.MinimumNArgs(2), 36 | Use: "exec [flags] NODE_NAME|NODE_SELECTOR -- COMMAND [ARG...]>\n\n" + 37 | "Args:\n" + 38 | " NODE_NAME is the container name without the cluster name prefix\n" + 39 | " NODE_SELECTOR can be one of:\n" + 40 | " @all all the control-plane and worker nodes \n" + 41 | " @cp* all the control-plane nodes \n" + 42 | " @cp1 the bootstrap-control plane node \n" + 43 | " @cpN the secondary control plane nodes \n" + 44 | " @w* all the worker nodes\n" + 45 | " @lb the external load balancer\n" + 46 | " @etcd the external etcd", 47 | Short: "Executes command on one or more nodes in the local Kubernetes cluster", 48 | Long: "Exec is a \"topology aware\" wrapper on docker exec, allowing to run command on one or more nodes in the local Kubernetes cluster\n", 49 | RunE: func(cmd *cobra.Command, args []string) error { 50 | return runE(flags, cmd, args) 51 | }, 52 | } 53 | cmd.Flags().StringVar( 54 | &flags.Name, 55 | "name", constants.DefaultClusterName, 56 | "cluster name", 57 | ) 58 | return cmd 59 | } 60 | 61 | func runE(flags *flagpole, cmd *cobra.Command, args []string) error { 62 | // get a kinder cluster manager 63 | o, err := manager.NewClusterManager(flags.Name) 64 | if err != nil { 65 | return errors.Wrapf(err, "failed to create a kinder cluster manager for %s", flags.Name) 66 | } 67 | 68 | // execute the command on selected target nodes 69 | err = o.ExecCommand(args[0], args[1:]) 70 | if err != nil { 71 | return errors.Wrap(err, "failed to exec command") 72 | } 73 | 74 | return nil 75 | } 76 | -------------------------------------------------------------------------------- /kinder/cmd/kinder/get/clusters/clusters.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package clusters 18 | 19 | import ( 20 | "fmt" 21 | 22 | "github.com/spf13/cobra" 23 | 24 | "k8s.io/kubeadm/kinder/pkg/cluster/status" 25 | ) 26 | 27 | // NewCommand returns a new cobra.Command for getting the list of clusters 28 | func NewCommand() *cobra.Command { 29 | cmd := &cobra.Command{ 30 | Args: cobra.NoArgs, 31 | Use: "clusters", 32 | Short: "Lists existing kind clusters by their name", 33 | Long: "Lists existing kind clusters by their name", 34 | RunE: func(cmd *cobra.Command, args []string) error { 35 | return runE(cmd, args) 36 | }, 37 | } 38 | return cmd 39 | } 40 | 41 | func runE(cmd *cobra.Command, args []string) error { 42 | clusters, err := status.ListClusters() 43 | if err != nil { 44 | return err 45 | } 46 | for _, cluster := range clusters { 47 | fmt.Println(cluster) 48 | } 49 | return nil 50 | } 51 | -------------------------------------------------------------------------------- /kinder/cmd/kinder/get/get.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package get 18 | 19 | import ( 20 | "github.com/spf13/cobra" 21 | 22 | "k8s.io/kubeadm/kinder/cmd/kinder/get/artifacts" 23 | "k8s.io/kubeadm/kinder/cmd/kinder/get/clusters" 24 | "k8s.io/kubeadm/kinder/cmd/kinder/get/kubeconfigpath" 25 | "k8s.io/kubeadm/kinder/cmd/kinder/get/nodes" 26 | ) 27 | 28 | // NewCommand returns a new cobra.Command for get 29 | func NewCommand() *cobra.Command { 30 | cmd := &cobra.Command{ 31 | Args: cobra.NoArgs, 32 | Use: "get", 33 | Short: "Gets one of [clusters, nodes, kubeconfig-path, artifacts]", 34 | Long: "Gets one of [clusters, nodes, kubeconfig-path, artifacts]", 35 | } 36 | 37 | cmd.AddCommand(clusters.NewCommand()) 38 | 39 | // add kind top level subcommands re-used without changes 40 | cmd.AddCommand(nodes.NewCommand()) 41 | cmd.AddCommand(kubeconfigpath.NewCommand()) 42 | 43 | // add kinder only commands 44 | cmd.AddCommand(artifacts.NewCommand()) 45 | return cmd 46 | } 47 | -------------------------------------------------------------------------------- /kinder/cmd/kinder/get/kubeconfigpath/kubeconfigpath.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package kubeconfigpath 18 | 19 | import ( 20 | "fmt" 21 | 22 | "github.com/spf13/cobra" 23 | 24 | "k8s.io/kubeadm/kinder/pkg/cluster/status" 25 | "k8s.io/kubeadm/kinder/pkg/constants" 26 | ) 27 | 28 | type flagpole struct { 29 | Name string 30 | } 31 | 32 | // NewCommand returns a new cobra.Command for getting the list of nodes in a cluster 33 | func NewCommand() *cobra.Command { 34 | flags := &flagpole{} 35 | 36 | cmd := &cobra.Command{ 37 | Args: cobra.NoArgs, 38 | Use: "kubeconfig-path", 39 | Short: "Prints the default kubeconfig path for the kind cluster by --name", 40 | Long: "Prints the default kubeconfig path for the kind cluster by --name", 41 | RunE: func(cmd *cobra.Command, args []string) error { 42 | fmt.Println(status.KubeConfigPath(flags.Name)) 43 | return nil 44 | }, 45 | } 46 | 47 | cmd.Flags().StringVar( 48 | &flags.Name, 49 | "name", constants.DefaultClusterName, "cluster name", 50 | ) 51 | return cmd 52 | } 53 | -------------------------------------------------------------------------------- /kinder/cmd/kinder/get/nodes/nodes.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package nodes 18 | 19 | import ( 20 | "fmt" 21 | 22 | "github.com/spf13/cobra" 23 | 24 | "k8s.io/kubeadm/kinder/pkg/cluster/status" 25 | "k8s.io/kubeadm/kinder/pkg/constants" 26 | ) 27 | 28 | type flagpole struct { 29 | Name string 30 | } 31 | 32 | // NewCommand returns a new cobra.Command for getting the list of nodes in a cluster 33 | func NewCommand() *cobra.Command { 34 | flags := &flagpole{} 35 | 36 | cmd := &cobra.Command{ 37 | Args: cobra.NoArgs, 38 | Use: "nodes", 39 | Short: "Lists existing nodes in kind clusters by their name", 40 | Long: "Lists existing nodes in kind clusters by their name", 41 | RunE: func(cmd *cobra.Command, args []string) error { 42 | return runE(flags, cmd, args) 43 | }, 44 | } 45 | 46 | cmd.Flags().StringVar( 47 | &flags.Name, 48 | "name", constants.DefaultClusterName, "cluster name", 49 | ) 50 | return cmd 51 | } 52 | 53 | func runE(flags *flagpole, cmd *cobra.Command, args []string) error { 54 | cluster, err := status.FromDocker(flags.Name) 55 | if err != nil { 56 | return err 57 | } 58 | 59 | for _, node := range cluster.AllNodes() { 60 | fmt.Println(node.Name()) 61 | } 62 | return nil 63 | } 64 | -------------------------------------------------------------------------------- /kinder/cmd/kinder/test/test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package test 18 | 19 | import ( 20 | "github.com/spf13/cobra" 21 | 22 | "k8s.io/kubeadm/kinder/cmd/kinder/test/e2e" 23 | "k8s.io/kubeadm/kinder/cmd/kinder/test/e2ekubeadm" 24 | "k8s.io/kubeadm/kinder/cmd/kinder/test/workflow" 25 | ) 26 | 27 | // NewCommand returns a new cobra.Command for running E2E tests on cluster 28 | func NewCommand() *cobra.Command { 29 | cmd := &cobra.Command{ 30 | Args: cobra.NoArgs, 31 | Use: "test", 32 | Short: "Runs a test workflow or e2e/e2e-kubeadm test suites on a Kubernetes cluster", 33 | Long: "Runs a test workflow or e2e/e2e-kubeadm test suites on a Kubernetes cluster", 34 | } 35 | cmd.AddCommand(e2e.NewCommand()) 36 | cmd.AddCommand(e2ekubeadm.NewCommand()) 37 | cmd.AddCommand(workflow.NewCommand()) 38 | return cmd 39 | } 40 | -------------------------------------------------------------------------------- /kinder/cmd/kinder/test/workflow/workflow.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package workflow 18 | 19 | import ( 20 | "os" 21 | 22 | "github.com/spf13/cobra" 23 | 24 | "k8s.io/kubeadm/kinder/pkg/test/workflow" 25 | ) 26 | 27 | type flagpole struct { 28 | DryRun bool 29 | Verbose bool 30 | ExitOnError bool 31 | } 32 | 33 | // NewCommand returns a new cobra.Command for e2e-kubeadm 34 | func NewCommand() *cobra.Command { 35 | flags := &flagpole{} 36 | cmd := &cobra.Command{ 37 | Use: "workflow [flags] CONFIG [ARTIFACTS]\n\n" + 38 | "Args:\n" + 39 | " CONFIG is the path of a workflow config file\n" + 40 | " ARTIFACTS is the path to the directory where to store ARTIFACTS\n", 41 | Short: "Runs test workflow", 42 | Args: cobra.RangeArgs(1, 2), 43 | // TODO: add a long description 44 | RunE: func(cmd *cobra.Command, args []string) error { 45 | return runE(flags, cmd, args) 46 | }, 47 | } 48 | 49 | cmd.Flags().BoolVar( 50 | &flags.DryRun, 51 | "dry-run", false, 52 | "only prints workflow commands, without executing them", 53 | ) 54 | cmd.Flags().BoolVar( 55 | &flags.Verbose, 56 | "verbose", false, 57 | "redirect command output to stdout", 58 | ) 59 | cmd.Flags().BoolVar( 60 | &flags.ExitOnError, 61 | "exit-on-task-error", false, 62 | "exit after first task failed", 63 | ) 64 | return cmd 65 | } 66 | 67 | func runE(flags *flagpole, cmd *cobra.Command, args []string) error { 68 | 69 | // retrieve config and artifacts from arguments 70 | config := args[0] 71 | artifacts := "" 72 | if len(args) > 1 { 73 | artifacts = args[1] 74 | } 75 | 76 | w, err := workflow.NewWorkflow(config) 77 | if err != nil { 78 | return err 79 | } 80 | 81 | return w.Run(os.Stdout, flags.DryRun, flags.Verbose, flags.ExitOnError, artifacts) 82 | } 83 | -------------------------------------------------------------------------------- /kinder/cmd/kinder/version/version.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package version 18 | 19 | import ( 20 | "fmt" 21 | 22 | "github.com/spf13/cobra" 23 | 24 | "k8s.io/kubeadm/kinder/pkg/constants" 25 | ) 26 | 27 | // NewCommand returns a new cobra.Command for version 28 | func NewCommand() *cobra.Command { 29 | cmd := &cobra.Command{ 30 | Args: cobra.NoArgs, 31 | Use: "version", 32 | Short: "prints the kinder CLI version", 33 | Long: "prints the kinder CLI version", 34 | RunE: func(cmd *cobra.Command, args []string) error { 35 | fmt.Printf("v%s\n", constants.KinderVersion) 36 | return nil 37 | }, 38 | } 39 | return cmd 40 | } 41 | -------------------------------------------------------------------------------- /kinder/doc/e2e-test.md: -------------------------------------------------------------------------------- 1 | # Run E2E tests 2 | 3 | You can use kinder as a proxy for running Kubernetes/Kubeadm e2e test suites, and use 4 | those suites to validate your cluster. 5 | 6 | ## E2E (Kubernetes) 7 | 8 | E2E Kubernetes is a rich set of test aimed at verifying the proper functioning of a Kubernetes cluster. 9 | 10 | By default Kinder selects a subset of test the corresponds to the "Conformance" as defined in the 11 | Kubernetes [test grid](https://git.k8s.io/test-infra/testgrid/conformance). 12 | 13 | ```bash 14 | kinder test e2e 15 | ``` 16 | 17 | > The test are run on the cluster defined in the current kubeconfig file 18 | 19 | Main flags supported by the command are: 20 | 21 | - `--kube-root` for setting the folder where the kubernetes sources are stored 22 | - `--conformance` as a shortcut for instructing the ginkgo test suite run only conformance tests 23 | - `--parallel` as a shortcut for instructing the ginkgo to run test in parallel 24 | 25 | See [Kinder reference](reference.md) for more options 26 | 27 | ## E2E kubeadm 28 | 29 | Similarly to E2E Kubernetes, there is a suite of tests aimed at checking that kubeadm has created 30 | and properly configured all the ConfigMap, Secrets, RBAC Roles and RoleBinding required for the 31 | proper functioning of future calls to `kubeadm join` or `kubeadm upgrade`. 32 | 33 | This can be achieved by a simple 34 | 35 | ```bash 36 | kinder test e2e-kubeadm 37 | ``` 38 | 39 | > The test are run on the cluster defined in the current kubeconfig file 40 | 41 | Main flags supported by the command are: 42 | 43 | - `--kube-root` for setting the folder where the kubernetes sources are stored 44 | - `--single-node` as a shortcut for instructing the ginkgo test suite to skip test labeled with [multi-node] 45 | - `--automatic-copy-certs` as a shortcut for instructing the ginkgo test suite to skip test labeled with [copy-certs] 46 | 47 | See [Kinder reference](reference.md) for more options 48 | -------------------------------------------------------------------------------- /kinder/doc/getting-started.md: -------------------------------------------------------------------------------- 1 | # Getting started (test single control-plane) 2 | 3 | This document assumes vX the Kubernetes release to be tested. 4 | 5 | See [Prepare for tests](prepare-for-tests.md) for how to create a node-image for Kubernetes vX. 6 | 7 | ```bash 8 | # create a cluster with eventually two worker nodes 9 | kinder create cluster --image kindest/node:vX --worker-nodes 2 10 | 11 | # initialize the bootstrap control plane 12 | kinder do kubeadm-init 13 | 14 | # join nodes 15 | kinder do kubeadm-join 16 | ``` 17 | 18 | Please note that if you need a better control of pre-defined actions with `kinder do`, you can use 19 | the `--only-node` flag to execute actions only on a selected node. 20 | 21 | As alternative, instead of using kinder pre-defined actions with `kinder do`, it is possible to 22 | use `docker exec` and `docker cp` to work on nodes invoking directly `kubeadm`, `kubectl` or 23 | any other shell commands. 24 | 25 | ## Test variants 26 | 27 | 1. add `--external-etcd` flag to `kinder create cluster` to test usage of external etcd cluster 28 | 2. add `--use-phases` flag to `kubeadm-init` and/or `kubeadm-join` to test phases 29 | 3. any combination of the above 30 | 31 | ## Validation 32 | 33 | ```bash 34 | # verify kubeadm commands outputs 35 | 36 | # get an overview of the resulting cluster 37 | kinder do cluster-info 38 | # > check for nodes, Kubernetes version x, ready 39 | # > check all the components running, Kubernetes version x + related dependencies 40 | # > check for etcd member 41 | 42 | # run a smoke test 43 | kinder do smoke-test 44 | ``` 45 | 46 | Also in this case: 47 | 48 | - you can use the `--only-node` flag to execute actions only on a selected node. 49 | - as alternative to `kinder do`, it is possible to use `docker exec` and `docker cp` 50 | 51 | See [run e2e tests](e2e-test.md) for validating your cluster with Kubernetes/Kubeadm e2e test suites. 52 | 53 | ## Cleanup 54 | 55 | ```bash 56 | kinder do kubeadm-reset 57 | 58 | kinder delete cluster 59 | ``` 60 | -------------------------------------------------------------------------------- /kinder/doc/kinder-workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubernetes/kubeadm/40b6b9bb449bde2a2de98995d9612a2c50bb29d4/kinder/doc/kinder-workflow.png -------------------------------------------------------------------------------- /kinder/doc/test-HA.md: -------------------------------------------------------------------------------- 1 | # Test HA 2 | 3 | This document assumes vX the Kubernetes release to be tested. 4 | 5 | See [Prepare for tests](prepare-for-tests.md) for how to create a node-image for Kubernetes vX. 6 | 7 | ```bash 8 | # create a cluster with at least two control plane nodes (and eventually some worker node) 9 | kinder create cluster --image kindest/node:vX --control-plane-nodes 2 --workers-nodes 0 10 | 11 | # initialize the bootstrap control plane 12 | kinder do kubeadm-init 13 | 14 | # join secondary control planes and nodes (if any) 15 | kinder do kubeadm-join 16 | ``` 17 | 18 | Please note that if you need a better control of pre-defined actions with `kinder do`, you can use 19 | the `--only-node` flag to execute actions only on a selected node. 20 | 21 | As alternative, instead of using kinder pre-defined actions with `kinder do`, it is possible to 22 | use `docker exec` and `docker cp` to work on nodes invoking directly `kubeadm`, `kubectl` or 23 | any other shell commands. 24 | 25 | ## Test variants 26 | 27 | 1. add `--external-etcd` flag to `kinder create cluster` to test usage of external etcd cluster 28 | 2. add `--use-phases` flag to `kubeadm-init` and/or `kubeadm-join` to test phases 29 | 3. add `--copy-certs=auto` flag both to `kubeadm-init` and `kubeadm-join` to test the automatic copy certs feature 30 | 4. any combination of the above 31 | 32 | ## Validation 33 | 34 | ```bash 35 | # verify kubeadm commands outputs 36 | 37 | # get an overview of the resulting cluster 38 | kinder do cluster-info 39 | # > check for nodes, Kubernetes version x, ready 40 | # > check all the components running, Kubernetes version x + related dependencies 41 | # > check for etcd member 42 | 43 | # run a smoke test 44 | kinder do smoke-test 45 | ``` 46 | 47 | Also in this case: 48 | 49 | - you can use the `--only-node` flag to execute actions only on a selected node. 50 | - as alternative to `kinder do`, it is possible to use `docker exec` and `docker cp` 51 | 52 | See [run e2e tests](e2e-test.md) for validating your cluster with Kubernetes/Kubeadm e2e test suites. 53 | 54 | ## Cleanup 55 | 56 | ```bash 57 | kinder do kubeadm-reset 58 | 59 | kinder delete cluster 60 | ``` 61 | -------------------------------------------------------------------------------- /kinder/doc/test-XonY.md: -------------------------------------------------------------------------------- 1 | # Testing X on Y 2 | 3 | X on Y test are meant to verify kubeadm vX managing Kubernetes cluster of different version vY, 4 | with vY being 1 minor less or same minor of vX 5 | 6 | ## Preparation 7 | 8 | In order to test X on Y, the recommended approach in kinder is to: 9 | 10 | 1. take a node-image for Kubernetes vY, e.g. `kindest/node:vY` 11 | 2. prepare locally the kubeadm binaries vX 12 | 3. create an variant of `kindest/node:vY`, e.g. `kindest/node:vX.on.Y`, that replaces kubeadm vY 13 | with kubeadm vX 14 | 15 | e.g. assuming vX artifacts stored in $artifacts 16 | 17 | ```bash 18 | kinder build node-image-variant --base-image kindest/node:vY --image kindest/node:vX.on.Y \ 19 | --with-kubeadm $artifacts/vY/kubeadm 20 | ``` 21 | 22 | > `kinder build node-image-variant` accepts in input a version, a release or ci build label, 23 | > a remote repository or a local folder. see [Kinder reference](reference.md) for more info. 24 | 25 | See [Prepare for tests](prepare-for-tests.md) for more detail 26 | 27 | ## Creating and initializing the cluster 28 | 29 | See [getting started (test single control-plane)](getting-started.md) or [testing HA](test-HA.md); 30 | in summary: 31 | 32 | ```bash 33 | # create a cluster (choose the desired number of control-plane/worker nodes) 34 | kinder create cluster --image kindest/node:vX.on.Y --control-plane-nodes 1 --worker-nodes 0 35 | 36 | # initialize the bootstrap control plane 37 | kinder do kubeadm-init 38 | 39 | # join secondary control planes and nodes (if any) 40 | kinder do kubeadm-join 41 | ``` 42 | 43 | Also in this case: 44 | 45 | - test variants can be achieved adding `--external-etcd`, `--copy-certs` flags to `kinder create cluster`, or by adding flags `--use-phases` to `kubeadm-init` and/or `kubeadm-join` 46 | 47 | ## Validation 48 | 49 | ```bash 50 | # verify kubeadm commands outputs 51 | 52 | # get an overview of the resulting cluster 53 | kinder do cluster-info 54 | # > check for nodes, Kubernetes version y, ready 55 | # > check all the components running, Kubernetes version y + related dependencies 56 | # > check for etcd member 57 | 58 | # run a smoke test 59 | kinder do smoke-test 60 | ``` 61 | 62 | See [run e2e tests](e2e-test.md) for validating your cluster with Kubernetes/Kubeadm e2e test suites. 63 | 64 | ## Cleanup 65 | 66 | ```bash 67 | kinder do kubeadm-reset 68 | 69 | kinder delete cluster 70 | ``` 71 | -------------------------------------------------------------------------------- /kinder/go.mod: -------------------------------------------------------------------------------- 1 | module k8s.io/kubeadm/kinder 2 | 3 | go 1.23.0 4 | 5 | toolchain go1.23.6 6 | 7 | require ( 8 | github.com/google/uuid v1.6.0 9 | github.com/pelletier/go-toml v1.9.5 10 | github.com/pkg/errors v0.9.1 11 | github.com/sirupsen/logrus v1.9.3 12 | github.com/spf13/cobra v1.8.1 13 | github.com/spf13/pflag v1.0.5 14 | gopkg.in/evanphx/json-patch.v4 v4.12.0 15 | k8s.io/apimachinery v0.32.2 16 | k8s.io/client-go v0.32.2 17 | sigs.k8s.io/kind v0.27.0 18 | sigs.k8s.io/yaml v1.4.0 19 | ) 20 | 21 | require ( 22 | al.essio.dev/pkg/shellescape v1.5.1 // indirect 23 | github.com/BurntSushi/toml v1.4.0 // indirect 24 | github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect 25 | github.com/evanphx/json-patch/v5 v5.6.0 // indirect 26 | github.com/fxamacker/cbor/v2 v2.7.0 // indirect 27 | github.com/go-logr/logr v1.4.2 // indirect 28 | github.com/gogo/protobuf v1.3.2 // indirect 29 | github.com/google/gofuzz v1.2.0 // indirect 30 | github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect 31 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 32 | github.com/json-iterator/go v1.1.12 // indirect 33 | github.com/kr/pretty v0.3.1 // indirect 34 | github.com/mattn/go-isatty v0.0.20 // indirect 35 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 36 | github.com/modern-go/reflect2 v1.0.2 // indirect 37 | github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect 38 | github.com/rogpeppe/go-internal v1.12.0 // indirect 39 | github.com/x448/float16 v0.8.4 // indirect 40 | golang.org/x/net v0.30.0 // indirect 41 | golang.org/x/oauth2 v0.23.0 // indirect 42 | golang.org/x/sys v0.26.0 // indirect 43 | golang.org/x/term v0.25.0 // indirect 44 | golang.org/x/text v0.19.0 // indirect 45 | golang.org/x/time v0.7.0 // indirect 46 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect 47 | gopkg.in/inf.v0 v0.9.1 // indirect 48 | gopkg.in/yaml.v3 v3.0.1 // indirect 49 | k8s.io/klog/v2 v2.130.1 // indirect 50 | k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect 51 | sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect 52 | sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect 53 | ) 54 | -------------------------------------------------------------------------------- /kinder/hack/orderimports/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | reviewers: 4 | - dims 5 | - neolit123 6 | - xinydev 7 | approvers: 8 | - dims 9 | - neolit123 10 | - xinydev 11 | -------------------------------------------------------------------------------- /kinder/hack/orderimports/testdata/imports.golden: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | import ( 9 | "fmt" 10 | "testing" 11 | 12 | "github.com/google/gofuzz" 13 | ) 14 | 15 | // with comments 16 | import ( 17 | "fmt" 18 | "testing" 19 | 20 | "github.com/google/gofuzz" // gofuzz 21 | "github.com/pkg/errors" 22 | ) 23 | 24 | import ( 25 | "fmt" 26 | "os" 27 | 28 | fuzz "github.com/google/gofuzz" 29 | 30 | corev1 "k8s.io/api/core/v1" 31 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 32 | runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" 33 | bootstraptokenv1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/bootstraptoken/v1" 34 | "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" 35 | "k8s.io/kubernetes/cmd/kubeadm/app/constants" 36 | 37 | "k8s.io/kubeadm/kinder/cmd/kinder/do" 38 | "k8s.io/kubeadm/kinder/cmd/kinder/exec" 39 | "k8s.io/kubeadm/kinder/cmd/kinder/get" 40 | "k8s.io/kubeadm/kinder/cmd/kinder/test" 41 | ) 42 | 43 | // wrong separation 44 | import ( 45 | "fmt" 46 | "os" 47 | 48 | fuzz "github.com/google/gofuzz" 49 | 50 | corev1 "k8s.io/api/core/v1" 51 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 52 | runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" 53 | bootstraptokenv1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/bootstraptoken/v1" 54 | "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" 55 | "k8s.io/kubernetes/cmd/kubeadm/app/constants" 56 | 57 | "k8s.io/kubeadm/kinder/cmd/kinder/do" 58 | "k8s.io/kubeadm/kinder/cmd/kinder/exec" 59 | "k8s.io/kubeadm/kinder/cmd/kinder/get" 60 | "k8s.io/kubeadm/kinder/cmd/kinder/test" 61 | ) 62 | -------------------------------------------------------------------------------- /kinder/hack/orderimports/testdata/imports.input: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | import ( 9 | "fmt" 10 | "testing" 11 | "github.com/google/gofuzz" 12 | ) 13 | 14 | // with comments 15 | import ( 16 | "fmt" 17 | "testing" 18 | "github.com/pkg/errors" 19 | // gofuzz 20 | "github.com/google/gofuzz" 21 | ) 22 | 23 | import ( 24 | bootstraptokenv1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/bootstraptoken/v1" 25 | "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" 26 | "k8s.io/kubernetes/cmd/kubeadm/app/constants" 27 | corev1 "k8s.io/api/core/v1" 28 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 29 | runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" 30 | fuzz "github.com/google/gofuzz" 31 | "k8s.io/kubeadm/kinder/cmd/kinder/do" 32 | "k8s.io/kubeadm/kinder/cmd/kinder/exec" 33 | "k8s.io/kubeadm/kinder/cmd/kinder/get" 34 | "k8s.io/kubeadm/kinder/cmd/kinder/test" 35 | "fmt" 36 | "os" 37 | ) 38 | 39 | // wrong separation 40 | import ( 41 | bootstraptokenv1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/bootstraptoken/v1" 42 | "k8s.io/kubernetes/cmd/kubeadm/app/constants" 43 | 44 | "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" 45 | 46 | corev1 "k8s.io/api/core/v1" 47 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 48 | 49 | runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" 50 | fuzz "github.com/google/gofuzz" 51 | "k8s.io/kubeadm/kinder/cmd/kinder/do" 52 | "k8s.io/kubeadm/kinder/cmd/kinder/exec" 53 | 54 | "k8s.io/kubeadm/kinder/cmd/kinder/get" 55 | "k8s.io/kubeadm/kinder/cmd/kinder/test" 56 | "fmt" 57 | "os" 58 | ) 59 | -------------------------------------------------------------------------------- /kinder/hack/update-all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2018 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # script to run all update scripts (except deps) 17 | set -o errexit 18 | set -o nounset 19 | set -o pipefail 20 | 21 | # shellcheck source=/dev/null 22 | source "$(dirname "$0")/utils.sh" 23 | REPO_PATH=$(get_root_path) 24 | 25 | "${REPO_PATH}"/hack/update-deps.sh 26 | "${REPO_PATH}"/hack/update-gofmt.sh 27 | "${REPO_PATH}"/hack/update-workflows.sh 28 | -------------------------------------------------------------------------------- /kinder/hack/update-deps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2018 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | # Runs go mod tidy, go mod vendor, and then prun vendor 18 | # 19 | # Usage: 20 | # update-deps.sh 21 | 22 | set -o nounset 23 | set -o errexit 24 | set -o pipefail 25 | 26 | # shellcheck source=/dev/null 27 | source "$(dirname "$0")/utils.sh" 28 | # cd to the root path 29 | cd_root_path 30 | 31 | prune-vendor() { 32 | find vendor -type f \ 33 | -not -iname "*.c" \ 34 | -not -iname "*.go" \ 35 | -not -iname "*.h" \ 36 | -not -iname "*.proto" \ 37 | -not -iname "*.s" \ 38 | -not -iname "AUTHORS*" \ 39 | -not -iname "CONTRIBUTORS*" \ 40 | -not -iname "COPYING*" \ 41 | -not -iname "LICENSE*" \ 42 | -not -iname "NOTICE*" \ 43 | -exec rm '{}' \; 44 | } 45 | 46 | export GO111MODULE="on" 47 | go mod tidy 48 | # TODO enable in kinder? 49 | # go mod vendor 50 | # prune-vendor 51 | -------------------------------------------------------------------------------- /kinder/hack/update-gofmt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # script to run gofmt over our code (not vendor) 17 | set -o errexit 18 | set -o nounset 19 | set -o pipefail 20 | 21 | # shellcheck source=/dev/null 22 | source "$(dirname "$0")/utils.sh" 23 | # cd to the root path 24 | cd_root_path 25 | 26 | # update go fmt 27 | go fmt ./cmd/... 28 | go fmt ./pkg/... 29 | go fmt ./ 30 | -------------------------------------------------------------------------------- /kinder/hack/update-imports-order.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2021 The Kubernetes Authors. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Usage: `./hack/update-imports-order.sh "k8s.io/kubeadm" . ` 18 | 19 | set -o errexit 20 | set -o nounset 21 | set -o pipefail 22 | 23 | # shellcheck source=/dev/null 24 | source "$(dirname "$0")/utils.sh" 25 | # cd to the root path 26 | cd_root_path 27 | 28 | export GO111MODULE=on 29 | go build ./hack/orderimports/orderimports.go 30 | 31 | # cleanup 32 | exitHandler() ( 33 | echo "Cleaning up..." 34 | rm orderimports 35 | ) 36 | trap exitHandler EXIT 37 | 38 | find_files() { 39 | find $1 -not \( \ 40 | \( \ 41 | -wholename './output' \ 42 | -o -wholename './.git' \ 43 | -o -wholename './_output' \ 44 | -o -wholename './_gopath' \ 45 | -o -wholename './release' \ 46 | -o -wholename './target' \ 47 | -o -wholename '*/third_party/*' \ 48 | -o -wholename '*/vendor/*' \ 49 | -o -wholename './staging/src/k8s.io/client-go/*vendor/*' \ 50 | -o -wholename '*zz_generated*' \ 51 | \) -prune \ 52 | \) -name '*.go' 53 | } 54 | 55 | find_files "$2" | xargs ./orderimports -w -p "$1" 56 | -------------------------------------------------------------------------------- /kinder/hack/update-workflows.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2021 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # script to update kinder workflows and test-infra Prow jobs 17 | # shellcheck source=/dev/null 18 | source "$(dirname "$0")/utils.sh" 19 | # cd to the root path 20 | cd_root_path 21 | 22 | # set kubernetes version 23 | KUBERNETES_VERSION="${KUBERNETES_VERSION:-v1.33.0}" 24 | 25 | # set skew 26 | KUBERNETES_SKEW="${KUBERNETES_SKEW:-3}" 27 | 28 | # path to the config 29 | PATH_CONFIG="${PATH_CONFIG:-./ci/tools/update-workflows/config.yaml}" 30 | 31 | # path to the kinder workflows 32 | PATH_WORKFLOWS="${PATH_WORKFLOWS:-./ci/workflows/}" 33 | 34 | # set test-infra path 35 | TEST_INFRA_SIG_DIR="config/jobs/kubernetes/sig-cluster-lifecycle" 36 | PATH_TEST_INFRA="${PATH_TEST_INFRA:-"${GOPATH}/src/k8s.io/test-infra/${TEST_INFRA_SIG_DIR}"}" 37 | 38 | # try to get the image from the provided test-infra path 39 | if [[ -z "${TEST_INFRA_IMAGE}" ]]; then 40 | TEST_INFRA_IMAGE=$(grep image "${PATH_TEST_INFRA}" -r | head -1 | cut -d ':' -f 4 | cut -d '-' -f-2) 41 | echo "${TEST_INFRA_IMAGE}" 42 | if [[ -z "${TEST_INFRA_IMAGE}" ]]; then 43 | echo "Error: Could not detect TEST_INFRA_IMAGE" 44 | exit 1 45 | fi 46 | fi 47 | 48 | # cleanup tracked files in workflows and test-infra 49 | echo "Cleaning up workflows..." 50 | rm "${PATH_WORKFLOWS}"/*.yaml 51 | 52 | echo "Cleaning up test-infra jobs..." 53 | rm "${PATH_TEST_INFRA}"/kubeadm-*.yaml 54 | 55 | set -o xtrace 56 | 57 | # run the tool 58 | go run ./ci/tools/update-workflows/cmd/main.go \ 59 | --config "${PATH_CONFIG}" \ 60 | --kubernetes-version="${KUBERNETES_VERSION}" \ 61 | --path-test-infra="${PATH_TEST_INFRA}" \ 62 | --path-workflows="${PATH_WORKFLOWS}" \ 63 | --skew-size="${KUBERNETES_SKEW}" \ 64 | --image-test-infra="${TEST_INFRA_IMAGE}" 65 | -------------------------------------------------------------------------------- /kinder/hack/utils.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # get_root_path returns the root path of the kinder source tree 17 | get_root_path() { 18 | echo "$(git rev-parse --show-toplevel)/kinder" 19 | } 20 | 21 | # cd_root_path cds to the root path of the kinder source tree 22 | cd_root_path() { 23 | cd "$(get_root_path)" || exit 24 | } 25 | -------------------------------------------------------------------------------- /kinder/hack/verify-boilerplate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | set -o errexit 17 | set -o nounset 18 | set -o pipefail 19 | 20 | # shellcheck source=/dev/null 21 | source "$(dirname "$0")/utils.sh" 22 | # cd to the root path 23 | cd_root_path 24 | 25 | git ls-files | xargs go run ./hack/verify-boilerplate.go 26 | -------------------------------------------------------------------------------- /kinder/hack/verify-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 The Kubernetes Authors. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | set -o errexit 18 | set -o nounset 19 | set -o pipefail 20 | 21 | # shellcheck source=/dev/null 22 | source "$(dirname "$0")/utils.sh" 23 | 24 | # cleanup on exit 25 | cleanup() { 26 | rm -f ./kinder 27 | } 28 | trap cleanup EXIT 29 | 30 | # check if the code builds 31 | # TODO: enable -mod=vendor? 32 | cd_root_path 33 | export GO111MODULE=on 34 | go build 35 | -------------------------------------------------------------------------------- /kinder/hack/verify-deps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2018 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | set -o nounset 17 | set -o pipefail 18 | 19 | # shellcheck source=/dev/null 20 | source "$(dirname "$0")/utils.sh" 21 | # cd to the root path 22 | cd_root_path 23 | 24 | # cleanup on exit 25 | cleanup() { 26 | echo "Cleaning up..." 27 | mv go.mod.old go.mod 28 | mv go.sum.old go.sum 29 | } 30 | trap cleanup EXIT 31 | 32 | echo "Verifying..." 33 | # temporary copy the go mod and sum files 34 | cp go.mod go.mod.old || exit 35 | cp go.sum go.sum.old || exit 36 | 37 | # run update-deps.sh 38 | export GO111MODULE="on" 39 | ./hack/update-deps.sh 40 | 41 | # compare the old and new files 42 | DIFF0=$(diff -u go.mod go.mod.old) 43 | DIFF1=$(diff -u go.sum go.sum.old) 44 | 45 | if [[ -n "${DIFF0}" ]] || [[ -n "${DIFF1}" ]]; then 46 | echo "${DIFF0}" 47 | echo "${DIFF1}" 48 | echo "Check failed. Please run ./hack/update-deps.sh" 49 | exit 1 50 | fi 51 | -------------------------------------------------------------------------------- /kinder/hack/verify-gofmt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2018 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | set -o errexit 17 | set -o nounset 18 | set -o pipefail 19 | 20 | # shellcheck source=/dev/null 21 | source "$(dirname "$0")/utils.sh" 22 | # cd to the root path 23 | cd_root_path 24 | 25 | # check for gofmt diffs 26 | diff=$(git ls-files | grep "\.go" | grep -v "vendor\/" | xargs gofmt -s -d 2>&1) 27 | if [[ -n "${diff}" ]]; then 28 | echo "${diff}" 29 | echo 30 | echo "Check failed. Please run hack/update-gofmt.sh" 31 | exit 1 32 | fi 33 | -------------------------------------------------------------------------------- /kinder/hack/verify-golint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2018 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # CI script to run go lint over our code 17 | set -o errexit 18 | set -o nounset 19 | set -o pipefail 20 | 21 | # shellcheck source=/dev/null 22 | source "$(dirname "$0")/utils.sh" 23 | 24 | # cd to the root path 25 | REPO_PATH=$(get_root_path) 26 | 27 | # create a temporary directory 28 | TMP_DIR=$(mktemp -d) 29 | 30 | # cleanup 31 | exitHandler() ( 32 | echo "Cleaning up..." 33 | rm -rf "${TMP_DIR}" 34 | ) 35 | trap exitHandler EXIT 36 | 37 | # pull the source code and build the binary 38 | cd "${TMP_DIR}" 39 | URL="https://github.com/golang/lint" 40 | echo "Cloning ${URL} in ${TMP_DIR}..." 41 | git clone --quiet --depth=1 "${URL}" . 42 | echo "Building golint..." 43 | export GO111MODULE=on 44 | go mod vendor 45 | go build -mod=vendor -o ./golint/golint ./golint 46 | 47 | # run the binary 48 | cd "${REPO_PATH}" 49 | echo "Running golint..." 50 | git ls-files | grep "\.go" | \ 51 | grep -v "\\/vendor\\/" | \ 52 | xargs -L1 "${TMP_DIR}/golint/golint" -set_exit_status 53 | -------------------------------------------------------------------------------- /kinder/hack/verify-gotest.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2018 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # CI script to run go vet over our code 17 | set -o errexit 18 | set -o nounset 19 | set -o pipefail 20 | 21 | # shellcheck source=/dev/null 22 | source "$(dirname "$0")/utils.sh" 23 | # cd to the root path 24 | cd_root_path 25 | 26 | # run go test 27 | export GO111MODULE=on 28 | go test -v -count=1 ./cmd/... 29 | go test -v -count=1 ./pkg/... 30 | go test -v -count=1 ./ci/tools/... 31 | go test -v -count=1 ./hack/... 32 | go test -v -count=1 ./ 33 | -------------------------------------------------------------------------------- /kinder/hack/verify-govet.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2018 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # CI script to run go vet over our code 17 | set -o errexit 18 | set -o nounset 19 | set -o pipefail 20 | 21 | # shellcheck source=/dev/null 22 | source "$(dirname "$0")/utils.sh" 23 | # cd to the root path 24 | cd_root_path 25 | 26 | # run go vet 27 | export GO111MODULE=on 28 | go vet ./cmd/... 29 | go vet ./pkg/... 30 | go vet ./ci/tools/... 31 | go vet ./ 32 | -------------------------------------------------------------------------------- /kinder/hack/verify-imports-order.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2021 The Kubernetes Authors. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # This script verifies that all the imports have our preferred order. 18 | # see: https://github.com/kubernetes/kubeadm/issues/2515 19 | 20 | # Usage: `./hack/verify-imports-order.sh "k8s.io/kubeadm" . ` 21 | 22 | set -o errexit 23 | set -o nounset 24 | set -o pipefail 25 | 26 | # shellcheck source=/dev/null 27 | source "$(dirname "$0")/utils.sh" 28 | # cd to the root path 29 | cd_root_path 30 | 31 | export GO111MODULE=on 32 | go build ./hack/orderimports/orderimports.go 33 | 34 | # cleanup 35 | exitHandler() ( 36 | echo "Cleaning up..." 37 | rm orderimports 38 | ) 39 | trap exitHandler EXIT 40 | 41 | find_files() { 42 | find $1 -not \( \ 43 | \( \ 44 | -wholename './output' \ 45 | -o -wholename './.git' \ 46 | -o -wholename './_output' \ 47 | -o -wholename './_gopath' \ 48 | -o -wholename './release' \ 49 | -o -wholename './target' \ 50 | -o -wholename '*/third_party/*' \ 51 | -o -wholename '*/vendor/*' \ 52 | -o -wholename './staging/src/k8s.io/client-go/*vendor/*' \ 53 | -o -wholename '*/bindata.go' \ 54 | -o -wholename '*zz_generated*' \ 55 | \) -prune \ 56 | \) -name '*.go' 57 | } 58 | 59 | # orderimports exits with non-zero exit code if it finds a problem unrelated to 60 | # formatting (e.g., a file does not parse correctly). Without "|| true" this 61 | # would have led to no useful error message from orderimports, because the script would 62 | # have failed before getting to the "echo" in the block below. 63 | diff=$(find_files "$2"| xargs ./orderimports -d -p "$1" 2>&1) || true 64 | if [[ -n "${diff}" ]]; then 65 | echo "${diff}" >&2 66 | echo >&2 67 | echo "Run ./hack/update-imports-order.sh" >&2 68 | exit 1 69 | fi 70 | -------------------------------------------------------------------------------- /kinder/hack/verify-shellcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 The Kubernetes Authors. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # set -o errexit 18 | set -o nounset 19 | set -o pipefail 20 | 21 | # shellcheck source=/dev/null 22 | source "$(dirname "$0")/utils.sh" 23 | ROOT_PATH=$(get_root_path) 24 | 25 | # create a temporary directory 26 | TMP_DIR=$(mktemp -d) 27 | 28 | # cleanup on exit 29 | cleanup() { 30 | echo "Cleaning up..." 31 | rm -rf "${TMP_DIR}" 32 | } 33 | trap cleanup EXIT 34 | 35 | # install shellcheck (Linux-x64 only!) 36 | cd "${TMP_DIR}" || exit 37 | VERSION="shellcheck-stable" 38 | DOWNLOAD_FILE="${VERSION}.linux.x86_64.tar.xz" 39 | wget https://github.com/koalaman/shellcheck/releases/download/stable/"${DOWNLOAD_FILE}" 40 | tar xf "${DOWNLOAD_FILE}" 41 | cd "${VERSION}" || exit 42 | 43 | echo "Running shellcheck..." 44 | cd "${ROOT_PATH}" || exit 45 | OUT="${TMP_DIR}/out.log" 46 | FILES=$(find . -name "*.sh") 47 | while read -r file; do 48 | "${TMP_DIR}/${VERSION}/shellcheck" "$file" >> "${OUT}" 2>&1 49 | done <<< "$FILES" 50 | 51 | if [[ -s "${OUT}" ]]; then 52 | echo "Found errors:" 53 | cat "${OUT}" 54 | exit 1 55 | fi 56 | -------------------------------------------------------------------------------- /kinder/hack/verify-spelling.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | set -o errexit 17 | set -o nounset 18 | set -o pipefail 19 | 20 | # shellcheck source=/dev/null 21 | source "$(dirname "$0")/utils.sh" 22 | # cd to the root path 23 | cd_root_path 24 | 25 | # create a temporary directory 26 | TMP_DIR=$(mktemp -d) 27 | 28 | # cleanup 29 | exitHandler() ( 30 | echo "Cleaning up..." 31 | rm -rf "${TMP_DIR}" 32 | ) 33 | trap exitHandler EXIT 34 | 35 | # pull misspell 36 | export GO111MODULE=on 37 | URL="https://github.com/client9/misspell" 38 | echo "Cloning ${URL} in ${TMP_DIR}..." 39 | git clone --quiet --depth=1 "${URL}" "${TMP_DIR}" 40 | pushd "${TMP_DIR}" > /dev/null 41 | go mod init misspell 42 | go mod tidy 43 | popd > /dev/null 44 | 45 | # build misspell 46 | BIN_PATH="${TMP_DIR}/cmd/misspell" 47 | pushd "${BIN_PATH}" > /dev/null 48 | echo "Building misspell..." 49 | go build > /dev/null 50 | popd > /dev/null 51 | 52 | # check spelling 53 | RES=0 54 | ERROR_LOG="${TMP_DIR}/errors.log" 55 | echo "Checking spelling..." 56 | git ls-files | grep -v -e vendor | grep -v -e go\. | xargs "${BIN_PATH}/misspell" > "${ERROR_LOG}" 57 | if [[ -s "${ERROR_LOG}" ]]; then 58 | sed 's/^/error: /' "${ERROR_LOG}" # add 'error' to each line to highlight in e2e status 59 | echo "Found spelling errors!" 60 | RES=1 61 | fi 62 | exit "${RES}" 63 | -------------------------------------------------------------------------------- /kinder/hack/verify-staticcheck.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # CI script to run staticcheck 17 | set -o errexit 18 | set -o nounset 19 | set -o pipefail 20 | 21 | # shellcheck source=/dev/null 22 | source "$(dirname "$0")/utils.sh" 23 | 24 | # cd to the root path 25 | REPO_PATH=$(get_root_path) 26 | 27 | # create a temporary directory 28 | TMP_DIR=$(mktemp -d) 29 | 30 | # cleanup 31 | exitHandler() ( 32 | echo "Cleaning up..." 33 | rm -rf "${TMP_DIR}" 34 | ) 35 | trap exitHandler EXIT 36 | 37 | # pull the source code and build the binary 38 | cd "${TMP_DIR}" 39 | URL="https://github.com/dominikh/go-tools" 40 | echo "Cloning ${URL} in ${TMP_DIR}..." 41 | git clone --quiet --depth=1 "${URL}" . 42 | echo "Building staticcheck..." 43 | export GO111MODULE=on 44 | go build -o ./bin/staticheck ./cmd/staticcheck 45 | 46 | # run the binary 47 | cd "${REPO_PATH}" 48 | echo "Running staticcheck..." 49 | "${TMP_DIR}/bin/staticheck" ./cmd/... ./pkg/... 50 | -------------------------------------------------------------------------------- /kinder/hack/verify-update-workflows.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2021 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | set -o nounset 17 | set -o pipefail 18 | 19 | # shellcheck source=/dev/null 20 | source "$(dirname "$0")/utils.sh" 21 | # cd to the root path 22 | cd_root_path 23 | 24 | # create a temporary directory 25 | TMP_DIR=$(mktemp -d) 26 | TMP_DIR_TEST_INFRA=$(mktemp -d) 27 | 28 | # cleanup 29 | exitHandler() ( 30 | echo "Cleaning up..." 31 | rm -rf "${TMP_DIR}" 32 | rm -rf "${TMP_DIR_TEST_INFRA}" 33 | ) 34 | trap exitHandler EXIT 35 | 36 | # copy all workflows trakced in git in a temp location 37 | # add them to git tracking there 38 | echo "Coping workflows to $TMP_DIR" 39 | FILES=$(git ls-files | grep ci/workflows | tr "\n" " ") 40 | # shellcheck disable=SC2086 41 | cp ${FILES} "${TMP_DIR}" 42 | pushd "${TMP_DIR}" || exit 1 43 | git init > /dev/null 44 | git config user.email "test@test-email.com" 45 | git config user.name "Test Name" 46 | git add . > /dev/null 47 | git commit -m "..." > /dev/null 48 | popd || exit 1 49 | 50 | # call the update-workflows.sh script to update the workflwos in the temp location 51 | echo "Running ./hack/update-workflows.sh" 52 | PATH_WORKFLOWS="${TMP_DIR}" PATH_TEST_INFRA="${TMP_DIR}" ./hack/update-workflows.sh > "${TMP_DIR}/output.log" 2>&1 53 | RES=$? 54 | if [[ $RES -ne 0 ]]; then 55 | echo "error: Running ./hack/update-workflows.sh failed" 56 | cat "${TMP_DIR}/output.log" 57 | exit 1 58 | fi 59 | 60 | # use git status to ensure there is no diff between the copied workflows 61 | # and the output of update-workflows.sh 62 | pushd "${TMP_DIR}" || exit 1 63 | OUT=$(git status --porcelain --untracked-files=no) 64 | if [[ -n "${OUT}" ]]; then 65 | echo "${OUT}" 66 | echo "error: Found difference in the output; please run ./hack/update-workflows.sh" 67 | exit 1 68 | fi 69 | 70 | echo "Done!" 71 | -------------------------------------------------------------------------------- /kinder/hack/verify-whitespace.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | set -o nounset 17 | set -o pipefail 18 | 19 | # shellcheck source=/dev/null 20 | source "$(dirname "$0")/utils.sh" 21 | # cd to the root path 22 | cd_root_path 23 | 24 | echo "Verifying trailing whitespace..." 25 | TRAILING="$(grep -rnI '[[:blank:]]$' .)" 26 | 27 | ERR="0" 28 | if [[ -n "$TRAILING" ]]; then 29 | echo "Found trailing whitespace in the follow files:" 30 | echo "${TRAILING}" 31 | ERR="1" 32 | fi 33 | 34 | echo -e "Verifying new lines at end of files..." 35 | FILES="$(git ls-files | grep -I -v -e vendor)" 36 | while read -r LINE; do 37 | grep -qI . "${LINE}" || continue # skip binary files 38 | c="$(tail -c 1 "${LINE}")" 39 | if [[ "$c" != "" ]]; then 40 | echo "${LINE}: no newline at the end of file" 41 | ERR=1 42 | fi 43 | done <<< "${FILES}" 44 | 45 | if [[ "$ERR" == "1" ]]; then 46 | echo "Found whitespace errors!" 47 | exit 1 48 | fi 49 | -------------------------------------------------------------------------------- /kinder/hack/verify-workflows.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | set -o nounset 17 | set -o pipefail 18 | 19 | # shellcheck source=/dev/null 20 | source "$(dirname "$0")/utils.sh" 21 | # cd to the root path 22 | cd_root_path 23 | 24 | # create a temporary directory 25 | TMP_DIR=$(mktemp -d) 26 | 27 | # cleanup 28 | exitHandler() ( 29 | echo "Cleaning up..." 30 | rm -rf "${TMP_DIR}" 31 | ) 32 | trap exitHandler EXIT 33 | 34 | # build the verify-workflow binary 35 | echo "Building verify-workflow..." 36 | export GO111MODULE=on 37 | BIN="${TMP_DIR}/verify-workflow" 38 | go build -o "${BIN}" ./ci/tools/verify-workflow.go 39 | 40 | # verify files 41 | echo "Verifying workflow files..." 42 | ERR="0" 43 | FILES="$(git ls-files | grep ci/workflows)" 44 | while read -r file; do 45 | "${BIN}" "${file}" || ERR="1" 46 | done <<< "$FILES" 47 | 48 | if [[ "${ERR}" == "1" ]]; then 49 | echo "" 50 | echo "Found errors in workflow files! See output above..." 51 | exit 1 52 | fi 53 | -------------------------------------------------------------------------------- /kinder/images/base/docker/README.md: -------------------------------------------------------------------------------- 1 | Docker support was dropped in kind 0.3.0 in favour of containerd. 2 | 3 | This package is based on kind 0.2.1, but then the code evolved in order to keep up with kind evolution and to adapt 4 | to the kinder specific needs/code organization (e.g. no usage of kindnet). 5 | -------------------------------------------------------------------------------- /kinder/images/base/docker/clean-install: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright 2019 The Kubernetes Authors. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # A script encapsulating a common Dockerimage pattern for installing packages 18 | # and then cleaning up the unnecessary install artifacts. 19 | # e.g. clean-install iptables ebtables conntrack 20 | 21 | set -o errexit 22 | 23 | if [ $# = 0 ]; then 24 | echo >&2 "No packages specified" 25 | exit 1 26 | fi 27 | 28 | apt-get update 29 | apt-get install -y --no-install-recommends $@ 30 | apt-get clean -y 31 | rm -rf \ 32 | /var/cache/debconf/* \ 33 | /var/lib/apt/lists/* \ 34 | /var/log/* \ 35 | /tmp/* \ 36 | /var/tmp/* 37 | -------------------------------------------------------------------------------- /kinder/images/base/docker/entrypoint/main.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | This implements our image entrypoint. It: 19 | - waits for SIGUSR1 20 | - then execs (argv[1], argv[1:], env[:]) 21 | This allows us to perform other actions in the "node" container via `docker exec` 22 | _before_ we have actually "booted" the init and everything else along with it. 23 | We can then send SIGUSR1 to this process to trigger starting the "actual" 24 | entrypoint when we are done preforming any provisioning on the "node". 25 | NOTE: this is implemented as a single go1.X file, using only the stdlib. 26 | This makes it easier to build portably, and is all we need for what it does. 27 | */ 28 | 29 | // Entrypoint implements a small docker image entrypoint that waits for SIGUSR1 30 | // before execing os.Args[1:] 31 | package main 32 | 33 | import ( 34 | "os" 35 | "os/signal" 36 | "syscall" 37 | 38 | "log" 39 | ) 40 | 41 | // yes this should be the c macro, but on linux in docker you're going to get this anyhow 42 | // http://man7.org/linux/man-pages/man7/signal.7.html 43 | // https://github.com/moby/moby/blob/562df8c2d6f48601c8d1df7256389569d25c0bf1/pkg/signal/signal_linux.go#L10 44 | const sigrtmin = 34 45 | 46 | func main() { 47 | // prevent zombie processes since we will be PID1 for a while 48 | // https://linux.die.net/man/2/waitpid 49 | signal.Ignore(syscall.SIGCHLD) 50 | 51 | // grab the "real" entrypoint command and args from our args 52 | if len(os.Args) < 2 { 53 | log.Fatal("Not enough arguments to entrypoint!") 54 | } 55 | cmd, argv := os.Args[1], os.Args[1:] 56 | 57 | // wait for SIGUSR1 (or exit on SIGRTMIN+3 to match systemd) 58 | c := make(chan os.Signal, 1) 59 | signal.Notify(c, syscall.SIGUSR1, syscall.Signal(sigrtmin+3)) 60 | log.Println("Waiting for SIGUSR1 ...") 61 | sig := <-c 62 | if sig != syscall.SIGUSR1 { 63 | log.Printf("Exiting after signal: %v != SIGUSR1", sig) 64 | return 65 | } 66 | 67 | // then exec to the "real" entrypoint, keeping the env 68 | log.Printf("Received SIGUSR1, execing to: %v %v\n", cmd, argv) 69 | syscall.Exec(cmd, argv, os.Environ()) 70 | } 71 | -------------------------------------------------------------------------------- /kinder/main.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // This package is a stub main wrapping cmd/kinder.Main() 18 | package main 19 | 20 | import ( 21 | "k8s.io/kubeadm/kinder/cmd/kinder" 22 | ) 23 | 24 | func main() { 25 | kinder.Main() 26 | } 27 | -------------------------------------------------------------------------------- /kinder/pkg/build/base/README.md: -------------------------------------------------------------------------------- 1 | Docker support was dropped in kind 0.3.0 in favour of containerd. 2 | 3 | This package is based on kind 0.2.1, but then the code evolved in order to keep up with kind evolution and to adapt 4 | to the kinder specific needs/code organization (e.g. no usage of kindnet). 5 | -------------------------------------------------------------------------------- /kinder/pkg/cluster/manager/actions/images.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package actions 18 | 19 | import ( 20 | "fmt" 21 | "strings" 22 | 23 | "github.com/pkg/errors" 24 | log "github.com/sirupsen/logrus" 25 | 26 | "k8s.io/kubeadm/kinder/pkg/cluster/status" 27 | "k8s.io/kubeadm/kinder/pkg/cri/nodes" 28 | ) 29 | 30 | // checkImagesForVersion pre-loaded images available on the node (this will report missing images, if any) 31 | func checkImagesForVersion(n *status.Node, version string) error { 32 | n.Infof("Checking pre-loaded images") 33 | 34 | imageListCmd := fmt.Sprintf("kubeadm config images list --kubernetes-version=%s 2>/dev/null", version) 35 | 36 | // gets the list of images kubeadm is going to use 37 | expected, err := n.Command( 38 | "bash", "-c", imageListCmd, 39 | ).Silent().RunAndCapture() 40 | if err != nil { 41 | return errors.Wrapf(err, "failed to read expected images for version %s from %s", version, n.Name()) 42 | } 43 | log.Debugf("List of images kubeadm is going to use %s\n", expected) 44 | 45 | // gets the list of images already pre-loaded in the node 46 | nodeCRI, err := n.CRI() 47 | if err != nil { 48 | return err 49 | } 50 | 51 | actionHelper, err := nodes.NewActionHelper(nodeCRI) 52 | if err != nil { 53 | return err 54 | } 55 | 56 | current, err := actionHelper.GetImages(n) 57 | if err != nil { 58 | return err 59 | } 60 | log.Debugf("List of images already pre-loaded in the node %s\n", current) 61 | 62 | // Compare expected and current image and report result 63 | var currentMap = map[string]string{} 64 | for _, c := range current { 65 | currentMap[c] = c 66 | } 67 | 68 | var missing = []string{} 69 | for _, e := range expected { 70 | if _, ok := currentMap[e]; ok { 71 | continue 72 | } 73 | 74 | missing = append(missing, e) 75 | } 76 | 77 | if len(missing) > 0 { 78 | fmt.Printf("Some of the required images are not pre-loaded into the container runtime:\n%s\n", strings.Join(missing, "\n")) 79 | return nil 80 | } 81 | 82 | fmt.Println("All the requested images are already pre-loaded into the container runtime") 83 | return nil 84 | } 85 | -------------------------------------------------------------------------------- /kinder/pkg/cluster/manager/actions/kubeadm-reset.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package actions 18 | 19 | import ( 20 | "fmt" 21 | 22 | "github.com/pkg/errors" 23 | 24 | "k8s.io/kubeadm/kinder/pkg/cluster/status" 25 | "k8s.io/kubeadm/kinder/pkg/constants" 26 | "k8s.io/kubeadm/kinder/pkg/kubeadm" 27 | ) 28 | 29 | // KubeadmReset executes the kubeadm reset workflow 30 | func KubeadmReset(c *status.Cluster, vLevel int) error { 31 | //TODO: implements kubeadm reset with phases 32 | for _, n := range c.K8sNodes().EligibleForActions() { 33 | flags := []string{"reset", fmt.Sprintf("--v=%d", vLevel)} 34 | 35 | // After upgrade, the 'kubeadm version' should return the version of the kubeadm used 36 | // to perform the upgrade. Use this version to determine if v1beta4 is enabled. If yes, 37 | // use ResetConfiguration with a 'force: true', else just use the '--force' flag. 38 | v, err := n.KubeadmVersion() 39 | if err != nil { 40 | return errors.Wrap(err, "could not obtain the kubeadm version before calling 'kubeadm reset'") 41 | } 42 | if kubeadm.GetKubeadmConfigVersion(v) == "v1beta4" { 43 | if err := KubeadmResetConfig(c, "", n); err != nil { 44 | return errors.Wrap(err, "could not write kubeadm config before calling 'kubeadm reset'") 45 | } 46 | flags = append(flags, "--config", constants.KubeadmConfigPath) 47 | } else { 48 | flags = append(flags, "--force") 49 | } 50 | 51 | if err := n.Command("kubeadm", flags...).RunWithEcho(); err != nil { 52 | return err 53 | } 54 | } 55 | return nil 56 | } 57 | -------------------------------------------------------------------------------- /kinder/pkg/cluster/manager/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | Package manager implements the highest level abstraction implemented of kinder, that is the ClusterManager. 19 | 20 | ClusterManager allows to operate on an existing K8s cluster created with kind(er) by exposing 21 | high level actions like cp, exec or do actions. 22 | 23 | This package implement also support for creating a new Kinder cluster, with the support for both 24 | containerd and docker as a container runtime running inside kind(er). 25 | */ 26 | package manager 27 | -------------------------------------------------------------------------------- /kinder/pkg/cluster/status/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | Package status allows to inspect and to represent the current status of a K8s cluster 19 | created with kind(er). 20 | 21 | The current status of a K8s cluster defines the starting point for any kinder operation. 22 | */ 23 | package status 24 | -------------------------------------------------------------------------------- /kinder/pkg/cluster/status/nodelist.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package status 18 | 19 | import ( 20 | "sort" 21 | ) 22 | 23 | // NodeList defines a list of Node 24 | type NodeList []*Node 25 | 26 | // Sort the list of Node wrapper by node provisioning order and by name 27 | func (l NodeList) Sort() { 28 | sort.Slice(l, func(i, j int) bool { 29 | return l[i].provisioningOrder() < l[j].provisioningOrder() || 30 | (l[i].provisioningOrder() == l[j].provisioningOrder() && l[i].Name() < l[j].Name()) 31 | }) 32 | } 33 | 34 | // EligibleForActions returns the list of nodes without nodes marked as SkipAction 35 | func (l NodeList) EligibleForActions() NodeList { 36 | var res NodeList 37 | for _, n := range l { 38 | if !n.skip { 39 | res = append(res, n) 40 | } 41 | } 42 | res.Sort() 43 | return res 44 | } 45 | -------------------------------------------------------------------------------- /kinder/pkg/cri/host/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package host 18 | 19 | /* 20 | Package host provide utilities for dealing with the CRI engine on the host machine (docker). 21 | 22 | The current implementation is a fork from "https://sigs.k8s.io/kind/pkg/build/nodeimage/internal/container/docker/", 23 | which can't be used because it is internal. The code in this package is now evolving independently from the original. 24 | */ 25 | -------------------------------------------------------------------------------- /kinder/pkg/cri/host/inspect.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package host 18 | 19 | import ( 20 | "k8s.io/kubeadm/kinder/pkg/exec" 21 | ) 22 | 23 | // InspectContainer return low-level information on containers 24 | func InspectContainer(containerNameOrID, format string) ([]string, error) { 25 | cmd := exec.NewHostCmd("docker", "inspect", 26 | "-f", format, 27 | containerNameOrID, // ... against the "node" container 28 | ) 29 | return cmd.RunAndCapture() 30 | } 31 | -------------------------------------------------------------------------------- /kinder/pkg/cri/host/pull.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package host 18 | 19 | import ( 20 | "time" 21 | 22 | "k8s.io/kubeadm/kinder/pkg/exec" 23 | ) 24 | 25 | // PullImage will pull an image if it is not present locally 26 | // retrying up to retries times 27 | // it returns true if it attempted to pull, and any errors from pulling 28 | func PullImage(image string, retries int) (bool, error) { 29 | // once we have configurable log levels 30 | // if this did not return an error, then the image exists locally 31 | if err := exec.NewHostCmd("docker", "inspect", "--type=image", image).Run(); err == nil { 32 | return false, nil 33 | } 34 | 35 | // otherwise try to pull it 36 | var err error 37 | if err = exec.NewHostCmd("docker", "pull", image).Run(); err != nil { 38 | for i := range retries { 39 | time.Sleep(time.Second * time.Duration(i+1)) 40 | if err = exec.NewHostCmd("docker", "pull", image).Run(); err == nil { 41 | break 42 | } 43 | } 44 | } 45 | return true, err 46 | } 47 | -------------------------------------------------------------------------------- /kinder/pkg/cri/host/run.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package host 18 | 19 | import ( 20 | "strings" 21 | 22 | "github.com/pkg/errors" 23 | 24 | "k8s.io/kubeadm/kinder/pkg/exec" 25 | ) 26 | 27 | // Run creates a container with "docker run", with some error handling 28 | func Run(image string, runArgs, containerArgs []string) error { 29 | // construct the actual docker run argv 30 | args := []string{"run"} 31 | args = append(args, runArgs...) 32 | args = append(args, image) 33 | args = append(args, containerArgs...) 34 | 35 | if output, err := exec.NewHostCmd("docker", args...).RunAndCapture(); err != nil { 36 | return errors.Wrapf(err, "failed to execute docker run: %s", strings.Join(output, " ")) 37 | } 38 | return nil 39 | } 40 | -------------------------------------------------------------------------------- /kinder/pkg/cri/host/signal.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package host 18 | 19 | import ( 20 | "k8s.io/kubeadm/kinder/pkg/exec" 21 | ) 22 | 23 | // SendSignal sends the named signal to the container 24 | func SendSignal(signal, containerNameOrID string) error { 25 | cmd := exec.NewHostCmd( 26 | "docker", "kill", 27 | "-s", signal, 28 | containerNameOrID, 29 | ) 30 | return cmd.Run() 31 | } 32 | -------------------------------------------------------------------------------- /kinder/pkg/cri/nodes/actionhelper.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package nodes 18 | 19 | import ( 20 | "github.com/pkg/errors" 21 | 22 | "k8s.io/kubeadm/kinder/pkg/cluster/status" 23 | "k8s.io/kubeadm/kinder/pkg/cri/nodes/containerd" 24 | "k8s.io/kubeadm/kinder/pkg/cri/nodes/docker" 25 | ) 26 | 27 | // ActionHelper helper provides CRI specific methods used by kind(er) actions 28 | type ActionHelper struct { 29 | cri status.ContainerRuntime 30 | } 31 | 32 | // NewActionHelper returns a new AlterHelper 33 | func NewActionHelper(cri status.ContainerRuntime) (*ActionHelper, error) { 34 | return &ActionHelper{ 35 | cri: cri, 36 | }, nil 37 | } 38 | 39 | // PreLoadUpgradeImages preload images required by kubeadm-update into the selected container runtime that exists inside a kind(er) node 40 | func (h *ActionHelper) PreLoadUpgradeImages(n *status.Node, srcFolder string) error { 41 | switch h.cri { 42 | case status.ContainerdRuntime: 43 | return containerd.PreLoadUpgradeImages(n, srcFolder) 44 | case status.DockerRuntime: 45 | return docker.PreLoadUpgradeImages(n, srcFolder) 46 | } 47 | return errors.Errorf("unknown cri: %s", h.cri) 48 | } 49 | 50 | // GetImages prints the images available in the node 51 | func (h *ActionHelper) GetImages(n *status.Node) ([]string, error) { 52 | switch h.cri { 53 | case status.ContainerdRuntime: 54 | return containerd.GetImages(n) 55 | case status.DockerRuntime: 56 | return docker.GetImages(n) 57 | } 58 | return nil, errors.Errorf("unknown cri: %s", h.cri) 59 | } 60 | -------------------------------------------------------------------------------- /kinder/pkg/cri/nodes/confighelper.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package nodes 18 | 19 | import ( 20 | "github.com/pkg/errors" 21 | 22 | "k8s.io/kubeadm/kinder/pkg/cluster/status" 23 | "k8s.io/kubeadm/kinder/pkg/kubeadm" 24 | ) 25 | 26 | // ConfigHelper provides CRI specific methods for creating the kubeadm config 27 | type ConfigHelper struct { 28 | cri status.ContainerRuntime 29 | } 30 | 31 | // NewConfigHelper returns a new ConfigHelper 32 | func NewConfigHelper(cri status.ContainerRuntime) (*ConfigHelper, error) { 33 | return &ConfigHelper{ 34 | cri: cri, 35 | }, nil 36 | } 37 | 38 | // GetKubeadmConfigPatches returns kustomize patches for configuring the kubeadm config file for using the selected container runtime 39 | func (h *ConfigHelper) GetKubeadmConfigPatches(kubeadmConfigVersion string, controlPlane bool) ([]string, error) { 40 | switch h.cri { 41 | case status.ContainerdRuntime: 42 | // since we are using kind library for generating the kubeadm-config file, and kind uses by default containerd, no 43 | // additional patches are required in this case 44 | return []string{}, nil 45 | case status.DockerRuntime: 46 | return kubeadm.GetDockerPatch(kubeadmConfigVersion, controlPlane) 47 | } 48 | return nil, errors.Errorf("unknown cri: %s", h.cri) 49 | } 50 | -------------------------------------------------------------------------------- /kinder/pkg/cri/nodes/containerd/actionhelper.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package containerd 18 | 19 | import ( 20 | "github.com/pkg/errors" 21 | 22 | "k8s.io/kubeadm/kinder/pkg/cluster/status" 23 | ) 24 | 25 | // PreLoadUpgradeImages preload images required by kubeadm-upgrade into the containerd runtime that exists inside a kind(er) node 26 | func PreLoadUpgradeImages(n *status.Node, srcFolder string) error { 27 | // NB. this code is an extract from "sigs.k8s.io/kind/pkg/build/node" 28 | return n.Command( 29 | "bash", "-c", 30 | `find `+srcFolder+` -name *.tar -print0 | xargs -0 -n 1 -P $(nproc) ctr --namespace=k8s.io images import --no-unpack`, 31 | ).Silent().Run() 32 | } 33 | 34 | // GetImages returns the list of images available in the node 35 | func GetImages(n *status.Node) ([]string, error) { 36 | current, err := n.Command( 37 | "ctr", "--namespace=k8s.io", "images", "ls", "-q", 38 | ).Silent().RunAndCapture() 39 | 40 | if err != nil { 41 | return nil, errors.Wrapf(err, "failed to read current images from %s", n.Name()) 42 | } 43 | 44 | return current, nil 45 | } 46 | -------------------------------------------------------------------------------- /kinder/pkg/cri/nodes/containerd/config/config.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2023 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package config 18 | 19 | import ( 20 | "os" 21 | 22 | "github.com/pelletier/go-toml" 23 | "github.com/pkg/errors" 24 | ) 25 | 26 | var ( 27 | // DefaultConfigPath is the default location of the containerd config file. 28 | DefaultConfigPath = "/etc/containerd/config.toml" 29 | ) 30 | 31 | var ( 32 | sandboxImageFieldPath = []string{"plugins", "io.containerd.grpc.v1.cri", "sandbox_image"} 33 | ) 34 | 35 | // GetCRISandboxImage returns the sandbox image defined in the containerd config file. 36 | func GetCRISandboxImage(path string) (string, error) { 37 | if _, err := os.Stat(path); err != nil { 38 | return "", err 39 | } 40 | 41 | tree, err := toml.LoadFile(path) 42 | if err != nil { 43 | return "", err 44 | } 45 | 46 | if !tree.HasPath(sandboxImageFieldPath) { 47 | return "", errors.Errorf("the field %v doesn't exist in the config file %s", sandboxImageFieldPath, path) 48 | } 49 | 50 | return tree.GetPath(sandboxImageFieldPath).(string), nil 51 | } 52 | 53 | // SetCRISandboxImage sets the sandbox image field of the containerd config file to the specified value. 54 | func SetCRISandboxImage(path string, sandboxImage string) error { 55 | if _, err := os.Stat(path); err != nil { 56 | return err 57 | } 58 | 59 | tree, err := toml.LoadFile(path) 60 | if err != nil { 61 | return err 62 | } 63 | 64 | tree.SetPath(sandboxImageFieldPath, sandboxImage) 65 | 66 | data, err := tree.ToTomlString() 67 | if err != nil { 68 | return err 69 | } 70 | 71 | if err := os.WriteFile(path, []byte(data), 0666); err != nil { 72 | return errors.Errorf("failed to write to config file %s, error: %v", path, err) 73 | } 74 | 75 | return nil 76 | } 77 | -------------------------------------------------------------------------------- /kinder/pkg/cri/nodes/containerd/createhelper.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package containerd 18 | 19 | import ( 20 | "k8s.io/kubeadm/kinder/pkg/cri/nodes/common" 21 | "k8s.io/kubeadm/kinder/pkg/exec" 22 | ) 23 | 24 | // CreateNode creates a container that internally hosts the containerd cri runtime 25 | func CreateNode(cluster, name, image, role string, volumes []string) error { 26 | args, err := common.BaseRunArgs(cluster, name, role) 27 | if err != nil { 28 | return err 29 | } 30 | 31 | args, err = common.RunArgsForNode(role, volumes, args) 32 | if err != nil { 33 | return err 34 | } 35 | 36 | // Specify the image to run 37 | args = append(args, image) 38 | 39 | // creates the container 40 | if err := exec.NewHostCmd("docker", args...).Run(); err != nil { 41 | return err 42 | } 43 | 44 | return nil 45 | } 46 | -------------------------------------------------------------------------------- /kinder/pkg/cri/nodes/docker/actionhelper.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package docker 18 | 19 | import ( 20 | "strconv" 21 | 22 | "github.com/pkg/errors" 23 | 24 | "k8s.io/kubeadm/kinder/pkg/cluster/status" 25 | ) 26 | 27 | // PreLoadUpgradeImages preload images required by kubeadm-upgrade into the docker runtime that exists inside a kind(er) node 28 | func PreLoadUpgradeImages(n *status.Node, srcFolder string) error { 29 | return n.Command( 30 | "/bin/bash", "-c", 31 | `find `+srcFolder+` -name *.tar -print0 | xargs -0 -n 1 -P $(nproc) docker load -i`, 32 | ).Silent().Run() 33 | } 34 | 35 | // GetImages returns the list of images available in the node 36 | func GetImages(n *status.Node) ([]string, error) { 37 | current, err := n.Command( 38 | "docker", "images", `--format="{{.Repository}}:{{.Tag}}"`, 39 | ).Silent().RunAndCapture() 40 | 41 | if err != nil { 42 | return nil, errors.Wrapf(err, "failed to read current images from %s", n.Name()) 43 | } 44 | 45 | for i := range current { 46 | current[i], _ = strconv.Unquote(current[i]) 47 | } 48 | 49 | return current, nil 50 | } 51 | -------------------------------------------------------------------------------- /kinder/pkg/cri/nodes/docker/readme.md: -------------------------------------------------------------------------------- 1 | Docker support was dropped in kind 0.3.0 in favour of containerd. 2 | 3 | This package is based on kind 0.2.1, but then the code evolved in order to keep up with kind evolution (e.g. introduction of port mappings) and to adapt 4 | to the kinder specific needs/code organization. 5 | -------------------------------------------------------------------------------- /kinder/pkg/exec/colors/color.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | Package colors implement utilities for colorizing prompt, command and args printed to screen before execution. 19 | */ 20 | package colors 21 | 22 | import ( 23 | "fmt" 24 | "os" 25 | "strings" 26 | ) 27 | 28 | func colorOn() bool { 29 | return strings.ToLower(os.Getenv("KINDER_COLORS")) == "on" 30 | } 31 | 32 | // Prompt returns a colorized version of the command prompt 33 | func Prompt(hostname string) string { 34 | if !colorOn() { 35 | return hostname 36 | } 37 | return fmt.Sprintf("\033[1;48;5;19m%s\033[0m", hostname) 38 | } 39 | 40 | // Command returns a colorized version of the command string, including also its arguments 41 | func Command(s string) string { 42 | if !colorOn() { 43 | return s 44 | } 45 | return fmt.Sprintf("\033[1;48;5;33m%s\033[0m", s) 46 | } 47 | 48 | // Info return a colorized version of a generic message 49 | func Info(s string) string { 50 | if !colorOn() { 51 | return s 52 | } 53 | return fmt.Sprintf("\033[1;48;5;34m%s\033[0m", s) 54 | } 55 | -------------------------------------------------------------------------------- /kinder/pkg/kubeadm/automaticcopycertspatch.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package kubeadm 18 | 19 | import ( 20 | "fmt" 21 | 22 | "github.com/pkg/errors" 23 | log "github.com/sirupsen/logrus" 24 | 25 | "k8s.io/kubeadm/kinder/pkg/constants" 26 | ) 27 | 28 | // GetAutomaticCopyCertsPatches returns the kubeadm config patch that will instruct kubeadm 29 | // to use a well known certificate key for init/join. 30 | func GetAutomaticCopyCertsPatches(kubeadmConfigVersion string) ([]string, error) { 31 | // select the patches for the kubeadm config version 32 | log.Debugf("Preparing automaticCopyCertsPatches for kubeadm config %s", kubeadmConfigVersion) 33 | 34 | switch kubeadmConfigVersion { 35 | case "v1beta3": 36 | return []string{ 37 | fmt.Sprintf(automaticCopyCertsInitv1beta3, constants.CertificateKey), 38 | fmt.Sprintf(automaticCopyCertsJoinv1beta3, constants.CertificateKey), 39 | }, nil 40 | case "v1beta4": 41 | return []string{ 42 | fmt.Sprintf(automaticCopyCertsInitv1beta4, constants.CertificateKey), 43 | fmt.Sprintf(automaticCopyCertsJoinv1beta4, constants.CertificateKey), 44 | }, nil 45 | } 46 | 47 | return nil, errors.Errorf("unknown kubeadm config version: %s", kubeadmConfigVersion) 48 | } 49 | 50 | const automaticCopyCertsInitv1beta3 = `apiVersion: kubeadm.k8s.io/v1beta3 51 | kind: InitConfiguration 52 | certificateKey: "%s"` 53 | 54 | const automaticCopyCertsJoinv1beta3 = `apiVersion: kubeadm.k8s.io/v1beta3 55 | kind: JoinConfiguration 56 | controlPlane: 57 | certificateKey: "%s"` 58 | 59 | const automaticCopyCertsInitv1beta4 = `apiVersion: kubeadm.k8s.io/v1beta4 60 | kind: InitConfiguration 61 | certificateKey: "%s"` 62 | 63 | const automaticCopyCertsJoinv1beta4 = `apiVersion: kubeadm.k8s.io/v1beta4 64 | kind: JoinConfiguration 65 | controlPlane: 66 | certificateKey: "%s"` 67 | -------------------------------------------------------------------------------- /kinder/pkg/kubeadm/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | Package kubeadm contains all the logic for creating kubeadm config and the kubeadm 19 | config patches to be used during cluster creation. 20 | 21 | Having direct control on kubeadm config is a specific necessity for kinder, because 22 | create nodes supports different CRI while kind supports only containerd; 23 | additionally, in kinder all the actions for setting up a working cluster can happen 24 | at different time while in kind everything - from create to a working K8s cluster - 25 | happens within an atomic operation, create. 26 | 27 | Another difference from kind, is that kinder support skew from kubeadm version and 28 | K8s version, and as a consequence it was necessary to ensure that the code in 29 | this package is dependent on the kubeadm version installed on nodes. 30 | 31 | Nevertheless, the core config used by kinder is a fork from "sigs.k8s.io/kind/pkg/cluster/internal/kubeadm"; 32 | all the kinder specific settings are applied as kustomize patches. 33 | */ 34 | package kubeadm 35 | -------------------------------------------------------------------------------- /kinder/pkg/kubeadm/dockerpatch.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package kubeadm 18 | 19 | import ( 20 | "fmt" 21 | 22 | "github.com/pkg/errors" 23 | log "github.com/sirupsen/logrus" 24 | ) 25 | 26 | // GetDockerPatch returns the kubeadm config patch that will instruct kubeadm 27 | // to setup user docker CRI defaults. 28 | func GetDockerPatch(kubeadmConfigVersion string, ControlPlane bool) ([]string, error) { 29 | // select the patches for the kubeadm config version 30 | log.Debugf("Preparing dockerPatch for kubeadm config %s", kubeadmConfigVersion) 31 | 32 | var basePatch string 33 | switch kubeadmConfigVersion { 34 | case "v1beta3": 35 | basePatch = dockerPatchv1beta3 36 | case "v1beta4": 37 | basePatch = dockerPatchv1beta4 38 | default: 39 | return nil, errors.Errorf("unknown kubeadm config version: %s", kubeadmConfigVersion) 40 | } 41 | 42 | return []string{ 43 | fmt.Sprintf(basePatch, "InitConfiguration"), 44 | fmt.Sprintf(basePatch, "JoinConfiguration"), 45 | }, nil 46 | } 47 | 48 | const dockerPatchv1beta3 = `apiVersion: kubeadm.k8s.io/v1beta3 49 | kind: %s 50 | nodeRegistration: 51 | criSocket: /var/run/dockershim.sock` 52 | 53 | const dockerPatchv1beta4 = `apiVersion: kubeadm.k8s.io/v1beta4 54 | kind: %s 55 | nodeRegistration: 56 | criSocket: /var/run/dockershim.sock` 57 | -------------------------------------------------------------------------------- /kinder/pkg/kubeadm/encryptionalgorithmpatch.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2024 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package kubeadm 18 | 19 | import ( 20 | "fmt" 21 | 22 | "github.com/pkg/errors" 23 | log "github.com/sirupsen/logrus" 24 | ) 25 | 26 | // GetEncryptionAlgorithmPatch returns the kubeadm config patch that will instruct kubeadm 27 | // to use a specific encryption algorithm 28 | func GetEncryptionAlgorithmPatch(kubeadmConfigVersion string, algorithm string) (string, error) { 29 | var patch string 30 | log.Debugf("Preparing encryptionAlgorithm patch for kubeadm config %s", kubeadmConfigVersion) 31 | 32 | switch kubeadmConfigVersion { 33 | case "v1beta3": 34 | return "", errors.New("ClusterConfiguration.encryptionAlgorithm is not supported in v1beta3") 35 | case "v1beta4": 36 | patch = encryptionAlgorithmPatchV1beta4 37 | default: 38 | return "", errors.Errorf("unknown kubeadm config version: %s", kubeadmConfigVersion) 39 | } 40 | 41 | return fmt.Sprintf(patch, algorithm), nil 42 | } 43 | 44 | const encryptionAlgorithmPatchV1beta4 = `apiVersion: kubeadm.k8s.io/v1beta4 45 | kind: ClusterConfiguration 46 | encryptionAlgorithm: %s 47 | ` 48 | -------------------------------------------------------------------------------- /kinder/pkg/kubeadm/externaletcdpatch.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package kubeadm 18 | 19 | import ( 20 | "fmt" 21 | 22 | "github.com/pkg/errors" 23 | log "github.com/sirupsen/logrus" 24 | ) 25 | 26 | // GetExternalEtcdPatch returns the kubeadm config patch that will instruct kubeadm 27 | // to use external etcd. 28 | func GetExternalEtcdPatch(kubeadmConfigVersion string, etcdIP string) (string, error) { 29 | // select the patches for the kubeadm config version 30 | log.Debugf("Preparing externalEtcdPatch for kubeadm config %s", kubeadmConfigVersion) 31 | 32 | var externalEtcdPatch string 33 | switch kubeadmConfigVersion { 34 | case "v1beta3": 35 | externalEtcdPatch = externalEtcdPatchv1beta3 36 | case "v1beta4": 37 | externalEtcdPatch = externalEtcdPatchv1beta4 38 | default: 39 | return "", errors.Errorf("unknown kubeadm config version: %s", kubeadmConfigVersion) 40 | } 41 | 42 | return fmt.Sprintf(externalEtcdPatch, etcdIP), nil 43 | } 44 | 45 | const externalEtcdPatchv1beta3 = `apiVersion: kubeadm.k8s.io/v1beta3 46 | kind: ClusterConfiguration 47 | etcd: 48 | external: 49 | endpoints: 50 | - http://%s:2379` 51 | 52 | const externalEtcdPatchv1beta4 = `apiVersion: kubeadm.k8s.io/v1beta4 53 | kind: ClusterConfiguration 54 | etcd: 55 | external: 56 | endpoints: 57 | - http://%s:2379` 58 | -------------------------------------------------------------------------------- /kinder/pkg/loadbalancer/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | /* 18 | Package loadbalancer contains external loadbalancer related constants and configuration. 19 | 20 | Having a direct control on loadbalancer config is a specific necessity for kinder, because 21 | in kinder all the actions for setting up a working cluster can happen 22 | at different time while in kind everything - from create to a working K8s cluster - 23 | happens within an atomic operation, create. 24 | 25 | The current implementation is a fork from "sigs.k8s.io/kind/pkg/cluster/internal/loadbalancer". 26 | */ 27 | package loadbalancer 28 | -------------------------------------------------------------------------------- /kinder/pkg/loadbalancer/loadbalancer.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package loadbalancer 18 | 19 | import ( 20 | "bytes" 21 | "text/template" 22 | 23 | "github.com/pkg/errors" 24 | ) 25 | 26 | // ConfigData is supplied to the loadbalancer config template 27 | type ConfigData struct { 28 | ControlPlanePort int 29 | BackendServers map[string]string 30 | IPv6 bool 31 | } 32 | 33 | // DefaultConfigTemplate is the loadbalancer config template 34 | const DefaultConfigTemplate = `# generated by kind 35 | global 36 | log /dev/log local0 37 | log /dev/log local1 notice 38 | daemon 39 | 40 | defaults 41 | log global 42 | mode tcp 43 | option dontlognull 44 | # TODO: tune these 45 | timeout connect 5000 46 | timeout client 50000 47 | timeout server 50000 48 | 49 | frontend control-plane 50 | bind *:{{ .ControlPlanePort }} 51 | {{ if .IPv6 -}} 52 | bind :::{{ .ControlPlanePort }}; 53 | {{- end }} 54 | default_backend kube-apiservers 55 | 56 | backend kube-apiservers 57 | option httpchk GET /healthz 58 | # TODO: we should be verifying (!) 59 | {{range $server, $address := .BackendServers}} 60 | server {{ $server }} {{ $address }} check check-ssl verify none 61 | {{- end}} 62 | ` 63 | 64 | // Config returns a kubeadm config generated from config data, in particular 65 | // the kubernetes version 66 | func Config(data *ConfigData) (config string, err error) { 67 | t, err := template.New("loadbalancer-config").Parse(DefaultConfigTemplate) 68 | if err != nil { 69 | return "", errors.Wrap(err, "failed to parse config template") 70 | } 71 | // execute the template 72 | var buff bytes.Buffer 73 | err = t.Execute(&buff, data) 74 | if err != nil { 75 | return "", errors.Wrap(err, "error executing config template") 76 | } 77 | return buff.String(), nil 78 | } 79 | -------------------------------------------------------------------------------- /logos/README.md: -------------------------------------------------------------------------------- 1 | ## kubeadm Logos 2 | 3 | *Note: GitHub Flavored Markdown used in the Readme doesn't support background colors. The white logos below are displayed on the light grey of tables.* 4 | 5 | 6 |
9 | | ||||||
---|---|---|---|---|---|---|
12 | | PNG | 13 |SVG | 14 |||||
17 | | horizontal | 18 |stacked | 19 |icon | 20 |horizontal | 21 |stacked | 22 |icon | 23 |
color | 26 |![]() |
27 | ![]() |
28 | ![]() |
29 | |||
black | 35 |![]() |
36 | ![]() |
37 | ![]() |
38 | |||
white | 44 |![]() |
45 | ![]() |
46 | ![]() |
47 |