Move Building to wiki and installation back to docs

Signed-off-by: Hollow Man <hollowman@opensuse.org>
This commit is contained in:
Hollow Man
2023-04-17 14:10:47 +03:00
parent e0b296c124
commit 3f69f06df1
4 changed files with 121 additions and 121 deletions

View File

@@ -37,11 +37,11 @@ curl -s https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh
Learn more about:
* [Installing Kubescape](https://github.com/kubescape/kubescape/wiki/Installation)
* [Installing Kubescape](docs/installation.md)
* [Running your first scan](docs/getting-started.md#run-your-first-scan)
* [Usage](docs/getting-started.md#examples)
* [Architecture](docs/architecture.md)
* [Building Kubescape from source](docs/building.md)
* [Building Kubescape from source](https://github.com/kubescape/kubescape/wiki/Building)
_Did you know you can use Kubescape in all these places?_

View File

@@ -1,107 +0,0 @@
# Building Kubescape
## Build on Windows
1. Install MSYS2 & build libgit _(needed only for the first time)_
```
build.bat all
```
> **Note**
> You can install MSYS2 separately by running `build.bat install` and build libgit2 separately by running `build.bat build`
2. Build kubescape
```
make build
```
OR
```
go build -tags=static .
```
## Build on Linux/MacOS
1. Install libgit2 dependency _(needed only for the first time)_
```
make libgit2
```
> **Note**
> `cmake` is required to build libgit2. You can install it by running `sudo apt-get install cmake` (Linux) or `brew install cmake` (macOS).
2. Build kubescape
```
make build
```
OR
```
go build -tags=static .
```
3. Test
```
make test
```
## Build Kubescape in a pre-configured playground
We have created a [Killercoda scenario](https://killercoda.com/suhas-gumma/scenario/kubescape-build-for-development) that you can use to experiment building Kubescape from source.
When you start the scenario, a script will clone the Kubescape repository and [execute a Linux build steps](https://github.com/kubescape/kubescape#build-on-linuxmacos). The entire process executes multiple commands in order: it takes around 5-6 minutes to complete.
How to use the build playground:
* Apply changes you wish to make to the Kubescape source code.
* [Perform a Linux build](#build-on-linuxmacos)
* Now, you can use Kubescape like normal, but instead of using `kubescape`, use `./kubescape`.
## VS Code configuration samples
You can use the sample files below to setup your VS Code environment for building and debugging purposes.
`.vscode/settings.json`:
```json5
// .vscode/settings.json
{
"go.testTags": "static",
"go.buildTags": "static",
"go.toolsEnvVars": {
"CGO_ENABLED": "1"
}
}
```
`.vscode/launch.json`:
```json5
// .vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/main.go",
"args": [
"scan",
"--logger",
"debug"
],
"buildFlags": "-tags=static"
}
]
}
```

View File

@@ -5,19 +5,14 @@ Kubescape can run as a command line tool on a client, as an operator inside a cl
The best way to get started with Kubescape is to download it to the machine you use to manage your Kubernetes cluster.
## Install Kubescape
```sh
curl -s https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash
```
(We're a security product; please read the file before you run it!)
* [Install on Linux / macOS (X86_64 or ARM64 (M1/M2))](https://github.com/kubescape/kubescape/wiki/Installation#x86_64-or-arm64-m1m2-linux--macos)
* [Install on Windows (X86_64)](https://github.com/kubescape/kubescape/wiki/Installation#x86_64-windows)
* [Install on openSUSE](https://github.com/kubescape/kubescape/wiki/Installation#opensuse)
* [Install on Arch Linux](https://github.com/kubescape/kubescape/wiki/Installation#arch)
* [Install on Ubuntu](https://github.com/kubescape/kubescape/wiki/Installation#ubuntu)
* [Install on Other Debian-based or RPM-based Linux Distros](https://software.opensuse.org/download.html?project=home%3Akubescape&package=kubescape)
* [Install on NixOS or Linux/macOS via nix](https://github.com/kubescape/kubescape/wiki/Installation#nixos-or-with-nix)
* [Install with Homebrew](https://github.com/kubescape/kubescape/wiki/Installation#homebrew)
* [Install with Chocolatey](https://github.com/kubescape/kubescape/wiki/Installation#chocolatey)
* [Install with Scoop](https://scoop.sh/#/apps?q=kubescape&s=0&d=1&o=true&id=1f5ae05eaafe3e7a26505f0889101e0da91ffe91)
* [Install with Krew](https://github.com/kubescape/kubescape/wiki/Installation#krew)
* [Install with Snap](https://snapcraft.io/cli-kubescape)
You can also check [other installation methods](installation.md)
## Run your first scan

112
docs/installation.md Normal file
View File

@@ -0,0 +1,112 @@
# Installation
## Manually
> **Note**: We do not recommend this method if you want to get auto-updating from package managers or have more platforms supported.
### X86_64 or ARM64 (M1/M2) Linux / macOS
```bash
curl -s https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash
```
### X86_64 Windows
You must have PowerShell v5.0 or higher:
```powershell
iwr -useb https://raw.githubusercontent.com/kubescape/kubescape/master/install.ps1 | iex
```
If you get an error, you may need to change the execution policy:
```powershell
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
```
## openSUSE
> **Note**: openSUSE community-supported.
```bash
sudo zypper refresh
sudo zypper install kubescape
```
## Arch
```bash
yay -S kubescape
```
If you would like to save some time and do not want to compile, install `kubescape-bin` instead:
> **Note**: kubescape-bin is AUR community-supported.
```bash
yay -S kubescape-bin
```
## Ubuntu
```bash
sudo add-apt-repository ppa:kubescape/kubescape
sudo apt update
sudo apt install kubescape
```
## Other Debian-based or RPM-based Linux Distros
Please follow the [guidelines here](https://software.opensuse.org/download.html?project=home%3Akubescape&package=kubescape).
## Homebrew
> **Note**: The kubescape delivered by [official Homebrew](https://formulae.brew.sh/formula/kubescape#default) comes with git disabled.
```bash
brew install kubescape
```
If you want to have the git enabled one, you can install via the [homebrew-tap](https://github.com/kubescape/homebrew-tap):
```bash
brew tap kubescape/tap
brew install kubescape-cli
```
## Chocolatey
> **Note**: Chocolatey [community-supported](https://community.chocolatey.org/packages/kubescape).
```powershell
choco install kubescape
```
## Scoop
> **Note**: Scoop [community-supported](https://scoop.sh/#/apps?q=kubescape&s=0&d=1&o=true&id=1f5ae05eaafe3e7a26505f0889101e0da91ffe91).
```powershell
scoop install kubescape
```
## Krew
```bash
kubectl krew update
kubectl krew install kubescape
kubectl kubescape
```
## Snap
> **Note**: If installed using snap, the executable is called cli-kubescape and not kubescape.
[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-white.svg)](https://snapcraft.io/cli-kubescape)
## NixOS or with nix
> **Note**: This method is community-supported. If you are having trouble, please reach out to [NixOS support](https://nixos.wiki/wiki/Support).
You can use `nix` on Linux or macOS.
Try it out in an ephemeral shell: `nix-shell -p kubescape`.
NixOS:
```
# your other config ...
environment.systemPackages = with pkgs; [
# your other packages ...
kubescape
];
```
home-manager:
```
# your other config ...
home.packages = with pkgs; [
# your other packages ...
kubescape
];
```
Or, to your profile (not preferred): `nix-env --install -A nixpkgs.kubescape`.