Merge branch 'master' of ssh://gitea.zwackl.de:2222/dominik/k3s
This commit is contained in:
commit
7977f98752
63
README.md
63
README.md
@ -23,6 +23,9 @@
|
|||||||
* [Deploying a LE-certificate with ingress](#cert-manager-ingress)
|
* [Deploying a LE-certificate with ingress](#cert-manager-ingress)
|
||||||
* [Deploying a LE-certificate by CRD](#cert-manager-crd)
|
* [Deploying a LE-certificate by CRD](#cert-manager-crd)
|
||||||
* [Troubleshooting](#cert-manager-troubleshooting)
|
* [Troubleshooting](#cert-manager-troubleshooting)
|
||||||
|
* [Cluster monitoring](#cluster-monitoring)
|
||||||
|
* [Log correlation with Loki-stack](#loki-stack)
|
||||||
|
* [Metrics with Prometheus-stack + Grafana](#prometheus-grafana)
|
||||||
* [HELM charts](#helm)
|
* [HELM charts](#helm)
|
||||||
* [Create a chart](#helm-create)
|
* [Create a chart](#helm-create)
|
||||||
* [Install local chart without packaging](#helm-install-without-packaging)
|
* [Install local chart without packaging](#helm-install-without-packaging)
|
||||||
@ -140,12 +143,11 @@ https://k3d.io/:
|
|||||||
```
|
```
|
||||||
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
|
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
|
||||||
```
|
```
|
||||||
Create a K3s cluster without `traefik` as well as `metrics-server`
|
Create a K3s cluster without `traefik``
|
||||||
```
|
```
|
||||||
k3d cluster create cluster1 \
|
k3d cluster create cluster1 \
|
||||||
--agents 2 \
|
--agents 2 \
|
||||||
--k3s-server-arg '--disable=traefik' \
|
--k3s-server-arg '--disable=traefik' \
|
||||||
--k3s-server-arg '--disable=metrics-server' \
|
|
||||||
--k3s-server-arg '--kube-apiserver-arg=service-node-port-range=1-65535'
|
--k3s-server-arg '--kube-apiserver-arg=service-node-port-range=1-65535'
|
||||||
```
|
```
|
||||||
If you encounter `helm` throwing errors like this one:
|
If you encounter `helm` throwing errors like this one:
|
||||||
@ -558,15 +560,62 @@ After successfull setup perform a TLS-test:
|
|||||||
* https://testssl.sh/ (`apt install testssl.sh`)
|
* https://testssl.sh/ (`apt install testssl.sh`)
|
||||||
* https://www.ssllabs.com/ssltest/index.html
|
* https://www.ssllabs.com/ssltest/index.html
|
||||||
|
|
||||||
|
# Cluster monitoring <a name="user-content-cluster-monitoring"></a>
|
||||||
|
Create namespace for monitoring
|
||||||
|
```
|
||||||
|
kubectl create ns monitoring
|
||||||
|
```
|
||||||
|
|
||||||
|
## Log correlation with Loki-stack <a name="user-content-loki-stack"></a>
|
||||||
|
Docs: https://github.com/grafana/helm-charts/tree/main/charts/loki-stack
|
||||||
|
```
|
||||||
|
helm repo add grafana https://grafana.github.io/helm-charts
|
||||||
|
helm repo update
|
||||||
|
```
|
||||||
|
Download values file for loki-stack helm chart and replace any macros with corresponding values:
|
||||||
|
* %PVC_STORAGECLASS% -> your storageclass for persistent storage
|
||||||
|
* %PVC_STORAGE_SIZE% -> size of persistent storage, e.g. 4Gi
|
||||||
|
```
|
||||||
|
wget https://gitea.zwackl.de/dominik/k3s/raw/branch/master/loki-stack-values.yaml
|
||||||
|
```
|
||||||
|
Install loki-stack:
|
||||||
|
```
|
||||||
|
helm -n monitoring upgrade --install -f loki-stack-values.yaml loki-stack grafana/loki-stack
|
||||||
|
```
|
||||||
|
Grafana will be installed with Prometheus-stack...
|
||||||
|
|
||||||
|
## Metrics with Prometheus-stack + Grafana <a name="user-content-prometheus-grafana"></a>
|
||||||
|
```
|
||||||
|
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
|
||||||
|
helm repo update
|
||||||
|
```
|
||||||
|
Download values file for prometheus-stack helm chart and replace any macros with corresponding values:
|
||||||
|
* %ADMIN_PASSWORD% -> Grafana admin password
|
||||||
|
* %SERVICE_FQDN% -> Service FQDN
|
||||||
|
* %MASTER_NODE_IPV4_ADDR% -> IPv4 address of your cluster master node
|
||||||
|
* %PVC_STORAGECLASS% -> your storageclass for persistent storage
|
||||||
|
* %PVC_STORAGE_SIZE% -> size of persistent storage, e.g. 4Gi
|
||||||
|
* %SMTP_HOST%
|
||||||
|
* %SMTP_USER%
|
||||||
|
* %SMTP_PASSWORD%
|
||||||
|
* %SMTP_SENDER_ADDRESS%
|
||||||
|
* %SMTP_FROM_HEADER%
|
||||||
|
```
|
||||||
|
wget https://gitea.zwackl.de/dominik/k3s/raw/branch/master/prom-stack-values.yaml
|
||||||
|
```
|
||||||
|
Install promethous-stack:
|
||||||
|
```
|
||||||
|
helm -n monitoring upgrade --install -f prom-stack-values.yaml prom-stack prometheus-community/kube-prometheus-stack
|
||||||
|
```
|
||||||
|
Access grafana web ui via port-forwarding at http://localhost:8080 (or configure an ingress instance):
|
||||||
|
```
|
||||||
|
kubectl -n monitoring port-forward service/prom-stack-grafana 8080:80
|
||||||
|
```
|
||||||
|
|
||||||
# HELM charts <a name="user-content-helm"></a>
|
# HELM charts <a name="user-content-helm"></a>
|
||||||
Docs:
|
Docs:
|
||||||
* https://helm.sh/docs/intro/using_helm/
|
* https://helm.sh/docs/intro/using_helm/
|
||||||
|
|
||||||
Prerequisites:
|
|
||||||
* running kubernetes installation
|
|
||||||
* kubectl with ENV[KUBECONFIG] pointing to appropriate config file
|
|
||||||
* helm
|
|
||||||
|
|
||||||
## Create a chart <a name="user-content-helm-create"></a>
|
## Create a chart <a name="user-content-helm-create"></a>
|
||||||
`helm create helm-test`
|
`helm create helm-test`
|
||||||
|
|
||||||
|
|||||||
5
loki-stack-values.yaml
Normal file
5
loki-stack-values.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
loki:
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
storageClassName: "%PVC_STORAGECLASS%"
|
||||||
|
size: "%PVC_STORAGE_SIZE%"
|
||||||
3409
prom-stack-values.yaml
Normal file
3409
prom-stack-values.yaml
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user