Skip to content

Commit

Permalink
Feature/shell (#34)
Browse files Browse the repository at this point in the history
* Deleted terraform

* Added shell version

* Added argocd dashboard

* Use CoreDNS patching instead own config file

* Added metrics-server

* Upgraded cert-manager

* Updated docs

* Removed skaffold and updated docs
  • Loading branch information
bravecobra authored Jul 25, 2021
1 parent 99e04ab commit ccac652
Show file tree
Hide file tree
Showing 134 changed files with 6,201 additions and 10,485 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@ certs.yaml
*.log
site/
cacerts.yaml
src/terraform/.terraform.lock.hcl
.terraform.lock.hcl
charts/
coredns-*.yaml
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,3 @@ This repository contains a kubernetes dev infrastructure, providing:
- Secret management

Each component is intended to be optional.

## Quickstart

To get started quicky, have a look at the [quickstart](./docs/quickstart.md)
6 changes: 0 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,3 @@ This repository contains a kubernetes dev infrastructure, providing:
- Elastic stack
- Secret management
- Identity Provider (IdentityServer4)

Each component is intended to be optional.

## Quickstart

To get started quicky, have a look at the [quickstart](quickstart.md)
39 changes: 39 additions & 0 deletions docs/installation-shell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Installation

## Prerequisites

Check you have all the [cli tools](./preparation/cli.md) installed and that you can connect to a running cluster.

```bash
kubectl cluster-info --context kind-devinfra
```

> When you created your local cluster on windows and now runnign WSL, copy your windows context to your WSL installation.
```bash
cp /mnt/c/users/<your username>>/.kube/config ~/.kube/config
```

## Update Local DNS

Since we are running completely locally, we want to add some entries to the hosts file to forward domainnames to our locally running cluster.
On Windows, open `C:\Windows\system32\drivers\etc\hosts` in an editor as `Administrator` and add the following entries.
On linux edit your `/etc/hosts` file as root.

```text
127.0.0.1 k8s.local infrastructure.k8s.local traefik.infrastructure.k8s.local
127.0.0.1 jaeger.infrastructure.k8s.local prometheus.infrastructure.k8s.local grafana.infrastructure.k8s.local
# 127.0.0.1 seq.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
127.0.0.1 argo.k8s.local
```

## Installer

Next run the installer in as Linux/WSL shell:

```bash
./src/shell/install.sh
```
155 changes: 0 additions & 155 deletions docs/installation-skaffold.md

This file was deleted.

19 changes: 10 additions & 9 deletions docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

Using proven opensource software projects, this repo builds a coherent dev environment that offers similar services that the big cloud providers also offer:

| Provides | Used | AWS | Azure | Google |
|---|---|---|---|---|
| Logging | seq | CloudWatch | | |
| Tracing | jaeger | X-Ray | AppInsights | |
| Metrics | prometheus | CloudWatch | | |
| Dashboards | grafana | CloudWatch | | |
| Service Mesh | consul | AppMesh | | |
| Ingress | traefik | CloudFront | | |
| Secrets | vault | SSM | Azure Vault | |
| Provides | Used | AWS | Azure | Google |
| ------------ | ------------- | ------------------- | ---------------------- | ------ |
| Logging | loki/promtail | CloudWatch | | |
| Tracing | jaeger | X-Ray | AppInsights | |
| Metrics | prometheus | CloudWatch | | |
| Dashboards | grafana | CloudWatch | | |
| Service Mesh | consul | AppMesh | | |
| Ingress | traefik | CloudFront | | |
| Secrets | vault | SSM | Azure Vault | |
| Certificates | cert-manager | Certificate Manager | management certificate | |
54 changes: 49 additions & 5 deletions docs/preparation/cli.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,68 @@
# Installing commandline tools

## Choco
## Windows

### Choco

Install/download the CLIs.

```powershell
choco install kind
choco install base64
choco install mkcert
choco install terraform
choco install kubernetes-cli
choco install kubernetes-helm
choco install skaffold
```

## Installing the argoCD CLI
### Installing the argoCD CLI

Follow the [guide](https://argoproj.github.io/argo-cd/cli_installation/)

For 2.0.3 and env variable needs to be set holding the name of the executable. This is missing from the docs.
```powershell
$version = (Invoke-RestMethod https://api.github.com/repos/argoproj/argo-cd/releases/latest).tag_name
$url = "https://github.com/argoproj/argo-cd/releases/download/" + $version + "/argocd-windows-amd64.exe"
$output = "argocd.exe"
Invoke-WebRequest -Uri $url -OutFile $output
```

For 2.0.3 an env variable needs to be set holding the name of the executable. This is missing from the docs.

```powershell
$env:ARGOCD_BINARY_NAME = 'argocd'
```

Now move `argocd.exe` to a location in your PATH.

## Linux/WSL

```bash
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl wget libnss3-tools cl-base64

# kind
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64
chmod +x ./kind
mv ./kind /usr/local/bin/kind

# mkcert
wget -O mkcert https://github.com/FiloSottile/mkcert/releases/download/v1.4.3/mkcert-v1.4.3-linux-amd64
sudo mv mkcert-v1.4.3-linux-amd64 /usr/local/bin/mkcert
sudo chmod +x /usr/local/bin/mkcert

# kubctl
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubectl

# helm
curl https://baltocdn.com/helm/signing.asc | sudo apt-key add -
sudo apt-get install apt-transport-https --yes
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm

# argocd
sudo curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
sudo chmod +x /usr/local/bin/argocd
```
9 changes: 7 additions & 2 deletions docs/preparation/kind.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ An example of running a multi-node cluster on docker can be done with `kind`. Th
To fire up the cluster, run the following:

```powershell
cd ./src/clusters/kind/
kind create cluster --name=devinfra --config .\config-devinfra.yaml
kind create cluster --name=devinfra --config ./src/clusters/kind/config-devinfra.yaml
```

We specifically expose ports 80, 443 and 8100 to this cluster on ip `127.0.0.1`. Think carefully what ports to expose. `kind` has no update strategy to change this afterwards.
Expand All @@ -34,3 +33,9 @@ To delete the cluster again
```powershell
kind delete cluster --name devinfra
```

When using WSL (Windows Subsystem for Linux), you need to copy the context configuration to your .kubeconfig file on the WSL home directory.

```powershell
cp /mnt/c/users/$(whoami)/.kube/config ~/.kube/config
```
51 changes: 0 additions & 51 deletions docs/quickstart.md

This file was deleted.

Loading

0 comments on commit ccac652

Please sign in to comment.