Skip to content

Commit

Permalink
website: create website
Browse files Browse the repository at this point in the history
This commit introduces a the Kilo website. It is generated with
Docusaurus and can be deployed with standard services like Netlify.

Signed-off-by: Lucas Servén Marín <[email protected]>
  • Loading branch information
squat committed Mar 9, 2020
1 parent e681c10 commit 3d9c5f3
Show file tree
Hide file tree
Showing 23 changed files with 11,455 additions and 9 deletions.
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,21 @@ header: .header
exit 1; \
fi

website/docs/README.md: README.md
rm -rf website/docs
mkdir website/docs
find docs -type f -name '*.md' | xargs -I{} ln {} website/{}
rm -rf website/static/img/graphs
cp -r docs/graphs website/static/img/
cp README.md website/docs/
sed -i 's/\.\/docs\///g' $@
find $(@D) -type f -name '*.md' | xargs -I{} sed -i 's/\.\//\/img\//g' {}
sed -i 's/graphs\//\/img\/graphs\//g' $@

website/build/index.html: website/docs/README.md
yarn --cwd website install
yarn --cwd website build

container: .container-$(ARCH)-$(VERSION) container-name
.container-$(ARCH)-$(VERSION): $(BINS) Dockerfile
@i=0; for a in $(ALL_ARCH); do [ "$$a" = $(ARCH) ] && break; i=$$((i+1)); done; \
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<p align="center"><img src="./kilo.svg" width="150"></p>
---
id: introduction
title: Introduction
hide_title: true
custom_edit_url: https://github.com/squat/kilo/edit/master/README.md
---

<p align="center"><img src="./kilo.svg" width="150" /></p>

# Kilo

Expand Down Expand Up @@ -101,7 +108,7 @@ For example, to run Kilo on a Typhoon cluster running Flannel:
kubectl apply -f https://raw.githubusercontent.com/squat/kilo/master/manifests/kilo-typhoon-flannel.yaml
```

[See the manifests directory for more examples](./manifests).
[See the manifests directory for more examples](https://github.com/squat/kilo/tree/master/manifests).

## VPN

Expand Down Expand Up @@ -181,4 +188,4 @@ For example, the `graph` command can be used to generate a graph of the network
kgctl graph | circo -Tsvg > cluster.svg
```

<img src="./docs/graphs/location.svg">
<img src="./docs/graphs/location.svg" />
6 changes: 6 additions & 0 deletions docs/annotations.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
id: annotations
title: Annotations
hide_title: true
---

# Annotations

The following annotations can be added to any Kubernetes Node object to configure the Kilo network.
Expand Down
9 changes: 7 additions & 2 deletions docs/kgctl.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
---
id: kgctl
hide_title: true
---

# kgctl

Kilo provides a command line tool for inspecting and interacting with clusters: `kgctl`.
This tool can be used to understand a mesh's topology, get the WireGuard configuration for a peer, or graph a cluster.
`kgctl` requires a Kubernetes configuration file to be provided, either by setting the `KUBECONFIG` environment variable or by providing the `--kubeconfig` flag.

## Getting Started
## Installation

