[
  {
    "path": ".circleci/config.yml",
    "content": "version: 2\njobs:\n  build:\n    machine:\n      enabled: true\n    steps:\n    - checkout\n    - run: ./kind-smoketest.sh\n"
  },
  {
    "path": ".github/workflows/kind.yml",
    "content": "name: Kind\non: [push, pull_request]\njobs:\n  test-unit:\n    name: Create a Kind cluster\n    runs-on: [ubuntu-latest]\n    steps:\n    - uses: actions/checkout@v1\n    - uses: actions/setup-go@v1\n      with:\n        go-version: 1.13\n    - name: Install latest version of Kind\n      run: |\n        GO111MODULE=on go get sigs.k8s.io/kind\n    - name: Create Kind cluster\n      run: |\n        PATH=$(go env GOPATH)/bin:$PATH kind create cluster --config kind-config.yaml\n    - name: Run some sanity checks\n      # kubectl is already installed on the Github Ubuntu worker\n      run: |\n        kubectl get nodes -o wide\n        kubectl get pods --all-namespaces -o wide\n        kubectl get services --all-namespaces -o wide\n"
  },
  {
    "path": ".gitlab-ci.yml",
    "content": "image: docker:stable\nvariables:\n  KUBECTL: v1.17.0\n  KIND: v0.8.1\nservices:\n  - docker:dind\nstages:\n  - test\ntest:\n  stage: test\n  script:\n    - apk add -U wget\n    - wget -O /usr/local/bin/kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND}/kind-linux-amd64\n    - chmod +x /usr/local/bin/kind\n    - wget -O /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBECTL}/bin/linux/amd64/kubectl\n    - chmod +x /usr/local/bin/kubectl\n    - kind create cluster --config=./gitlab/kind-config.yaml\n    - sed -i -E -e 's/localhost|0\\.0\\.0\\.0/docker/g' \"$HOME/.kube/config\"\n    - kubectl get nodes -o wide\n    - kubectl get pods --all-namespaces -o wide\n    - kubectl get services --all-namespaces -o wide\n"
  },
  {
    "path": ".travis.yml",
    "content": "sudo: required\nlanguage: go\ngo:\n    - \"1.14\"\n\nservices:\n  - docker\n\ninstall: true\n\nscript: \n  - echo \"Run your tests here\"\n\nbefore_install:\n  # Download and install Kind and kubectl\n  - GO111MODULE=on go get sigs.k8s.io/kind\n  - kind create cluster --config kind-config.yaml\n  - export KUBECONFIG=\"$(kind get kubeconfig-path --name=\"kind\")\"\n  - curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl\n  - chmod +x ./kubectl\n  - ./kubectl get nodes -o wide\n  - ./kubectl get pods --all-namespaces -o wide\n  - ./kubectl get services --all-namespaces -o wide\n\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "# Examples\n\nThis repository provides samples and testing for running [sigs.k8s.io/kind](https://sigs.k8s.io/kind) on various CI platforms.\n\n## Supported / Tested CI Platforms\n\n\nFor any platform not yet listed or listed as \"Unsure :question:\" we are looking for your help!\nPlease file Pull Requests and / or Issues for missing CI platforms :smile:\n\n| Platform | Known to Work? | Status |\n|---|---|--|\n| [CircleCI](https://circleci.com/) | [Yes](.circleci) :heavy_check_mark: | [![CircleCI](https://circleci.com/gh/kind-ci/examples.svg?style=svg)](https://circleci.com/gh/kind-ci/examples) |\n| [Travis CI](https://travis-ci.com/) | [Yes](.travis.yml) :heavy_check_mark: | [![Travis CI](https://travis-ci.com/kind-ci/examples.svg?branch=master)](https://travis-ci.com/kind-ci/examples/) |\n| [Prow](https://github.com/kubernetes/test-infra/tree/master/prow) | [Yes](https://github.com/kubernetes/test-infra/tree/master/config/jobs/kubernetes-sigs/kind) :heavy_check_mark: | [![Prow](https://prow.k8s.io/badge.svg?jobs=ci-kubernetes-kind-e2e-parallel)](https://prow.k8s.io/?job=ci-kubernetes-kind-e2e-parallel) |\n| [Concourse](https://concourse-ci.org/) | [Yes](concourse.md) :heavy_check_mark: | [![Concourse k8s](https://hush-house.pivotal.io/api/v1/teams/k8s-c10s/pipelines/kind/badge)](https://hush-house.pivotal.io/teams/k8s-c10s/pipelines/kind?group=all) |\n| [Github](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-continuous-integration) | [Yes](.github/workflows/kind.yml) :heavy_check_mark: | ![Github](https://github.com/kind-ci/examples/workflows/Kind/badge.svg) |\n| [Gitlab](https://about.gitlab.com/product/continuous-integration/) | [Yes](.gitlab-ci.yml) :heavy_check_mark: | ![Gitlab](https://gitlab.com/kind-ci/examples/badges/master/pipeline.svg) |\n| [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) | [Yes](azure-pipelines.yml) :heavy_check_mark: | ![Azure Pipelines](https://dev.azure.com/kind-ci/examples/_apis/build/status/examples?api-version=5.1-preview.1) |\n| [Drone](https://drone.io/) | [Yes](./drone) :heavy_check_mark: | None |\n| [Google Cloud Build](https://cloud.google.com/cloud-build/) | [Yes](./gcb.md) :heavy_check_mark: | None |\n| [BuildKite](https://buildkite.com/) | Unsure :question: | None |\n| [CodeShip](https://codeship.com/) | Unsure :question: | None |\n"
  },
  {
    "path": "azure-pipelines.yml",
    "content": "trigger:\n  - master\n\npool:\n  vmImage: 'Ubuntu 18.04'\n\nsteps:\n- task: GoTool@0\n  inputs:\n    version: '1.13.7'\n    goBin: '$(Agent.HomeDirectory)/bin'\n\n- script: GO111MODULE=\"on\" go get sigs.k8s.io/kind@v0.8.1\n  displayName: 'Install kind'\n\n- script: $(GOBIN)/kind create cluster\n  displayName: 'Deploying kind cluster'\n\n- script: kubectl cluster-info --context kind-kind\n  displayName: 'Show cluster info'\n"
  },
  {
    "path": "concourse.md",
    "content": "# `kind` on `concourse` with [`kind-on-c`][kind-on-c]\n\n## Quick Intro\n\nTo run [kind] in a [concourse] task you can use [kind-on-c]. \nThe project aims to provide an easy, nice, and \"concourse-native\" experience\nfor concourse pipeline authors by supplying a reusable concourse task\ndefinition and task container.\n\n[kind-on-c] supports primarily two modes:\n- pull and run the node images provided by `kind`\n- pull the source of kubernetes in a specific revision and create a node image\n  on the fly\n\nMore information on supported kubernetes versions and features can be found at\n[the project's github][kind-on-c] or its [automated test\npipeline][ci] (see also: [pipeline source][ci-src]).\n\n## Example pipeline stub\n\n```yaml\n# ...\njobs:\n- name: kind\n  plan:\n  - in_parallel:\n    - get: kind-on-c\n    - get: kind-release\n      params:\n        globs:\n        - kind-linux-amd64\n  - task: run-kind\n    privileged: true\n    file: kind-on-c/kind.yaml\n    params:\n      KIND_TESTS: |\n        # your actual tests go here!\n        kubectl get nodes -o wide\n# ...\nresources:\n- name: kind-release\n  type: github-release\n  source:\n    owner: kubernetes-sigs\n    repository: kind\n    access_token: <some github token>\n    pre_release: true\n- name: kind-on-c\n  type: git\n  source:\n    uri: https://github.com/pivotal-k8s/kind-on-c\n# ...\n```\n\n[kind]: //kind.sigs.k8s.io/\n[concourse]: //concourse-ci.org/\n[kind-on-c]: //github.com/pivotal-k8s/kind-on-c\n[ci]: //hush-house.pivotal.io/teams/k8s-c10s/pipelines/kind\n[ci-src]: //github.com/pivotal-k8s/kind-on-c/tree/master/ci/\n"
  },
  {
    "path": "drone/.drone.yml",
    "content": "---\nkind: pipeline\nname: test\n\nplatform:\n  os: linux\n  arch: amd64\n\nsteps:\n  - name: setup\n    image: docker:stable\n    pull: always\n    depends_on: [ clone ]\n    environment:\n      CLUSTER_HOST: docker\n      CLUSTER_NAME: kind-cluster\n      KUBECONFIG: /mnt/config/admin.conf\n    commands:\n      - ./drone/install.sh\n      - ./drone/setup.sh\n      - kubectl get nodes\n    volumes:\n      - name: dockersock\n        path: /var/run\n      - name: kubeconfig\n        path: /mnt/config\n    when:\n      event:\n      - push\n\n  - name: test\n    image: alpine:3.14\n    pull: always\n    depends_on: [ setup ]\n    environment:\n      KUBECONFIG: /mnt/config/admin.conf\n    commands:\n      - ./drone/install.sh\n      - kubectl get nodes\n    volumes:\n      - name: kubeconfig\n        path: /mnt/config\n    when:\n      event:\n      - push\n\nservices:\n- name: docker\n  image: docker:dind\n  privileged: true\n  volumes:\n  - name: dockersock\n    path: /var/run\n\nvolumes:\n- name: dockersock\n  temp: {}\n- name: kubeconfig\n  temp: {}\n"
  },
  {
    "path": "drone/README.md",
    "content": "# DRONE PIPELINE EXAMPLE\n\nAn example drone pipeline using kind to create a kind cluster.\n\nFor the sake of simplicity all dependencies will be installed at runtime, but a more complete example can be found in the [fury-kubernetes-monitoring project](https://github.com/sighupio/fury-kubernetes-monitoring/blob/master/.drone.yml) using the image built from [fury-images](https://github.com/sighupio/fury-images/tree/master/kind).\n\nWe have chosen to use a docker service, sharing the docker socket with the pipeline step creating the cluster.\nIf access to the cluster is needed from successive steps, only the kubeconfig file has to be mounted and used as in the example.\n\n## N.B.\n- the project's repository has to be flagged as \"trusted\" from drone reposistory's settings due to the docker service having `privileged: true` set\n- the teardown of the cluster will be managed from the docker service, no need to `kind delete cluster` explicitly\n- the docker service name (here \"docker\") has to be added to \"/apiServer/certSANs\" as can be seen in the \"kubeadmConfigPatchesJson6902\" in [kind-config](./kind-config)\n"
  },
  {
    "path": "drone/install.sh",
    "content": "# standard bash error handling\nset -o errexit;\nset -o pipefail;\nset -o nounset;\n# debug commands\nset -x;\n\nKUBECTL=v1.21.0\nKIND=v0.11.0\n\ninstall(){\n  wget -O /usr/local/bin/$1 $2\n  chmod +x /usr/local/bin/$1\n}\n\n# installing kind\ninstall \"kind\" \"https://github.com/kubernetes-sigs/kind/releases/download/${KIND}/kind-linux-amd64\"\n\n#installing kubectl\ninstall \"kubectl\" \"https://storage.googleapis.com/kubernetes-release/release/${KUBECTL}/bin/linux/amd64/kubectl\"\n"
  },
  {
    "path": "drone/kind-config",
    "content": "apiVersion: kind.x-k8s.io/v1alpha4\nkind: Cluster\nname: test\nnetworking:\n  apiServerAddress: \"0.0.0.0\"\n\nnodes:\n# add to the apiServer certSANs the name of the drone service in order to be able to reach the cluster through it\n- role: control-plane\n  kubeadmConfigPatches:\n  - |\n    kind: ClusterConfiguration\n    apiServer:\n      certSANs:\n      - \"docker\"\n- role: worker\n"
  },
  {
    "path": "drone/setup.sh",
    "content": "# standard bash error handling\nset -o errexit;\nset -o pipefail;\nset -o nounset;\n# debug commands\nset -x;\n\n\nkind create cluster --name \"$CLUSTER_NAME\" --config drone/kind-config --wait 1m\n\n#replace localhost or 0.0.0.0 in the kubeconfig file with \"docker\", in order to be able to reach the cluster through the docker service\nsed -i -E -e 's/localhost|0\\.0\\.0\\.0/'\"$CLUSTER_HOST\"'/g' ${KUBECONFIG}\n\nkubectl wait node --all --for condition=ready\n"
  },
  {
    "path": "gcb.md",
    "content": "# `kind` on Google Cloud Build\n\nThis is very much a **hack**. Don't use this for real, take inspiration from it\nat max!\n\nThe biggest hacks here are:\n- using `awk` to \"parse\" out the port that exposes the APIServer from an URL in\n  a yaml file\n- the forwarding of the port from the host into the container where `kind` and\n  the actual test is running:\n  - inside the container, where `kind` and the actual test runs, we start a\n    `socat` process which listens on a tcp port\n  - when a connection to that port inside the container is made, we start\n    another container in the host's network namespace. That container is able\n    to connect to the exposed port on the host. Both `socat` processes are\n    connected via their Stdin & Stdout.\n  - we've essentially created a tunnel from within the container to the host\n    for this one port\n  - by default, `kind` exposes the APIServer on localhost (on the host), thus\n    the kubeconfig file will hold something like `https://127.0.0.1:XXX/` as\n    the server URL. Thus if we use the same port inside the container that\n    `kind` has setup on the host, we can just use the same kubeconfig.\n\n## Example `cloudbuild.yml`\n\nThe following cloud build config can be used by running\n\n```sh\ngcloud builds submit --config cloudbuild.yml --no-source\n```\n\nand will:\n\n- download current version of `kubectl`\n- compile `kind` from the tip of master\n- run `kind` to create a cluster\n- start a portforwarder to make the kube-apiserver accessible\n\nThere are two things which can be configured via `--substitutions`, none of\nwhich is mandatory:\n- `KIND_CONFIG`: a [configuration for kind][kind-config]\n- `KIND_TESTS`: whatever should be run after the cluster hast been created,\n  `KUBECONFIG` is setup for you\n\nExamples on what the substitutions could look like can be found in the following `cloudbuild.yml`.\n\n[kind-config]: https://kind.sigs.k8s.io/docs/user/quick-start/#configuring-your-kind-cluster\n\n```yaml\nsteps:\n- name: 'gcr.io/cloud-builders/git'\n  args:\n  - clone\n  - https://github.com/kubernetes-sigs/kind\n  - src/kind\n- name: 'gcr.io/cloud-builders/docker'\n  entrypoint: bash\n  dir: bin\n  args:\n  - -c\n  - |\n    curl -L https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl > kubectl\n    chmod 0750 kubectl\n- name: golang\n  dir: src/kind\n  env:\n  - CGO_ENABLED=0\n  - GO111MODULE=on\n  args:\n  - go\n  - build\n  - -o\n  - ../../bin/kind\n- name: 'gcr.io/cloud-builders/docker'\n  entrypoint: bash\n  args:\n  - -xeuc\n  - |\n    PATH=\"$${PATH}:$${PWD}/bin\"\n\n    {\n      apt-get update -y\n      apt-get install -y socat\n    } >/dev/null\n\n    kindArgs=( create cluster )\n\n    if [ -n \"$_KIND_CONFIG\" ]\n    then\n      echo \"$_KIND_CONFIG\" > /tmp/kind-config.yml\n      kindArgs+=( --config=/tmp/kind-config.yml )\n    fi\n\n    kind \"$${kindArgs[@]}\"\n\n    KUBECONFIG=\"$$(mktemp)\"\n    kind get kubeconfig > \"$$KUBECONFIG\"\n    export KUBECONFIG\n\n    startForwarder() {\n      local port\n      # Gets the apiServerPort from the KUBECONFIG file.\n      port=\"$( awk -F: '/server:/{ print $4 }' \"$$KUBECONFIG\" )\"\n      socat \\\n        TCP-LISTEN:${port},reuseaddr,fork \\\n        \"EXEC:docker run --rm -i --network=host alpine/socat 'STDIO TCP-CONNECT:localhost:${port}'\"\n    }\n    startForwarder &\n\n    bash -xeuc \"${_KIND_TESTS}\"\n\nsubstitutions:\n  _KIND_TESTS: |\n    kubectl get nodes -o wide\n  _KIND_CONFIG: |\n    kind: Cluster\n    apiVersion: kind.x-k8s.io/v1alpha4\n    nodes:\n    - role: control-plane\n    - role: worker\n```\n"
  },
  {
    "path": "gitlab/kind-config.yaml",
    "content": "apiVersion: kind.x-k8s.io/v1alpha4\nkind: Cluster\nnetworking:\n  apiServerAddress: \"0.0.0.0\"\n\n# add to the apiServer certSANs the name of the docker (dind) service in order to be able to reach the cluster through it\nkubeadmConfigPatchesJSON6902:\n  - group: kubeadm.k8s.io\n    version: v1beta2\n    kind: ClusterConfiguration\n    patch: |\n      - op: add\n        path: /apiServer/certSANs/-\n        value: docker\nnodes:\n  - role: control-plane\n  - role: worker\n"
  },
  {
    "path": "kind-config.yaml",
    "content": "# see: https://kind.sigs.k8s.io/docs/user/configuration/\nkind: Cluster\napiVersion: kind.x-k8s.io/v1alpha4\nnodes:\n- role: control-plane\n"
  },
  {
    "path": "kind-smoketest.sh",
    "content": "#!/bin/bash\n\n# standard bash error handling\nset -o errexit;\nset -o pipefail;\nset -o nounset;\n# debug commands\nset -x;\n\n# working dir to install binaries etc, cleaned up on exit\nBIN_DIR=\"$(mktemp -d)\"\n# kind binary will be here\nKIND=\"${BIN_DIR}/kind\"\n\nCWD=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" >/dev/null 2>&1 && pwd )\"\nKIND_CONFIG=\"${CWD}/kind-config.yaml\"\n\n# cleanup on exit (useful for running locally)\ncleanup() {\n    \"${KIND}\" delete cluster || true\n    rm -rf \"${BIN_DIR}\"\n}\ntrap cleanup EXIT\n\n# util to install the latest kind version into ${BIN_DIR}\ninstall_latest_kind() {\n    # clone kind into a tempdir within BIN_DIR\n    local tmp_dir\n    tmp_dir=\"$(TMPDIR=\"${BIN_DIR}\" mktemp -d \"${BIN_DIR}/kind-source.XXXXX\")\"\n    cd \"${tmp_dir}\" || exit\n    git clone https://github.com/kubernetes-sigs/kind && cd ./kind\n    make install INSTALL_DIR=\"${BIN_DIR}\"\n}\n\n# util to install a released kind version into ${BIN_DIR}\ninstall_kind_release() {\n    VERSION=\"v0.5.1\"\n    KIND_BINARY_URL=\"https://github.com/kubernetes-sigs/kind/releases/download/${VERSION}/kind-linux-amd64\"\n    wget -O \"${KIND}\" \"${KIND_BINARY_URL}\"\n    chmod +x \"${KIND}\"\n}\n\nmain() {\n    # get kind\n    install_latest_kind\n    # create a cluster\n    \"${KIND}\" create cluster --loglevel=debug --config \"${KIND_CONFIG}\"\n    # set KUBECONFIG to point to the cluster\n    KUBECONFIG=\"$(\"${KIND}\" get kubeconfig-path)\"\n    export KUBECONFIG\n    # TODO: invoke your tests here\n    # teardown will happen automatically on exit\n}\n\nmain\n"
  }
]