From 7eceae77c7fd221ad2d5cfde5ce78947d7a11b4f Mon Sep 17 00:00:00 2001 From: Shiming Zhang Date: Wed, 24 Jul 2024 15:31:56 +0800 Subject: [PATCH] Remove old test --- .github/workflows/test.yaml | 32 +- test/e2e/dryrun.go | 2 +- .../kwokctl/dryrun}/testdata/extra.yaml | 0 test/kwokctl/audit-policy.yaml | 4 - test/kwokctl/fake-deployment.yaml | 18 - test/kwokctl/fake-node.yaml | 16 - test/kwokctl/kustomization.yaml | 6 - .../kwokctl_binary_export_logs.test.sh | 31 - test/kwokctl/kwokctl_binary_restart.test.sh | 31 - test/kwokctl/kwokctl_binary_snapshot.test.sh | 31 - .../kwokctl_docker_export_logs.test.sh | 31 - test/kwokctl/kwokctl_docker_restart.test.sh | 31 - test/kwokctl/kwokctl_docker_snapshot.test.sh | 31 - test/kwokctl/kwokctl_export_logs_test.sh | 132 ---- .../kwokctl_kind-podman_export_logs.test.sh | 31 - .../kwokctl_kind-podman_restart.test.sh | 31 - .../kwokctl_kind-podman_snapshot.test.sh | 31 - test/kwokctl/kwokctl_kind_export_logs.test.sh | 31 - test/kwokctl/kwokctl_kind_restart.test.sh | 31 - test/kwokctl/kwokctl_kind_snapshot.test.sh | 31 - .../kwokctl_nerdctl_export_logs.test.sh | 31 - test/kwokctl/kwokctl_nerdctl_restart.test.sh | 31 - test/kwokctl/kwokctl_nerdctl_snapshot.test.sh | 31 - .../kwokctl_podman_export_logs.test.sh | 31 - test/kwokctl/kwokctl_podman_restart.test.sh | 31 - test/kwokctl/kwokctl_podman_snapshot.test.sh | 31 - test/kwokctl/kwokctl_podman_verbosity.test.sh | 31 - test/kwokctl/kwokctl_restart_test.sh | 169 ----- test/kwokctl/kwokctl_snapshot_test.sh | 242 ------- test/kwokctl/kwokctl_with_dryrun.test.sh | 105 ---- .../testdata/binary/create_cluster.txt | 45 -- .../binary/create_cluster_with_extra.txt | 133 ---- .../binary/create_cluster_with_verbosity.txt | 166 ----- test/kwokctl/testdata/binary/export_logs.txt | 10 - .../testdata/binary/snapshot_restore_etcd.txt | 15 - .../testdata/binary/snapshot_save_etcd.txt | 2 - .../kwokctl/testdata/binary/start_cluster.txt | 12 - test/kwokctl/testdata/binary/stop_cluster.txt | 12 - .../testdata/docker/create_cluster.txt | 65 -- .../docker/create_cluster_with_extra.txt | 154 ----- .../docker/create_cluster_with_verbosity.txt | 194 ------ test/kwokctl/testdata/docker/export_logs.txt | 10 - .../testdata/docker/snapshot_restore_etcd.txt | 14 - .../testdata/docker/snapshot_save_etcd.txt | 2 - .../kwokctl/testdata/docker/start_cluster.txt | 6 - test/kwokctl/testdata/docker/stop_cluster.txt | 6 - .../testdata/kind-podman/create_cluster.txt | 133 ---- .../kind-podman/create_cluster_with_extra.txt | 341 ---------- .../create_cluster_with_verbosity.txt | 591 ------------------ .../testdata/kind-podman/export_logs.txt | 10 - .../kind-podman/snapshot_restore_etcd.txt | 8 - .../kind-podman/snapshot_save_etcd.txt | 3 - .../testdata/kind-podman/start_cluster.txt | 1 - .../testdata/kind-podman/stop_cluster.txt | 1 - test/kwokctl/testdata/kind/create_cluster.txt | 130 ---- .../kind/create_cluster_with_extra.txt | 335 ---------- .../kind/create_cluster_with_verbosity.txt | 573 ----------------- test/kwokctl/testdata/kind/export_logs.txt | 10 - .../testdata/kind/snapshot_restore_etcd.txt | 8 - .../testdata/kind/snapshot_save_etcd.txt | 3 - test/kwokctl/testdata/kind/start_cluster.txt | 1 - test/kwokctl/testdata/kind/stop_cluster.txt | 1 - .../testdata/nerdctl/create_cluster.txt | 65 -- .../nerdctl/create_cluster_with_extra.txt | 154 ----- .../nerdctl/create_cluster_with_verbosity.txt | 194 ------ test/kwokctl/testdata/nerdctl/export_logs.txt | 10 - .../nerdctl/snapshot_restore_etcd.txt | 15 - .../testdata/nerdctl/snapshot_save_etcd.txt | 2 - .../testdata/nerdctl/start_cluster.txt | 6 - .../kwokctl/testdata/nerdctl/stop_cluster.txt | 6 - .../testdata/podman/create_cluster.txt | 65 -- .../podman/create_cluster_with_extra.txt | 154 ----- .../podman/create_cluster_with_verbosity.txt | 194 ------ test/kwokctl/testdata/podman/export_logs.txt | 10 - .../testdata/podman/snapshot_restore_etcd.txt | 14 - .../testdata/podman/snapshot_save_etcd.txt | 2 - .../kwokctl/testdata/podman/start_cluster.txt | 6 - test/kwokctl/testdata/podman/stop_cluster.txt | 6 - 78 files changed, 3 insertions(+), 5210 deletions(-) rename test/{kwokctl => e2e/kwokctl/dryrun}/testdata/extra.yaml (100%) delete mode 100644 test/kwokctl/audit-policy.yaml delete mode 100644 test/kwokctl/fake-deployment.yaml delete mode 100644 test/kwokctl/fake-node.yaml delete mode 100644 test/kwokctl/kustomization.yaml delete mode 100755 test/kwokctl/kwokctl_binary_export_logs.test.sh delete mode 100755 test/kwokctl/kwokctl_binary_restart.test.sh delete mode 100755 test/kwokctl/kwokctl_binary_snapshot.test.sh delete mode 100755 test/kwokctl/kwokctl_docker_export_logs.test.sh delete mode 100755 test/kwokctl/kwokctl_docker_restart.test.sh delete mode 100755 test/kwokctl/kwokctl_docker_snapshot.test.sh delete mode 100755 test/kwokctl/kwokctl_export_logs_test.sh delete mode 100755 test/kwokctl/kwokctl_kind-podman_export_logs.test.sh delete mode 100755 test/kwokctl/kwokctl_kind-podman_restart.test.sh delete mode 100755 test/kwokctl/kwokctl_kind-podman_snapshot.test.sh delete mode 100755 test/kwokctl/kwokctl_kind_export_logs.test.sh delete mode 100755 test/kwokctl/kwokctl_kind_restart.test.sh delete mode 100755 test/kwokctl/kwokctl_kind_snapshot.test.sh delete mode 100755 test/kwokctl/kwokctl_nerdctl_export_logs.test.sh delete mode 100755 test/kwokctl/kwokctl_nerdctl_restart.test.sh delete mode 100755 test/kwokctl/kwokctl_nerdctl_snapshot.test.sh delete mode 100755 test/kwokctl/kwokctl_podman_export_logs.test.sh delete mode 100755 test/kwokctl/kwokctl_podman_restart.test.sh delete mode 100755 test/kwokctl/kwokctl_podman_snapshot.test.sh delete mode 100755 test/kwokctl/kwokctl_podman_verbosity.test.sh delete mode 100755 test/kwokctl/kwokctl_restart_test.sh delete mode 100755 test/kwokctl/kwokctl_snapshot_test.sh delete mode 100755 test/kwokctl/kwokctl_with_dryrun.test.sh delete mode 100644 test/kwokctl/testdata/binary/create_cluster.txt delete mode 100644 test/kwokctl/testdata/binary/create_cluster_with_extra.txt delete mode 100644 test/kwokctl/testdata/binary/create_cluster_with_verbosity.txt delete mode 100644 test/kwokctl/testdata/binary/export_logs.txt delete mode 100644 test/kwokctl/testdata/binary/snapshot_restore_etcd.txt delete mode 100644 test/kwokctl/testdata/binary/snapshot_save_etcd.txt delete mode 100644 test/kwokctl/testdata/binary/start_cluster.txt delete mode 100644 test/kwokctl/testdata/binary/stop_cluster.txt delete mode 100644 test/kwokctl/testdata/docker/create_cluster.txt delete mode 100644 test/kwokctl/testdata/docker/create_cluster_with_extra.txt delete mode 100644 test/kwokctl/testdata/docker/create_cluster_with_verbosity.txt delete mode 100644 test/kwokctl/testdata/docker/export_logs.txt delete mode 100644 test/kwokctl/testdata/docker/snapshot_restore_etcd.txt delete mode 100644 test/kwokctl/testdata/docker/snapshot_save_etcd.txt delete mode 100644 test/kwokctl/testdata/docker/start_cluster.txt delete mode 100644 test/kwokctl/testdata/docker/stop_cluster.txt delete mode 100644 test/kwokctl/testdata/kind-podman/create_cluster.txt delete mode 100644 test/kwokctl/testdata/kind-podman/create_cluster_with_extra.txt delete mode 100644 test/kwokctl/testdata/kind-podman/create_cluster_with_verbosity.txt delete mode 100644 test/kwokctl/testdata/kind-podman/export_logs.txt delete mode 100644 test/kwokctl/testdata/kind-podman/snapshot_restore_etcd.txt delete mode 100644 test/kwokctl/testdata/kind-podman/snapshot_save_etcd.txt delete mode 100644 test/kwokctl/testdata/kind-podman/start_cluster.txt delete mode 100644 test/kwokctl/testdata/kind-podman/stop_cluster.txt delete mode 100644 test/kwokctl/testdata/kind/create_cluster.txt delete mode 100644 test/kwokctl/testdata/kind/create_cluster_with_extra.txt delete mode 100644 test/kwokctl/testdata/kind/create_cluster_with_verbosity.txt delete mode 100644 test/kwokctl/testdata/kind/export_logs.txt delete mode 100644 test/kwokctl/testdata/kind/snapshot_restore_etcd.txt delete mode 100644 test/kwokctl/testdata/kind/snapshot_save_etcd.txt delete mode 100644 test/kwokctl/testdata/kind/start_cluster.txt delete mode 100644 test/kwokctl/testdata/kind/stop_cluster.txt delete mode 100644 test/kwokctl/testdata/nerdctl/create_cluster.txt delete mode 100644 test/kwokctl/testdata/nerdctl/create_cluster_with_extra.txt delete mode 100644 test/kwokctl/testdata/nerdctl/create_cluster_with_verbosity.txt delete mode 100644 test/kwokctl/testdata/nerdctl/export_logs.txt delete mode 100644 test/kwokctl/testdata/nerdctl/snapshot_restore_etcd.txt delete mode 100644 test/kwokctl/testdata/nerdctl/snapshot_save_etcd.txt delete mode 100644 test/kwokctl/testdata/nerdctl/start_cluster.txt delete mode 100644 test/kwokctl/testdata/nerdctl/stop_cluster.txt delete mode 100644 test/kwokctl/testdata/podman/create_cluster.txt delete mode 100644 test/kwokctl/testdata/podman/create_cluster_with_extra.txt delete mode 100644 test/kwokctl/testdata/podman/create_cluster_with_verbosity.txt delete mode 100644 test/kwokctl/testdata/podman/export_logs.txt delete mode 100644 test/kwokctl/testdata/podman/snapshot_restore_etcd.txt delete mode 100644 test/kwokctl/testdata/podman/snapshot_save_etcd.txt delete mode 100644 test/kwokctl/testdata/podman/start_cluster.txt delete mode 100644 test/kwokctl/testdata/podman/stop_cluster.txt diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0af07f6fd..327c9a3f1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -246,16 +246,10 @@ jobs: sudo mkdir -p /var/run/kubernetes sudo chmod 777 /var/run/kubernetes - - name: Install kubectl and kustomize - shell: bash - run: | - ./hack/requirements.sh kubectl kustomize - - - name: Test Dry Run - if: ${{ matrix.os == 'ubuntu-latest' && matrix.kwokctl-runtime == 'binary' }} + - name: Install kubectl shell: bash run: | - ./hack/e2e-test.sh kwokctl/kwokctl_with_dryrun + ./hack/requirements.sh kubectl - name: Test e2e dry run if: ${{ matrix.os == 'ubuntu-latest' && matrix.kwokctl-runtime == 'binary' }} @@ -268,14 +262,6 @@ jobs: run: | ./hack/e2e-test.sh e2e/kwokctl/${{ matrix.kwokctl-runtime }} && rm -rf logs - - name: Test Export Logs - shell: bash - run: | - if [[ "${{ matrix.kwokctl-runtime }}" != 'ubuntu-latest' ]]; then - export SKIP_DRY_RUN=true - fi - ./hack/e2e-test.sh kwokctl/kwokctl_${{ matrix.kwokctl-runtime }}_export_logs - - name: Test Workable shell: bash run: | @@ -284,20 +270,6 @@ jobs: fi ./hack/e2e-test.sh kwokctl/kwokctl_${{ matrix.kwokctl-runtime }} - - name: Test Snapshot - if: ${{ matrix.os != 'windows-latest' }} # TODO: fix snapshot test on windows - shell: bash - run: | - ./hack/e2e-test.sh kwokctl/kwokctl_${{ matrix.kwokctl-runtime }}_snapshot - - - name: Test Restart - shell: bash - run: | - if [[ "${{ matrix.kwokctl-runtime }}" != 'ubuntu-latest' ]]; then - export SKIP_DRY_RUN=true - fi - ./hack/e2e-test.sh kwokctl/kwokctl_${{ matrix.kwokctl-runtime }}_restart - - name: Test Benchmark if: ${{ matrix.os == 'ubuntu-latest' && matrix.kwokctl-runtime == 'binary' }} shell: bash diff --git a/test/e2e/dryrun.go b/test/e2e/dryrun.go index 6e3c8e336..ad9be2198 100644 --- a/test/e2e/dryrun.go +++ b/test/e2e/dryrun.go @@ -103,7 +103,7 @@ func CaseDryrunWithExtra(clusterName string, kwokctlPath string, rootDir string, f := features.New("Dry run with extra") f = f.Assess("test cluster dryrun with extra", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context { absPath := "test/e2e/kwokctl/dryrun/testdata/" + clusterRuntime + "/create_cluster_with_extra.txt" - extraPath := path.Join(rootDir, "test/kwokctl/testdata/extra.yaml") + extraPath := path.Join(rootDir, "test/e2e/kwokctl/dryrun/testdata/extra.yaml") args := []string{ "create", "cluster", "--dry-run", "--name", clusterName, "--timeout=30m", "--wait=30m", "--quiet-pull", "--disable-qps-limits", "--runtime", clusterRuntime, diff --git a/test/kwokctl/testdata/extra.yaml b/test/e2e/kwokctl/dryrun/testdata/extra.yaml similarity index 100% rename from test/kwokctl/testdata/extra.yaml rename to test/e2e/kwokctl/dryrun/testdata/extra.yaml diff --git a/test/kwokctl/audit-policy.yaml b/test/kwokctl/audit-policy.yaml deleted file mode 100644 index 67ec4611e..000000000 --- a/test/kwokctl/audit-policy.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: audit.k8s.io/v1 -kind: Policy -rules: -- level: Metadata diff --git a/test/kwokctl/fake-deployment.yaml b/test/kwokctl/fake-deployment.yaml deleted file mode 100644 index 1e9266d32..000000000 --- a/test/kwokctl/fake-deployment.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: fake-pod - namespace: default -spec: - replicas: 1 - selector: - matchLabels: - app: fake-pod - template: - metadata: - labels: - app: fake-pod - spec: - containers: - - name: fake-pod - image: fake diff --git a/test/kwokctl/fake-node.yaml b/test/kwokctl/fake-node.yaml deleted file mode 100644 index 28404368a..000000000 --- a/test/kwokctl/fake-node.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Node -metadata: - annotations: - kwok.x-k8s.io/node: fake - node.alpha.kubernetes.io/ttl: "0" - labels: - beta.kubernetes.io/arch: amd64 - beta.kubernetes.io/os: linux - kubernetes.io/arch: amd64 - kubernetes.io/hostname: fake-node - kubernetes.io/os: linux - kubernetes.io/role: agent - node-role.kubernetes.io/agent: "" - type: kwok-controller - name: fake-node diff --git a/test/kwokctl/kustomization.yaml b/test/kwokctl/kustomization.yaml deleted file mode 100644 index ca82527f7..000000000 --- a/test/kwokctl/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: -- fake-deployment.yaml -- fake-node.yaml diff --git a/test/kwokctl/kwokctl_binary_export_logs.test.sh b/test/kwokctl/kwokctl_binary_export_logs.test.sh deleted file mode 100755 index f87e5ef40..000000000 --- a/test/kwokctl/kwokctl_binary_export_logs.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2023 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "binary" "export_logs" "${all_releases[@]}" || exit 1 -} - -requirements_for_binary - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_binary_restart.test.sh b/test/kwokctl/kwokctl_binary_restart.test.sh deleted file mode 100755 index 1ec900789..000000000 --- a/test/kwokctl/kwokctl_binary_restart.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "binary" "restart" "${all_releases[@]}" || exit 1 -} - -requirements_for_binary - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_binary_snapshot.test.sh b/test/kwokctl/kwokctl_binary_snapshot.test.sh deleted file mode 100755 index 64770dc12..000000000 --- a/test/kwokctl/kwokctl_binary_snapshot.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "binary" "snapshot" "${all_releases[@]}" || exit 1 -} - -requirements_for_binary - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_docker_export_logs.test.sh b/test/kwokctl/kwokctl_docker_export_logs.test.sh deleted file mode 100755 index 2b64aee32..000000000 --- a/test/kwokctl/kwokctl_docker_export_logs.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2023 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "docker" "export_logs" "${all_releases[@]}" || exit 1 -} - -requirements - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_docker_restart.test.sh b/test/kwokctl/kwokctl_docker_restart.test.sh deleted file mode 100755 index 45064afb1..000000000 --- a/test/kwokctl/kwokctl_docker_restart.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "docker" "restart" "${all_releases[@]}" || exit 1 -} - -requirements - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_docker_snapshot.test.sh b/test/kwokctl/kwokctl_docker_snapshot.test.sh deleted file mode 100755 index 6a81a4c29..000000000 --- a/test/kwokctl/kwokctl_docker_snapshot.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "docker" "snapshot" "${all_releases[@]}" || exit 1 -} - -requirements - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_export_logs_test.sh b/test/kwokctl/kwokctl_export_logs_test.sh deleted file mode 100755 index 2f8d9cec0..000000000 --- a/test/kwokctl/kwokctl_export_logs_test.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2023 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/suite.sh" - -RELEASES=() - -function usage() { - echo "Usage: $0 " - echo " is the version of kubernetes to test against." -} - -function args() { - if [[ $# -eq 0 ]]; then - usage - exit 1 - fi - while [[ $# -gt 0 ]]; do - RELEASES+=("${1}") - shift - done -} - -function test_export_logs() { - local name="${1}" - local root_dir="${KWOK_LOGS_DIR}/kwok-${name}" - - if [[ "${SKIP_DRY_RUN}" != "true" ]]; then - got="$(save_logs "${name}" --dry-run | clear_testdata "${name}")" - want="$(<"${DIR}/testdata/${KWOK_RUNTIME}/export_logs.txt")" - if [[ "${got}" != "${want}" ]]; then - echo "------------------------------" - diff -u <(echo "${want}") <(echo "${got}") - echo "Error: dry run export logs failed" - if [[ "${UPDATE_DRY_RUN_TESTDATA}" == "true" ]]; then - echo "${got}" >"${DIR}/testdata/${KWOK_RUNTIME}/export_logs.txt" - fi - echo "------------------------------" - echo "cat <${DIR}/testdata/${KWOK_RUNTIME}/export_logs.txt" - echo "${got}" - echo "ALL" - echo "------------------------------" - return 1 - fi - fi - - if ! save_logs "${name}"; then - echo "Error: export logs failed" - return 1 - fi - - if [[ ! -d "${root_dir}" ]]; then - echo "Required directory ${root_dir} does not exist." - return 1 - fi - - REQUIRED_FILES=( - "kwok.yaml" - "${KWOK_RUNTIME}-info.txt" - ) - - for file in "${REQUIRED_FILES[@]}"; do - if [ ! -f "${root_dir}/$file" ]; then - echo "Required file $root_dir/$file does not exist." - return 1 - fi - done - - if [ ! -d "${root_dir}/components" ]; then - echo "Required directory ${root_dir}/components does not exist." - return 1 - fi - - LOG_FILES=( - "audit.log" - "etcd.log" - "kube-apiserver.log" - "kube-controller-manager.log" - "kube-scheduler.log" - "kwok-controller.log" - ) - for file in "${LOG_FILES[@]}"; do - if [[ ! -f "${root_dir}/components/${file}" ]]; then - echo "Required file ${root_dir}/components/${file} does not exist." - return 1 - fi - done - - echo "Directory ${KWOK_LOGS_DIR} is correct." -} - -function main() { - local failed=() - - for release in "${RELEASES[@]}"; do - echo "------------------------------" - echo "Testing export logs on ${KWOK_RUNTIME} for ${release}" - name="export-logs-cluster-${KWOK_RUNTIME}-${release//./-}" - create_cluster "${name}" "${release}" --kube-audit-policy="${DIR}/audit-policy.yaml" -v=4 - test_export_logs "${name}" || failed+=("${name}_export_logs") - delete_cluster "${name}" - done - - if [[ "${#failed[@]}" -ne 0 ]]; then - echo "------------------------------" - echo "Error: Some tests failed" - for test in "${failed[@]}"; do - echo " - ${test}" - done - exit 1 - fi -} - -args "$@" - -main diff --git a/test/kwokctl/kwokctl_kind-podman_export_logs.test.sh b/test/kwokctl/kwokctl_kind-podman_export_logs.test.sh deleted file mode 100755 index 3f1214156..000000000 --- a/test/kwokctl/kwokctl_kind-podman_export_logs.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2023 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "kind-podman" "export_logs" "${all_releases[@]}" || exit 1 -} - -requirements_for_podman - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_kind-podman_restart.test.sh b/test/kwokctl/kwokctl_kind-podman_restart.test.sh deleted file mode 100755 index 68336f8d1..000000000 --- a/test/kwokctl/kwokctl_kind-podman_restart.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2023 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "kind-podman" "restart" "${all_releases[@]}" || exit 1 -} - -requirements_for_podman - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_kind-podman_snapshot.test.sh b/test/kwokctl/kwokctl_kind-podman_snapshot.test.sh deleted file mode 100755 index aa1ffef65..000000000 --- a/test/kwokctl/kwokctl_kind-podman_snapshot.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2023 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "kind-podman" "snapshot" "${all_releases[@]}" || exit 1 -} - -requirements_for_podman - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_kind_export_logs.test.sh b/test/kwokctl/kwokctl_kind_export_logs.test.sh deleted file mode 100755 index b262ab851..000000000 --- a/test/kwokctl/kwokctl_kind_export_logs.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2023 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "kind" "export_logs" "${all_releases[@]}" || exit 1 -} - -requirements - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_kind_restart.test.sh b/test/kwokctl/kwokctl_kind_restart.test.sh deleted file mode 100755 index f22b6a7b8..000000000 --- a/test/kwokctl/kwokctl_kind_restart.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "kind" "restart" "${all_releases[@]}" || exit 1 -} - -requirements - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_kind_snapshot.test.sh b/test/kwokctl/kwokctl_kind_snapshot.test.sh deleted file mode 100755 index b538a9942..000000000 --- a/test/kwokctl/kwokctl_kind_snapshot.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "kind" "snapshot" "${all_releases[@]}" || exit 1 -} - -requirements - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_nerdctl_export_logs.test.sh b/test/kwokctl/kwokctl_nerdctl_export_logs.test.sh deleted file mode 100755 index 3ce5b9665..000000000 --- a/test/kwokctl/kwokctl_nerdctl_export_logs.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2023 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "nerdctl" "export_logs" "${all_releases[@]}" || exit 1 -} - -requirements_for_nerdctl - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_nerdctl_restart.test.sh b/test/kwokctl/kwokctl_nerdctl_restart.test.sh deleted file mode 100755 index 1d7cd400e..000000000 --- a/test/kwokctl/kwokctl_nerdctl_restart.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "nerdctl" "restart" "${all_releases[@]}" || exit 1 -} - -requirements_for_nerdctl - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_nerdctl_snapshot.test.sh b/test/kwokctl/kwokctl_nerdctl_snapshot.test.sh deleted file mode 100755 index 5e49c9c03..000000000 --- a/test/kwokctl/kwokctl_nerdctl_snapshot.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "nerdctl" "snapshot" "${all_releases[@]}" || exit 1 -} - -requirements_for_nerdctl - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_podman_export_logs.test.sh b/test/kwokctl/kwokctl_podman_export_logs.test.sh deleted file mode 100755 index da99c5a16..000000000 --- a/test/kwokctl/kwokctl_podman_export_logs.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2023 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "podman" "export_logs" "${all_releases[@]}" || exit 1 -} - -requirements_for_podman - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_podman_restart.test.sh b/test/kwokctl/kwokctl_podman_restart.test.sh deleted file mode 100755 index d6a257c2c..000000000 --- a/test/kwokctl/kwokctl_podman_restart.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2023 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "podman" "restart" "${all_releases[@]}" || exit 1 -} - -requirements_for_podman - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_podman_snapshot.test.sh b/test/kwokctl/kwokctl_podman_snapshot.test.sh deleted file mode 100755 index 8978641fd..000000000 --- a/test/kwokctl/kwokctl_podman_snapshot.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2023 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "podman" "snapshot" "${all_releases[@]}" || exit 1 -} - -requirements_for_podman - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_podman_verbosity.test.sh b/test/kwokctl/kwokctl_podman_verbosity.test.sh deleted file mode 100755 index 0566bbd5d..000000000 --- a/test/kwokctl/kwokctl_podman_verbosity.test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2023 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" - -function main() { - local all_releases=("${@}") - - test_all "podman" "verbosity" "${all_releases[@]}" || exit 1 -} - -requirements_for_podman - -mapfile -t releases < <(supported_releases) -main "${releases[@]}" diff --git a/test/kwokctl/kwokctl_restart_test.sh b/test/kwokctl/kwokctl_restart_test.sh deleted file mode 100755 index 97c246a76..000000000 --- a/test/kwokctl/kwokctl_restart_test.sh +++ /dev/null @@ -1,169 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/suite.sh" - -RELEASES=() - -function usage() { - echo "Usage: $0 " - echo " is the version of kubernetes to test against." -} - -function args() { - if [[ $# -eq 0 ]]; then - usage - exit 1 - fi - while [[ $# -gt 0 ]]; do - RELEASES+=("${1}") - shift - done -} - -function test_prometheus() { - local targets - for ((i = 0; i < 120; i++)); do - targets="$(curl -s http://127.0.0.1:9090/api/v1/targets)" - if [[ "$(echo "${targets}" | grep -o '"health":"up"' | wc -l)" -ge 6 ]]; then - break - fi - sleep 1 - done - - if ! [[ "$(echo "${targets}" | grep -o '"health":"up"' | wc -l)" -ge 6 ]]; then - echo "Error: metrics is not health" - echo curl -s http://127.0.0.1:9090/api/v1/targets - echo "${targets}" - return 1 - fi -} - -function get_resource_info() { - local name="${1}" - kwokctl --name "${name}" kubectl get pod --all-namespaces | awk '{print $1, $2}' - kwokctl --name "${name}" kubectl get node | awk '{print $1}' -} - -function test_restart() { - local name="${1}" - local expect_info - local actual_info - - if ! test_prometheus; then - echo "Error: cluster ${name} not ready" - return 1 - fi - kubectl kustomize "${DIR}" | kwokctl --name "${name}" kubectl apply -f - - sleep 15 - expect_info="$(get_resource_info "${name}")" - - if [[ "${SKIP_DRY_RUN}" != "true" ]]; then - got="$(kwokctl --name "${name}" stop cluster --dry-run | clear_testdata "${name}")" - want="$(<"${DIR}/testdata/${KWOK_RUNTIME}/stop_cluster.txt")" - if [[ "${got}" != "${want}" ]]; then - echo "------------------------------" - diff -u <(echo "${want}") <(echo "${got}") - echo "Error: dry run stop cluster ${name} failed" - if [[ "${UPDATE_DRY_RUN_TESTDATA}" == "true" ]]; then - echo "${got}" >"${DIR}/testdata/${KWOK_RUNTIME}/stop_cluster.txt" - fi - echo "------------------------------" - echo "cat <${DIR}/testdata/${KWOK_RUNTIME}/stop_cluster.txt" - echo "${got}" - echo "ALL" - echo "------------------------------" - return 1 - fi - fi - echo kwokctl --name "${name}" stop cluster - if kwokctl --name "${name}" stop cluster; then - echo "Cluster ${name} stopped successfully." - else - echo "Error: stop cluster ${name} failed" - return 1 - fi - if kwokctl --name "${name}" kubectl get node; then - echo "Error: cluster ${name} do not stop" - return 1 - fi - - if [[ "${SKIP_DRY_RUN}" != "true" ]]; then - got="$(kwokctl --name "${name}" start cluster --timeout 30m --wait 30m --dry-run | clear_testdata "${name}")" - want="$(<"${DIR}/testdata/${KWOK_RUNTIME}/start_cluster.txt")" - if [[ "${got}" != "${want}" ]]; then - echo "------------------------------" - diff -u <(echo "${want}") <(echo "${got}") - echo "Error: dry run start cluster ${name} failed" - if [[ "${UPDATE_DRY_RUN_TESTDATA}" == "true" ]]; then - echo "${got}" >"${DIR}/testdata/${KWOK_RUNTIME}/start_cluster.txt" - fi - echo "------------------------------" - echo "cat <${DIR}/testdata/${KWOK_RUNTIME}/start_cluster.txt" - echo "${got}" - echo "ALL" - echo "------------------------------" - return 1 - fi - fi - echo kwokctl --name "${name}" start cluster --timeout 30m --wait 30m - if kwokctl --name "${name}" start cluster --timeout 30m --wait 30m; then - echo "Cluster ${name} started successfully." - else - echo "Error: start cluster ${name} start failed" - return 1 - fi - if ! test_prometheus; then - echo "Error: cluster ${name} not restart" - return 1 - fi - - actual_info="$(get_resource_info "${name}")" - if [[ "${expect_info}" != "${actual_info}" ]]; then - echo "Error: Cluster ${name} start failed" - echo "Expected: ${expect_info}" - echo "Actual: ${actual_info}" - return 1 - fi -} - -function main() { - local failed=() - for release in "${RELEASES[@]}"; do - echo "------------------------------" - echo "Testing restart on ${KWOK_RUNTIME} for ${release}" - name="restart-cluster-${KWOK_RUNTIME}-${release//./-}" - create_cluster "${name}" "${release}" --prometheus-port 9090 - test_restart "${name}" || failed+=("restart_cluster_${name}") - delete_cluster "${name}" - done - - if [[ "${#failed[@]}" -ne 0 ]]; then - echo "------------------------------" - echo "Error: Some tests failed" - for test in "${failed[@]}"; do - echo " - ${test}" - done - exit 1 - fi -} - -args "$@" - -main diff --git a/test/kwokctl/kwokctl_snapshot_test.sh b/test/kwokctl/kwokctl_snapshot_test.sh deleted file mode 100755 index 0b877f146..000000000 --- a/test/kwokctl/kwokctl_snapshot_test.sh +++ /dev/null @@ -1,242 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/suite.sh" - -RELEASES=() - -function usage() { - echo "Usage: $0 " - echo " is the version of kubernetes to test against." -} - -function args() { - if [[ $# -eq 0 ]]; then - usage - exit 1 - fi - while [[ $# -gt 0 ]]; do - RELEASES+=("${1}") - shift - done -} - -function get_snapshot_info() { - local name="${1}" - kwokctl --name "${name}" kubectl get pod | awk '{print $1}' - kwokctl --name "${name}" kubectl get node | awk '{print $1}' -} - -function test_snapshot_etcd() { - local name="${1}" - local empty_info - local full_info - local restore_empty_info - local restore_full_info - local empty_path="./snapshot-empty-${name}" - local full_path="./snapshot-full-${name}" - - empty_info="$(get_snapshot_info "${name}")" - - if [[ "${SKIP_DRY_RUN}" != "true" ]]; then - got="$(kwokctl snapshot save --name "${name}" --path "${empty_path}" --format etcd --dry-run | clear_testdata "${name}")" - want="$(<"${DIR}/testdata/${KWOK_RUNTIME}/snapshot_save_etcd.txt")" - if [[ "${got}" != "${want}" ]]; then - echo "------------------------------" - diff -u <(echo "${want}") <(echo "${got}") - echo "${got}" >"${DIR}/testdata/${KWOK_RUNTIME}/snapshot_save_etcd.txt" - echo "Error: dry run snapshot save etcd failed" - if [[ "${UPDATE_DRY_RUN_TESTDATA}" == "true" ]]; then - echo "${got}" >"${DIR}/testdata/${KWOK_RUNTIME}/snapshot_save_etcd.txt" - fi - echo "------------------------------" - echo "cat <${DIR}/testdata/${KWOK_RUNTIME}/snapshot_save_etcd.txt" - echo "${got}" - echo "ALL" - echo "------------------------------" - return 1 - fi - fi - kwokctl snapshot save --name "${name}" --path "${empty_path}" --format etcd - - for ((i = 0; i < 120; i++)); do - kubectl kustomize "${DIR}" | kwokctl --name "${name}" kubectl apply -f - && break - sleep 1 - done - - for ((i = 0; i < 120; i++)); do - full_info="$(get_snapshot_info "${name}")" - if [[ "${full_info}" != "${empty_info}" && "${full_info}" =~ "fake-pod-" ]]; then - break - fi - sleep 1 - done - - if [[ "${full_info}" == "${empty_info}" ]]; then - echo "Error: Resource creation failed" - return 1 - fi - - kwokctl snapshot save --name "${name}" --path "${full_path}" --format etcd - - sleep 1 - - if [[ "${SKIP_DRY_RUN}" != "true" ]]; then - got="$(kwokctl snapshot restore --name "${name}" --path "${empty_path}" --format etcd --dry-run | clear_testdata "${name}")" - want="$(<"${DIR}/testdata/${KWOK_RUNTIME}/snapshot_restore_etcd.txt")" - if [[ "${got}" != "${want}" ]]; then - echo "------------------------------" - diff -u <(echo "${want}") <(echo "${got}") - echo "${got}" >"${DIR}/testdata/${KWOK_RUNTIME}/snapshot_restore_etcd.txt" - echo "Error: dry run snapshot restore etcd failed" - if [[ "${UPDATE_DRY_RUN_TESTDATA}" == "true" ]]; then - echo "${got}" >"${DIR}/testdata/${KWOK_RUNTIME}/snapshot_restore_etcd.txt" - fi - echo "------------------------------" - echo "cat <${DIR}/testdata/${KWOK_RUNTIME}/snapshot_restore_etcd.txt" - echo "${got}" - echo "ALL" - echo "------------------------------" - return 1 - fi - fi - kwokctl snapshot restore --name "${name}" --path "${empty_path}" --format etcd - for ((i = 0; i < 120; i++)); do - restore_empty_info="$(get_snapshot_info "${name}")" - if [[ "${empty_info}" == "${restore_empty_info}" ]]; then - break - fi - sleep 1 - done - - if [[ "${empty_info}" != "${restore_empty_info}" ]]; then - echo "Error: Empty snapshot restore failed" - echo "Expected: ${empty_info}" - echo "Actual: ${restore_empty_info}" - return 1 - fi - - sleep 1 - - kwokctl snapshot restore --name "${name}" --path "${full_path}" --format etcd - for ((i = 0; i < 120; i++)); do - restore_full_info=$(get_snapshot_info "${name}") - if [[ "${full_info}" == "${restore_full_info}" ]]; then - break - fi - sleep 1 - done - - if [[ "${full_info}" != "${restore_full_info}" ]]; then - echo "Error: Full snapshot restore failed" - echo "Expected: ${full_info}" - echo "Actual: ${restore_full_info}" - return 1 - fi - - rm -rf "${empty_path}" "${full_path}" -} - -function test_snapshot_k8s() { - local name="${1}" - local full_info - local restore_full_info - local full_path="./snapshot-k8s-${name}" - - for ((i = 0; i < 120; i++)); do - kubectl kustomize "${DIR}" | kwokctl --name "${name}" kubectl apply -f - && break - sleep 1 - done - - for ((i = 0; i < 120; i++)); do - full_info="$(get_snapshot_info "${name}")" - if [[ "${full_info}" =~ "fake-pod-" ]]; then - break - fi - sleep 1 - done - - if [[ ! "${full_info}" =~ "fake-pod-" ]]; then - echo "Error: Resource creation failed" - return 1 - fi - - kwokctl snapshot save --name "${name}" --path "${full_path}" --format k8s - - for ((i = 0; i < 120; i++)); do - kubectl kustomize "${DIR}" | kwokctl --name "${name}" kubectl delete -f - && break - sleep 1 - done - - for ((i = 0; i < 120; i++)); do - restore_full_info="$(get_snapshot_info "${name}")" - if [[ ! "${restore_full_info}" =~ "fake-pod-" ]]; then - break - fi - sleep 1 - done - - kwokctl snapshot restore --name "${name}" --path "${full_path}" --format k8s - - for ((i = 0; i < 120; i++)); do - restore_full_info="$(get_snapshot_info "${name}")" - if [[ "${restore_full_info}" =~ "fake-pod-" ]]; then - break - fi - sleep 1 - done - - if [[ "${full_info}" != "${restore_full_info}" ]]; then - echo "Error: Full snapshot restore failed" - echo "Expected: ${full_info}" - echo "Actual: ${restore_full_info}" - return 1 - fi - - rm -rf "${full_path}" -} - -function main() { - local failed=() - for release in "${RELEASES[@]}"; do - echo "------------------------------" - echo "Testing snapshot on ${KWOK_RUNTIME} for ${release}" - name="snapshot-cluster-${KWOK_RUNTIME}-${release//./-}" - create_cluster "etcd-${name}" "${release}" - test_snapshot_etcd "etcd-${name}" || failed+=("snapshot_etcd_${name}") - delete_cluster "etcd-${name}" - - create_cluster "k8s-${name}" "${release}" - test_snapshot_k8s "k8s-${name}" || failed+=("snapshot_k8s_${name}") - delete_cluster "k8s-${name}" - done - - if [[ "${#failed[@]}" -ne 0 ]]; then - echo "------------------------------" - echo "Error: Some tests failed" - for test in "${failed[@]}"; do - echo " - ${test}" - done - exit 1 - fi -} - -args "$@" - -main diff --git a/test/kwokctl/kwokctl_with_dryrun.test.sh b/test/kwokctl/kwokctl_with_dryrun.test.sh deleted file mode 100755 index 9e7c908e2..000000000 --- a/test/kwokctl/kwokctl_with_dryrun.test.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2023 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR="$(dirname "${BASH_SOURCE[0]}")" - -DIR="$(realpath "${DIR}")" - -source "${DIR}/helper.sh" -source "${DIR}/suite.sh" - -function main() { - local runtimes=("${@}") - local failed=() - local name - local got - - for runtime in "${runtimes[@]}"; do - name="dryrun-cluster-${runtime}" - echo "------------------------------" - echo "Testing dryrun on runtime ${runtime}" - got="$(KWOK_RUNTIME="${runtime}" create_cluster "${name}" "" \ - --kube-authorization=false \ - --dry-run | clear_testdata "${name}")" - want="$(<"${DIR}/testdata/${runtime}/create_cluster.txt")" - if [[ "${got}" != "${want}" ]]; then - echo "------------------------------" - diff -u <(echo "${want}") <(echo "${got}") - failed+=("create-cluster-runtime-${runtime}-dry-run") - if [[ "${UPDATE_DRY_RUN_TESTDATA}" == "true" ]]; then - echo "${got}" >"${DIR}/testdata/${runtime}/create_cluster.txt" - fi - echo "------------------------------" - echo "cat <${DIR}/testdata/${runtime}/create_cluster.txt" - echo "${got}" - echo "ALL" - echo "------------------------------" - fi - echo "------------------------------" - echo "Testing dryrun with extra on runtime ${runtime}" - got="$(KWOK_RUNTIME="${runtime}" create_cluster <"${DIR}/testdata/extra.yaml" "${name}" "" --config - --dry-run | clear_testdata "${name}")" - want="$(<"${DIR}/testdata/${runtime}/create_cluster_with_extra.txt")" - if [[ "${got}" != "${want}" ]]; then - echo "------------------------------" - diff -u <(echo "${want}") <(echo "${got}") - failed+=("create-cluster-${runtime}-with-extra-dry-run") - if [[ "${UPDATE_DRY_RUN_TESTDATA}" == "true" ]]; then - echo "${got}" >"${DIR}/testdata/${runtime}/create_cluster_with_extra.txt" - fi - echo "------------------------------" - echo "cat <${DIR}/testdata/${runtime}/create_cluster_with_extra.txt" - echo "${got}" - echo "ALL" - echo "------------------------------" - fi - echo "------------------------------" - echo "Testing dryrun with verbosity on runtime ${runtime}" - got="$(KWOK_RUNTIME="${runtime}" create_cluster "${name}" "" -v=debug \ - --prometheus-port 9090 \ - --jaeger-port 16686 \ - --dashboard-port 8000 \ - --kube-audit-policy "${DIR}/audit-policy.yaml" \ - --kube-scheduler-config "${DIR}/scheduler-config.yaml" \ - --enable-metrics-server \ - --dry-run | clear_testdata "${name}")" - want="$(<"${DIR}/testdata/${runtime}/create_cluster_with_verbosity.txt")" - if [[ "${got}" != "${want}" ]]; then - echo "------------------------------" - diff -u <(echo "${want}") <(echo "${got}") - failed+=("create-cluster-${runtime}-with-verbosity-dry-run") - if [[ "${UPDATE_DRY_RUN_TESTDATA}" == "true" ]]; then - echo "${got}" >"${DIR}/testdata/${runtime}/create_cluster_with_verbosity.txt" - fi - echo "------------------------------" - echo "cat <${DIR}/testdata/${runtime}/create_cluster_with_verbosity.txt" - echo "${got}" - echo "ALL" - echo "------------------------------" - fi - done - - if [[ "${#failed[@]}" -ne 0 ]]; then - echo "------------------------------" - echo "Error: Some tests failed" - for test in "${failed[@]}"; do - echo " - ${test}" - done - exit 1 - fi -} - -requirements_for_binary - -main binary docker podman nerdctl kind kind-podman diff --git a/test/kwokctl/testdata/binary/create_cluster.txt b/test/kwokctl/testdata/binary/create_cluster.txt deleted file mode 100644 index fd07b7dd4..000000000 --- a/test/kwokctl/testdata/binary/create_cluster.txt +++ /dev/null @@ -1,45 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pids -mkdir -p /workdir/clusters//logs -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//etcd -# Download https://github.com/etcd-io/etcd/releases/download/v3.5.11/etcd-v3.5.11--. and extract etcd to /workdir/clusters//bin/etcd -# Download https://dl.k8s.io/release/v1.30.2/bin///kube-apiserver to /workdir/clusters//bin/kube-apiserver -# Download https://dl.k8s.io/release/v1.30.2/bin///kube-controller-manager to /workdir/clusters//bin/kube-controller-manager -# Download https://dl.k8s.io/release/v1.30.2/bin///kube-scheduler to /workdir/clusters//bin/kube-scheduler -# Download /bin///kwok to /workdir/clusters//bin/kwok-controller -cat </workdir/clusters//kubeconfig.yaml -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /workdir/clusters//pki/ca.crt - server: https://127.0.0.1:32764 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /workdir/clusters//pki/admin.crt - client-key: /workdir/clusters//pki/admin.key -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -# Add context kwok- to ~/.kube/config -cd /workdir/clusters/ && etcd --name=node0 --auto-compaction-retention=1 --quota-backend-bytes=8589934592 --data-dir=/workdir/clusters//etcd --initial-advertise-peer-urls=http://0.0.0.0:32766 --listen-peer-urls=http://0.0.0.0:32766 --advertise-client-urls=http://0.0.0.0:32765 --listen-client-urls=http://0.0.0.0:32765 --initial-cluster=node0=http://0.0.0.0:32766 >/workdir/clusters//logs/etcd.log 2>&1 & -echo $! >/workdir/clusters//pids/etcd.pid -cd /workdir/clusters/ && kube-apiserver --etcd-prefix=/registry --allow-privileged=true --max-requests-inflight=0 --max-mutating-requests-inflight=0 --enable-priority-and-fairness=false --etcd-servers=http://127.0.0.1:32765 --bind-address=0.0.0.0 --secure-port=32764 --tls-cert-file=/workdir/clusters//pki/admin.crt --tls-private-key-file=/workdir/clusters//pki/admin.key --client-ca-file=/workdir/clusters//pki/ca.crt --service-account-key-file=/workdir/clusters//pki/admin.key --service-account-signing-key-file=/workdir/clusters//pki/admin.key --service-account-issuer=https://kubernetes.default.svc.cluster.local --proxy-client-key-file=/workdir/clusters//pki/admin.key --proxy-client-cert-file=/workdir/clusters//pki/admin.crt >/workdir/clusters//logs/kube-apiserver.log 2>&1 & -echo $! >/workdir/clusters//pids/kube-apiserver.pid -cd /workdir/clusters/ && kube-controller-manager --node-monitor-period=25s --node-monitor-grace-period=3m20s --kubeconfig=/workdir/clusters//kubeconfig.yaml --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=32762 --kube-api-qps=5000 --kube-api-burst=10000 >/workdir/clusters//logs/kube-controller-manager.log 2>&1 & -echo $! >/workdir/clusters//pids/kube-controller-manager.pid -cd /workdir/clusters/ && kube-scheduler --kubeconfig=/workdir/clusters//kubeconfig.yaml --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=32761 --kube-api-qps=5000 --kube-api-burst=10000 >/workdir/clusters//logs/kube-scheduler.log 2>&1 & -echo $! >/workdir/clusters//pids/kube-scheduler.pid -cd /workdir/clusters/ && kwok-controller --manage-all-nodes=true --kubeconfig=/workdir/clusters//kubeconfig.yaml --config=/workdir/clusters//kwok.yaml --tls-cert-file=/workdir/clusters//pki/admin.crt --tls-private-key-file=/workdir/clusters//pki/admin.key --node-ip= --node-name=localhost --node-port=32763 --server-address=0.0.0.0:32763 --node-lease-duration-seconds=200 >/workdir/clusters//logs/kwok-controller.log 2>&1 & -echo $! >/workdir/clusters//pids/kwok-controller.pid diff --git a/test/kwokctl/testdata/binary/create_cluster_with_extra.txt b/test/kwokctl/testdata/binary/create_cluster_with_extra.txt deleted file mode 100644 index e01aee7e6..000000000 --- a/test/kwokctl/testdata/binary/create_cluster_with_extra.txt +++ /dev/null @@ -1,133 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pids -mkdir -p /workdir/clusters//logs -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//etcd -# Download https://github.com/etcd-io/etcd/releases/download/v3.5.11/etcd-v3.5.11--. and extract etcd to /workdir/clusters//bin/etcd -# Download https://dl.k8s.io/release/v1.30.2/bin///kube-apiserver to /workdir/clusters//bin/kube-apiserver -# Download https://dl.k8s.io/release/v1.30.2/bin///kube-controller-manager to /workdir/clusters//bin/kube-controller-manager -# Download https://dl.k8s.io/release/v1.30.2/bin///kube-scheduler to /workdir/clusters//bin/kube-scheduler -# Download /bin///kwok to /workdir/clusters//bin/kwok-controller -# Download https://github.com/prometheus/prometheus/releases/download/v2.53.0/prometheus-2.53.0.-. and extract prometheus to /workdir/clusters//bin/prometheus -cat </workdir/clusters//prometheus.yaml -global: - scrape_interval: 15s - scrape_timeout: 10s - evaluation_interval: 15s -alerting: - alertmanagers: - - follow_redirects: true - enable_http2: true - scheme: http - timeout: 10s - api_version: v2 - static_configs: - - targets: [] -scrape_configs: -- job_name: "etcd" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:32765 -- job_name: "kube-apiserver" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/workdir/clusters//pki/admin.crt" - key_file: "/workdir/clusters//pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:32764 -- job_name: "kube-controller-manager" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/workdir/clusters//pki/admin.crt" - key_file: "/workdir/clusters//pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:32762 -- job_name: "kube-scheduler" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/workdir/clusters//pki/admin.crt" - key_file: "/workdir/clusters//pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:32761 -- job_name: "kwok-controller-metrics-discovery" - http_sd_configs: - - url: http://127.0.0.1:32763/discovery/prometheus -- job_name: "kwok-controller" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:32763 -- job_name: "prometheus" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:9090 -EOF -cat </workdir/clusters//kubeconfig.yaml -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /workdir/clusters//pki/ca.crt - server: https://127.0.0.1:32764 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /workdir/clusters//pki/admin.crt - client-key: /workdir/clusters//pki/admin.key -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -# Add context kwok- to ~/.kube/config -cd /workdir/clusters/ && TEST_KEY=TEST_VALUE etcd --name=node0 --auto-compaction-retention=1 --quota-backend-bytes=8589934592 --data-dir=/workdir/clusters//etcd --initial-advertise-peer-urls=http://0.0.0.0:32766 --listen-peer-urls=http://0.0.0.0:32766 --advertise-client-urls=http://0.0.0.0:32765 --listen-client-urls=http://0.0.0.0:32765 --initial-cluster=node0=http://0.0.0.0:32766 --log-level=debug >/workdir/clusters//logs/etcd.log 2>&1 & -echo $! >/workdir/clusters//pids/etcd.pid -cd /workdir/clusters/ && TEST_KEY=TEST_VALUE kube-apiserver --etcd-prefix=/registry --allow-privileged=true --max-requests-inflight=0 --max-mutating-requests-inflight=0 --enable-priority-and-fairness=false --etcd-servers=http://127.0.0.1:32765 --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --secure-port=32764 --tls-cert-file=/workdir/clusters//pki/admin.crt --tls-private-key-file=/workdir/clusters//pki/admin.key --client-ca-file=/workdir/clusters//pki/ca.crt --service-account-key-file=/workdir/clusters//pki/admin.key --service-account-signing-key-file=/workdir/clusters//pki/admin.key --service-account-issuer=https://kubernetes.default.svc.cluster.local --proxy-client-key-file=/workdir/clusters//pki/admin.key --proxy-client-cert-file=/workdir/clusters//pki/admin.crt --v=5 >/workdir/clusters//logs/kube-apiserver.log 2>&1 & -echo $! >/workdir/clusters//pids/kube-apiserver.pid -cd /workdir/clusters/ && TEST_KEY=TEST_VALUE kube-controller-manager --node-monitor-period=25s --node-monitor-grace-period=3m20s --kubeconfig=/workdir/clusters//kubeconfig.yaml --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=32762 --root-ca-file=/workdir/clusters//pki/ca.crt --service-account-private-key-file=/workdir/clusters//pki/admin.key --kube-api-qps=5000 --kube-api-burst=10000 --v=5 >/workdir/clusters//logs/kube-controller-manager.log 2>&1 & -echo $! >/workdir/clusters//pids/kube-controller-manager.pid -cd /workdir/clusters/ && TEST_KEY=TEST_VALUE kube-scheduler --kubeconfig=/workdir/clusters//kubeconfig.yaml --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=32761 --kube-api-qps=5000 --kube-api-burst=10000 --v=5 >/workdir/clusters//logs/kube-scheduler.log 2>&1 & -echo $! >/workdir/clusters//pids/kube-scheduler.pid -cd /workdir/clusters/ && TEST_KEY=TEST_VALUE kwok-controller --manage-all-nodes=true --kubeconfig=/workdir/clusters//kubeconfig.yaml --config=/workdir/clusters//kwok.yaml --tls-cert-file=/workdir/clusters//pki/admin.crt --tls-private-key-file=/workdir/clusters//pki/admin.key --node-ip= --node-name=localhost --node-port=32763 --server-address=0.0.0.0:32763 --node-lease-duration-seconds=200 --v=-4 >/workdir/clusters//logs/kwok-controller.log 2>&1 & -echo $! >/workdir/clusters//pids/kwok-controller.pid -cd /workdir/clusters/ && TEST_KEY=TEST_VALUE prometheus --config.file=/workdir/clusters//prometheus.yaml --web.listen-address=0.0.0.0:9090 --log.level=debug >/workdir/clusters//logs/prometheus.log 2>&1 & -echo $! >/workdir/clusters//pids/prometheus.pid diff --git a/test/kwokctl/testdata/binary/create_cluster_with_verbosity.txt b/test/kwokctl/testdata/binary/create_cluster_with_verbosity.txt deleted file mode 100644 index a8b899945..000000000 --- a/test/kwokctl/testdata/binary/create_cluster_with_verbosity.txt +++ /dev/null @@ -1,166 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pids -mkdir -p /workdir/clusters//logs -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -touch /workdir/clusters//logs/audit.log -cp /test/kwokctl/audit-policy.yaml /workdir/clusters//audit.yaml -mkdir -p /workdir/clusters//etcd -# Download https://github.com/etcd-io/etcd/releases/download/v3.5.11/etcd-v3.5.11--. and extract etcd to /workdir/clusters//bin/etcd -# Download https://dl.k8s.io/release/v1.30.2/bin///kube-apiserver to /workdir/clusters//bin/kube-apiserver -cat </workdir/clusters//apiserver-tracing-config.yaml -apiVersion: apiserver.config.k8s.io/v1alpha1 -kind: TracingConfiguration -endpoint: 127.0.0.1:32762 -samplingRatePerMillion: 1000000 -EOF -# Download https://dl.k8s.io/release/v1.30.2/bin///kube-controller-manager to /workdir/clusters//bin/kube-controller-manager -# Download https://dl.k8s.io/release/v1.30.2/bin///kube-scheduler to /workdir/clusters//bin/kube-scheduler -cp /test/kwokctl/scheduler-config.yaml /workdir/clusters//scheduler.yaml -cat <>/workdir/clusters//scheduler.yaml -clientConnection: - kubeconfig: "/workdir/clusters//kubeconfig.yaml" -EOF -# Download /bin///kwok to /workdir/clusters//bin/kwok-controller -# Download https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.7.1/metrics-server-- to /workdir/clusters//bin/metrics-server -# Download https://github.com/prometheus/prometheus/releases/download/v2.53.0/prometheus-2.53.0.-. and extract prometheus to /workdir/clusters//bin/prometheus -# Download https://github.com/jaegertracing/jaeger/releases/download/v1.58.1/jaeger-1.58.1--. and extract jaeger-all-in-one to /workdir/clusters//bin/jaeger -cat </workdir/clusters//prometheus.yaml -global: - scrape_interval: 15s - scrape_timeout: 10s - evaluation_interval: 15s -alerting: - alertmanagers: - - follow_redirects: true - enable_http2: true - scheme: http - timeout: 10s - api_version: v2 - static_configs: - - targets: [] -scrape_configs: -- job_name: "etcd" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:32765 -- job_name: "kube-apiserver" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/workdir/clusters//pki/admin.crt" - key_file: "/workdir/clusters//pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:32764 -- job_name: "kube-controller-manager" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/workdir/clusters//pki/admin.crt" - key_file: "/workdir/clusters//pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:32761 -- job_name: "kube-scheduler" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/workdir/clusters//pki/admin.crt" - key_file: "/workdir/clusters//pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:32760 -- job_name: "kwok-controller-metrics-discovery" - http_sd_configs: - - url: http://127.0.0.1:32763/discovery/prometheus -- job_name: "kwok-controller" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:32763 -- job_name: "metrics-server" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/workdir/clusters//pki/admin.crt" - key_file: "/workdir/clusters//pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:32759 -- job_name: "prometheus" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:9090 -EOF -cat </workdir/clusters//kubeconfig.yaml -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /workdir/clusters//pki/ca.crt - server: https://127.0.0.1:32764 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /workdir/clusters//pki/admin.crt - client-key: /workdir/clusters//pki/admin.key -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -# Add context kwok- to ~/.kube/config -cd /workdir/clusters/ && etcd --name=node0 --auto-compaction-retention=1 --quota-backend-bytes=8589934592 --data-dir=/workdir/clusters//etcd --initial-advertise-peer-urls=http://0.0.0.0:32766 --listen-peer-urls=http://0.0.0.0:32766 --advertise-client-urls=http://0.0.0.0:32765 --listen-client-urls=http://0.0.0.0:32765 --initial-cluster=node0=http://0.0.0.0:32766 --log-level=debug >/workdir/clusters//logs/etcd.log 2>&1 & -echo $! >/workdir/clusters//pids/etcd.pid -cd /workdir/clusters/ && jaeger --collector.otlp.enabled=true --query.http-server.host-port=0.0.0.0:16686 --collector.otlp.grpc.host-port=127.0.0.1:32762 --log-level=debug >/workdir/clusters//logs/jaeger.log 2>&1 & -echo $! >/workdir/clusters//pids/jaeger.pid -cd /workdir/clusters/ && kube-apiserver --etcd-prefix=/registry --allow-privileged=true --max-requests-inflight=0 --max-mutating-requests-inflight=0 --enable-priority-and-fairness=false --etcd-servers=http://127.0.0.1:32765 --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --secure-port=32764 --tls-cert-file=/workdir/clusters//pki/admin.crt --tls-private-key-file=/workdir/clusters//pki/admin.key --client-ca-file=/workdir/clusters//pki/ca.crt --service-account-key-file=/workdir/clusters//pki/admin.key --service-account-signing-key-file=/workdir/clusters//pki/admin.key --service-account-issuer=https://kubernetes.default.svc.cluster.local --proxy-client-key-file=/workdir/clusters//pki/admin.key --proxy-client-cert-file=/workdir/clusters//pki/admin.crt --audit-policy-file=/workdir/clusters//audit.yaml --audit-log-path=/workdir/clusters//logs/audit.log --tracing-config-file=/workdir/clusters//apiserver-tracing-config.yaml --v=4 >/workdir/clusters//logs/kube-apiserver.log 2>&1 & -echo $! >/workdir/clusters//pids/kube-apiserver.pid -cd /workdir/clusters/ && kube-controller-manager --node-monitor-period=25s --node-monitor-grace-period=3m20s --kubeconfig=/workdir/clusters//kubeconfig.yaml --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=32761 --root-ca-file=/workdir/clusters//pki/ca.crt --service-account-private-key-file=/workdir/clusters//pki/admin.key --kube-api-qps=5000 --kube-api-burst=10000 --v=4 >/workdir/clusters//logs/kube-controller-manager.log 2>&1 & -echo $! >/workdir/clusters//pids/kube-controller-manager.pid -cd /workdir/clusters/ && kube-scheduler --config=/workdir/clusters//scheduler.yaml --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=32760 --kube-api-qps=5000 --kube-api-burst=10000 --v=4 >/workdir/clusters//logs/kube-scheduler.log 2>&1 & -echo $! >/workdir/clusters//pids/kube-scheduler.pid -cd /workdir/clusters/ && kwok-controller --manage-all-nodes=true --kubeconfig=/workdir/clusters//kubeconfig.yaml --config=/workdir/clusters//kwok.yaml --tls-cert-file=/workdir/clusters//pki/admin.crt --tls-private-key-file=/workdir/clusters//pki/admin.key --node-ip= --node-name=localhost --node-port=32763 --server-address=0.0.0.0:32763 --node-lease-duration-seconds=200 --v=DEBUG >/workdir/clusters//logs/kwok-controller.log 2>&1 & -echo $! >/workdir/clusters//pids/kwok-controller.pid -cd /workdir/clusters/ && metrics-server --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --kubelet-use-node-status-port --kubelet-insecure-tls --metric-resolution=15s --bind-address=0.0.0.0 --secure-port=32759 --kubeconfig=/workdir/clusters//kubeconfig.yaml --authentication-kubeconfig=/workdir/clusters//kubeconfig.yaml --authorization-kubeconfig=/workdir/clusters//kubeconfig.yaml --tls-cert-file=/workdir/clusters//pki/admin.crt --tls-private-key-file=/workdir/clusters//pki/admin.key --v=4 >/workdir/clusters//logs/metrics-server.log 2>&1 & -echo $! >/workdir/clusters//pids/metrics-server.pid -cd /workdir/clusters/ && prometheus --config.file=/workdir/clusters//prometheus.yaml --web.listen-address=0.0.0.0:9090 --log.level=debug >/workdir/clusters//logs/prometheus.log 2>&1 & -echo $! >/workdir/clusters//pids/prometheus.pid -# Set up apiservice for metrics server diff --git a/test/kwokctl/testdata/binary/export_logs.txt b/test/kwokctl/testdata/binary/export_logs.txt deleted file mode 100644 index 3c36745f7..000000000 --- a/test/kwokctl/testdata/binary/export_logs.txt +++ /dev/null @@ -1,10 +0,0 @@ -mkdir -p /logs/kwok- -cp /workdir/clusters//kwok.yaml /logs/kwok-/kwok.yaml -mkdir -p /logs/kwok-/components -echo / >/logs/kwok-/binary-info.txt -cp /workdir/clusters//logs/etcd.log /logs/kwok-/components/etcd.log -cp /workdir/clusters//logs/kube-apiserver.log /logs/kwok-/components/kube-apiserver.log -cp /workdir/clusters//logs/kube-controller-manager.log /logs/kwok-/components/kube-controller-manager.log -cp /workdir/clusters//logs/kube-scheduler.log /logs/kwok-/components/kube-scheduler.log -cp /workdir/clusters//logs/kwok-controller.log /logs/kwok-/components/kwok-controller.log -cp /workdir/clusters//logs/audit.log /logs/kwok-/components/audit.log diff --git a/test/kwokctl/testdata/binary/snapshot_restore_etcd.txt b/test/kwokctl/testdata/binary/snapshot_restore_etcd.txt deleted file mode 100644 index 3566d55b1..000000000 --- a/test/kwokctl/testdata/binary/snapshot_restore_etcd.txt +++ /dev/null @@ -1,15 +0,0 @@ -kill $(cat /workdir/clusters//pids/etcd.pid) -rm /workdir/clusters//pids/etcd.pid -kill $(cat /workdir/clusters//pids/kube-apiserver.pid) -rm /workdir/clusters//pids/kube-apiserver.pid -rm -rf /workdir/clusters//etcd-data -# Download https://github.com/etcd-io/etcd/releases/download/v3.5.11/etcd-v3.5.11--. and extract etcdctl to /workdir/clusters//bin/etcdctl -ETCDCTL_API=3 etcdctl --endpoints 127.0.0.1:32765 snapshot restore ./snapshot-empty- --data-dir /workdir/clusters//etcd-data -rm -rf /workdir/clusters//etcd -mv /workdir/clusters//etcd-data /workdir/clusters//etcd -kill $(cat /workdir/clusters//pids/kwok-controller.pid) -rm /workdir/clusters//pids/kwok-controller.pid -kill $(cat /workdir/clusters//pids/kube-controller-manager.pid) -rm /workdir/clusters//pids/kube-controller-manager.pid -kill $(cat /workdir/clusters//pids/kube-scheduler.pid) -rm /workdir/clusters//pids/kube-scheduler.pid diff --git a/test/kwokctl/testdata/binary/snapshot_save_etcd.txt b/test/kwokctl/testdata/binary/snapshot_save_etcd.txt deleted file mode 100644 index fbbd0c02c..000000000 --- a/test/kwokctl/testdata/binary/snapshot_save_etcd.txt +++ /dev/null @@ -1,2 +0,0 @@ -# Download https://github.com/etcd-io/etcd/releases/download/v3.5.11/etcd-v3.5.11--. and extract etcdctl to /workdir/clusters//bin/etcdctl -ETCDCTL_API=3 etcdctl --endpoints 127.0.0.1:32765 snapshot save ./snapshot-empty- diff --git a/test/kwokctl/testdata/binary/start_cluster.txt b/test/kwokctl/testdata/binary/start_cluster.txt deleted file mode 100644 index a610bb25f..000000000 --- a/test/kwokctl/testdata/binary/start_cluster.txt +++ /dev/null @@ -1,12 +0,0 @@ -cd /workdir/clusters/ && etcd --name=node0 --auto-compaction-retention=1 --quota-backend-bytes=8589934592 --data-dir=/workdir/clusters//etcd --initial-advertise-peer-urls=http://0.0.0.0:32766 --listen-peer-urls=http://0.0.0.0:32766 --advertise-client-urls=http://0.0.0.0:32765 --listen-client-urls=http://0.0.0.0:32765 --initial-cluster=node0=http://0.0.0.0:32766 >/workdir/clusters//logs/etcd.log 2>&1 & -echo $! >/workdir/clusters//pids/etcd.pid -cd /workdir/clusters/ && kube-apiserver --etcd-prefix=/registry --allow-privileged=true --max-requests-inflight=0 --max-mutating-requests-inflight=0 --enable-priority-and-fairness=false --etcd-servers=http://127.0.0.1:32765 --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --secure-port=32764 --tls-cert-file=/workdir/clusters//pki/admin.crt --tls-private-key-file=/workdir/clusters//pki/admin.key --client-ca-file=/workdir/clusters//pki/ca.crt --service-account-key-file=/workdir/clusters//pki/admin.key --service-account-signing-key-file=/workdir/clusters//pki/admin.key --service-account-issuer=https://kubernetes.default.svc.cluster.local --proxy-client-key-file=/workdir/clusters//pki/admin.key --proxy-client-cert-file=/workdir/clusters//pki/admin.crt >/workdir/clusters//logs/kube-apiserver.log 2>&1 & -echo $! >/workdir/clusters//pids/kube-apiserver.pid -cd /workdir/clusters/ && kube-controller-manager --node-monitor-period=25s --node-monitor-grace-period=3m20s --kubeconfig=/workdir/clusters//kubeconfig.yaml --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=32762 --root-ca-file=/workdir/clusters//pki/ca.crt --service-account-private-key-file=/workdir/clusters//pki/admin.key --kube-api-qps=5000 --kube-api-burst=10000 >/workdir/clusters//logs/kube-controller-manager.log 2>&1 & -echo $! >/workdir/clusters//pids/kube-controller-manager.pid -cd /workdir/clusters/ && kube-scheduler --kubeconfig=/workdir/clusters//kubeconfig.yaml --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=32761 --kube-api-qps=5000 --kube-api-burst=10000 >/workdir/clusters//logs/kube-scheduler.log 2>&1 & -echo $! >/workdir/clusters//pids/kube-scheduler.pid -cd /workdir/clusters/ && kwok-controller --manage-all-nodes=true --kubeconfig=/workdir/clusters//kubeconfig.yaml --config=/workdir/clusters//kwok.yaml --tls-cert-file=/workdir/clusters//pki/admin.crt --tls-private-key-file=/workdir/clusters//pki/admin.key --node-ip= --node-name=localhost --node-port=32763 --server-address=0.0.0.0:32763 --node-lease-duration-seconds=200 >/workdir/clusters//logs/kwok-controller.log 2>&1 & -echo $! >/workdir/clusters//pids/kwok-controller.pid -cd /workdir/clusters/ && prometheus --config.file=/workdir/clusters//prometheus.yaml --web.listen-address=0.0.0.0:9090 >/workdir/clusters//logs/prometheus.log 2>&1 & -echo $! >/workdir/clusters//pids/prometheus.pid diff --git a/test/kwokctl/testdata/binary/stop_cluster.txt b/test/kwokctl/testdata/binary/stop_cluster.txt deleted file mode 100644 index 0064a4474..000000000 --- a/test/kwokctl/testdata/binary/stop_cluster.txt +++ /dev/null @@ -1,12 +0,0 @@ -kill $(cat /workdir/clusters//pids/prometheus.pid) -rm /workdir/clusters//pids/prometheus.pid -kill $(cat /workdir/clusters//pids/kube-controller-manager.pid) -rm /workdir/clusters//pids/kube-controller-manager.pid -kill $(cat /workdir/clusters//pids/kube-scheduler.pid) -rm /workdir/clusters//pids/kube-scheduler.pid -kill $(cat /workdir/clusters//pids/kwok-controller.pid) -rm /workdir/clusters//pids/kwok-controller.pid -kill $(cat /workdir/clusters//pids/kube-apiserver.pid) -rm /workdir/clusters//pids/kube-apiserver.pid -kill $(cat /workdir/clusters//pids/etcd.pid) -rm /workdir/clusters//pids/etcd.pid diff --git a/test/kwokctl/testdata/docker/create_cluster.txt b/test/kwokctl/testdata/docker/create_cluster.txt deleted file mode 100644 index 5c312e196..000000000 --- a/test/kwokctl/testdata/docker/create_cluster.txt +++ /dev/null @@ -1,65 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//etcd -docker pull registry.k8s.io/etcd:3.5.11-0 -docker pull registry.k8s.io/kube-apiserver:v1.30.2 -docker pull registry.k8s.io/kube-controller-manager:v1.30.2 -docker pull registry.k8s.io/kube-scheduler:v1.30.2 -docker pull localhost/kwok:test -cat </workdir/clusters//kubeconfig.yaml -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /workdir/clusters//pki/ca.crt - server: https://127.0.0.1:32766 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /workdir/clusters//pki/admin.crt - client-key: /workdir/clusters//pki/admin.key -EOF -cat </workdir/clusters//kubeconfig -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /etc/kubernetes/pki/ca.crt - server: https://kwok--kube-apiserver:6443 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /etc/kubernetes/pki/admin.crt - client-key: /etc/kubernetes/pki/admin.key -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -docker network create kwok- --label=com.docker.compose.project=kwok- -docker create --name=kwok--etcd --pull=never --entrypoint=etcd --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=32765:2379/tcp registry.k8s.io/etcd:3.5.11-0 --name=node0 --auto-compaction-retention=1 --quota-backend-bytes=8589934592 --data-dir=/etcd-data --initial-advertise-peer-urls=http://0.0.0.0:2380 --listen-peer-urls=http://0.0.0.0:2380 --advertise-client-urls=http://0.0.0.0:2379 --listen-client-urls=http://0.0.0.0:2379 --initial-cluster=node0=http://0.0.0.0:2380 -docker create --name=kwok--kube-apiserver --pull=never --entrypoint=kube-apiserver --network=kwok- --link=kwok--etcd --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=32766:6443/tcp --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-apiserver:v1.30.2 --etcd-prefix=/registry --allow-privileged=true --max-requests-inflight=0 --max-mutating-requests-inflight=0 --enable-priority-and-fairness=false --etcd-servers=http://kwok--etcd:2379 --bind-address=0.0.0.0 --secure-port=6443 --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --client-ca-file=/etc/kubernetes/pki/ca.crt --service-account-key-file=/etc/kubernetes/pki/admin.key --service-account-signing-key-file=/etc/kubernetes/pki/admin.key --service-account-issuer=https://kubernetes.default.svc.cluster.local --proxy-client-key-file=/etc/kubernetes/pki/admin.key --proxy-client-cert-file=/etc/kubernetes/pki/admin.crt -docker create --name=kwok--kube-controller-manager --pull=never --entrypoint=kube-controller-manager --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-controller-manager:v1.30.2 --node-monitor-period=25s --node-monitor-grace-period=3m20s --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10257 --kube-api-qps=5000 --kube-api-burst=10000 -docker create --name=kwok--kube-scheduler --pull=never --entrypoint=kube-scheduler --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-scheduler:v1.30.2 --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10259 --kube-api-qps=5000 --kube-api-burst=10000 -docker create --name=kwok--kwok-controller --pull=never --entrypoint=kwok --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//kwok.yaml:~/.kwok/kwok.yaml:ro localhost/kwok:test --manage-all-nodes=true --kubeconfig=~/.kube/config --config=~/.kwok/kwok.yaml --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --node-ip= --node-name=kwok--kwok-controller --node-port=10247 --server-address=0.0.0.0:10247 --node-lease-duration-seconds=200 -# Add context kwok- to ~/.kube/config -docker start kwok--etcd -docker start kwok--kube-apiserver -docker start kwok--kube-controller-manager -docker start kwok--kube-scheduler -docker start kwok--kwok-controller diff --git a/test/kwokctl/testdata/docker/create_cluster_with_extra.txt b/test/kwokctl/testdata/docker/create_cluster_with_extra.txt deleted file mode 100644 index 89fa722f0..000000000 --- a/test/kwokctl/testdata/docker/create_cluster_with_extra.txt +++ /dev/null @@ -1,154 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//etcd -docker pull registry.k8s.io/etcd:3.5.11-0 -docker pull registry.k8s.io/kube-apiserver:v1.30.2 -docker pull registry.k8s.io/kube-controller-manager:v1.30.2 -docker pull registry.k8s.io/kube-scheduler:v1.30.2 -docker pull localhost/kwok:test -docker pull docker.io/prom/prometheus:v2.53.0 -cat </workdir/clusters//prometheus.yaml -global: - scrape_interval: 15s - scrape_timeout: 10s - evaluation_interval: 15s -alerting: - alertmanagers: - - follow_redirects: true - enable_http2: true - scheme: http - timeout: 10s - api_version: v2 - static_configs: - - targets: [] -scrape_configs: -- job_name: "etcd" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - kwok--etcd:2379 -- job_name: "kube-apiserver" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-apiserver:6443 -- job_name: "kube-controller-manager" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-controller-manager:10257 -- job_name: "kube-scheduler" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-scheduler:10259 -- job_name: "kwok-controller-metrics-discovery" - http_sd_configs: - - url: http://kwok--kwok-controller:10247/discovery/prometheus -- job_name: "kwok-controller" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - kwok--kwok-controller:10247 -- job_name: "prometheus" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:9090 -EOF -chmod 0644 /workdir/clusters//prometheus.yaml -cat </workdir/clusters//kubeconfig.yaml -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /workdir/clusters//pki/ca.crt - server: https://127.0.0.1:32766 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /workdir/clusters//pki/admin.crt - client-key: /workdir/clusters//pki/admin.key -EOF -cat </workdir/clusters//kubeconfig -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /etc/kubernetes/pki/ca.crt - server: https://kwok--kube-apiserver:6443 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /etc/kubernetes/pki/admin.crt - client-key: /etc/kubernetes/pki/admin.key -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -docker network create kwok- --label=com.docker.compose.project=kwok- -docker create --name=kwok--etcd --pull=never --entrypoint=etcd --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=32765:2379/tcp --env=TEST_KEY=TEST_VALUE registry.k8s.io/etcd:3.5.11-0 --name=node0 --auto-compaction-retention=1 --quota-backend-bytes=8589934592 --data-dir=/etcd-data --initial-advertise-peer-urls=http://0.0.0.0:2380 --listen-peer-urls=http://0.0.0.0:2380 --advertise-client-urls=http://0.0.0.0:2379 --listen-client-urls=http://0.0.0.0:2379 --initial-cluster=node0=http://0.0.0.0:2380 --log-level=debug -docker create --name=kwok--kube-apiserver --pull=never --entrypoint=kube-apiserver --network=kwok- --link=kwok--etcd --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=32766:6443/tcp --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/extras/apiserver:/extras/tmp --env=TEST_KEY=TEST_VALUE registry.k8s.io/kube-apiserver:v1.30.2 --etcd-prefix=/registry --allow-privileged=true --max-requests-inflight=0 --max-mutating-requests-inflight=0 --enable-priority-and-fairness=false --etcd-servers=http://kwok--etcd:2379 --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --secure-port=6443 --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --client-ca-file=/etc/kubernetes/pki/ca.crt --service-account-key-file=/etc/kubernetes/pki/admin.key --service-account-signing-key-file=/etc/kubernetes/pki/admin.key --service-account-issuer=https://kubernetes.default.svc.cluster.local --proxy-client-key-file=/etc/kubernetes/pki/admin.key --proxy-client-cert-file=/etc/kubernetes/pki/admin.crt --v=5 -docker create --name=kwok--kube-controller-manager --pull=never --entrypoint=kube-controller-manager --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/extras/controller-manager:/extras/tmp --env=TEST_KEY=TEST_VALUE registry.k8s.io/kube-controller-manager:v1.30.2 --node-monitor-period=25s --node-monitor-grace-period=3m20s --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10257 --root-ca-file=/etc/kubernetes/pki/ca.crt --service-account-private-key-file=/etc/kubernetes/pki/admin.key --kube-api-qps=5000 --kube-api-burst=10000 --v=5 -docker create --name=kwok--kube-scheduler --pull=never --entrypoint=kube-scheduler --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/extras/scheduler:/extras/tmp --env=TEST_KEY=TEST_VALUE registry.k8s.io/kube-scheduler:v1.30.2 --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10259 --kube-api-qps=5000 --kube-api-burst=10000 --v=5 -docker create --name=kwok--kwok-controller --pull=never --entrypoint=kwok --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//kwok.yaml:~/.kwok/kwok.yaml:ro --volume=/extras/controller:/extras/tmp --env=TEST_KEY=TEST_VALUE localhost/kwok:test --manage-all-nodes=true --kubeconfig=~/.kube/config --config=~/.kwok/kwok.yaml --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --node-ip= --node-name=kwok--kwok-controller --node-port=10247 --server-address=0.0.0.0:10247 --node-lease-duration-seconds=200 --v=-4 -docker create --name=kwok--prometheus --pull=never --entrypoint=prometheus --network=kwok- --link=kwok--etcd --link=kwok--kube-apiserver --link=kwok--kube-controller-manager --link=kwok--kube-scheduler --link=kwok--kwok-controller --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=9090:9090/tcp --volume=/workdir/clusters//prometheus.yaml:/etc/prometheus/prometheus.yaml:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/extras/prometheus:/extras/tmp --env=TEST_KEY=TEST_VALUE docker.io/prom/prometheus:v2.53.0 --config.file=/etc/prometheus/prometheus.yaml --web.listen-address=0.0.0.0:9090 --log.level=debug -# Add context kwok- to ~/.kube/config -docker start kwok--etcd -docker start kwok--kube-apiserver -docker start kwok--kube-controller-manager -docker start kwok--kube-scheduler -docker start kwok--kwok-controller -docker start kwok--prometheus diff --git a/test/kwokctl/testdata/docker/create_cluster_with_verbosity.txt b/test/kwokctl/testdata/docker/create_cluster_with_verbosity.txt deleted file mode 100644 index 21914a728..000000000 --- a/test/kwokctl/testdata/docker/create_cluster_with_verbosity.txt +++ /dev/null @@ -1,194 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//logs -touch /workdir/clusters//logs/audit.log -cp /test/kwokctl/audit-policy.yaml /workdir/clusters//audit.yaml -mkdir -p /workdir/clusters//etcd -docker pull registry.k8s.io/etcd:3.5.11-0 -docker pull registry.k8s.io/kube-apiserver:v1.30.2 -cat </workdir/clusters//apiserver-tracing-config.yaml -apiVersion: apiserver.config.k8s.io/v1alpha1 -kind: TracingConfiguration -endpoint: kwok--jaeger:4317 -samplingRatePerMillion: 1000000 -EOF -docker pull registry.k8s.io/kube-controller-manager:v1.30.2 -cp /test/kwokctl/scheduler-config.yaml /workdir/clusters//scheduler.yaml -cat <>/workdir/clusters//scheduler.yaml -clientConnection: - kubeconfig: "~/.kube/config" -EOF -docker pull registry.k8s.io/kube-scheduler:v1.30.2 -docker pull localhost/kwok:test -docker pull registry.k8s.io/metrics-server/metrics-server:v0.7.1 -docker pull docker.io/prom/prometheus:v2.53.0 -docker pull docker.io/jaegertracing/all-in-one:1.58.1 -docker pull docker.io/kubernetesui/dashboard:v2.7.0 -docker pull docker.io/kubernetesui/metrics-scraper:v1.0.9 -cat </workdir/clusters//prometheus.yaml -global: - scrape_interval: 15s - scrape_timeout: 10s - evaluation_interval: 15s -alerting: - alertmanagers: - - follow_redirects: true - enable_http2: true - scheme: http - timeout: 10s - api_version: v2 - static_configs: - - targets: [] -scrape_configs: -- job_name: "etcd" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - kwok--etcd:2379 -- job_name: "kube-apiserver" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-apiserver:6443 -- job_name: "kube-controller-manager" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-controller-manager:10257 -- job_name: "kube-scheduler" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-scheduler:10259 -- job_name: "kwok-controller-metrics-discovery" - http_sd_configs: - - url: http://kwok--kwok-controller:10247/discovery/prometheus -- job_name: "kwok-controller" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - kwok--kwok-controller:10247 -- job_name: "metrics-server" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kwok-controller:4443 -- job_name: "prometheus" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:9090 -EOF -chmod 0644 /workdir/clusters//prometheus.yaml -cat </workdir/clusters//kubeconfig.yaml -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /workdir/clusters//pki/ca.crt - server: https://127.0.0.1:32766 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /workdir/clusters//pki/admin.crt - client-key: /workdir/clusters//pki/admin.key -EOF -cat </workdir/clusters//kubeconfig -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /etc/kubernetes/pki/ca.crt - server: https://kwok--kube-apiserver:6443 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /etc/kubernetes/pki/admin.crt - client-key: /etc/kubernetes/pki/admin.key -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -docker network create kwok- --label=com.docker.compose.project=kwok- -docker create --name=kwok--etcd --pull=never --entrypoint=etcd --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=32765:2379/tcp registry.k8s.io/etcd:3.5.11-0 --name=node0 --auto-compaction-retention=1 --quota-backend-bytes=8589934592 --data-dir=/etcd-data --initial-advertise-peer-urls=http://0.0.0.0:2380 --listen-peer-urls=http://0.0.0.0:2380 --advertise-client-urls=http://0.0.0.0:2379 --listen-client-urls=http://0.0.0.0:2379 --initial-cluster=node0=http://0.0.0.0:2380 --log-level=debug -docker create --name=kwok--jaeger --pull=never --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=16686:16686/tcp docker.io/jaegertracing/all-in-one:1.58.1 --collector.otlp.enabled=true --query.http-server.host-port=0.0.0.0:16686 --log-level=debug -docker create --name=kwok--kube-apiserver --pull=never --entrypoint=kube-apiserver --network=kwok- --link=kwok--etcd --link=kwok--jaeger --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=32766:6443/tcp --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//audit.yaml:/etc/kubernetes/audit-policy.yaml:ro --volume=/workdir/clusters//logs/audit.log:/var/log/kubernetes/audit/audit.log --volume=/workdir/clusters//apiserver-tracing-config.yaml:/etc/kubernetes/apiserver-tracing-config.yaml:ro registry.k8s.io/kube-apiserver:v1.30.2 --etcd-prefix=/registry --allow-privileged=true --max-requests-inflight=0 --max-mutating-requests-inflight=0 --enable-priority-and-fairness=false --etcd-servers=http://kwok--etcd:2379 --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --secure-port=6443 --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --client-ca-file=/etc/kubernetes/pki/ca.crt --service-account-key-file=/etc/kubernetes/pki/admin.key --service-account-signing-key-file=/etc/kubernetes/pki/admin.key --service-account-issuer=https://kubernetes.default.svc.cluster.local --proxy-client-key-file=/etc/kubernetes/pki/admin.key --proxy-client-cert-file=/etc/kubernetes/pki/admin.crt --audit-policy-file=/etc/kubernetes/audit-policy.yaml --audit-log-path=/var/log/kubernetes/audit/audit.log --tracing-config-file=/etc/kubernetes/apiserver-tracing-config.yaml --v=4 -docker create --name=kwok--kube-controller-manager --pull=never --entrypoint=kube-controller-manager --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-controller-manager:v1.30.2 --node-monitor-period=25s --node-monitor-grace-period=3m20s --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10257 --root-ca-file=/etc/kubernetes/pki/ca.crt --service-account-private-key-file=/etc/kubernetes/pki/admin.key --kube-api-qps=5000 --kube-api-burst=10000 --v=4 -docker create --name=kwok--kube-scheduler --pull=never --entrypoint=kube-scheduler --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//scheduler.yaml:/etc/kubernetes/scheduler.yaml:ro registry.k8s.io/kube-scheduler:v1.30.2 --config=/etc/kubernetes/scheduler.yaml --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10259 --kube-api-qps=5000 --kube-api-burst=10000 --v=4 -docker create --name=kwok--kwok-controller --pull=never --entrypoint=kwok --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//kwok.yaml:~/.kwok/kwok.yaml:ro localhost/kwok:test --manage-all-nodes=true --kubeconfig=~/.kube/config --config=~/.kwok/kwok.yaml --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --node-ip= --node-name=kwok--kwok-controller --node-port=10247 --server-address=0.0.0.0:10247 --node-lease-duration-seconds=200 --v=DEBUG -docker create --name=kwok--dashboard --pull=never --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=8000:8080/tcp --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/dashboard:v2.7.0 --insecure-bind-address=0.0.0.0 --bind-address=127.0.0.1 --port=0 --enable-insecure-login --enable-skip-login --disable-settings-authorizer --sidecar-host=kwok--dashboard-metrics-scraper:8000 --system-banner=Welcome to kwok- --kubeconfig=~/.kube/config --insecure-port=8080 -docker create --name=kwok--metrics-server --pull=never --entrypoint=/metrics-server --network=kwok- --user=root --link=kwok--kwok-controller --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/metrics-server/metrics-server:v0.7.1 --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --kubelet-use-node-status-port --kubelet-insecure-tls --metric-resolution=15s --bind-address=0.0.0.0 --secure-port=4443 --kubeconfig=~/.kube/config --authentication-kubeconfig=~/.kube/config --authorization-kubeconfig=~/.kube/config --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --v=4 -docker create --name=kwok--prometheus --pull=never --entrypoint=prometheus --network=kwok- --link=kwok--etcd --link=kwok--kube-apiserver --link=kwok--kube-controller-manager --link=kwok--kube-scheduler --link=kwok--kwok-controller --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=9090:9090/tcp --volume=/workdir/clusters//prometheus.yaml:/etc/prometheus/prometheus.yaml:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/prom/prometheus:v2.53.0 --config.file=/etc/prometheus/prometheus.yaml --web.listen-address=0.0.0.0:9090 --log.level=debug -docker create --name=kwok--dashboard-metrics-scraper --pull=never --network=kwok- --user=root --link=kwok--metrics-server --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/metrics-scraper:v1.0.9 --db-file=/metrics.db --kubeconfig=~/.kube/config -# Add context kwok- to ~/.kube/config -docker start kwok--etcd -docker start kwok--jaeger -docker start kwok--kube-apiserver -docker start kwok--kube-controller-manager -docker start kwok--kube-scheduler -docker start kwok--kwok-controller -docker start kwok--dashboard -docker start kwok--metrics-server -docker start kwok--prometheus -docker start kwok--dashboard-metrics-scraper -# Set up apiservice for metrics server diff --git a/test/kwokctl/testdata/docker/export_logs.txt b/test/kwokctl/testdata/docker/export_logs.txt deleted file mode 100644 index bfff2c575..000000000 --- a/test/kwokctl/testdata/docker/export_logs.txt +++ /dev/null @@ -1,10 +0,0 @@ -mkdir -p /logs/kwok- -cp /workdir/clusters//kwok.yaml /logs/kwok-/kwok.yaml -mkdir -p /logs/kwok-/components -docker info >/logs/kwok-/docker-info.txt -etcd logs kwok--etcd >/logs/kwok-/components/etcd.log -kube-apiserver logs kwok--kube-apiserver >/logs/kwok-/components/kube-apiserver.log -kube-controller-manager logs kwok--kube-controller-manager >/logs/kwok-/components/kube-controller-manager.log -kube-scheduler logs kwok--kube-scheduler >/logs/kwok-/components/kube-scheduler.log -kwok-controller logs kwok--kwok-controller >/logs/kwok-/components/kwok-controller.log -cp /workdir/clusters//logs/audit.log /logs/kwok-/components/audit.log diff --git a/test/kwokctl/testdata/docker/snapshot_restore_etcd.txt b/test/kwokctl/testdata/docker/snapshot_restore_etcd.txt deleted file mode 100644 index b129539f1..000000000 --- a/test/kwokctl/testdata/docker/snapshot_restore_etcd.txt +++ /dev/null @@ -1,14 +0,0 @@ -# Download https://github.com/etcd-io/etcd/releases/download/v3.5.11/etcd-v3.5.11--. and extract etcdctl to /workdir/clusters//bin/etcdctl -ETCDCTL_API=3 etcdctl snapshot restore ./snapshot-empty- --data-dir /workdir/clusters//etcd-data -docker stop kwok--etcd --time=0 -docker stop kwok--kube-apiserver --time=0 -docker cp /workdir/clusters//etcd-data kwok--etcd:/ -docker start kwok--etcd -docker start kwok--kube-apiserver -docker stop kwok--kwok-controller --time=0 -docker start kwok--kwok-controller -docker stop kwok--kube-controller-manager --time=0 -docker start kwok--kube-controller-manager -docker stop kwok--kube-scheduler --time=0 -docker start kwok--kube-scheduler -rm -rf /workdir/clusters//etcd-data diff --git a/test/kwokctl/testdata/docker/snapshot_save_etcd.txt b/test/kwokctl/testdata/docker/snapshot_save_etcd.txt deleted file mode 100644 index c96d5ae2f..000000000 --- a/test/kwokctl/testdata/docker/snapshot_save_etcd.txt +++ /dev/null @@ -1,2 +0,0 @@ -docker exec --env=ETCDCTL_API=3 -i kwok--etcd etcdctl snapshot save /snapshot.db -docker cp kwok--etcd:/snapshot.db ./snapshot-empty- diff --git a/test/kwokctl/testdata/docker/start_cluster.txt b/test/kwokctl/testdata/docker/start_cluster.txt deleted file mode 100644 index 75f8c5aca..000000000 --- a/test/kwokctl/testdata/docker/start_cluster.txt +++ /dev/null @@ -1,6 +0,0 @@ -docker start kwok--etcd -docker start kwok--kube-apiserver -docker start kwok--kube-controller-manager -docker start kwok--kube-scheduler -docker start kwok--kwok-controller -docker start kwok--prometheus diff --git a/test/kwokctl/testdata/docker/stop_cluster.txt b/test/kwokctl/testdata/docker/stop_cluster.txt deleted file mode 100644 index 4a7290cc4..000000000 --- a/test/kwokctl/testdata/docker/stop_cluster.txt +++ /dev/null @@ -1,6 +0,0 @@ -docker stop kwok--prometheus --time=0 -docker stop kwok--kube-controller-manager --time=0 -docker stop kwok--kube-scheduler --time=0 -docker stop kwok--kwok-controller --time=0 -docker stop kwok--kube-apiserver --time=0 -docker stop kwok--etcd --time=0 diff --git a/test/kwokctl/testdata/kind-podman/create_cluster.txt b/test/kwokctl/testdata/kind-podman/create_cluster.txt deleted file mode 100644 index 8ac51767e..000000000 --- a/test/kwokctl/testdata/kind-podman/create_cluster.txt +++ /dev/null @@ -1,133 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//pki/etcd -podman pull docker.io/kindest/node:v1.30.2 -mkdir -p /workdir/clusters//pki -mkdir -p /workdir/clusters//manifests -cat </workdir/clusters//kind.yaml -apiVersion: kind.x-k8s.io/v1alpha4 -kind: Cluster -kubeadmConfigPatches: -- | - apiServer: - extraArgs: - enable-priority-and-fairness: "false" - max-mutating-requests-inflight: "0" - max-requests-inflight: "0" - apiVersion: kubeadm.k8s.io/v1beta3 - controllerManager: - extraArgs: - kube-api-burst: "10000" - kube-api-qps: "5000" - dns: {} - etcd: - local: - dataDir: /var/lib/etcd - kind: ClusterConfiguration - networking: {} - scheduler: - extraArgs: - kube-api-burst: "10000" - kube-api-qps: "5000" -networking: - apiServerPort: 32766 -nodes: -- extraMounts: - - containerPath: /etc/kwok/ - hostPath: /workdir/clusters/ - - containerPath: /etc/kubernetes/manifests - hostPath: /workdir/clusters//manifests - - containerPath: /etc/kubernetes/pki - hostPath: /workdir/clusters//pki - extraPortMappings: - - containerPort: 2379 - hostPort: 32765 - protocol: TCP - role: control-plane -EOF -podman pull localhost/kwok:test -cat </workdir/clusters//manifests/kwok-controller.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: kwok-controller - namespace: kube-system -spec: - containers: - - args: - - --manage-all-nodes=false - - --manage-nodes-with-annotation-selector=kwok.x-k8s.io/node=fake - - --kubeconfig=~/.kube/config - - --config=~/.kwok/kwok.yaml - - --tls-cert-file=/etc/kubernetes/pki/admin.crt - - --tls-private-key-file=/etc/kubernetes/pki/admin.key - - --node-ip=$(POD_IP) - - --node-name=kwok-controller.kube-system.svc - - --node-port=10247 - - --server-address=0.0.0.0:10247 - - --node-lease-duration-seconds=40 - command: - - kwok - env: - - name: POD_IP - valueFrom: - fieldRef: - fieldPath: status.podIP - image: localhost/kwok:test - imagePullPolicy: Never - name: kwok-controller - resources: {} - volumeMounts: - - mountPath: ~/.kube/config - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/ca.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-3 - readOnly: true - - mountPath: ~/.kwok/kwok.yaml - name: volume-4 - readOnly: true - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /etc/kubernetes/admin.conf - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/ca.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-3 - - hostPath: - path: /etc/kwok/kwok.yaml - name: volume-4 -status: {} -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -KIND_EXPERIMENTAL_PROVIDER=podman kind create cluster --config /workdir/clusters//kind.yaml --name kwok- --image docker.io/kindest/node:v1.30.2 --wait 29m -mkdir -p /workdir/cache/image-archive/localhost/kwok -podman save localhost/kwok:test -o /workdir/cache/image-archive/localhost/kwok/test.tar -KIND_EXPERIMENTAL_PROVIDER=podman kind load image-archive /workdir/cache/image-archive/localhost/kwok/test.tar --name kwok- -rm /workdir/cache/image-archive/localhost/kwok/test.tar -kubectl config view --minify=true --raw=true -cat </workdir/clusters//kubeconfig.yaml -EOF -kubectl cordon kwok--control-plane -podman exec kwok--control-plane chmod -R +r /etc/kubernetes/pki -# Add context kwok- to ~/.kube/config diff --git a/test/kwokctl/testdata/kind-podman/create_cluster_with_extra.txt b/test/kwokctl/testdata/kind-podman/create_cluster_with_extra.txt deleted file mode 100644 index fc2d4283e..000000000 --- a/test/kwokctl/testdata/kind-podman/create_cluster_with_extra.txt +++ /dev/null @@ -1,341 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//pki/etcd -podman pull docker.io/kindest/node:v1.30.2 -mkdir -p /workdir/clusters//pki -mkdir -p /workdir/clusters//manifests -cat </workdir/clusters//kind.yaml -apiVersion: kind.x-k8s.io/v1alpha4 -kind: Cluster -kubeadmConfigPatches: -- | - apiServer: - extraArgs: - enable-priority-and-fairness: "false" - max-mutating-requests-inflight: "0" - max-requests-inflight: "0" - v: "5" - extraVolumes: - - hostPath: /var/components/apiserver/extras/tmp - mountPath: /extras/tmp - name: tmp-apiserver - pathType: DirectoryOrCreate - apiVersion: kubeadm.k8s.io/v1beta3 - controllerManager: - extraArgs: - kube-api-burst: "10000" - kube-api-qps: "5000" - v: "5" - extraVolumes: - - hostPath: /var/components/controller-manager/extras/tmp - mountPath: /extras/tmp - name: tmp-controller-manager - pathType: DirectoryOrCreate - dns: {} - etcd: - local: - dataDir: /var/lib/etcd - extraArgs: - log-level: debug - kind: ClusterConfiguration - networking: {} - scheduler: - extraArgs: - kube-api-burst: "10000" - kube-api-qps: "5000" - v: "5" - extraVolumes: - - hostPath: /var/components/scheduler/extras/tmp - mountPath: /extras/tmp - name: tmp-scheduler - pathType: DirectoryOrCreate -networking: - apiServerPort: 32766 -nodes: -- extraMounts: - - containerPath: /etc/kwok/ - hostPath: /workdir/clusters/ - - containerPath: /etc/kubernetes/manifests - hostPath: /workdir/clusters//manifests - - containerPath: /etc/kubernetes/pki - hostPath: /workdir/clusters//pki - - containerPath: /var/components/apiserver/extras/tmp - hostPath: /extras/apiserver - - containerPath: /var/components/controller-manager/extras/tmp - hostPath: /extras/controller-manager - - containerPath: /var/components/scheduler/extras/tmp - hostPath: /extras/scheduler - - containerPath: /var/components/controller/extras/tmp - hostPath: /extras/controller - - containerPath: /var/components/prometheus/extras/tmp - hostPath: /extras/prometheus - - containerPath: /var/components/prometheus/etc/prometheus/prometheus.yaml - hostPath: /workdir/clusters//prometheus.yaml - extraPortMappings: - - containerPort: 9090 - hostPort: 9090 - protocol: TCP - - containerPort: 2379 - hostPort: 32765 - protocol: TCP - role: control-plane -EOF -podman pull localhost/kwok:test -cat </workdir/clusters//manifests/kwok-controller.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: kwok-controller - namespace: kube-system -spec: - containers: - - args: - - --manage-all-nodes=false - - --manage-nodes-with-annotation-selector=kwok.x-k8s.io/node=fake - - --kubeconfig=~/.kube/config - - --config=~/.kwok/kwok.yaml - - --tls-cert-file=/etc/kubernetes/pki/admin.crt - - --tls-private-key-file=/etc/kubernetes/pki/admin.key - - --node-ip=$(POD_IP) - - --node-name=kwok-controller.kube-system.svc - - --node-port=10247 - - --server-address=0.0.0.0:10247 - - --node-lease-duration-seconds=40 - - --v=-4 - command: - - kwok - env: - - name: TEST_KEY - value: TEST_VALUE - - name: POD_IP - valueFrom: - fieldRef: - fieldPath: status.podIP - image: localhost/kwok:test - imagePullPolicy: Never - name: kwok-controller - resources: {} - volumeMounts: - - mountPath: ~/.kube/config - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/ca.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-3 - readOnly: true - - mountPath: ~/.kwok/kwok.yaml - name: volume-4 - readOnly: true - - mountPath: /extras/tmp - name: tmp-controller - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /etc/kubernetes/admin.conf - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/ca.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-3 - - hostPath: - path: /etc/kwok/kwok.yaml - name: volume-4 - - hostPath: - path: /extras/controller - type: DirectoryOrCreate - name: tmp-controller -status: {} -EOF -podman pull docker.io/prom/prometheus:v2.53.0 -cat </workdir/clusters//manifests/prometheus.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: prometheus - namespace: kube-system -spec: - containers: - - args: - - --config.file=/etc/prometheus/prometheus.yaml - - --web.listen-address=0.0.0.0:9090 - - --log.level=debug - command: - - prometheus - env: - - name: TEST_KEY - value: TEST_VALUE - image: docker.io/prom/prometheus:v2.53.0 - imagePullPolicy: Never - name: prometheus - ports: - - containerPort: 9090 - hostPort: 9090 - resources: {} - volumeMounts: - - mountPath: /etc/prometheus/prometheus.yaml - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/apiserver-etcd-client.crt - name: volume-3 - readOnly: true - - mountPath: /etc/kubernetes/pki/apiserver-etcd-client.key - name: volume-4 - readOnly: true - - mountPath: /extras/tmp - name: tmp-prometheus - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /var/components/prometheus/etc/prometheus/prometheus.yaml - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/apiserver-etcd-client.crt - name: volume-3 - - hostPath: - path: /etc/kubernetes/pki/apiserver-etcd-client.key - name: volume-4 - - hostPath: - path: /extras/prometheus - type: DirectoryOrCreate - name: tmp-prometheus -status: {} -EOF -cat </workdir/clusters//prometheus.yaml -global: - scrape_interval: 15s - scrape_timeout: 10s - evaluation_interval: 15s -alerting: - alertmanagers: - - follow_redirects: true - enable_http2: true - scheme: http - timeout: 10s - api_version: v2 - static_configs: - - targets: [] -scrape_configs: -- job_name: "etcd" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/apiserver-etcd-client.crt" - key_file: "/etc/kubernetes/pki/apiserver-etcd-client.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:2379 -- job_name: "kube-apiserver" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:6443 -- job_name: "kube-controller-manager" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:10257 -- job_name: "kube-scheduler" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:10259 -- job_name: "kwok-controller-metrics-discovery" - http_sd_configs: - - url: http://127.0.0.1:10247/discovery/prometheus -- job_name: "kwok-controller" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:10247 -- job_name: "prometheus" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:9090 -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -KIND_EXPERIMENTAL_PROVIDER=podman kind create cluster --config /workdir/clusters//kind.yaml --name kwok- --image docker.io/kindest/node:v1.30.2 --wait 29m -mkdir -p /workdir/cache/image-archive/localhost/kwok -podman save localhost/kwok:test -o /workdir/cache/image-archive/localhost/kwok/test.tar -KIND_EXPERIMENTAL_PROVIDER=podman kind load image-archive /workdir/cache/image-archive/localhost/kwok/test.tar --name kwok- -rm /workdir/cache/image-archive/localhost/kwok/test.tar -mkdir -p /workdir/cache/image-archive/docker.io/prom/prometheus -podman save docker.io/prom/prometheus:v2.53.0 -o /workdir/cache/image-archive/docker.io/prom/prometheus/v2.53.0.tar -KIND_EXPERIMENTAL_PROVIDER=podman kind load image-archive /workdir/cache/image-archive/docker.io/prom/prometheus/v2.53.0.tar --name kwok- -rm /workdir/cache/image-archive/docker.io/prom/prometheus/v2.53.0.tar -kubectl config view --minify=true --raw=true -cat </workdir/clusters//kubeconfig.yaml -EOF -kubectl cordon kwok--control-plane -podman exec kwok--control-plane chmod -R +r /etc/kubernetes/pki -# Add context kwok- to ~/.kube/config diff --git a/test/kwokctl/testdata/kind-podman/create_cluster_with_verbosity.txt b/test/kwokctl/testdata/kind-podman/create_cluster_with_verbosity.txt deleted file mode 100644 index 46efe811f..000000000 --- a/test/kwokctl/testdata/kind-podman/create_cluster_with_verbosity.txt +++ /dev/null @@ -1,591 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//pki/etcd -podman pull docker.io/kindest/node:v1.30.2 -mkdir -p /workdir/clusters//pki -mkdir -p /workdir/clusters//manifests -mkdir -p /workdir/clusters//logs -touch /workdir/clusters//logs/audit.log -cp /test/kwokctl/audit-policy.yaml /workdir/clusters//audit.yaml -cp /test/kwokctl/scheduler-config.yaml /workdir/clusters//scheduler.yaml -cat <>/workdir/clusters//scheduler.yaml -clientConnection: - kubeconfig: "/etc/kubernetes/scheduler.conf" -EOF -cat </workdir/clusters//apiserver-tracing-config.yaml -apiVersion: apiserver.config.k8s.io/v1alpha1 -kind: TracingConfiguration -endpoint: 0.0.0.0:4317 -samplingRatePerMillion: 1000000 -EOF -cat </workdir/clusters//kind.yaml -apiVersion: kind.x-k8s.io/v1alpha4 -kind: Cluster -kubeadmConfigPatches: -- | - apiServer: - extraArgs: - audit-log-path: /var/log/kubernetes/audit.log - audit-policy-file: /etc/kubernetes/audit/audit.yaml - enable-priority-and-fairness: "false" - max-mutating-requests-inflight: "0" - max-requests-inflight: "0" - tracing-config-file: /etc/kubernetes/apiserver-tracing-config.yaml - v: "4" - extraVolumes: - - hostPath: /var/components/apiserver/etc/kubernetes/audit/audit.yaml - mountPath: /etc/kubernetes/audit/audit.yaml - name: audit-policy-file - pathType: File - readOnly: true - - hostPath: /var/components/apiserver/var/log/kubernetes/audit.log - mountPath: /var/log/kubernetes/audit.log - name: audit-log-path - pathType: File - - hostPath: /var/components/apiserver/etc/kubernetes/apiserver-tracing-config.yaml - mountPath: /etc/kubernetes/apiserver-tracing-config.yaml - name: apiserver-tracing-config - pathType: File - readOnly: true - apiVersion: kubeadm.k8s.io/v1beta3 - controllerManager: - extraArgs: - kube-api-burst: "10000" - kube-api-qps: "5000" - v: "4" - dns: {} - etcd: - local: - dataDir: /var/lib/etcd - extraArgs: - log-level: debug - kind: ClusterConfiguration - networking: {} - scheduler: - extraArgs: - config: /etc/kubernetes/scheduler/scheduler.yaml - kube-api-burst: "10000" - kube-api-qps: "5000" - v: "4" - extraVolumes: - - hostPath: /var/components/scheduler/etc/kubernetes/scheduler/scheduler.yaml - mountPath: /etc/kubernetes/scheduler/scheduler.yaml - name: config - pathType: File - readOnly: true -networking: - apiServerPort: 32766 -nodes: -- extraMounts: - - containerPath: /etc/kwok/ - hostPath: /workdir/clusters/ - - containerPath: /etc/kubernetes/manifests - hostPath: /workdir/clusters//manifests - - containerPath: /etc/kubernetes/pki - hostPath: /workdir/clusters//pki - - containerPath: /var/components/apiserver/etc/kubernetes/audit/audit.yaml - hostPath: /workdir/clusters//audit.yaml - readOnly: true - - containerPath: /var/components/apiserver/var/log/kubernetes/audit.log - hostPath: /workdir/clusters//logs/audit.log - - containerPath: /var/components/apiserver/etc/kubernetes/apiserver-tracing-config.yaml - hostPath: /workdir/clusters//apiserver-tracing-config.yaml - readOnly: true - - containerPath: /var/components/scheduler/etc/kubernetes/scheduler/scheduler.yaml - hostPath: /workdir/clusters//scheduler.yaml - readOnly: true - - containerPath: /var/components/prometheus/etc/prometheus/prometheus.yaml - hostPath: /workdir/clusters//prometheus.yaml - extraPortMappings: - - containerPort: 8080 - hostPort: 8000 - protocol: TCP - - containerPort: 9090 - hostPort: 9090 - protocol: TCP - - containerPort: 16686 - hostPort: 16686 - protocol: TCP - - containerPort: 2379 - hostPort: 32765 - protocol: TCP - role: control-plane -EOF -podman pull localhost/kwok:test -cat </workdir/clusters//manifests/kwok-controller.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: kwok-controller - namespace: kube-system -spec: - containers: - - args: - - --manage-all-nodes=false - - --manage-nodes-with-annotation-selector=kwok.x-k8s.io/node=fake - - --kubeconfig=~/.kube/config - - --config=~/.kwok/kwok.yaml - - --tls-cert-file=/etc/kubernetes/pki/admin.crt - - --tls-private-key-file=/etc/kubernetes/pki/admin.key - - --node-ip=$(POD_IP) - - --node-name=kwok-controller.kube-system.svc - - --node-port=10247 - - --server-address=0.0.0.0:10247 - - --node-lease-duration-seconds=40 - - --v=DEBUG - command: - - kwok - env: - - name: POD_IP - valueFrom: - fieldRef: - fieldPath: status.podIP - image: localhost/kwok:test - imagePullPolicy: Never - name: kwok-controller - resources: {} - volumeMounts: - - mountPath: ~/.kube/config - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/ca.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-3 - readOnly: true - - mountPath: ~/.kwok/kwok.yaml - name: volume-4 - readOnly: true - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /etc/kubernetes/admin.conf - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/ca.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-3 - - hostPath: - path: /etc/kwok/kwok.yaml - name: volume-4 -status: {} -EOF -podman pull docker.io/kubernetesui/dashboard:v2.7.0 -cat </workdir/clusters//manifests/dashboard.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: dashboard - namespace: kube-system -spec: - containers: - - args: - - --insecure-bind-address=0.0.0.0 - - --bind-address=127.0.0.1 - - --port=0 - - --enable-insecure-login - - --enable-skip-login - - --disable-settings-authorizer - - --sidecar-host=127.0.0.1:8000 - - --system-banner=Welcome to kwok- - - --kubeconfig=~/.kube/config - - --insecure-port=8080 - image: docker.io/kubernetesui/dashboard:v2.7.0 - imagePullPolicy: Never - name: dashboard - ports: - - containerPort: 8080 - hostPort: 8080 - name: http - protocol: TCP - resources: {} - volumeMounts: - - mountPath: ~/.kube/config - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/ca.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-3 - readOnly: true - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /etc/kubernetes/admin.conf - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/ca.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-3 -status: {} -EOF -podman pull docker.io/kubernetesui/metrics-scraper:v1.0.9 -cat </workdir/clusters//manifests/dashboard-metrics-scraper.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: dashboard-metrics-scraper - namespace: kube-system -spec: - containers: - - args: - - --db-file=/metrics.db - - --kubeconfig=~/.kube/config - image: docker.io/kubernetesui/metrics-scraper:v1.0.9 - imagePullPolicy: Never - name: dashboard-metrics-scraper - resources: {} - volumeMounts: - - mountPath: ~/.kube/config - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/ca.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-3 - readOnly: true - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /etc/kubernetes/admin.conf - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/ca.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-3 -status: {} -EOF -podman pull registry.k8s.io/metrics-server/metrics-server:v0.7.1 -cat </workdir/clusters//manifests/metrics-server.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: metrics-server - namespace: kube-system -spec: - containers: - - args: - - --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname - - --kubelet-use-node-status-port - - --kubelet-insecure-tls - - --metric-resolution=15s - - --bind-address=0.0.0.0 - - --secure-port=4443 - - --kubeconfig=~/.kube/config - - --authentication-kubeconfig=~/.kube/config - - --authorization-kubeconfig=~/.kube/config - - --tls-cert-file=/etc/kubernetes/pki/admin.crt - - --tls-private-key-file=/etc/kubernetes/pki/admin.key - - --v=4 - command: - - /metrics-server - image: registry.k8s.io/metrics-server/metrics-server:v0.7.1 - imagePullPolicy: Never - name: metrics-server - ports: - - containerPort: 4443 - hostPort: 4443 - resources: {} - volumeMounts: - - mountPath: ~/.kube/config - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/ca.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-3 - readOnly: true - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /etc/kubernetes/admin.conf - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/ca.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-3 -status: {} -EOF -podman pull docker.io/prom/prometheus:v2.53.0 -cat </workdir/clusters//manifests/prometheus.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: prometheus - namespace: kube-system -spec: - containers: - - args: - - --config.file=/etc/prometheus/prometheus.yaml - - --web.listen-address=0.0.0.0:9090 - - --log.level=debug - command: - - prometheus - image: docker.io/prom/prometheus:v2.53.0 - imagePullPolicy: Never - name: prometheus - ports: - - containerPort: 9090 - hostPort: 9090 - resources: {} - volumeMounts: - - mountPath: /etc/prometheus/prometheus.yaml - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/apiserver-etcd-client.crt - name: volume-3 - readOnly: true - - mountPath: /etc/kubernetes/pki/apiserver-etcd-client.key - name: volume-4 - readOnly: true - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /var/components/prometheus/etc/prometheus/prometheus.yaml - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/apiserver-etcd-client.crt - name: volume-3 - - hostPath: - path: /etc/kubernetes/pki/apiserver-etcd-client.key - name: volume-4 -status: {} -EOF -podman pull docker.io/jaegertracing/all-in-one:1.58.1 -cat </workdir/clusters//manifests/jaeger.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: jaeger - namespace: kube-system -spec: - containers: - - args: - - --collector.otlp.enabled=true - - --query.http-server.host-port=0.0.0.0:16686 - - --log-level=debug - image: docker.io/jaegertracing/all-in-one:1.58.1 - imagePullPolicy: Never - name: jaeger - ports: - - containerPort: 16686 - hostPort: 16686 - resources: {} - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 -status: {} -EOF -cat </workdir/clusters//prometheus.yaml -global: - scrape_interval: 15s - scrape_timeout: 10s - evaluation_interval: 15s -alerting: - alertmanagers: - - follow_redirects: true - enable_http2: true - scheme: http - timeout: 10s - api_version: v2 - static_configs: - - targets: [] -scrape_configs: -- job_name: "etcd" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/apiserver-etcd-client.crt" - key_file: "/etc/kubernetes/pki/apiserver-etcd-client.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:2379 -- job_name: "kube-apiserver" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:6443 -- job_name: "kube-controller-manager" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:10257 -- job_name: "kube-scheduler" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:10259 -- job_name: "kwok-controller-metrics-discovery" - http_sd_configs: - - url: http://127.0.0.1:10247/discovery/prometheus -- job_name: "kwok-controller" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:10247 -- job_name: "metrics-server" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:4443 -- job_name: "prometheus" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:9090 -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -KIND_EXPERIMENTAL_PROVIDER=podman kind create cluster --config /workdir/clusters//kind.yaml --name kwok- --image docker.io/kindest/node:v1.30.2 --wait 29m -mkdir -p /workdir/cache/image-archive/localhost/kwok -podman save localhost/kwok:test -o /workdir/cache/image-archive/localhost/kwok/test.tar -KIND_EXPERIMENTAL_PROVIDER=podman kind load image-archive /workdir/cache/image-archive/localhost/kwok/test.tar --name kwok- -rm /workdir/cache/image-archive/localhost/kwok/test.tar -mkdir -p /workdir/cache/image-archive/docker.io/kubernetesui/dashboard -podman save docker.io/kubernetesui/dashboard:v2.7.0 -o /workdir/cache/image-archive/docker.io/kubernetesui/dashboard/v2.7.0.tar -KIND_EXPERIMENTAL_PROVIDER=podman kind load image-archive /workdir/cache/image-archive/docker.io/kubernetesui/dashboard/v2.7.0.tar --name kwok- -rm /workdir/cache/image-archive/docker.io/kubernetesui/dashboard/v2.7.0.tar -mkdir -p /workdir/cache/image-archive/docker.io/kubernetesui/metrics-scraper -podman save docker.io/kubernetesui/metrics-scraper:v1.0.9 -o /workdir/cache/image-archive/docker.io/kubernetesui/metrics-scraper/v1.0.9.tar -KIND_EXPERIMENTAL_PROVIDER=podman kind load image-archive /workdir/cache/image-archive/docker.io/kubernetesui/metrics-scraper/v1.0.9.tar --name kwok- -rm /workdir/cache/image-archive/docker.io/kubernetesui/metrics-scraper/v1.0.9.tar -mkdir -p /workdir/cache/image-archive/registry.k8s.io/metrics-server/metrics-server -podman save registry.k8s.io/metrics-server/metrics-server:v0.7.1 -o /workdir/cache/image-archive/registry.k8s.io/metrics-server/metrics-server/v0.7.1.tar -KIND_EXPERIMENTAL_PROVIDER=podman kind load image-archive /workdir/cache/image-archive/registry.k8s.io/metrics-server/metrics-server/v0.7.1.tar --name kwok- -rm /workdir/cache/image-archive/registry.k8s.io/metrics-server/metrics-server/v0.7.1.tar -mkdir -p /workdir/cache/image-archive/docker.io/prom/prometheus -podman save docker.io/prom/prometheus:v2.53.0 -o /workdir/cache/image-archive/docker.io/prom/prometheus/v2.53.0.tar -KIND_EXPERIMENTAL_PROVIDER=podman kind load image-archive /workdir/cache/image-archive/docker.io/prom/prometheus/v2.53.0.tar --name kwok- -rm /workdir/cache/image-archive/docker.io/prom/prometheus/v2.53.0.tar -mkdir -p /workdir/cache/image-archive/docker.io/jaegertracing/all-in-one -podman save docker.io/jaegertracing/all-in-one:1.58.1 -o /workdir/cache/image-archive/docker.io/jaegertracing/all-in-one/1.58.1.tar -KIND_EXPERIMENTAL_PROVIDER=podman kind load image-archive /workdir/cache/image-archive/docker.io/jaegertracing/all-in-one/1.58.1.tar --name kwok- -rm /workdir/cache/image-archive/docker.io/jaegertracing/all-in-one/1.58.1.tar -kubectl config view --minify=true --raw=true -cat </workdir/clusters//kubeconfig.yaml -EOF -kubectl cordon kwok--control-plane -podman exec kwok--control-plane chmod -R +r /etc/kubernetes/pki -# Set up apiservice for metrics server -# Add context kwok- to ~/.kube/config diff --git a/test/kwokctl/testdata/kind-podman/export_logs.txt b/test/kwokctl/testdata/kind-podman/export_logs.txt deleted file mode 100644 index af723fee5..000000000 --- a/test/kwokctl/testdata/kind-podman/export_logs.txt +++ /dev/null @@ -1,10 +0,0 @@ -mkdir -p /logs/kwok- -cp /workdir/clusters//kwok.yaml /logs/kwok-/kwok.yaml -mkdir -p /logs/kwok-/components -kind version >/logs/kwok-/kind-podman-info.txt -etcd logs -n kube-system etcd-kwok--control-plane >/logs/kwok-/components/etcd.log -kube-apiserver logs -n kube-system kube-apiserver-kwok--control-plane >/logs/kwok-/components/kube-apiserver.log -kwok-controller logs -n kube-system kwok-controller-kwok--control-plane >/logs/kwok-/components/kwok-controller.log -kube-scheduler logs -n kube-system kube-scheduler-kwok--control-plane >/logs/kwok-/components/kube-scheduler.log -kube-controller-manager logs -n kube-system kube-controller-manager-kwok--control-plane >/logs/kwok-/components/kube-controller-manager.log -cp /workdir/clusters//logs/audit.log /logs/kwok-/components/audit.log diff --git a/test/kwokctl/testdata/kind-podman/snapshot_restore_etcd.txt b/test/kwokctl/testdata/kind-podman/snapshot_restore_etcd.txt deleted file mode 100644 index 1104b356e..000000000 --- a/test/kwokctl/testdata/kind-podman/snapshot_restore_etcd.txt +++ /dev/null @@ -1,8 +0,0 @@ -podman exec kwok--control-plane mv /etc/kubernetes/manifests/etcd.yaml /etc/kubernetes/etcd.yaml.bak -# Download https://github.com/etcd-io/etcd/releases/download/v3.5.11/etcd-v3.5.11--. and extract etcdctl to /workdir/clusters//bin/etcdctl -ETCDCTL_API=3 etcdctl snapshot restore ./snapshot-empty- --data-dir /workdir/clusters//etcd -podman cp /workdir/clusters//etcd kwok--control-plane:/var/lib/ -rm -rf /workdir/clusters//etcd -podman exec kwok--control-plane mv /etc/kubernetes/etcd.yaml.bak /etc/kubernetes/manifests/etcd.yaml -podman stop kwok--control-plane -podman start kwok--control-plane diff --git a/test/kwokctl/testdata/kind-podman/snapshot_save_etcd.txt b/test/kwokctl/testdata/kind-podman/snapshot_save_etcd.txt deleted file mode 100644 index 1a38f2025..000000000 --- a/test/kwokctl/testdata/kind-podman/snapshot_save_etcd.txt +++ /dev/null @@ -1,3 +0,0 @@ -kubectl --kubeconfig /workdir/clusters//kubeconfig.yaml exec -i -n kube-system etcd-kwok--control-plane -- etcdctl --endpoints=127.0.0.1:2379 --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key --cacert=/etc/kubernetes/pki/etcd/ca.crt snapshot save /var/lib/etcd/snapshot.db -podman cp kwok--control-plane:/var/lib/etcd/snapshot.db ./snapshot-empty- -podman exec -i kwok--control-plane rm -f /var/lib/etcd/snapshot.db diff --git a/test/kwokctl/testdata/kind-podman/start_cluster.txt b/test/kwokctl/testdata/kind-podman/start_cluster.txt deleted file mode 100644 index 041be1db5..000000000 --- a/test/kwokctl/testdata/kind-podman/start_cluster.txt +++ /dev/null @@ -1 +0,0 @@ -podman start kwok--control-plane diff --git a/test/kwokctl/testdata/kind-podman/stop_cluster.txt b/test/kwokctl/testdata/kind-podman/stop_cluster.txt deleted file mode 100644 index dc367ab74..000000000 --- a/test/kwokctl/testdata/kind-podman/stop_cluster.txt +++ /dev/null @@ -1 +0,0 @@ -podman stop kwok--control-plane diff --git a/test/kwokctl/testdata/kind/create_cluster.txt b/test/kwokctl/testdata/kind/create_cluster.txt deleted file mode 100644 index 9e2f38361..000000000 --- a/test/kwokctl/testdata/kind/create_cluster.txt +++ /dev/null @@ -1,130 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//pki/etcd -docker pull docker.io/kindest/node:v1.30.2 -mkdir -p /workdir/clusters//pki -mkdir -p /workdir/clusters//manifests -cat </workdir/clusters//kind.yaml -apiVersion: kind.x-k8s.io/v1alpha4 -kind: Cluster -kubeadmConfigPatches: -- | - apiServer: - extraArgs: - enable-priority-and-fairness: "false" - max-mutating-requests-inflight: "0" - max-requests-inflight: "0" - apiVersion: kubeadm.k8s.io/v1beta3 - controllerManager: - extraArgs: - kube-api-burst: "10000" - kube-api-qps: "5000" - dns: {} - etcd: - local: - dataDir: /var/lib/etcd - kind: ClusterConfiguration - networking: {} - scheduler: - extraArgs: - kube-api-burst: "10000" - kube-api-qps: "5000" -networking: - apiServerPort: 32766 -nodes: -- extraMounts: - - containerPath: /etc/kwok/ - hostPath: /workdir/clusters/ - - containerPath: /etc/kubernetes/manifests - hostPath: /workdir/clusters//manifests - - containerPath: /etc/kubernetes/pki - hostPath: /workdir/clusters//pki - extraPortMappings: - - containerPort: 2379 - hostPort: 32765 - protocol: TCP - role: control-plane -EOF -docker pull localhost/kwok:test -cat </workdir/clusters//manifests/kwok-controller.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: kwok-controller - namespace: kube-system -spec: - containers: - - args: - - --manage-all-nodes=false - - --manage-nodes-with-annotation-selector=kwok.x-k8s.io/node=fake - - --kubeconfig=~/.kube/config - - --config=~/.kwok/kwok.yaml - - --tls-cert-file=/etc/kubernetes/pki/admin.crt - - --tls-private-key-file=/etc/kubernetes/pki/admin.key - - --node-ip=$(POD_IP) - - --node-name=kwok-controller.kube-system.svc - - --node-port=10247 - - --server-address=0.0.0.0:10247 - - --node-lease-duration-seconds=40 - command: - - kwok - env: - - name: POD_IP - valueFrom: - fieldRef: - fieldPath: status.podIP - image: localhost/kwok:test - imagePullPolicy: Never - name: kwok-controller - resources: {} - volumeMounts: - - mountPath: ~/.kube/config - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/ca.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-3 - readOnly: true - - mountPath: ~/.kwok/kwok.yaml - name: volume-4 - readOnly: true - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /etc/kubernetes/admin.conf - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/ca.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-3 - - hostPath: - path: /etc/kwok/kwok.yaml - name: volume-4 -status: {} -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -KIND_EXPERIMENTAL_PROVIDER=docker kind create cluster --config /workdir/clusters//kind.yaml --name kwok- --image docker.io/kindest/node:v1.30.2 --wait 29m -KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image localhost/kwok:test --name kwok- -kubectl config view --minify=true --raw=true -cat </workdir/clusters//kubeconfig.yaml -EOF -kubectl cordon kwok--control-plane -docker exec kwok--control-plane chmod -R +r /etc/kubernetes/pki -# Add context kwok- to ~/.kube/config diff --git a/test/kwokctl/testdata/kind/create_cluster_with_extra.txt b/test/kwokctl/testdata/kind/create_cluster_with_extra.txt deleted file mode 100644 index a90a0de9e..000000000 --- a/test/kwokctl/testdata/kind/create_cluster_with_extra.txt +++ /dev/null @@ -1,335 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//pki/etcd -docker pull docker.io/kindest/node:v1.30.2 -mkdir -p /workdir/clusters//pki -mkdir -p /workdir/clusters//manifests -cat </workdir/clusters//kind.yaml -apiVersion: kind.x-k8s.io/v1alpha4 -kind: Cluster -kubeadmConfigPatches: -- | - apiServer: - extraArgs: - enable-priority-and-fairness: "false" - max-mutating-requests-inflight: "0" - max-requests-inflight: "0" - v: "5" - extraVolumes: - - hostPath: /var/components/apiserver/extras/tmp - mountPath: /extras/tmp - name: tmp-apiserver - pathType: DirectoryOrCreate - apiVersion: kubeadm.k8s.io/v1beta3 - controllerManager: - extraArgs: - kube-api-burst: "10000" - kube-api-qps: "5000" - v: "5" - extraVolumes: - - hostPath: /var/components/controller-manager/extras/tmp - mountPath: /extras/tmp - name: tmp-controller-manager - pathType: DirectoryOrCreate - dns: {} - etcd: - local: - dataDir: /var/lib/etcd - extraArgs: - log-level: debug - kind: ClusterConfiguration - networking: {} - scheduler: - extraArgs: - kube-api-burst: "10000" - kube-api-qps: "5000" - v: "5" - extraVolumes: - - hostPath: /var/components/scheduler/extras/tmp - mountPath: /extras/tmp - name: tmp-scheduler - pathType: DirectoryOrCreate -networking: - apiServerPort: 32766 -nodes: -- extraMounts: - - containerPath: /etc/kwok/ - hostPath: /workdir/clusters/ - - containerPath: /etc/kubernetes/manifests - hostPath: /workdir/clusters//manifests - - containerPath: /etc/kubernetes/pki - hostPath: /workdir/clusters//pki - - containerPath: /var/components/apiserver/extras/tmp - hostPath: /extras/apiserver - - containerPath: /var/components/controller-manager/extras/tmp - hostPath: /extras/controller-manager - - containerPath: /var/components/scheduler/extras/tmp - hostPath: /extras/scheduler - - containerPath: /var/components/controller/extras/tmp - hostPath: /extras/controller - - containerPath: /var/components/prometheus/extras/tmp - hostPath: /extras/prometheus - - containerPath: /var/components/prometheus/etc/prometheus/prometheus.yaml - hostPath: /workdir/clusters//prometheus.yaml - extraPortMappings: - - containerPort: 9090 - hostPort: 9090 - protocol: TCP - - containerPort: 2379 - hostPort: 32765 - protocol: TCP - role: control-plane -EOF -docker pull localhost/kwok:test -cat </workdir/clusters//manifests/kwok-controller.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: kwok-controller - namespace: kube-system -spec: - containers: - - args: - - --manage-all-nodes=false - - --manage-nodes-with-annotation-selector=kwok.x-k8s.io/node=fake - - --kubeconfig=~/.kube/config - - --config=~/.kwok/kwok.yaml - - --tls-cert-file=/etc/kubernetes/pki/admin.crt - - --tls-private-key-file=/etc/kubernetes/pki/admin.key - - --node-ip=$(POD_IP) - - --node-name=kwok-controller.kube-system.svc - - --node-port=10247 - - --server-address=0.0.0.0:10247 - - --node-lease-duration-seconds=40 - - --v=-4 - command: - - kwok - env: - - name: TEST_KEY - value: TEST_VALUE - - name: POD_IP - valueFrom: - fieldRef: - fieldPath: status.podIP - image: localhost/kwok:test - imagePullPolicy: Never - name: kwok-controller - resources: {} - volumeMounts: - - mountPath: ~/.kube/config - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/ca.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-3 - readOnly: true - - mountPath: ~/.kwok/kwok.yaml - name: volume-4 - readOnly: true - - mountPath: /extras/tmp - name: tmp-controller - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /etc/kubernetes/admin.conf - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/ca.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-3 - - hostPath: - path: /etc/kwok/kwok.yaml - name: volume-4 - - hostPath: - path: /extras/controller - type: DirectoryOrCreate - name: tmp-controller -status: {} -EOF -docker pull docker.io/prom/prometheus:v2.53.0 -cat </workdir/clusters//manifests/prometheus.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: prometheus - namespace: kube-system -spec: - containers: - - args: - - --config.file=/etc/prometheus/prometheus.yaml - - --web.listen-address=0.0.0.0:9090 - - --log.level=debug - command: - - prometheus - env: - - name: TEST_KEY - value: TEST_VALUE - image: docker.io/prom/prometheus:v2.53.0 - imagePullPolicy: Never - name: prometheus - ports: - - containerPort: 9090 - hostPort: 9090 - resources: {} - volumeMounts: - - mountPath: /etc/prometheus/prometheus.yaml - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/apiserver-etcd-client.crt - name: volume-3 - readOnly: true - - mountPath: /etc/kubernetes/pki/apiserver-etcd-client.key - name: volume-4 - readOnly: true - - mountPath: /extras/tmp - name: tmp-prometheus - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /var/components/prometheus/etc/prometheus/prometheus.yaml - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/apiserver-etcd-client.crt - name: volume-3 - - hostPath: - path: /etc/kubernetes/pki/apiserver-etcd-client.key - name: volume-4 - - hostPath: - path: /extras/prometheus - type: DirectoryOrCreate - name: tmp-prometheus -status: {} -EOF -cat </workdir/clusters//prometheus.yaml -global: - scrape_interval: 15s - scrape_timeout: 10s - evaluation_interval: 15s -alerting: - alertmanagers: - - follow_redirects: true - enable_http2: true - scheme: http - timeout: 10s - api_version: v2 - static_configs: - - targets: [] -scrape_configs: -- job_name: "etcd" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/apiserver-etcd-client.crt" - key_file: "/etc/kubernetes/pki/apiserver-etcd-client.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:2379 -- job_name: "kube-apiserver" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:6443 -- job_name: "kube-controller-manager" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:10257 -- job_name: "kube-scheduler" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:10259 -- job_name: "kwok-controller-metrics-discovery" - http_sd_configs: - - url: http://127.0.0.1:10247/discovery/prometheus -- job_name: "kwok-controller" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:10247 -- job_name: "prometheus" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:9090 -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -KIND_EXPERIMENTAL_PROVIDER=docker kind create cluster --config /workdir/clusters//kind.yaml --name kwok- --image docker.io/kindest/node:v1.30.2 --wait 29m -KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image localhost/kwok:test --name kwok- -KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image docker.io/prom/prometheus:v2.53.0 --name kwok- -kubectl config view --minify=true --raw=true -cat </workdir/clusters//kubeconfig.yaml -EOF -kubectl cordon kwok--control-plane -docker exec kwok--control-plane chmod -R +r /etc/kubernetes/pki -# Add context kwok- to ~/.kube/config diff --git a/test/kwokctl/testdata/kind/create_cluster_with_verbosity.txt b/test/kwokctl/testdata/kind/create_cluster_with_verbosity.txt deleted file mode 100644 index 46869d145..000000000 --- a/test/kwokctl/testdata/kind/create_cluster_with_verbosity.txt +++ /dev/null @@ -1,573 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//pki/etcd -docker pull docker.io/kindest/node:v1.30.2 -mkdir -p /workdir/clusters//pki -mkdir -p /workdir/clusters//manifests -mkdir -p /workdir/clusters//logs -touch /workdir/clusters//logs/audit.log -cp /test/kwokctl/audit-policy.yaml /workdir/clusters//audit.yaml -cp /test/kwokctl/scheduler-config.yaml /workdir/clusters//scheduler.yaml -cat <>/workdir/clusters//scheduler.yaml -clientConnection: - kubeconfig: "/etc/kubernetes/scheduler.conf" -EOF -cat </workdir/clusters//apiserver-tracing-config.yaml -apiVersion: apiserver.config.k8s.io/v1alpha1 -kind: TracingConfiguration -endpoint: 0.0.0.0:4317 -samplingRatePerMillion: 1000000 -EOF -cat </workdir/clusters//kind.yaml -apiVersion: kind.x-k8s.io/v1alpha4 -kind: Cluster -kubeadmConfigPatches: -- | - apiServer: - extraArgs: - audit-log-path: /var/log/kubernetes/audit.log - audit-policy-file: /etc/kubernetes/audit/audit.yaml - enable-priority-and-fairness: "false" - max-mutating-requests-inflight: "0" - max-requests-inflight: "0" - tracing-config-file: /etc/kubernetes/apiserver-tracing-config.yaml - v: "4" - extraVolumes: - - hostPath: /var/components/apiserver/etc/kubernetes/audit/audit.yaml - mountPath: /etc/kubernetes/audit/audit.yaml - name: audit-policy-file - pathType: File - readOnly: true - - hostPath: /var/components/apiserver/var/log/kubernetes/audit.log - mountPath: /var/log/kubernetes/audit.log - name: audit-log-path - pathType: File - - hostPath: /var/components/apiserver/etc/kubernetes/apiserver-tracing-config.yaml - mountPath: /etc/kubernetes/apiserver-tracing-config.yaml - name: apiserver-tracing-config - pathType: File - readOnly: true - apiVersion: kubeadm.k8s.io/v1beta3 - controllerManager: - extraArgs: - kube-api-burst: "10000" - kube-api-qps: "5000" - v: "4" - dns: {} - etcd: - local: - dataDir: /var/lib/etcd - extraArgs: - log-level: debug - kind: ClusterConfiguration - networking: {} - scheduler: - extraArgs: - config: /etc/kubernetes/scheduler/scheduler.yaml - kube-api-burst: "10000" - kube-api-qps: "5000" - v: "4" - extraVolumes: - - hostPath: /var/components/scheduler/etc/kubernetes/scheduler/scheduler.yaml - mountPath: /etc/kubernetes/scheduler/scheduler.yaml - name: config - pathType: File - readOnly: true -networking: - apiServerPort: 32766 -nodes: -- extraMounts: - - containerPath: /etc/kwok/ - hostPath: /workdir/clusters/ - - containerPath: /etc/kubernetes/manifests - hostPath: /workdir/clusters//manifests - - containerPath: /etc/kubernetes/pki - hostPath: /workdir/clusters//pki - - containerPath: /var/components/apiserver/etc/kubernetes/audit/audit.yaml - hostPath: /workdir/clusters//audit.yaml - readOnly: true - - containerPath: /var/components/apiserver/var/log/kubernetes/audit.log - hostPath: /workdir/clusters//logs/audit.log - - containerPath: /var/components/apiserver/etc/kubernetes/apiserver-tracing-config.yaml - hostPath: /workdir/clusters//apiserver-tracing-config.yaml - readOnly: true - - containerPath: /var/components/scheduler/etc/kubernetes/scheduler/scheduler.yaml - hostPath: /workdir/clusters//scheduler.yaml - readOnly: true - - containerPath: /var/components/prometheus/etc/prometheus/prometheus.yaml - hostPath: /workdir/clusters//prometheus.yaml - extraPortMappings: - - containerPort: 8080 - hostPort: 8000 - protocol: TCP - - containerPort: 9090 - hostPort: 9090 - protocol: TCP - - containerPort: 16686 - hostPort: 16686 - protocol: TCP - - containerPort: 2379 - hostPort: 32765 - protocol: TCP - role: control-plane -EOF -docker pull localhost/kwok:test -cat </workdir/clusters//manifests/kwok-controller.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: kwok-controller - namespace: kube-system -spec: - containers: - - args: - - --manage-all-nodes=false - - --manage-nodes-with-annotation-selector=kwok.x-k8s.io/node=fake - - --kubeconfig=~/.kube/config - - --config=~/.kwok/kwok.yaml - - --tls-cert-file=/etc/kubernetes/pki/admin.crt - - --tls-private-key-file=/etc/kubernetes/pki/admin.key - - --node-ip=$(POD_IP) - - --node-name=kwok-controller.kube-system.svc - - --node-port=10247 - - --server-address=0.0.0.0:10247 - - --node-lease-duration-seconds=40 - - --v=DEBUG - command: - - kwok - env: - - name: POD_IP - valueFrom: - fieldRef: - fieldPath: status.podIP - image: localhost/kwok:test - imagePullPolicy: Never - name: kwok-controller - resources: {} - volumeMounts: - - mountPath: ~/.kube/config - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/ca.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-3 - readOnly: true - - mountPath: ~/.kwok/kwok.yaml - name: volume-4 - readOnly: true - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /etc/kubernetes/admin.conf - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/ca.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-3 - - hostPath: - path: /etc/kwok/kwok.yaml - name: volume-4 -status: {} -EOF -docker pull docker.io/kubernetesui/dashboard:v2.7.0 -cat </workdir/clusters//manifests/dashboard.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: dashboard - namespace: kube-system -spec: - containers: - - args: - - --insecure-bind-address=0.0.0.0 - - --bind-address=127.0.0.1 - - --port=0 - - --enable-insecure-login - - --enable-skip-login - - --disable-settings-authorizer - - --sidecar-host=127.0.0.1:8000 - - --system-banner=Welcome to kwok- - - --kubeconfig=~/.kube/config - - --insecure-port=8080 - image: docker.io/kubernetesui/dashboard:v2.7.0 - imagePullPolicy: Never - name: dashboard - ports: - - containerPort: 8080 - hostPort: 8080 - name: http - protocol: TCP - resources: {} - volumeMounts: - - mountPath: ~/.kube/config - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/ca.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-3 - readOnly: true - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /etc/kubernetes/admin.conf - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/ca.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-3 -status: {} -EOF -docker pull docker.io/kubernetesui/metrics-scraper:v1.0.9 -cat </workdir/clusters//manifests/dashboard-metrics-scraper.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: dashboard-metrics-scraper - namespace: kube-system -spec: - containers: - - args: - - --db-file=/metrics.db - - --kubeconfig=~/.kube/config - image: docker.io/kubernetesui/metrics-scraper:v1.0.9 - imagePullPolicy: Never - name: dashboard-metrics-scraper - resources: {} - volumeMounts: - - mountPath: ~/.kube/config - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/ca.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-3 - readOnly: true - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /etc/kubernetes/admin.conf - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/ca.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-3 -status: {} -EOF -docker pull registry.k8s.io/metrics-server/metrics-server:v0.7.1 -cat </workdir/clusters//manifests/metrics-server.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: metrics-server - namespace: kube-system -spec: - containers: - - args: - - --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname - - --kubelet-use-node-status-port - - --kubelet-insecure-tls - - --metric-resolution=15s - - --bind-address=0.0.0.0 - - --secure-port=4443 - - --kubeconfig=~/.kube/config - - --authentication-kubeconfig=~/.kube/config - - --authorization-kubeconfig=~/.kube/config - - --tls-cert-file=/etc/kubernetes/pki/admin.crt - - --tls-private-key-file=/etc/kubernetes/pki/admin.key - - --v=4 - command: - - /metrics-server - image: registry.k8s.io/metrics-server/metrics-server:v0.7.1 - imagePullPolicy: Never - name: metrics-server - ports: - - containerPort: 4443 - hostPort: 4443 - resources: {} - volumeMounts: - - mountPath: ~/.kube/config - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/ca.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-3 - readOnly: true - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /etc/kubernetes/admin.conf - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/ca.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-3 -status: {} -EOF -docker pull docker.io/prom/prometheus:v2.53.0 -cat </workdir/clusters//manifests/prometheus.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: prometheus - namespace: kube-system -spec: - containers: - - args: - - --config.file=/etc/prometheus/prometheus.yaml - - --web.listen-address=0.0.0.0:9090 - - --log.level=debug - command: - - prometheus - image: docker.io/prom/prometheus:v2.53.0 - imagePullPolicy: Never - name: prometheus - ports: - - containerPort: 9090 - hostPort: 9090 - resources: {} - volumeMounts: - - mountPath: /etc/prometheus/prometheus.yaml - name: volume-0 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.crt - name: volume-1 - readOnly: true - - mountPath: /etc/kubernetes/pki/admin.key - name: volume-2 - readOnly: true - - mountPath: /etc/kubernetes/pki/apiserver-etcd-client.crt - name: volume-3 - readOnly: true - - mountPath: /etc/kubernetes/pki/apiserver-etcd-client.key - name: volume-4 - readOnly: true - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 - volumes: - - hostPath: - path: /var/components/prometheus/etc/prometheus/prometheus.yaml - name: volume-0 - - hostPath: - path: /etc/kubernetes/pki/admin.crt - name: volume-1 - - hostPath: - path: /etc/kubernetes/pki/admin.key - name: volume-2 - - hostPath: - path: /etc/kubernetes/pki/apiserver-etcd-client.crt - name: volume-3 - - hostPath: - path: /etc/kubernetes/pki/apiserver-etcd-client.key - name: volume-4 -status: {} -EOF -docker pull docker.io/jaegertracing/all-in-one:1.58.1 -cat </workdir/clusters//manifests/jaeger.yaml -apiVersion: v1 -kind: Pod -metadata: - creationTimestamp: null - name: jaeger - namespace: kube-system -spec: - containers: - - args: - - --collector.otlp.enabled=true - - --query.http-server.host-port=0.0.0.0:16686 - - --log-level=debug - image: docker.io/jaegertracing/all-in-one:1.58.1 - imagePullPolicy: Never - name: jaeger - ports: - - containerPort: 16686 - hostPort: 16686 - resources: {} - hostNetwork: true - restartPolicy: Always - securityContext: - runAsGroup: 0 - runAsUser: 0 -status: {} -EOF -cat </workdir/clusters//prometheus.yaml -global: - scrape_interval: 15s - scrape_timeout: 10s - evaluation_interval: 15s -alerting: - alertmanagers: - - follow_redirects: true - enable_http2: true - scheme: http - timeout: 10s - api_version: v2 - static_configs: - - targets: [] -scrape_configs: -- job_name: "etcd" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/apiserver-etcd-client.crt" - key_file: "/etc/kubernetes/pki/apiserver-etcd-client.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:2379 -- job_name: "kube-apiserver" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:6443 -- job_name: "kube-controller-manager" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:10257 -- job_name: "kube-scheduler" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:10259 -- job_name: "kwok-controller-metrics-discovery" - http_sd_configs: - - url: http://127.0.0.1:10247/discovery/prometheus -- job_name: "kwok-controller" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:10247 -- job_name: "metrics-server" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - 127.0.0.1:4443 -- job_name: "prometheus" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:9090 -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -KIND_EXPERIMENTAL_PROVIDER=docker kind create cluster --config /workdir/clusters//kind.yaml --name kwok- --image docker.io/kindest/node:v1.30.2 --wait 29m -KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image localhost/kwok:test --name kwok- -KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image docker.io/kubernetesui/dashboard:v2.7.0 --name kwok- -KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image docker.io/kubernetesui/metrics-scraper:v1.0.9 --name kwok- -KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image registry.k8s.io/metrics-server/metrics-server:v0.7.1 --name kwok- -KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image docker.io/prom/prometheus:v2.53.0 --name kwok- -KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image docker.io/jaegertracing/all-in-one:1.58.1 --name kwok- -kubectl config view --minify=true --raw=true -cat </workdir/clusters//kubeconfig.yaml -EOF -kubectl cordon kwok--control-plane -docker exec kwok--control-plane chmod -R +r /etc/kubernetes/pki -# Set up apiservice for metrics server -# Add context kwok- to ~/.kube/config diff --git a/test/kwokctl/testdata/kind/export_logs.txt b/test/kwokctl/testdata/kind/export_logs.txt deleted file mode 100644 index 49ae8a495..000000000 --- a/test/kwokctl/testdata/kind/export_logs.txt +++ /dev/null @@ -1,10 +0,0 @@ -mkdir -p /logs/kwok- -cp /workdir/clusters//kwok.yaml /logs/kwok-/kwok.yaml -mkdir -p /logs/kwok-/components -kind version >/logs/kwok-/kind-info.txt -etcd logs -n kube-system etcd-kwok--control-plane >/logs/kwok-/components/etcd.log -kube-apiserver logs -n kube-system kube-apiserver-kwok--control-plane >/logs/kwok-/components/kube-apiserver.log -kwok-controller logs -n kube-system kwok-controller-kwok--control-plane >/logs/kwok-/components/kwok-controller.log -kube-scheduler logs -n kube-system kube-scheduler-kwok--control-plane >/logs/kwok-/components/kube-scheduler.log -kube-controller-manager logs -n kube-system kube-controller-manager-kwok--control-plane >/logs/kwok-/components/kube-controller-manager.log -cp /workdir/clusters//logs/audit.log /logs/kwok-/components/audit.log diff --git a/test/kwokctl/testdata/kind/snapshot_restore_etcd.txt b/test/kwokctl/testdata/kind/snapshot_restore_etcd.txt deleted file mode 100644 index 2a4eaa1e1..000000000 --- a/test/kwokctl/testdata/kind/snapshot_restore_etcd.txt +++ /dev/null @@ -1,8 +0,0 @@ -docker exec kwok--control-plane mv /etc/kubernetes/manifests/etcd.yaml /etc/kubernetes/etcd.yaml.bak -# Download https://github.com/etcd-io/etcd/releases/download/v3.5.11/etcd-v3.5.11--. and extract etcdctl to /workdir/clusters//bin/etcdctl -ETCDCTL_API=3 etcdctl snapshot restore ./snapshot-empty- --data-dir /workdir/clusters//etcd -docker cp /workdir/clusters//etcd kwok--control-plane:/var/lib/ -rm -rf /workdir/clusters//etcd -docker exec kwok--control-plane mv /etc/kubernetes/etcd.yaml.bak /etc/kubernetes/manifests/etcd.yaml -docker stop kwok--control-plane -docker start kwok--control-plane diff --git a/test/kwokctl/testdata/kind/snapshot_save_etcd.txt b/test/kwokctl/testdata/kind/snapshot_save_etcd.txt deleted file mode 100644 index 0adba8f6a..000000000 --- a/test/kwokctl/testdata/kind/snapshot_save_etcd.txt +++ /dev/null @@ -1,3 +0,0 @@ -kubectl --kubeconfig /workdir/clusters//kubeconfig.yaml exec -i -n kube-system etcd-kwok--control-plane -- etcdctl --endpoints=127.0.0.1:2379 --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key --cacert=/etc/kubernetes/pki/etcd/ca.crt snapshot save /var/lib/etcd/snapshot.db -docker cp kwok--control-plane:/var/lib/etcd/snapshot.db ./snapshot-empty- -docker exec -i kwok--control-plane rm -f /var/lib/etcd/snapshot.db diff --git a/test/kwokctl/testdata/kind/start_cluster.txt b/test/kwokctl/testdata/kind/start_cluster.txt deleted file mode 100644 index 9ae0d8be5..000000000 --- a/test/kwokctl/testdata/kind/start_cluster.txt +++ /dev/null @@ -1 +0,0 @@ -docker start kwok--control-plane diff --git a/test/kwokctl/testdata/kind/stop_cluster.txt b/test/kwokctl/testdata/kind/stop_cluster.txt deleted file mode 100644 index 67e6733c7..000000000 --- a/test/kwokctl/testdata/kind/stop_cluster.txt +++ /dev/null @@ -1 +0,0 @@ -docker stop kwok--control-plane diff --git a/test/kwokctl/testdata/nerdctl/create_cluster.txt b/test/kwokctl/testdata/nerdctl/create_cluster.txt deleted file mode 100644 index f94c05caa..000000000 --- a/test/kwokctl/testdata/nerdctl/create_cluster.txt +++ /dev/null @@ -1,65 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//etcd -nerdctl pull registry.k8s.io/etcd:3.5.11-0 -nerdctl pull registry.k8s.io/kube-apiserver:v1.30.2 -nerdctl pull registry.k8s.io/kube-controller-manager:v1.30.2 -nerdctl pull registry.k8s.io/kube-scheduler:v1.30.2 -nerdctl pull localhost/kwok:test -cat </workdir/clusters//kubeconfig.yaml -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /workdir/clusters//pki/ca.crt - server: https://127.0.0.1:32766 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /workdir/clusters//pki/admin.crt - client-key: /workdir/clusters//pki/admin.key -EOF -cat </workdir/clusters//kubeconfig -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /etc/kubernetes/pki/ca.crt - server: https://kwok--kube-apiserver:6443 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /etc/kubernetes/pki/admin.crt - client-key: /etc/kubernetes/pki/admin.key -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -nerdctl network create kwok- --label=com.docker.compose.project=kwok- -nerdctl create --name=kwok--etcd --pull=never --entrypoint=etcd --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=32765:2379/tcp registry.k8s.io/etcd:3.5.11-0 --name=node0 --auto-compaction-retention=1 --quota-backend-bytes=8589934592 --data-dir=/etcd-data --initial-advertise-peer-urls=http://0.0.0.0:2380 --listen-peer-urls=http://0.0.0.0:2380 --advertise-client-urls=http://0.0.0.0:2379 --listen-client-urls=http://0.0.0.0:2379 --initial-cluster=node0=http://0.0.0.0:2380 -nerdctl create --name=kwok--kube-apiserver --pull=never --entrypoint=kube-apiserver --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=32766:6443/tcp --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-apiserver:v1.30.2 --etcd-prefix=/registry --allow-privileged=true --max-requests-inflight=0 --max-mutating-requests-inflight=0 --enable-priority-and-fairness=false --etcd-servers=http://kwok--etcd:2379 --bind-address=0.0.0.0 --secure-port=6443 --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --client-ca-file=/etc/kubernetes/pki/ca.crt --service-account-key-file=/etc/kubernetes/pki/admin.key --service-account-signing-key-file=/etc/kubernetes/pki/admin.key --service-account-issuer=https://kubernetes.default.svc.cluster.local --proxy-client-key-file=/etc/kubernetes/pki/admin.key --proxy-client-cert-file=/etc/kubernetes/pki/admin.crt -nerdctl create --name=kwok--kube-controller-manager --pull=never --entrypoint=kube-controller-manager --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-controller-manager:v1.30.2 --node-monitor-period=25s --node-monitor-grace-period=3m20s --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10257 --kube-api-qps=5000 --kube-api-burst=10000 -nerdctl create --name=kwok--kube-scheduler --pull=never --entrypoint=kube-scheduler --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-scheduler:v1.30.2 --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10259 --kube-api-qps=5000 --kube-api-burst=10000 -nerdctl create --name=kwok--kwok-controller --pull=never --entrypoint=kwok --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//kwok.yaml:~/.kwok/kwok.yaml:ro localhost/kwok:test --manage-all-nodes=true --kubeconfig=~/.kube/config --config=~/.kwok/kwok.yaml --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --node-ip= --node-name=kwok--kwok-controller --node-port=10247 --server-address=0.0.0.0:10247 --node-lease-duration-seconds=200 -# Add context kwok- to ~/.kube/config -nerdctl start kwok--etcd -nerdctl start kwok--kube-apiserver -nerdctl start kwok--kube-controller-manager -nerdctl start kwok--kube-scheduler -nerdctl start kwok--kwok-controller diff --git a/test/kwokctl/testdata/nerdctl/create_cluster_with_extra.txt b/test/kwokctl/testdata/nerdctl/create_cluster_with_extra.txt deleted file mode 100644 index a26ae4be2..000000000 --- a/test/kwokctl/testdata/nerdctl/create_cluster_with_extra.txt +++ /dev/null @@ -1,154 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//etcd -nerdctl pull registry.k8s.io/etcd:3.5.11-0 -nerdctl pull registry.k8s.io/kube-apiserver:v1.30.2 -nerdctl pull registry.k8s.io/kube-controller-manager:v1.30.2 -nerdctl pull registry.k8s.io/kube-scheduler:v1.30.2 -nerdctl pull localhost/kwok:test -nerdctl pull docker.io/prom/prometheus:v2.53.0 -cat </workdir/clusters//prometheus.yaml -global: - scrape_interval: 15s - scrape_timeout: 10s - evaluation_interval: 15s -alerting: - alertmanagers: - - follow_redirects: true - enable_http2: true - scheme: http - timeout: 10s - api_version: v2 - static_configs: - - targets: [] -scrape_configs: -- job_name: "etcd" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - kwok--etcd:2379 -- job_name: "kube-apiserver" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-apiserver:6443 -- job_name: "kube-controller-manager" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-controller-manager:10257 -- job_name: "kube-scheduler" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-scheduler:10259 -- job_name: "kwok-controller-metrics-discovery" - http_sd_configs: - - url: http://kwok--kwok-controller:10247/discovery/prometheus -- job_name: "kwok-controller" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - kwok--kwok-controller:10247 -- job_name: "prometheus" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:9090 -EOF -chmod 0644 /workdir/clusters//prometheus.yaml -cat </workdir/clusters//kubeconfig.yaml -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /workdir/clusters//pki/ca.crt - server: https://127.0.0.1:32766 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /workdir/clusters//pki/admin.crt - client-key: /workdir/clusters//pki/admin.key -EOF -cat </workdir/clusters//kubeconfig -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /etc/kubernetes/pki/ca.crt - server: https://kwok--kube-apiserver:6443 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /etc/kubernetes/pki/admin.crt - client-key: /etc/kubernetes/pki/admin.key -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -nerdctl network create kwok- --label=com.docker.compose.project=kwok- -nerdctl create --name=kwok--etcd --pull=never --entrypoint=etcd --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=32765:2379/tcp --env=TEST_KEY=TEST_VALUE registry.k8s.io/etcd:3.5.11-0 --name=node0 --auto-compaction-retention=1 --quota-backend-bytes=8589934592 --data-dir=/etcd-data --initial-advertise-peer-urls=http://0.0.0.0:2380 --listen-peer-urls=http://0.0.0.0:2380 --advertise-client-urls=http://0.0.0.0:2379 --listen-client-urls=http://0.0.0.0:2379 --initial-cluster=node0=http://0.0.0.0:2380 --log-level=debug -nerdctl create --name=kwok--kube-apiserver --pull=never --entrypoint=kube-apiserver --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=32766:6443/tcp --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/extras/apiserver:/extras/tmp --env=TEST_KEY=TEST_VALUE registry.k8s.io/kube-apiserver:v1.30.2 --etcd-prefix=/registry --allow-privileged=true --max-requests-inflight=0 --max-mutating-requests-inflight=0 --enable-priority-and-fairness=false --etcd-servers=http://kwok--etcd:2379 --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --secure-port=6443 --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --client-ca-file=/etc/kubernetes/pki/ca.crt --service-account-key-file=/etc/kubernetes/pki/admin.key --service-account-signing-key-file=/etc/kubernetes/pki/admin.key --service-account-issuer=https://kubernetes.default.svc.cluster.local --proxy-client-key-file=/etc/kubernetes/pki/admin.key --proxy-client-cert-file=/etc/kubernetes/pki/admin.crt --v=5 -nerdctl create --name=kwok--kube-controller-manager --pull=never --entrypoint=kube-controller-manager --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/extras/controller-manager:/extras/tmp --env=TEST_KEY=TEST_VALUE registry.k8s.io/kube-controller-manager:v1.30.2 --node-monitor-period=25s --node-monitor-grace-period=3m20s --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10257 --root-ca-file=/etc/kubernetes/pki/ca.crt --service-account-private-key-file=/etc/kubernetes/pki/admin.key --kube-api-qps=5000 --kube-api-burst=10000 --v=5 -nerdctl create --name=kwok--kube-scheduler --pull=never --entrypoint=kube-scheduler --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/extras/scheduler:/extras/tmp --env=TEST_KEY=TEST_VALUE registry.k8s.io/kube-scheduler:v1.30.2 --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10259 --kube-api-qps=5000 --kube-api-burst=10000 --v=5 -nerdctl create --name=kwok--kwok-controller --pull=never --entrypoint=kwok --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//kwok.yaml:~/.kwok/kwok.yaml:ro --volume=/extras/controller:/extras/tmp --env=TEST_KEY=TEST_VALUE localhost/kwok:test --manage-all-nodes=true --kubeconfig=~/.kube/config --config=~/.kwok/kwok.yaml --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --node-ip= --node-name=kwok--kwok-controller --node-port=10247 --server-address=0.0.0.0:10247 --node-lease-duration-seconds=200 --v=-4 -nerdctl create --name=kwok--prometheus --pull=never --entrypoint=prometheus --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=9090:9090/tcp --volume=/workdir/clusters//prometheus.yaml:/etc/prometheus/prometheus.yaml:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/extras/prometheus:/extras/tmp --env=TEST_KEY=TEST_VALUE docker.io/prom/prometheus:v2.53.0 --config.file=/etc/prometheus/prometheus.yaml --web.listen-address=0.0.0.0:9090 --log.level=debug -# Add context kwok- to ~/.kube/config -nerdctl start kwok--etcd -nerdctl start kwok--kube-apiserver -nerdctl start kwok--kube-controller-manager -nerdctl start kwok--kube-scheduler -nerdctl start kwok--kwok-controller -nerdctl start kwok--prometheus diff --git a/test/kwokctl/testdata/nerdctl/create_cluster_with_verbosity.txt b/test/kwokctl/testdata/nerdctl/create_cluster_with_verbosity.txt deleted file mode 100644 index acef5d3df..000000000 --- a/test/kwokctl/testdata/nerdctl/create_cluster_with_verbosity.txt +++ /dev/null @@ -1,194 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//logs -touch /workdir/clusters//logs/audit.log -cp /test/kwokctl/audit-policy.yaml /workdir/clusters//audit.yaml -mkdir -p /workdir/clusters//etcd -nerdctl pull registry.k8s.io/etcd:3.5.11-0 -nerdctl pull registry.k8s.io/kube-apiserver:v1.30.2 -cat </workdir/clusters//apiserver-tracing-config.yaml -apiVersion: apiserver.config.k8s.io/v1alpha1 -kind: TracingConfiguration -endpoint: kwok--jaeger:4317 -samplingRatePerMillion: 1000000 -EOF -nerdctl pull registry.k8s.io/kube-controller-manager:v1.30.2 -cp /test/kwokctl/scheduler-config.yaml /workdir/clusters//scheduler.yaml -cat <>/workdir/clusters//scheduler.yaml -clientConnection: - kubeconfig: "~/.kube/config" -EOF -nerdctl pull registry.k8s.io/kube-scheduler:v1.30.2 -nerdctl pull localhost/kwok:test -nerdctl pull registry.k8s.io/metrics-server/metrics-server:v0.7.1 -nerdctl pull docker.io/prom/prometheus:v2.53.0 -nerdctl pull docker.io/jaegertracing/all-in-one:1.58.1 -nerdctl pull docker.io/kubernetesui/dashboard:v2.7.0 -nerdctl pull docker.io/kubernetesui/metrics-scraper:v1.0.9 -cat </workdir/clusters//prometheus.yaml -global: - scrape_interval: 15s - scrape_timeout: 10s - evaluation_interval: 15s -alerting: - alertmanagers: - - follow_redirects: true - enable_http2: true - scheme: http - timeout: 10s - api_version: v2 - static_configs: - - targets: [] -scrape_configs: -- job_name: "etcd" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - kwok--etcd:2379 -- job_name: "kube-apiserver" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-apiserver:6443 -- job_name: "kube-controller-manager" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-controller-manager:10257 -- job_name: "kube-scheduler" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-scheduler:10259 -- job_name: "kwok-controller-metrics-discovery" - http_sd_configs: - - url: http://kwok--kwok-controller:10247/discovery/prometheus -- job_name: "kwok-controller" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - kwok--kwok-controller:10247 -- job_name: "metrics-server" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kwok-controller:4443 -- job_name: "prometheus" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:9090 -EOF -chmod 0644 /workdir/clusters//prometheus.yaml -cat </workdir/clusters//kubeconfig.yaml -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /workdir/clusters//pki/ca.crt - server: https://127.0.0.1:32766 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /workdir/clusters//pki/admin.crt - client-key: /workdir/clusters//pki/admin.key -EOF -cat </workdir/clusters//kubeconfig -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /etc/kubernetes/pki/ca.crt - server: https://kwok--kube-apiserver:6443 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /etc/kubernetes/pki/admin.crt - client-key: /etc/kubernetes/pki/admin.key -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -nerdctl network create kwok- --label=com.docker.compose.project=kwok- -nerdctl create --name=kwok--etcd --pull=never --entrypoint=etcd --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=32765:2379/tcp registry.k8s.io/etcd:3.5.11-0 --name=node0 --auto-compaction-retention=1 --quota-backend-bytes=8589934592 --data-dir=/etcd-data --initial-advertise-peer-urls=http://0.0.0.0:2380 --listen-peer-urls=http://0.0.0.0:2380 --advertise-client-urls=http://0.0.0.0:2379 --listen-client-urls=http://0.0.0.0:2379 --initial-cluster=node0=http://0.0.0.0:2380 --log-level=debug -nerdctl create --name=kwok--jaeger --pull=never --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=16686:16686/tcp docker.io/jaegertracing/all-in-one:1.58.1 --collector.otlp.enabled=true --query.http-server.host-port=0.0.0.0:16686 --log-level=debug -nerdctl create --name=kwok--kube-apiserver --pull=never --entrypoint=kube-apiserver --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=32766:6443/tcp --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//audit.yaml:/etc/kubernetes/audit-policy.yaml:ro --volume=/workdir/clusters//logs/audit.log:/var/log/kubernetes/audit/audit.log --volume=/workdir/clusters//apiserver-tracing-config.yaml:/etc/kubernetes/apiserver-tracing-config.yaml:ro registry.k8s.io/kube-apiserver:v1.30.2 --etcd-prefix=/registry --allow-privileged=true --max-requests-inflight=0 --max-mutating-requests-inflight=0 --enable-priority-and-fairness=false --etcd-servers=http://kwok--etcd:2379 --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --secure-port=6443 --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --client-ca-file=/etc/kubernetes/pki/ca.crt --service-account-key-file=/etc/kubernetes/pki/admin.key --service-account-signing-key-file=/etc/kubernetes/pki/admin.key --service-account-issuer=https://kubernetes.default.svc.cluster.local --proxy-client-key-file=/etc/kubernetes/pki/admin.key --proxy-client-cert-file=/etc/kubernetes/pki/admin.crt --audit-policy-file=/etc/kubernetes/audit-policy.yaml --audit-log-path=/var/log/kubernetes/audit/audit.log --tracing-config-file=/etc/kubernetes/apiserver-tracing-config.yaml --v=4 -nerdctl create --name=kwok--kube-controller-manager --pull=never --entrypoint=kube-controller-manager --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-controller-manager:v1.30.2 --node-monitor-period=25s --node-monitor-grace-period=3m20s --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10257 --root-ca-file=/etc/kubernetes/pki/ca.crt --service-account-private-key-file=/etc/kubernetes/pki/admin.key --kube-api-qps=5000 --kube-api-burst=10000 --v=4 -nerdctl create --name=kwok--kube-scheduler --pull=never --entrypoint=kube-scheduler --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//scheduler.yaml:/etc/kubernetes/scheduler.yaml:ro registry.k8s.io/kube-scheduler:v1.30.2 --config=/etc/kubernetes/scheduler.yaml --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10259 --kube-api-qps=5000 --kube-api-burst=10000 --v=4 -nerdctl create --name=kwok--kwok-controller --pull=never --entrypoint=kwok --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//kwok.yaml:~/.kwok/kwok.yaml:ro localhost/kwok:test --manage-all-nodes=true --kubeconfig=~/.kube/config --config=~/.kwok/kwok.yaml --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --node-ip= --node-name=kwok--kwok-controller --node-port=10247 --server-address=0.0.0.0:10247 --node-lease-duration-seconds=200 --v=DEBUG -nerdctl create --name=kwok--dashboard --pull=never --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=8000:8080/tcp --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/dashboard:v2.7.0 --insecure-bind-address=0.0.0.0 --bind-address=127.0.0.1 --port=0 --enable-insecure-login --enable-skip-login --disable-settings-authorizer --sidecar-host=kwok--dashboard-metrics-scraper:8000 --system-banner=Welcome to kwok- --kubeconfig=~/.kube/config --insecure-port=8080 -nerdctl create --name=kwok--metrics-server --pull=never --entrypoint=/metrics-server --network=kwok- --user=root --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/metrics-server/metrics-server:v0.7.1 --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --kubelet-use-node-status-port --kubelet-insecure-tls --metric-resolution=15s --bind-address=0.0.0.0 --secure-port=4443 --kubeconfig=~/.kube/config --authentication-kubeconfig=~/.kube/config --authorization-kubeconfig=~/.kube/config --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --v=4 -nerdctl create --name=kwok--prometheus --pull=never --entrypoint=prometheus --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=9090:9090/tcp --volume=/workdir/clusters//prometheus.yaml:/etc/prometheus/prometheus.yaml:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/prom/prometheus:v2.53.0 --config.file=/etc/prometheus/prometheus.yaml --web.listen-address=0.0.0.0:9090 --log.level=debug -nerdctl create --name=kwok--dashboard-metrics-scraper --pull=never --network=kwok- --user=root --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/metrics-scraper:v1.0.9 --db-file=/metrics.db --kubeconfig=~/.kube/config -# Add context kwok- to ~/.kube/config -nerdctl start kwok--etcd -nerdctl start kwok--jaeger -nerdctl start kwok--kube-apiserver -nerdctl start kwok--kube-controller-manager -nerdctl start kwok--kube-scheduler -nerdctl start kwok--kwok-controller -nerdctl start kwok--dashboard -nerdctl start kwok--metrics-server -nerdctl start kwok--prometheus -nerdctl start kwok--dashboard-metrics-scraper -# Set up apiservice for metrics server diff --git a/test/kwokctl/testdata/nerdctl/export_logs.txt b/test/kwokctl/testdata/nerdctl/export_logs.txt deleted file mode 100644 index 0722e6ab7..000000000 --- a/test/kwokctl/testdata/nerdctl/export_logs.txt +++ /dev/null @@ -1,10 +0,0 @@ -mkdir -p /logs/kwok- -cp /workdir/clusters//kwok.yaml /logs/kwok-/kwok.yaml -mkdir -p /logs/kwok-/components -nerdctl info >/logs/kwok-/nerdctl-info.txt -etcd logs kwok--etcd >/logs/kwok-/components/etcd.log -kube-apiserver logs kwok--kube-apiserver >/logs/kwok-/components/kube-apiserver.log -kube-controller-manager logs kwok--kube-controller-manager >/logs/kwok-/components/kube-controller-manager.log -kube-scheduler logs kwok--kube-scheduler >/logs/kwok-/components/kube-scheduler.log -kwok-controller logs kwok--kwok-controller >/logs/kwok-/components/kwok-controller.log -cp /workdir/clusters//logs/audit.log /logs/kwok-/components/audit.log diff --git a/test/kwokctl/testdata/nerdctl/snapshot_restore_etcd.txt b/test/kwokctl/testdata/nerdctl/snapshot_restore_etcd.txt deleted file mode 100644 index 2a44401e0..000000000 --- a/test/kwokctl/testdata/nerdctl/snapshot_restore_etcd.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Download https://github.com/etcd-io/etcd/releases/download/v3.5.11/etcd-v3.5.11--. and extract etcdctl to /workdir/clusters//bin/etcdctl -ETCDCTL_API=3 etcdctl snapshot restore ./snapshot-empty- --data-dir /workdir/clusters//etcd-data -nerdctl stop kwok--kube-apiserver --time=0 -nerdctl cp /workdir/clusters//etcd-data kwok--etcd:/ -nerdctl stop kwok--etcd --time=0 -nerdctl start kwok--etcd -nerdctl start kwok--kube-apiserver -nerdctl stop kwok--kwok-controller --time=0 -nerdctl start kwok--kwok-controller -nerdctl stop kwok--kube-controller-manager --time=0 -nerdctl start kwok--kube-controller-manager -nerdctl stop kwok--kube-scheduler --time=0 -nerdctl start kwok--kube-scheduler -nerdctl start kwok--kube-apiserver -rm -rf /workdir/clusters//etcd-data diff --git a/test/kwokctl/testdata/nerdctl/snapshot_save_etcd.txt b/test/kwokctl/testdata/nerdctl/snapshot_save_etcd.txt deleted file mode 100644 index d101d63b1..000000000 --- a/test/kwokctl/testdata/nerdctl/snapshot_save_etcd.txt +++ /dev/null @@ -1,2 +0,0 @@ -nerdctl exec --env=ETCDCTL_API=3 -i kwok--etcd etcdctl snapshot save /snapshot.db -nerdctl cp kwok--etcd:/snapshot.db ./snapshot-empty- diff --git a/test/kwokctl/testdata/nerdctl/start_cluster.txt b/test/kwokctl/testdata/nerdctl/start_cluster.txt deleted file mode 100644 index 5243f71c5..000000000 --- a/test/kwokctl/testdata/nerdctl/start_cluster.txt +++ /dev/null @@ -1,6 +0,0 @@ -nerdctl start kwok--etcd -nerdctl start kwok--kube-apiserver -nerdctl start kwok--kube-controller-manager -nerdctl start kwok--kube-scheduler -nerdctl start kwok--kwok-controller -nerdctl start kwok--prometheus diff --git a/test/kwokctl/testdata/nerdctl/stop_cluster.txt b/test/kwokctl/testdata/nerdctl/stop_cluster.txt deleted file mode 100644 index 1fd236492..000000000 --- a/test/kwokctl/testdata/nerdctl/stop_cluster.txt +++ /dev/null @@ -1,6 +0,0 @@ -nerdctl stop kwok--prometheus --time=0 -nerdctl stop kwok--kube-controller-manager --time=0 -nerdctl stop kwok--kube-scheduler --time=0 -nerdctl stop kwok--kwok-controller --time=0 -nerdctl stop kwok--kube-apiserver --time=0 -nerdctl stop kwok--etcd --time=0 diff --git a/test/kwokctl/testdata/podman/create_cluster.txt b/test/kwokctl/testdata/podman/create_cluster.txt deleted file mode 100644 index d355fdd67..000000000 --- a/test/kwokctl/testdata/podman/create_cluster.txt +++ /dev/null @@ -1,65 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//etcd -podman pull registry.k8s.io/etcd:3.5.11-0 -podman pull registry.k8s.io/kube-apiserver:v1.30.2 -podman pull registry.k8s.io/kube-controller-manager:v1.30.2 -podman pull registry.k8s.io/kube-scheduler:v1.30.2 -podman pull localhost/kwok:test -cat </workdir/clusters//kubeconfig.yaml -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /workdir/clusters//pki/ca.crt - server: https://127.0.0.1:32766 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /workdir/clusters//pki/admin.crt - client-key: /workdir/clusters//pki/admin.key -EOF -cat </workdir/clusters//kubeconfig -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /etc/kubernetes/pki/ca.crt - server: https://kwok--kube-apiserver:6443 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /etc/kubernetes/pki/admin.crt - client-key: /etc/kubernetes/pki/admin.key -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -podman network create kwok- --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- -podman create --name=kwok--etcd --pull=never --entrypoint=etcd --network=kwok- --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --publish=32765:2379/tcp registry.k8s.io/etcd:3.5.11-0 --name=node0 --auto-compaction-retention=1 --quota-backend-bytes=8589934592 --data-dir=/etcd-data --initial-advertise-peer-urls=http://0.0.0.0:2380 --listen-peer-urls=http://0.0.0.0:2380 --advertise-client-urls=http://0.0.0.0:2379 --listen-client-urls=http://0.0.0.0:2379 --initial-cluster=node0=http://0.0.0.0:2380 -podman create --name=kwok--kube-apiserver --pull=never --entrypoint=kube-apiserver --network=kwok- --requires=kwok--etcd --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --publish=32766:6443/tcp --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-apiserver:v1.30.2 --etcd-prefix=/registry --allow-privileged=true --max-requests-inflight=0 --max-mutating-requests-inflight=0 --enable-priority-and-fairness=false --etcd-servers=http://kwok--etcd:2379 --bind-address=0.0.0.0 --secure-port=6443 --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --client-ca-file=/etc/kubernetes/pki/ca.crt --service-account-key-file=/etc/kubernetes/pki/admin.key --service-account-signing-key-file=/etc/kubernetes/pki/admin.key --service-account-issuer=https://kubernetes.default.svc.cluster.local --proxy-client-key-file=/etc/kubernetes/pki/admin.key --proxy-client-cert-file=/etc/kubernetes/pki/admin.crt -podman create --name=kwok--kube-controller-manager --pull=never --entrypoint=kube-controller-manager --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-controller-manager:v1.30.2 --node-monitor-period=25s --node-monitor-grace-period=3m20s --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10257 --kube-api-qps=5000 --kube-api-burst=10000 -podman create --name=kwok--kube-scheduler --pull=never --entrypoint=kube-scheduler --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-scheduler:v1.30.2 --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10259 --kube-api-qps=5000 --kube-api-burst=10000 -podman create --name=kwok--kwok-controller --pull=never --entrypoint=kwok --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//kwok.yaml:~/.kwok/kwok.yaml:ro localhost/kwok:test --manage-all-nodes=true --kubeconfig=~/.kube/config --config=~/.kwok/kwok.yaml --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --node-ip= --node-name=kwok--kwok-controller --node-port=10247 --server-address=0.0.0.0:10247 --node-lease-duration-seconds=200 -# Add context kwok- to ~/.kube/config -podman start kwok--etcd -podman start kwok--kube-apiserver -podman start kwok--kube-controller-manager -podman start kwok--kube-scheduler -podman start kwok--kwok-controller diff --git a/test/kwokctl/testdata/podman/create_cluster_with_extra.txt b/test/kwokctl/testdata/podman/create_cluster_with_extra.txt deleted file mode 100644 index 68bd6387d..000000000 --- a/test/kwokctl/testdata/podman/create_cluster_with_extra.txt +++ /dev/null @@ -1,154 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//etcd -podman pull registry.k8s.io/etcd:3.5.11-0 -podman pull registry.k8s.io/kube-apiserver:v1.30.2 -podman pull registry.k8s.io/kube-controller-manager:v1.30.2 -podman pull registry.k8s.io/kube-scheduler:v1.30.2 -podman pull localhost/kwok:test -podman pull docker.io/prom/prometheus:v2.53.0 -cat </workdir/clusters//prometheus.yaml -global: - scrape_interval: 15s - scrape_timeout: 10s - evaluation_interval: 15s -alerting: - alertmanagers: - - follow_redirects: true - enable_http2: true - scheme: http - timeout: 10s - api_version: v2 - static_configs: - - targets: [] -scrape_configs: -- job_name: "etcd" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - kwok--etcd:2379 -- job_name: "kube-apiserver" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-apiserver:6443 -- job_name: "kube-controller-manager" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-controller-manager:10257 -- job_name: "kube-scheduler" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-scheduler:10259 -- job_name: "kwok-controller-metrics-discovery" - http_sd_configs: - - url: http://kwok--kwok-controller:10247/discovery/prometheus -- job_name: "kwok-controller" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - kwok--kwok-controller:10247 -- job_name: "prometheus" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:9090 -EOF -chmod 0644 /workdir/clusters//prometheus.yaml -cat </workdir/clusters//kubeconfig.yaml -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /workdir/clusters//pki/ca.crt - server: https://127.0.0.1:32766 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /workdir/clusters//pki/admin.crt - client-key: /workdir/clusters//pki/admin.key -EOF -cat </workdir/clusters//kubeconfig -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /etc/kubernetes/pki/ca.crt - server: https://kwok--kube-apiserver:6443 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /etc/kubernetes/pki/admin.crt - client-key: /etc/kubernetes/pki/admin.key -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -podman network create kwok- --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- -podman create --name=kwok--etcd --pull=never --entrypoint=etcd --network=kwok- --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --publish=32765:2379/tcp --env=TEST_KEY=TEST_VALUE registry.k8s.io/etcd:3.5.11-0 --name=node0 --auto-compaction-retention=1 --quota-backend-bytes=8589934592 --data-dir=/etcd-data --initial-advertise-peer-urls=http://0.0.0.0:2380 --listen-peer-urls=http://0.0.0.0:2380 --advertise-client-urls=http://0.0.0.0:2379 --listen-client-urls=http://0.0.0.0:2379 --initial-cluster=node0=http://0.0.0.0:2380 --log-level=debug -podman create --name=kwok--kube-apiserver --pull=never --entrypoint=kube-apiserver --network=kwok- --requires=kwok--etcd --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --publish=32766:6443/tcp --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/extras/apiserver:/extras/tmp --env=TEST_KEY=TEST_VALUE registry.k8s.io/kube-apiserver:v1.30.2 --etcd-prefix=/registry --allow-privileged=true --max-requests-inflight=0 --max-mutating-requests-inflight=0 --enable-priority-and-fairness=false --etcd-servers=http://kwok--etcd:2379 --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --secure-port=6443 --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --client-ca-file=/etc/kubernetes/pki/ca.crt --service-account-key-file=/etc/kubernetes/pki/admin.key --service-account-signing-key-file=/etc/kubernetes/pki/admin.key --service-account-issuer=https://kubernetes.default.svc.cluster.local --proxy-client-key-file=/etc/kubernetes/pki/admin.key --proxy-client-cert-file=/etc/kubernetes/pki/admin.crt --v=5 -podman create --name=kwok--kube-controller-manager --pull=never --entrypoint=kube-controller-manager --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/extras/controller-manager:/extras/tmp --env=TEST_KEY=TEST_VALUE registry.k8s.io/kube-controller-manager:v1.30.2 --node-monitor-period=25s --node-monitor-grace-period=3m20s --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10257 --root-ca-file=/etc/kubernetes/pki/ca.crt --service-account-private-key-file=/etc/kubernetes/pki/admin.key --kube-api-qps=5000 --kube-api-burst=10000 --v=5 -podman create --name=kwok--kube-scheduler --pull=never --entrypoint=kube-scheduler --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/extras/scheduler:/extras/tmp --env=TEST_KEY=TEST_VALUE registry.k8s.io/kube-scheduler:v1.30.2 --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10259 --kube-api-qps=5000 --kube-api-burst=10000 --v=5 -podman create --name=kwok--kwok-controller --pull=never --entrypoint=kwok --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//kwok.yaml:~/.kwok/kwok.yaml:ro --volume=/extras/controller:/extras/tmp --env=TEST_KEY=TEST_VALUE localhost/kwok:test --manage-all-nodes=true --kubeconfig=~/.kube/config --config=~/.kwok/kwok.yaml --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --node-ip= --node-name=kwok--kwok-controller --node-port=10247 --server-address=0.0.0.0:10247 --node-lease-duration-seconds=200 --v=-4 -podman create --name=kwok--prometheus --pull=never --entrypoint=prometheus --network=kwok- --requires=kwok--etcd --requires=kwok--kube-apiserver --requires=kwok--kube-controller-manager --requires=kwok--kube-scheduler --requires=kwok--kwok-controller --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --publish=9090:9090/tcp --volume=/workdir/clusters//prometheus.yaml:/etc/prometheus/prometheus.yaml:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/extras/prometheus:/extras/tmp --env=TEST_KEY=TEST_VALUE docker.io/prom/prometheus:v2.53.0 --config.file=/etc/prometheus/prometheus.yaml --web.listen-address=0.0.0.0:9090 --log.level=debug -# Add context kwok- to ~/.kube/config -podman start kwok--etcd -podman start kwok--kube-apiserver -podman start kwok--kube-controller-manager -podman start kwok--kube-scheduler -podman start kwok--kwok-controller -podman start kwok--prometheus diff --git a/test/kwokctl/testdata/podman/create_cluster_with_verbosity.txt b/test/kwokctl/testdata/podman/create_cluster_with_verbosity.txt deleted file mode 100644 index 247fe6510..000000000 --- a/test/kwokctl/testdata/podman/create_cluster_with_verbosity.txt +++ /dev/null @@ -1,194 +0,0 @@ -# Save cluster config to /workdir/clusters//kwok.yaml -mkdir -p /workdir/clusters/ -mkdir -p /workdir/clusters//pki -# Generate PKI to /workdir/clusters//pki -mkdir -p /workdir/clusters//logs -touch /workdir/clusters//logs/audit.log -cp /test/kwokctl/audit-policy.yaml /workdir/clusters//audit.yaml -mkdir -p /workdir/clusters//etcd -podman pull registry.k8s.io/etcd:3.5.11-0 -podman pull registry.k8s.io/kube-apiserver:v1.30.2 -cat </workdir/clusters//apiserver-tracing-config.yaml -apiVersion: apiserver.config.k8s.io/v1alpha1 -kind: TracingConfiguration -endpoint: kwok--jaeger:4317 -samplingRatePerMillion: 1000000 -EOF -podman pull registry.k8s.io/kube-controller-manager:v1.30.2 -cp /test/kwokctl/scheduler-config.yaml /workdir/clusters//scheduler.yaml -cat <>/workdir/clusters//scheduler.yaml -clientConnection: - kubeconfig: "~/.kube/config" -EOF -podman pull registry.k8s.io/kube-scheduler:v1.30.2 -podman pull localhost/kwok:test -podman pull registry.k8s.io/metrics-server/metrics-server:v0.7.1 -podman pull docker.io/prom/prometheus:v2.53.0 -podman pull docker.io/jaegertracing/all-in-one:1.58.1 -podman pull docker.io/kubernetesui/dashboard:v2.7.0 -podman pull docker.io/kubernetesui/metrics-scraper:v1.0.9 -cat </workdir/clusters//prometheus.yaml -global: - scrape_interval: 15s - scrape_timeout: 10s - evaluation_interval: 15s -alerting: - alertmanagers: - - follow_redirects: true - enable_http2: true - scheme: http - timeout: 10s - api_version: v2 - static_configs: - - targets: [] -scrape_configs: -- job_name: "etcd" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - kwok--etcd:2379 -- job_name: "kube-apiserver" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-apiserver:6443 -- job_name: "kube-controller-manager" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-controller-manager:10257 -- job_name: "kube-scheduler" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kube-scheduler:10259 -- job_name: "kwok-controller-metrics-discovery" - http_sd_configs: - - url: http://kwok--kwok-controller:10247/discovery/prometheus -- job_name: "kwok-controller" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - kwok--kwok-controller:10247 -- job_name: "metrics-server" - scheme: https - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - tls_config: - cert_file: "/etc/kubernetes/pki/admin.crt" - key_file: "/etc/kubernetes/pki/admin.key" - insecure_skip_verify: true - static_configs: - - targets: - - kwok--kwok-controller:4443 -- job_name: "prometheus" - scheme: http - honor_timestamps: true - metrics_path: /metrics - follow_redirects: true - enable_http2: true - static_configs: - - targets: - - 127.0.0.1:9090 -EOF -chmod 0644 /workdir/clusters//prometheus.yaml -cat </workdir/clusters//kubeconfig.yaml -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /workdir/clusters//pki/ca.crt - server: https://127.0.0.1:32766 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /workdir/clusters//pki/admin.crt - client-key: /workdir/clusters//pki/admin.key -EOF -cat </workdir/clusters//kubeconfig -apiVersion: v1 -clusters: -- cluster: - certificate-authority: /etc/kubernetes/pki/ca.crt - server: https://kwok--kube-apiserver:6443 - name: kwok- -contexts: -- context: - cluster: kwok- - user: kwok- - name: kwok- -current-context: kwok- -kind: Config -preferences: {} -users: -- name: kwok- - user: - client-certificate: /etc/kubernetes/pki/admin.crt - client-key: /etc/kubernetes/pki/admin.key -EOF -# Save cluster config to /workdir/clusters//kwok.yaml -podman network create kwok- --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- -podman create --name=kwok--etcd --pull=never --entrypoint=etcd --network=kwok- --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --publish=32765:2379/tcp registry.k8s.io/etcd:3.5.11-0 --name=node0 --auto-compaction-retention=1 --quota-backend-bytes=8589934592 --data-dir=/etcd-data --initial-advertise-peer-urls=http://0.0.0.0:2380 --listen-peer-urls=http://0.0.0.0:2380 --advertise-client-urls=http://0.0.0.0:2379 --listen-client-urls=http://0.0.0.0:2379 --initial-cluster=node0=http://0.0.0.0:2380 --log-level=debug -podman create --name=kwok--jaeger --pull=never --network=kwok- --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --publish=16686:16686/tcp docker.io/jaegertracing/all-in-one:1.58.1 --collector.otlp.enabled=true --query.http-server.host-port=0.0.0.0:16686 --log-level=debug -podman create --name=kwok--kube-apiserver --pull=never --entrypoint=kube-apiserver --network=kwok- --requires=kwok--etcd --requires=kwok--jaeger --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --publish=32766:6443/tcp --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//audit.yaml:/etc/kubernetes/audit-policy.yaml:ro --volume=/workdir/clusters//logs/audit.log:/var/log/kubernetes/audit/audit.log --volume=/workdir/clusters//apiserver-tracing-config.yaml:/etc/kubernetes/apiserver-tracing-config.yaml:ro registry.k8s.io/kube-apiserver:v1.30.2 --etcd-prefix=/registry --allow-privileged=true --max-requests-inflight=0 --max-mutating-requests-inflight=0 --enable-priority-and-fairness=false --etcd-servers=http://kwok--etcd:2379 --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --secure-port=6443 --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --client-ca-file=/etc/kubernetes/pki/ca.crt --service-account-key-file=/etc/kubernetes/pki/admin.key --service-account-signing-key-file=/etc/kubernetes/pki/admin.key --service-account-issuer=https://kubernetes.default.svc.cluster.local --proxy-client-key-file=/etc/kubernetes/pki/admin.key --proxy-client-cert-file=/etc/kubernetes/pki/admin.crt --audit-policy-file=/etc/kubernetes/audit-policy.yaml --audit-log-path=/var/log/kubernetes/audit/audit.log --tracing-config-file=/etc/kubernetes/apiserver-tracing-config.yaml --v=4 -podman create --name=kwok--kube-controller-manager --pull=never --entrypoint=kube-controller-manager --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-controller-manager:v1.30.2 --node-monitor-period=25s --node-monitor-grace-period=3m20s --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10257 --root-ca-file=/etc/kubernetes/pki/ca.crt --service-account-private-key-file=/etc/kubernetes/pki/admin.key --kube-api-qps=5000 --kube-api-burst=10000 --v=4 -podman create --name=kwok--kube-scheduler --pull=never --entrypoint=kube-scheduler --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//scheduler.yaml:/etc/kubernetes/scheduler.yaml:ro registry.k8s.io/kube-scheduler:v1.30.2 --config=/etc/kubernetes/scheduler.yaml --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10259 --kube-api-qps=5000 --kube-api-burst=10000 --v=4 -podman create --name=kwok--kwok-controller --pull=never --entrypoint=kwok --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//kwok.yaml:~/.kwok/kwok.yaml:ro localhost/kwok:test --manage-all-nodes=true --kubeconfig=~/.kube/config --config=~/.kwok/kwok.yaml --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --node-ip= --node-name=kwok--kwok-controller --node-port=10247 --server-address=0.0.0.0:10247 --node-lease-duration-seconds=200 --v=DEBUG -podman create --name=kwok--dashboard --pull=never --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --publish=8000:8080/tcp --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/dashboard:v2.7.0 --insecure-bind-address=0.0.0.0 --bind-address=127.0.0.1 --port=0 --enable-insecure-login --enable-skip-login --disable-settings-authorizer --sidecar-host=kwok--dashboard-metrics-scraper:8000 --system-banner=Welcome to kwok- --kubeconfig=~/.kube/config --insecure-port=8080 -podman create --name=kwok--metrics-server --pull=never --entrypoint=/metrics-server --network=kwok- --user=root --requires=kwok--kwok-controller --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/metrics-server/metrics-server:v0.7.1 --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --kubelet-use-node-status-port --kubelet-insecure-tls --metric-resolution=15s --bind-address=0.0.0.0 --secure-port=4443 --kubeconfig=~/.kube/config --authentication-kubeconfig=~/.kube/config --authorization-kubeconfig=~/.kube/config --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --v=4 -podman create --name=kwok--prometheus --pull=never --entrypoint=prometheus --network=kwok- --requires=kwok--etcd --requires=kwok--kube-apiserver --requires=kwok--kube-controller-manager --requires=kwok--kube-scheduler --requires=kwok--kwok-controller --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --publish=9090:9090/tcp --volume=/workdir/clusters//prometheus.yaml:/etc/prometheus/prometheus.yaml:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/prom/prometheus:v2.53.0 --config.file=/etc/prometheus/prometheus.yaml --web.listen-address=0.0.0.0:9090 --log.level=debug -podman create --name=kwok--dashboard-metrics-scraper --pull=never --network=kwok- --user=root --requires=kwok--metrics-server --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/metrics-scraper:v1.0.9 --db-file=/metrics.db --kubeconfig=~/.kube/config -# Add context kwok- to ~/.kube/config -podman start kwok--etcd -podman start kwok--jaeger -podman start kwok--kube-apiserver -podman start kwok--kube-controller-manager -podman start kwok--kube-scheduler -podman start kwok--kwok-controller -podman start kwok--dashboard -podman start kwok--metrics-server -podman start kwok--prometheus -podman start kwok--dashboard-metrics-scraper -# Set up apiservice for metrics server diff --git a/test/kwokctl/testdata/podman/export_logs.txt b/test/kwokctl/testdata/podman/export_logs.txt deleted file mode 100644 index ef484a9e6..000000000 --- a/test/kwokctl/testdata/podman/export_logs.txt +++ /dev/null @@ -1,10 +0,0 @@ -mkdir -p /logs/kwok- -cp /workdir/clusters//kwok.yaml /logs/kwok-/kwok.yaml -mkdir -p /logs/kwok-/components -podman info >/logs/kwok-/podman-info.txt -etcd logs kwok--etcd >/logs/kwok-/components/etcd.log -kube-apiserver logs kwok--kube-apiserver >/logs/kwok-/components/kube-apiserver.log -kube-controller-manager logs kwok--kube-controller-manager >/logs/kwok-/components/kube-controller-manager.log -kube-scheduler logs kwok--kube-scheduler >/logs/kwok-/components/kube-scheduler.log -kwok-controller logs kwok--kwok-controller >/logs/kwok-/components/kwok-controller.log -cp /workdir/clusters//logs/audit.log /logs/kwok-/components/audit.log diff --git a/test/kwokctl/testdata/podman/snapshot_restore_etcd.txt b/test/kwokctl/testdata/podman/snapshot_restore_etcd.txt deleted file mode 100644 index 38e65d7a4..000000000 --- a/test/kwokctl/testdata/podman/snapshot_restore_etcd.txt +++ /dev/null @@ -1,14 +0,0 @@ -# Download https://github.com/etcd-io/etcd/releases/download/v3.5.11/etcd-v3.5.11--. and extract etcdctl to /workdir/clusters//bin/etcdctl -ETCDCTL_API=3 etcdctl snapshot restore ./snapshot-empty- --data-dir /workdir/clusters//etcd-data -podman stop kwok--etcd --time=0 -podman stop kwok--kube-apiserver --time=0 -podman cp /workdir/clusters//etcd-data kwok--etcd:/ -podman start kwok--etcd -podman start kwok--kube-apiserver -podman stop kwok--kwok-controller --time=0 -podman start kwok--kwok-controller -podman stop kwok--kube-controller-manager --time=0 -podman start kwok--kube-controller-manager -podman stop kwok--kube-scheduler --time=0 -podman start kwok--kube-scheduler -rm -rf /workdir/clusters//etcd-data diff --git a/test/kwokctl/testdata/podman/snapshot_save_etcd.txt b/test/kwokctl/testdata/podman/snapshot_save_etcd.txt deleted file mode 100644 index 0d0bfc1be..000000000 --- a/test/kwokctl/testdata/podman/snapshot_save_etcd.txt +++ /dev/null @@ -1,2 +0,0 @@ -podman exec --env=ETCDCTL_API=3 -i kwok--etcd etcdctl snapshot save /snapshot.db -podman cp kwok--etcd:/snapshot.db ./snapshot-empty- diff --git a/test/kwokctl/testdata/podman/start_cluster.txt b/test/kwokctl/testdata/podman/start_cluster.txt deleted file mode 100644 index c1c82b519..000000000 --- a/test/kwokctl/testdata/podman/start_cluster.txt +++ /dev/null @@ -1,6 +0,0 @@ -podman start kwok--etcd -podman start kwok--kube-apiserver -podman start kwok--kube-controller-manager -podman start kwok--kube-scheduler -podman start kwok--kwok-controller -podman start kwok--prometheus diff --git a/test/kwokctl/testdata/podman/stop_cluster.txt b/test/kwokctl/testdata/podman/stop_cluster.txt deleted file mode 100644 index b98f8e0d6..000000000 --- a/test/kwokctl/testdata/podman/stop_cluster.txt +++ /dev/null @@ -1,6 +0,0 @@ -podman stop kwok--prometheus --time=0 -podman stop kwok--kube-controller-manager --time=0 -podman stop kwok--kube-scheduler --time=0 -podman stop kwok--kwok-controller --time=0 -podman stop kwok--kube-apiserver --time=0 -podman stop kwok--etcd --time=0