kind-helper

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

README

K8s-school Logo, expertise et formation Kubernetes

kind-helper

Helper to install Kubernetes clusters, based on kind, on any Linux system. Allow to easily setup:

  • multi-nodes cluster
  • set CNI plugin and enable NetworkPolicies
  • enable PodSecurityPolicy adminission control plugin.

Can be used for VMs launched by a CI/CD platform, including Github Action

CI Status

Support kind v0.10.0 and k8s v1.20

Run kind on a workstation, in two lines of code

# Sudo access is required here
VERSION="v1.0.1-rc1"
curl -sfL https://raw.githubusercontent.com/k8s-school/kind-helper/$VERSION/install.sh | bash

# Run a single node k8s cluster with kind
kind-helper create -s

# Run a 3 nodes k8s cluster with kind
kind-helper create

# Run a k8s cluster with Calico CNI
kind-helper create -c

# Delete the kind cluster
kind-helper delete

Run kind inside Github Actions

Check this tutorial: build a Kubernetes CI with Kind in order to learn how to run kind inside Travis-CI.

Pre-requisites
  • Create a Github repository for a given application, for example: https://github.com/<GITHUB_ACCOUNT>/<GITHUB_REPOSITORY>
Setup

Enable Github Action by creating file .github/workflow/itests.yaml, based on template below:

name: "Integration tests"
on:
  push:
  pull_request:
    branches:
      - main
  itests:
    name: Run integration tests on Kubernetes
    runs-on: ubuntu-22.04
    needs: build
    env:
      GHA_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Create k8s/kind cluster
        run: |
          curl -sfL https://raw.githubusercontent.com/k8s-school/kind-helper/$VERSION/install.sh | bash
          kind-helper create -s

     - run: |
          kubectl get nodes
          # Add scripts which deploy and tests application on Kubernetes

Additional resource

Documentation

Overview

Copyright © 2023 Fabrice Jammes fabrice.jammes@gmail.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL