Skip to content

Commit

Permalink
Removed shell variant
Browse files Browse the repository at this point in the history
  • Loading branch information
bravecobra committed Nov 25, 2021
1 parent bad8730 commit 497ec39
Show file tree
Hide file tree
Showing 62 changed files with 152 additions and 16,502 deletions.
7 changes: 4 additions & 3 deletions docs/installation-argocd.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ Open `C:\Windows\system32\drivers\etc\hosts` in an editor as `Administrator` and

```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 jaeger.infrastructure.k8s.local prometheus.infrastructure.k8s.local
127.0.0.1 grafana.infrastructure.k8s.local
127.0.0.1 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
127.0.0.1 linkerd.infrastructure.k8s.local
```

## Generating the CA certificate k8s secret with mkcert
Expand Down
40 changes: 0 additions & 40 deletions docs/installation-shell.md

This file was deleted.

45 changes: 24 additions & 21 deletions docs/installation-terraform.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- markdownlint-disable MD046 -->
# Installation

## Prerequisites
Expand All @@ -8,11 +9,12 @@ Check you have all the [cli tools](./preparation/cli.md) installed and that you
kubectl cluster-info --context <your cluster name>
```

> When you created your local cluster on windows and now running WSL, copy your windows context to your WSL installation.
!!!Note
When you created your local cluster on windows and now running WSL, copy your windows context to your WSL installation.

```bash
cp /mnt/c/users/<your username>/.kube/config ~/.kube/config
```
```bash
cp /mnt/c/users/<your username>/.kube/config ~/.kube/config
```

## Update Local DNS

Expand All @@ -22,8 +24,8 @@ 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 jaeger.infrastructure.k8s.local prometheus.infrastructure.k8s.local
127.0.0.1 grafana.infrastructure.k8s.local
127.0.0.1 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 @@ -33,22 +35,23 @@ On Linux edit your `/etc/hosts` file as root.

## Installer

### Linux/WSL
=== "Linux/WSL"

Next run the installer in a Linux/WSL shell:
Next run the installer in a Linux/WSL shell:

```bash
cd src/terraform
./generate-certificate.sh
terraform init
terraform apply -auto-approve
```
```bash
helm repo update
cd src/terraform
./generate-certificate.sh
terraform init
terraform apply -auto-approve
```

### Windows
=== "Windows"

```bash
cd src/terraform
./generate-certificate.ps1
terraform init
terraform apply -auto-approve
```
```bash
cd src/terraform
./generate-certificate.ps1
terraform init
terraform apply -auto-approve
```
21 changes: 11 additions & 10 deletions docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

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 | loki/promtail | CloudWatch | | |
| Tracing | jaeger | X-Ray | AppInsights | |
| Metrics | prometheus | CloudWatch | | |
| Dashboards | grafana | CloudWatch | | |
| Service Mesh | linkerd | AppMesh | | |
| Ingress | traefik | CloudFront | | |
| Secrets | vault | SSM | Azure Vault | |
| Certificates | cert-manager | Certificate Manager | management certificate | |
| Capability | This repo | AWS | Azure | Google |
| ------------ | ------------- | ---------------------- | ---------------------- | ------ |
| Logging | loki/promtail | CloudWatch | AppInsights | |
| Tracing | jaeger | X-Ray | AppInsights | |
| Metrics | prometheus | CloudWatch | AppInsights | |
| Dashboards | grafana | CloudWatch | AppInsights | |
| Service Mesh | linkerd | AppMesh | Open Service Mesh | |
| Ingress | traefik | CloudFront/API Gateway | Azure FrontDoor | |
| Secrets | vault | SSM | Azure Vault | |
| Certificates | cert-manager | Certificate Manager | Management Certificate | |
| Storage | minio | S3 | Azure Storage | |
127 changes: 54 additions & 73 deletions docs/preparation/cli.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,58 @@
# Installing commandline tools

## Windows

### Choco

Install/download the CLIs.

```powershell
choco install kind
choco install base64
choco install mkcert
choco install kubernetes-cli
choco install kubernetes-helm
choco install linkerd2
choco install k3d
```

### Installing the argoCD CLI

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

```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 (if needed)
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 (if needed)
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 (if needed)
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

#linkerd
curl -sL https://run.linkerd.io/install | sh
export PATH=$PATH:~/.linkerd2/bin

#k3d (if needed)
wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
```
=== "Windows"

```powershell
choco install kind
choco install base64
choco install mkcert
choco install kubernetes-cli
choco install kubernetes-helm
choco install linkerd2
choco install k3d
choco install argocd-cli
choco install terraform
```

=== "Linux"

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

# kind (if needed)
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 (if needed)
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 (if needed)
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

#linkerd
curl -sL https://run.linkerd.io/install | sh
export PATH=$PATH:~/.linkerd2/bin

#k3d (if needed)
wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
```
44 changes: 25 additions & 19 deletions docs/preparation/k3d.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,53 @@
<!-- markdownlint-disable MD046 -->
# K3D

## K3D installation

### K3D CLI installation

On Windows:
=== "Windows"

```Powershell
choco install k3d
```
```Powershell
choco install k3d
```

On linux:
=== "Linux"

```bash
wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
```
```bash
wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
```

### Creating a cluster with terraform

Edit `terraform.tfvars` to your needs. Then run `terraform apply` to create the cluster.
Edit `terraform.tfvars` to your needs. By default it will create a 3-node cluster on a custom `Docker` network. Then run to create the cluster, run:

```shell
cd ./src/clusters/k3d
terraform init
terraform apply --auto-approve
```

When using WSL2 (Windows Subsystem for Linux), you need to copy the context configuration to your .kubeconfig file on the WSL2 home directory or the other way round, depending on which shell you use to run the terraform code.
!!! Note
When using `WSL2` (Windows Subsystem for Linux), you need to copy the context configuration to your `.kubeconfig` file on the `WSL2` home directory or the other way round, depending on which shell you use to run the terraform code.

```powershell
cp /mnt/c/users/$(whoami)/.kube/config ~/.kube/config
```
```powershell
cp /mnt/c/users/$(whoami)/.kube/config ~/.kube/config
```

or
or

```powershell
cp ~/.kube/config /mnt/c/users/$(whoami)/.kube/config
```
```powershell
cp ~/.kube/config /mnt/c/users/$(whoami)/.kube/config
```

The cluster creation automatically add configuration to connect to the new cluster
The cluster creation automatically add configuration to your `kubectl` contexts connect to so you can connect to the new cluster

```powershell
kubectl cluster-info --context k3d-devinfra
```

To delete the cluster again, just run `terraform destroy --auto-approve`.
To delete the cluster again, just run

```shell
terraform destroy --auto-approve
```
Loading

0 comments on commit 497ec39

Please sign in to comment.