Skip to content

Commit

Permalink
Reordered crds and updated quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
bravecobra committed May 16, 2021
1 parent da87bd7 commit c8e50fc
Show file tree
Hide file tree
Showing 31 changed files with 54 additions and 13 deletions.
12 changes: 6 additions & 6 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ We use self-signed certificates instead of LetsEncrypt as that would require eit
To generate the certficates for `k8s.local` and `*.k8s.local`, use [mkcert](https://github.com/FiloSottile/mkcert) which you can install easily with `choco install mkcert`.

```powershell
mkcert -cert-file src/skaffold/crds/certs/k8s.local.crt -key-file src/skaffold/crds/certs/k8s.local.key k8s.local *.k8s.local infrastructure.k8s.local *.infrastructure.k8s.local
# mkcert -pkcs12 src/skaffold/crds/certs/k8s.local.pfx k8s.local *.k8s.local *.k8s.local infrastructure.k8s.local *.infrastructure.k8s.local
mkcert -cert-file src/skaffold/traefik/crds/certs/k8s.local.crt -key-file src/skaffold/traefik/crds/certs/k8s.local.key k8s.local *.k8s.local infrastructure.k8s.local *.infrastructure.k8s.local
# mkcert -pkcs12 src/skaffold/traefik/crds/certs/k8s.local.pfx k8s.local *.k8s.local *.k8s.local infrastructure.k8s.local *.infrastructure.k8s.local
```

We then generate a kubernetes secret from the certificate

```powershell
kubectl create secret tls traefik-cert --cert=./src/skaffold/crds/certs/k8s.local.crt --key=./src/skaffold/crds/certs/k8s.local.key --dry-run=client -o yaml > ./src/skaffold/crds/certs/certs.yaml
kubectl create secret tls traefik-cert --cert=./src/skaffold/traefik/crds/certs/k8s.local.crt --key=./src/skaffold/traefik/crds/certs/k8s.local.key --dry-run=client -o yaml > ./src/skaffold/traefik/crds/certs/certs.yaml
```

## Adding helm repo's
Expand Down Expand Up @@ -88,18 +88,18 @@ Fetch the ip address of the Consul DNS
kubectl get svc consul-consul-dns -o jsonpath='{.spec.clusterIP}' --namespace=infrastructure
```

Update the values of the consul dns service in `.\infrastructure\coredns\coredns.yaml`
Update the values of the consul dns service in `./src/skaffold/coredns/coredns.yaml`

> Important: `coredns.yaml` is the syntax for CoreDNS 1.7.0, matching the tested. You can also fetch the current configmap and append the consul part as described in the [Consul Docs](https://www.consul.io/docs/k8s/dns).
```powershell
kubectl apply -f .\infrastructure\coredns\coredns.yaml
kubectl apply -f ./src/skaffold/coredns/coredns.yaml
```

Test it out by running a job

```powershell
kubectl apply -f .\infrastructure\coredns\test-dns-job.yaml --namespace=infrastructure
kubectl apply -f ./src/skaffold/coredns/test-dns-job.yaml --namespace=infrastructure
```

## Generated credentials
Expand Down
40 changes: 40 additions & 0 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,43 @@ choco install kubernetes-cli
choco install kubernetes-helm
choco install skaffold
```

## Prepare locally

Open `C:\Windows\system32\drivers\etc\hosts` in an editor as `Administrator` and add the following entries

```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
```

Add a self-signed certificate and add the needed helm repo's

```powershell
mkcert -cert-file src/skaffold/traefik/crds/certs/k8s.local.crt -key-file src/skaffold/traefik/crds/certs/k8s.local.key k8s.local *.k8s.local infrastructure.k8s.local *.infrastructure.k8s.local
kubectl create secret tls traefik-cert --cert=./src/skaffold/traefik/crds/certs/k8s.local.crt --key=./src/skaffold/traefik/crds/certs/k8s.local.key --dry-run=client -o yaml > ./src/skaffold/traefik/crds/certs/certs.yaml
helm repo add hashicorp https://helm.releases.hashicorp.com
helm repo add jaegertracing https://jaegertracing.github.io/helm-charts
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add traefik https://helm.traefik.io/traefik
helm repo add datalust https://helm.datalust.co
helm repo add fluent https://fluent.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
```

> Update the externalIP for Traefik if needed (KinD) as described in the [installation](../installation/#traefik-external-ip-kind)
## Install on the cluster

```powershell
cd src\skaffold
kubectl apply -f .\namespace.yaml
skaffold run
```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ theme:
nav:
- Home: 'index.md'
- Introduction: 'introduction.md'
- QuickStart: 'quickstart.md'
- Installing:
- Preparation:
- CLI: './preparation/cli.md'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions src/skaffold/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ profiles:
deploy:
kubectl:
manifests:
- 'crds/certs/*.yaml'
- 'crds/traefik/routes/*.yaml'
- 'crds/traefik/*.yaml'
- 'crds/jaeger/*.yaml'
- 'crds/prometheus/*.yaml'
- 'crds/loki/*.yaml'
- 'crds/coredns/*.yaml'
- 'traefik/crds/certs/*.yaml'
- 'traefik/crds/routes/*.yaml'
- 'traefik/crds/*.yaml'
- 'jaeger/crds/*.yaml'
- 'prometheus/crds/*.yaml'
- 'loki/crds/*.yaml'
- 'coredns/crds/*.yaml'
helm:
releases:
- name: consul
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c8e50fc

Please sign in to comment.