mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-05-31 13:02:46 +00:00
Compare commits
2 Commits
feat-nativ
...
add-kind
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
278f9affa6 | ||
|
|
60d40ce098 |
55
kind/README.md
Normal file
55
kind/README.md
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
---
|
||||||
|
title: kind
|
||||||
|
homepage: https://github.com/kubernetes-sigs/kind
|
||||||
|
tagline: |
|
||||||
|
kind: tool for running local Kubernetes clusters using Docker container "nodes".
|
||||||
|
---
|
||||||
|
|
||||||
|
To update or switch versions, run `webi kind@stable` (or `@v2`, `@beta`,etc).
|
||||||
|
|
||||||
|
## Cheat Sheet
|
||||||
|
|
||||||
|
> Kind uses a single docker container to run a lightweight kubernetes cluster for testing and shenanigans
|
||||||
|
|
||||||
|
User Guide - Quick Start: https://kind.sigs.k8s.io/docs/user/quick-start
|
||||||
|
|
||||||
|
To create a cluster with default name
|
||||||
|
```bash
|
||||||
|
kind create cluster
|
||||||
|
```
|
||||||
|
|
||||||
|
Create a cluster with a specific name
|
||||||
|
```bash
|
||||||
|
kind create cluster --name foo
|
||||||
|
```
|
||||||
|
|
||||||
|
List clusters
|
||||||
|
```bash
|
||||||
|
kind get clusters
|
||||||
|
```
|
||||||
|
|
||||||
|
Specify Kubernetes version
|
||||||
|
```bash
|
||||||
|
kind create cluster --image "kindest/node:$favoriteTag"
|
||||||
|
```
|
||||||
|
- pick your $favoriteTag from here: https://hub.docker.com/r/kindest/node/tags?page=1&ordering=last_updated
|
||||||
|
|
||||||
|
Export all logs from a cluster
|
||||||
|
```bash
|
||||||
|
kind exports logs $HOME/somedir
|
||||||
|
```
|
||||||
|
|
||||||
|
To delete a cluster with default name
|
||||||
|
```bash
|
||||||
|
kind delete cluster
|
||||||
|
```
|
||||||
|
|
||||||
|
To delete a cluster with specific name
|
||||||
|
```bash
|
||||||
|
kind delete cluster --name foo
|
||||||
|
```
|
||||||
|
|
||||||
|
Get the kubeconfig of a cluster
|
||||||
|
```bash
|
||||||
|
kind get kubeconfig --name foo
|
||||||
|
```
|
||||||
46
kind/install.ps1
Normal file
46
kind/install.ps1
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
##################
|
||||||
|
# Install kind #
|
||||||
|
##################
|
||||||
|
|
||||||
|
$pkg_cmd_name = "kind"
|
||||||
|
|
||||||
|
$pkg_dst_cmd = "$Env:USERPROFILE\.local\bin\kind.exe"
|
||||||
|
$pkg_dst = "$pkg_dst_cmd"
|
||||||
|
|
||||||
|
$pkg_src_cmd = "$Env:USERPROFILE\.local\opt\kind-v$Env:WEBI_VERSION\bin\kind.exe"
|
||||||
|
$pkg_src_bin = "$Env:USERPROFILE\.local\opt\kind-v$Env:WEBI_VERSION\bin"
|
||||||
|
$pkg_src_dir = "$Env:USERPROFILE\.local\opt\kind-v$Env:WEBI_VERSION"
|
||||||
|
$pkg_src = "$pkg_src_cmd"
|
||||||
|
|
||||||
|
$pkg_download = "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"
|
||||||
|
|
||||||
|
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"))
|
||||||
|
{
|
||||||
|
echo "Downloading kind from $Env:WEBI_PKG_URL to $pkg_download"
|
||||||
|
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||||
|
& move "$pkg_download.part" "$pkg_download"
|
||||||
|
}
|
||||||
|
|
||||||
|
IF (!(Test-Path -Path "$pkg_src_cmd"))
|
||||||
|
{
|
||||||
|
echo "Installing kind"
|
||||||
|
pushd .local\tmp
|
||||||
|
|
||||||
|
Remove-Item -Path ".\kind-v*" -Recurse -ErrorAction Ignore
|
||||||
|
Remove-Item -Path ".\kind.exe" -Recurse -ErrorAction Ignore
|
||||||
|
|
||||||
|
echo "Unpacking $pkg_download"
|
||||||
|
& tar xf "$pkg_download"
|
||||||
|
|
||||||
|
echo "Install Location: $pkg_src_cmd"
|
||||||
|
New-Item "$pkg_src_bin" -ItemType Directory -Force
|
||||||
|
Move-Item -Path ".\kind-*\kind.exe" -Destination "$pkg_src_bin"
|
||||||
|
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Copying into '$pkg_dst_cmd' from '$pkg_src_cmd'"
|
||||||
|
Remove-Item -Path "$pkg_dst_cmd" -Recurse -ErrorAction Ignore
|
||||||
|
Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse
|
||||||
31
kind/install.sh
Normal file
31
kind/install.sh
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function __init_kind() {
|
||||||
|
set -e
|
||||||
|
set -u
|
||||||
|
|
||||||
|
##################
|
||||||
|
# Install kind #
|
||||||
|
##################
|
||||||
|
|
||||||
|
pkg_cmd_name="kind"
|
||||||
|
|
||||||
|
pkg_dst_cmd="$HOME/.local/bin/kind"
|
||||||
|
pkg_dst="$pkg_dst_cmd"
|
||||||
|
|
||||||
|
pkg_src_cmd="$HOME/.local/opt/kind-v$WEBI_VERSION/bin/kind"
|
||||||
|
pkg_src_dir="$HOME/.local/opt/kind-v$WEBI_VERSION"
|
||||||
|
pkg_src="$pkg_src_cmd"
|
||||||
|
|
||||||
|
pkg_install() {
|
||||||
|
mkdir -p "$(dirname $pkg_src_cmd)"
|
||||||
|
mv ./kind-*/kind "$pkg_src_cmd"
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_get_current_version() {
|
||||||
|
echo $(kind --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
__init_kind
|
||||||
28
kind/releases.js
Normal file
28
kind/releases.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var github = require('../_common/github.js');
|
||||||
|
var owner = 'kubernetes-sigs';
|
||||||
|
var repo = 'kind';
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/** Note: Delete this Comment! **/
|
||||||
|
/** **/
|
||||||
|
/** Need a an example that filters out miscellaneous release files? **/
|
||||||
|
/** See `deno`, `gitea`, or `caddy` **/
|
||||||
|
/** **/
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
module.exports = function (request) {
|
||||||
|
return github(request, owner, repo).then(function (all) {
|
||||||
|
return all;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
if (module === require.main) {
|
||||||
|
module.exports(require('@root/request')).then(function (all) {
|
||||||
|
all = require('../_webi/normalize.js')(all);
|
||||||
|
// just select the first 5 for demonstration
|
||||||
|
all.releases = all.releases.slice(0, 5);
|
||||||
|
console.info(JSON.stringify(all, null, 2));
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user