Merge pull request #1196 from HollowMan6/doc

Move building instructions to wiki, add more installation instructions
This commit is contained in:
Craig Box
2023-04-20 14:55:52 +12:00
committed by GitHub
4 changed files with 113 additions and 172 deletions
+2 -2
View File
@@ -37,11 +37,11 @@ curl -s https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh
Learn more about:
* [Installing Kubescape](docs/getting-started.md#install-kubescape)
* [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?_
-107
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"
}
]
}
```
+1 -63
View File
@@ -12,11 +12,7 @@ curl -s https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh
(We're a security product; please read the file before you run it!)
You can also
* [Install on windows](#install-on-windows)
* [Install on macOS](#install-on-macos)
* [Install on NixOS or Linux/macOS via nix](#install-on-nixos-or-with-nix)
You can also check [other installation methods](installation.md)
## Run your first scan
@@ -235,61 +231,3 @@ Experiment with Kubescape in the [Kubescape playground](https://killercoda.com/s
* Customize control configurations:
- [Kubescape CLI](https://youtu.be/955psg6TVu4)
- [ARMO Platform](https://youtu.be/lIMVSVhH33o)
## Other installation methods
The `curl` install method will work on all platforms, but you may wish to use a native method to install Kubescape.
### Install on Windows
You must have PowerShell v5.0 or higher installed.
``` 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
```
### Install on macOS
You can install Kubescape via [Homebrew](https://brew.sh/):
```sh
brew tap kubescape/tap
brew install kubescape-cli
```
</details>
### Install on NixOS or with nix
_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`
+110
View File
@@ -0,0 +1,110 @@
# 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
[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-white.svg)](https://snapcraft.io/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`.