Skip to content

Commit

Permalink
Feature/update docs (#116)
Browse files Browse the repository at this point in the history
* updated readme
* Updated docs
  • Loading branch information
bravecobra authored Nov 13, 2022
1 parent 604735e commit a0854b8
Show file tree
Hide file tree
Showing 22 changed files with 367 additions and 673 deletions.
71 changes: 63 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,66 @@

## Description

This repository contains a kubernetes dev infrastructure, providing:

- Logging
- Metrics
- Tracing
- Service discovery
- Elastic stack
- Secret management
This repository contains a `kubernetes` dev infrastructure, providing both crosscutting concerns as well as Saas infrastructure. All this is provided through `terraform` deploying `helm` charts and custom configuration.

| Category | Service | Description |
| :-------------- | ----------------------- | ------------------------ |
| Networking | traefik | Reverse Proxy |
| Networking | linkerd | Service Mesh |
| Networking | cert-manager | Certificates |
| Monitoring | seq | Logging |
| Monitoring | loki | Logging |
| Monitoring | jaeger | Tracing |
| Monitoring | tempo | Tracing |
| Monitoring | prometheus | Metrics |
| Monitoring | metrics-server | Metrics |
| Monitoring | opentelemetry-collector | Ingestion |
| Saas Cloud | localstack | AWS emulator |
| Saas Config | etcd | Key-Value service |
| Saas Config | vault | Secrets management |
| Saas Database | mongodb | Document database |
| Saas Database | mariadb | Relational database |
| Saas Database | mysql | Relational database |
| Saas Database | oracle | Relational database |
| Saas Database | postgres | Relational database |
| Saas Database | sqlserver | Relational database |
| Saas Deployment | fluxcd | GitOps |
| Saas Deployment | argocd | GitOps |
| Saas Messaging | rabbitmq | Message Broker |
| Saas Search | elasticsearch | Search Engine |
| Saas Auth | identityserver | IDP |
| Saas Auth | keycloak | IDP |
| Saas Storage | minio | S3 compatible storage |
| Saas Storage | azurite | Azure compatible storage |

## Deploy

### Quick Start

- Install Tooling
- Install Docker: [Docker desktop](https://www.docker.com/products/docker-desktop/) or [Rancher desktop](https://rancherdesktop.io/)
- Install [Lens](https://k8slens.dev/) (K8S GUI)
- Install tooling [prerequisites](./docs/preparation.md)
- Create a local `k8s` cluster
- Edit your `hosts`: add domain names
- Check the docker network subnet range (adjust in main.tf -> variable) so there is no overlap with an existing one.
- Generate mkcert as admin
- Run generate certificates.ps1
- Creation local cluster
- cluster k3d: terraform init + apply
- cluster kind: terraform init + apply
- Deploy
- edit `terraform.tfvars`
- deploy services: terraform init + apply

### Documentation

The docs are available at [Github Pages](https://bravecobra.github.io/k8s-dev-infrastructure/)

#### Build the docs locally

```shell
pip install --user -f requirements.txt
mkdocs build
mkdocs serve
```
Binary file modified docs/images/docker-desktop-kubernetes-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/docker-desktop-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/rancher-desktop-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 31 additions & 19 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,36 @@

## Description

This repository contains a kubernetes dev infrastructure, providing both crosscutting concerns as well as Saas infrastructure. All this is provided through terraform deploying helm charts and custom configuration.
This repository contains a `kubernetes` dev infrastructure, providing both crosscutting concerns as well as Saas infrastructure. All this is provided through `terraform` deploying `helm` charts and custom configuration.

### Cross-cutting concerns
## Components

- Certificates (cert-manager)
- Reverse proxy (traefik)
- Logging (seq/fluent or loki/promtail)
- Metrics (prometheus)
- Tracing (jaeger)
- Service Mesh (linkerd)
- Dashboards (grafana)

### Saas

- Elastic stack (elasticsearch, kibana)
- Secret management (vault)
- Identity Provider (IdentityServer4 or Keycloak)
- Configuration management/KV (etcd)
- ArgoCD (CI/CD)
- Storage (Minio/Azurite)
- Messaging (RabbitMQ)
| Category | Service | Description |
| :-------------- | ----------------------- | ------------------------ |
| Networking | traefik | Reverse Proxy |
| Networking | linkerd | Service Mesh |
| Networking | cert-manager | Certificates |
| Monitoring | seq | Logging |
| Monitoring | loki | Logging |
| Monitoring | jaeger | Tracing |
| Monitoring | tempo | Tracing |
| Monitoring | prometheus | Metrics |
| Monitoring | metrics-server | Metrics |
| Monitoring | opentelemetry-collector | Ingestion |
| Saas Cloud | localstack | AWS emulator |
| Saas Config | etcd | Key-Value service |
| Saas Config | vault | Secrets management |
| Saas Database | mongodb | Document database |
| Saas Database | mariadb | Relational database |
| Saas Database | mysql | Relational database |
| Saas Database | oracle | Relational database |
| Saas Database | postgres | Relational database |
| Saas Database | sqlserver | Relational database |
| Saas Deployment | fluxcd | GitOps |
| Saas Deployment | argocd | GitOps |
| Saas Messaging | rabbitmq | Message Broker |
| Saas Search | elasticsearch | Search Engine |
| Saas Auth | identityserver | IDP |
| Saas Auth | keycloak | IDP |
| Saas Storage | minio | S3 compatible storage |
| Saas Storage | azurite | Azure compatible storage |
44 changes: 36 additions & 8 deletions docs/installation-terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

## Prerequisites

Check you have all the [cli tools](./preparation/cli.md) installed and that you can connect to a running cluster.
Check you've done all the [preparation](./preparation.md) and that you can connect to a running cluster. You should have all the required CLI tools and a running local cluster (using either `k3d`, `kind`, `docker desktop`, `rancher desktop` or `minikube`).

To check:

```bash
kubectl cluster-info --context <your cluster name>
Expand All @@ -23,10 +25,8 @@ On Windows, open `C:\Windows\system32\drivers\etc\hosts` in an editor as `Admini
On Linux edit your `/etc/hosts` file as root.

```text
127.0.0.1 k8s.local infrastructure.k8s.local traefik.infrastructure.k8s.local traefik.k8s.local
127.0.0.1 jaeger.infrastructure.k8s.local prometheus.infrastructure.k8s.local seq.infrastructure.k8s.local
127.0.0.1 grafana.infrastructure.k8s.local
127.0.0.1 jaeger.infrastructure.k8s.local prometheus.infrastructure.k8s.local seq.infrastructure.k8s.local grafana.infrastructure.k8s.local
127.0.0.1 consul.infrastructure.k8s.local vault.infrastructure.k8s.local
127.0.0.1 es.infrastructure.k8s.local kibana.infrastructure.k8s.local
127.0.0.1 login.k8s.local admin.login.k8s.local api.login.k8s.local
Expand All @@ -37,30 +37,58 @@ On Linux edit your `/etc/hosts` file as root.
127.0.0.1 keycloak.k8s.local auth.k8s.local
127.0.0.1 etcd.infrastructure.k8s.local
127.0.0.1 minio.infrastructure.k8s.local console.minio.infrastructure.k8s.local
127.0.0.1 azurite.infrastructure.k8s.local
127.0.0.1 rabbitmq.infrastructure.k8s.local
127.0.0.1 localstack.infrastructure.k8s.local
127.0.0.1 flux.infrastructure.k8s.local
127.0.0.1 kafka.infrastructure.k8s.local
127.0.0.1 mysql.infrastructure.k8s.local
127.0.0.1 mariadb.infrastructure.k8s.local
127.0.0.1 postgres.infrastructure.k8s.local
127.0.0.1 mssql.infrastructure.k8s.local
127.0.0.1 oracle.infrastructure.k8s.local
127.0.0.1 mongo.infrastructure.k8s.local
127.0.0.1 oracle.infrastructure.k8s.local
```

## Installer
## Generate a root certificate

=== "Windows"

```bash
cd src/terraform
./generate-certificate.ps1
```

=== "Linux/WSL"

Next run the installer in a Linux/WSL shell:

```bash
helm repo update
cd src/terraform
./generate-certificate.sh
```

## Installer

Edit the `terraform.tfvars` as you see fit.

=== "Windows"

```bash
cd src/terraform
helm repo update
terraform init
terraform apply -auto-approve
```

=== "Windows"
=== "Linux/WSL"

Next run the installer in a Linux/WSL shell:

```bash
cd src/terraform
./generate-certificate.ps1
helm repo update
terraform init
terraform apply -auto-approve
```
20 changes: 0 additions & 20 deletions docs/introduction.md

This file was deleted.

Loading

0 comments on commit a0854b8

Please sign in to comment.