Skip to content

Commit

Permalink
begin docs with hugo and docsy
Browse files Browse the repository at this point in the history
  • Loading branch information
tobikris committed May 11, 2021
0 parents commit 57baddd
Show file tree
Hide file tree
Showing 19 changed files with 368 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

# Created by https://www.toptal.com/developers/gitignore/api/hugo
# Edit at https://www.toptal.com/developers/gitignore?templates=hugo

### Hugo ###
# Generated files by hugo
/public/
/resources/_gen/
hugo_stats.json

# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux

# End of https://www.toptal.com/developers/gitignore/api/hugo
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "static/logo"]
path = static/logo
url = git@github.com:nimbolus/logo.git
[submodule "themes/docsy"]
path = themes/docsy
url = https://github.com/google/docsy.git
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM klakegg/hugo:ext-alpine

RUN apk add git
7 changes: 7 additions & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "{{ replace .Name "-" " " | title }}"
linkTitle: "{{ replace .Name "-" " " | title }}"
date: "{{ .Date }}"
weight: 10
---

1 change: 1 addition & 0 deletions assets/icons/logo.svg
2 changes: 2 additions & 0 deletions assets/scss/_variables_project.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$primary: #3f608c;
$secondary: #af0000;
54 changes: 54 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
baseURL = "https://nimbolus.de/"
languageCode = "en-us"
title = "Nimbolus"
description = "Nimbolus Documentation"
theme = ["docsy"]

enableGitInfo = false

contentDir = "content/en"
defaultContentLanguageInSubdir = true

[languages]
[languages.en]
title = "Nimbolus"
description = "Nimbolus Documentation"
languageName ="English"
weight = 1