Installing `kgctl` currently requires building the binary from source.
*Note*: the [Go toolchain must be installed](https://golang.org/doc/install) in order to build the binary.
Expand Down Expand Up @@ -60,7 +65,7 @@ kgctl graph | circo -Tsvg > cluster.svg

This will generate an SVG like:

<img src="./graphs/location.svg">
<img src="./graphs/location.svg" />

### showconf

Expand Down
6 changes: 6 additions & 0 deletions docs/multi-cluster-services.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
id: multi-cluster-services
title: Multi-cluster Services
hide_title: true
---

# Multi-cluster Services

Just as Kilo can connect a Kubernetes cluster to external services over WireGuard, it can connect multiple independent Kubernetes clusters.
Expand Down
14 changes: 10 additions & 4 deletions docs/topology.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
id: topology
title: Topology
hide_title: true
---

# Topology

Kilo allows the topology of the encrypted network to be customized.
Expand Down Expand Up @@ -30,7 +36,7 @@ Analyzing the cluster with `kgctl` would produce a result like:
kgctl graph | circo -Tsvg > cluster.svg
```

<img src="./graphs/location.svg">
<img src="./graphs/location.svg" />

## Full Mesh

Expand All @@ -44,7 +50,7 @@ Analyzing the cluster with `kgctl` would produce a result like:
kgctl graph | circo -Tsvg > cluster.svg
```

<img src="./graphs/full-mesh.svg">
<img src="./graphs/full-mesh.svg" />

## Mixed

Expand All @@ -64,7 +70,7 @@ Analyzing the cluster with `kgctl` would produce a result like:
kgctl graph | circo -Tsvg > cluster.svg
```

<img src="./graphs/mixed.svg">
<img src="./graphs/mixed.svg" />

If the cluster also had nodes in AWS, then the following snippet could be used:

Expand All @@ -80,4 +86,4 @@ This would in turn produce a graph like:
kgctl graph | circo -Tsvg > cluster.svg
```

<img src="./graphs/complex.svg">
<img src="./graphs/complex.svg" />
6 changes: 6 additions & 0 deletions docs/vpn-server.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
id: vpn-server
title: VPN Sever
hide_title: true
---

# VPN Server

The cluster VPN created by Kilo can also be used by peers as a gateway to access the Internet.
Expand Down
6 changes: 6 additions & 0 deletions docs/vpn.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
id: vpn
title: VPN
hide_title: true
---

# VPN

Kilo enables peers outside of a Kubernetes cluster to connect to the created WireGuard network.
Expand Down
21 changes: 21 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Dependencies
/node_modules

# Production
/docs
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
33 changes: 33 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Website

This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

```
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
77 changes: 77 additions & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
module.exports = {
title: 'Kilo',
tagline: 'a multi-cloud network overlay built on WireGuard and designed for Kubernetes',
url: 'https://kilo.squat.ai',
baseUrl: '/',
favicon: 'img/favicon.ico',
organizationName: 'squat',
projectName: 'kilo',
themeConfig: {
navbar: {
title: 'Kilo',
logo: {
alt: 'Kilo',
src: 'img/kilo.svg',
},
links: [
{
to: 'docs/introduction',
activeBasePath: 'docs',
label: 'Docs',
position: 'left',
},
{
href: 'https://github.com/squat/kilo',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Introduction',
to: 'docs/introduction',
},
{
label: 'Topology',
to: 'docs/topology',
},
{
label: 'VPN',
to: 'docs/vpn',
},
],
},
{
title: 'Social',
items: [
{
label: 'GitHub',
href: 'https://github.com/squat/kilo',
},
],
},
],
},
},
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/squat/kilo/edit/master/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
};
30 changes: 30 additions & 0 deletions website/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "website",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy"
},
"dependencies": {
"@docusaurus/core": "^2.0.0-alpha.48",
"@docusaurus/preset-classic": "^2.0.0-alpha.48",
"classnames": "^2.2.6",
"react": "^16.8.4",
"react-dom": "^16.8.4"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
19 changes: 19 additions & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
docs: [
{
type: 'doc',
id: 'introduction',
},
{
type: 'category',
label: 'Guides',
items: ['topology', 'vpn', 'vpn-server', 'multi-cluster-services'],
},
{
type: 'category',
label: 'Reference',
items: ['annotations', 'kgctl'],
},
//Features: ['mdx'],
],
};
25 changes: 25 additions & 0 deletions website/src/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* stylelint-disable docusaurus/copyright-header */
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/

/* You can override the default Infima variables here. */
:root {
--ifm-color-primary: #25c2a0;
--ifm-color-primary-dark: rgb(33, 175, 144);
--ifm-color-primary-darker: rgb(31, 165, 136);
--ifm-color-primary-darkest: rgb(26, 136, 112);
--ifm-color-primary-light: rgb(70, 203, 174);
--ifm-color-primary-lighter: rgb(102, 212, 189);
--ifm-color-primary-lightest: rgb(146, 224, 208);
--ifm-code-font-size: 95%;
}

.docusaurus-highlight-code-line {
background-color: rgb(72, 77, 91);
display: block;
margin: 0 calc(-1 * var(--ifm-pre-padding));
padding: 0 var(--ifm-pre-padding);
}
Loading

0 comments on commit 3d9c5f3

Please sign in to comment.