[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[markup.highlight]
style = "monokai"

[outputs]
section = ["HTML", "print"]

[params]
copyright = "Nimbolus"
images = ["logo/nimbolus_red_512.png"]

github_repo = "https://github.com/nimbolus/nimbolus.de"
github_branch= "main"

[params.ui.readingtime]
enable = true

[params.ui]
sidebar_menu_compact = false
breadcrumb_disable = false
sidebar_search_disable = false
navbar_logo = true
footer_about_disable = true

[params.mermaid]
enable = true
theme = "neutral"

[[menu.main]]
name = "GitHub"
weight = 50
url = "https://github.com/nimbolus/"
pre = "<i class='fab fa-github'></i>"
18 changes: 18 additions & 0 deletions content/en/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "Documentation"
linkTitle: "Documentation"
date: "2021-05-11T01:41:54+02:00"
menu:
main:
weight: 10

cascade:
- type: "blog"
toc_root: true
_target:
path: "/blog/**"
- type: "docs"
_target:
path: "/**"
---
{{< alert color="warning" >}}The docs are still under heady development. Use with caution.{{< /alert >}}
9 changes: 9 additions & 0 deletions content/en/ansible-openstack/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: "Ansible OpenStack"
linkTitle: "Ansible OpenStack"
date: "2021-05-11T01:41:54+02:00"
weight: 1

github_project_repo: https://github.com/nimbolus/ansible-openstack
---
[View on GitHub](https://github.com/nimbolus/ansible-openstack.git)
7 changes: 7 additions & 0 deletions content/en/helm-bot/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Helm Bot"
linkTitle: "Helm Bot"
date: "2021-05-11T01:41:54+02:00"
weight: 3
---

7 changes: 7 additions & 0 deletions content/en/terraform-modules/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Terraform Modules"
linkTitle: "Terraform Modules"
date: "2021-05-11T01:41:54+02:00"
weight: 2
---

191 changes: 191 additions & 0 deletions content/en/terraform-modules/tf-k3s/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
---
title: "Terraform K3s"
linkTitle: "Terraform K3s"
date: "2021-05-11T01:41:54+02:00"
weight: 2

github_project_repo: https://github.com/nimbolus/tf-k3s
---
[View on GitHub](https://github.com/nimbolus/tf-k3s.git)

These Terraform modules can provision k3s nodes and are able to build a cluster from multiple nodes.

You can use the [k3s](https://github.com/nimbolus/tf-k3s/tree/master/k3s) module to template the necessary cloudinit files for creating a k3s cluster node.
Modules for [OpenStack](https://github.com/nimbolus/tf-k3s/tree/master/k3s-openstack) and [Hetzner hcloud](https://github.com/nimbolus/tf-k3s/tree/master/k3s-hcloud) that bundle all necessary resources are available.

## Examples

Note that network, subnet and key pair needs to be created beforehand.

### Simple Module for templating cloudinit user_data
[View on GitHub](https://github.com/nimbolus/tf-k3s/tree/master/example-simple.tf)

```terraform
resource "random_password" "cluster_token" {
length = 64
special = false
}
module "k3s_master" {
source = "github.com/nimbolus/tf-k3s/k3s"
name = "k3s-master"
k3s_token = random_password.cluster_token.result
install_k3s_exec = "server --disable traefik --node-label az=ex1"
}
module "k3s_worker" {
source = "github.com/nimbolus/tf-k3s/k3s"
name = "k3s-worker"
k3s_join_existing = true
k3s_url = module.k3s_master.k3s_url
k3s_token = random_password.cluster_token.result
install_k3s_exec = "agent --node-label az=ex1"
}
```

### HA-Master and bootstrap token with OpenStack
[View on GitHub](https://github.com/nimbolus/tf-k3s/tree/master/example-ha-openstack.tf)

```terraform
resource "random_password" "ha_cluster_token" {
length = 64
special = false
}
resource "random_password" "ha_bootstrap_token_id" {
length = 6
special = false
}
resource "random_password" "ha_bootstrap_token_secret" {
length = 16
special = false
}
module "master1" {
source = "github.com/nimbolus/tf-k3s/k3s-openstack"
name = "k3s-master1"
image_name = "ubuntu-20.04"
flavor_name = "m1.small"
availability_zone = "ex1"
keypair_name = "example-keypair"
network_id = "example-id"
subnet_id = "example-id"
k3s_token = random_password.ha_cluster_token.result
install_k3s_exec = "server --cluster-init --kube-apiserver-arg=\"enable-bootstrap-token-auth\" --node-label az=ex1"
bootstrap_token_id = nonsensitive(random_password.ha_bootstrap_token_id.result)
bootstrap_token_secret = random_password.ha_bootstrap_token_secret.result
}
output "k3s_url" {
value = module.master1.k3s_url
}
resource "local_file" "kubeconfig" {
filename = "kubeconfig.yaml"
content = module.master1.kubeconfig
}
module "master2" {
source = "github.com/nimbolus/tf-k3s/k3s-openstack"
name = "k3s-master2"
image_name = "ubuntu-20.04"
flavor_name = "m1.small"
availability_zone = "ex1"
keypair_name = "example-keypair"
network_id = "example-id"
subnet_id = "example-id"
security_group_id = module.master1.security_group_id
k3s_join_existing = true
k3s_url = module.master1.k3s_url
k3s_token = random_password.ha_cluster_token.result
install_k3s_exec = "server --kube-apiserver-arg=\"enable-bootstrap-token-auth\" --node-label az=ex1"
}
module "master3" {
source = "github.com/nimbolus/tf-k3s/k3s-openstack"
name = "k3s-master3"
image_name = "ubuntu-20.04"
flavor_name = "m1.small"
availability_zone = "ex1"
keypair_name = "example-keypair"
network_id = "example-id"
subnet_id = "example-id"
security_group_id = module.master1.security_group_id
k3s_join_existing = true
k3s_url = module.master1.k3s_url
k3s_token = random_password.ha_cluster_token.result
install_k3s_exec = "server --kube-apiserver-arg=\"enable-bootstrap-token-auth\" --node-label az=ex1"
}
module "worker1" {
source = "github.com/nimbolus/tf-k3s/k3s-openstack"
name = "k3s-worker1"
image_name = "ubuntu-20.04"
flavor_name = "m1.small"
availability_zone = "ex1"
keypair_name = "example-keypair"
network_id = "example-id"
subnet_id = "example-id"
security_group_id = module.master1.security_group_id
k3s_join_existing = true
k3s_url = module.master1.k3s_url
k3s_token = random_password.ha_cluster_token.result
install_k3s_exec = "agent --node-label az=ex1"
}
provider "kubernetes" {
host = module.master1.k3s_url
token = "${module.master1.bootstrap_token_id}.${module.master1.bootstrap_token_secret}"
cluster_ca_certificate = base64decode(module.master1.ca_crt)
}
```

### Single Master and Worker with hcloud
[View on GitHub](https://github.com/nimbolus/tf-k3s/tree/master/example-simple-hcloud.tf)

```terraform
resource "random_password" "hcloud_cluster_token" {
length = 64
special = false
}
module "hcloud_master" {
source = "github.com/nimbolus/tf-k3s/k3s-hcloud"
name = "k3s-master"
keypair_name = "pubkey"
network_id = "example-id"
k3s_token = random_password.hcloud_cluster_token.result
install_k3s_exec = "server --disable traefik --node-label az=ex1"
}
module "hcloud_worker" {
source = "github.com/nimbolus/tf-k3s/k3s-hcloud"
name = "k3s-worker"
keypair_name = hcloud_ssh_key.yubikey.name
network_id = hcloud_network.k3s.id
k3s_join_existing = true
k3s_url = module.hcloud_master.k3s_url
k3s_token = random_password.hcloud_cluster_token.result
install_k3s_exec = "agent --node-label az=ex1"
}
resource "local_file" "hcloud_kubeconfig" {
filename = "hcloud-kubeconfig.yaml"
content = module.hcloud_master.kubeconfig
}
```
8 changes: 8 additions & 0 deletions content/en/terraform-modules/tf-pihole/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "Terraform Pihole"
linkTitle: "Terraform Pihole"
date: "2021-05-11T01:41:54+02:00"
weight: 10
icon: fas fa-exclamation-triangle
---
{{< alert color="warning" >}}This module is still under heady development.{{< /alert >}}
8 changes: 8 additions & 0 deletions content/en/terraform-modules/tf-rancher/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "Terraform Rancher"
linkTitle: "Terraform Rancher"
date: "2021-05-11T01:41:54+02:00"
weight: 10
icon: fas fa-exclamation-triangle
---
{{< alert color="warning" >}}This module is still under heady development.{{< /alert >}}
8 changes: 8 additions & 0 deletions content/en/terraform-modules/tf-wireguard/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "Terraform Wireguard"
linkTitle: "Terraform Wireguard"
date: "2021-05-11T01:41:54+02:00"
weight: 10
icon: fas fa-exclamation-triangle
---
{{< alert color="warning" >}}This module is still under heady development.{{< /alert >}}
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3.3"

services:
site:
image: nimbolus.de
build:
context: .
command: server -D
ports:
- "1313:1313"
volumes:
- .:/src
user: "1000:1000"
1 change: 1 addition & 0 deletions static/logo
Submodule logo added at 4f3d84
1 change: 1 addition & 0 deletions themes/docsy
Submodule docsy added at 0b5c79

0 comments on commit 57baddd

Please sign in to comment.