-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c20aab
commit 9c42c68
Showing
35 changed files
with
532 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
manifests | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Install services | ||
|
||
All services are setup using [Kustomize](https://github.com/kubernetes-sigs/kustomize) defined in [Sources](../Sources) folder. | ||
|
||
## Deploy | ||
|
||
1. Update values in | ||
1. Change domain in [grafana-chart-values.yml](../Sources/monitoring-system/grafana/grafana-chart-values.yml) | ||
2. Add digitalocean.com DNS token to [../tmp/dnstoken](../tmp/dnstoken) | ||
access-token=YOUR_TOKEN | ||
If you use different DNS provider change [issuer.yml](../Sources/cert-manager/issuer.yml) see docs for more informations https://cert-manager.io/docs/configuration/acme/dns01/ | ||
3. Change loadbalancer IP in [metallb](../Sources/metallb-system/configs/config) and then also in ingress [controller](../Sources/ingress-nginx/kustomization.yml) | ||
4. Change email in [cert-manager](../Sources/cert-manager/issuer.yml) | ||
2. Run [manifests.sh](../manifests.sh) file. In case that you will run into CRD nonexistent error run command again. | ||
|
||
## Verify | ||
|
||
Log into your grafana dashboard using [adminpass](../tmp/adminpass) credentials. After login you should see 'Pi k3s Simple Dashboard', look around there are few other dashboard preinstalled for you 😉. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Cert Manager | ||
|
||
- Git: https://github.com/jetstack/cert-manager | ||
- Kustomize: https://github.com/jetstack/cert-manager/releases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: cert-manager.io/v1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: ingress | ||
spec: | ||
acme: | ||
email: [email protected] | ||
server: https://acme-v02.api.letsencrypt.org/directory | ||
privateKeySecretRef: | ||
name: issuer-account-key | ||
solvers: | ||
- dns01: | ||
digitalocean: | ||
tokenSecretRef: | ||
name: digitalocean-dns | ||
key: access-token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# https://github.com/jetstack/cert-manager/releases | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
namespace: cert-manager | ||
|
||
resources: | ||
- https://github.com/jetstack/cert-manager/releases/download/v1.0.2/cert-manager.yaml | ||
- issuer.yml | ||
|
||
generatorOptions: | ||
disableNameSuffixHash: true | ||
|
||
secretGenerator: | ||
- name: digitalocean-dns | ||
envs: | ||
- ../../tmp/dnstoken | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Nginx Ingress Controller | ||
|
||
- Git: https://github.com/kubernetes/ingress-nginx | ||
- Kustomize: https://github.com/kubernetes/ingress-nginx/tree/master/deploy/static/provider/cloud |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# https://github.com/kubernetes/ingress-nginx/tree/master/deploy/static/provider/cloud | ||
resources: | ||
- https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.34.1/deploy/static/provider/cloud/deploy.yaml | ||
|
||
patchesJson6902: | ||
- target: | ||
version: v1 | ||
kind: Service | ||
name: ingress-nginx-controller | ||
namespace: ingress-nginx | ||
patch: |- | ||
- op: add | ||
path: "/metadata/annotations" | ||
value: | ||
metallb.universe.tf/address-pool: ingress | ||
- op: add | ||
path: "/spec/loadBalancerIP" | ||
value: 10.236.127.155 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Metallb | ||
|
||
We use metallb for automatically assigning IP to active node, in case of node failure IP is attached to next working node. | ||
|
||
- Git: https://github.com/metallb/metallb | ||
- Kustomize: https://github.com/metallb/metallb/tree/main/manifests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
address-pools: | ||
- name: ingress | ||
protocol: layer2 | ||
addresses: | ||
- 10.236.127.155/32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Aish]ea9Shai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# https://github.com/metallb/metallb/tree/main/manifests | ||
namespace: metallb-system | ||
|
||
resources: | ||
- github.com/metallb/metallb/manifests?ref=v0.9.3 | ||
|
||
configMapGenerator: | ||
- name: config | ||
files: | ||
- configs/config | ||
|
||
secretGenerator: | ||
- name: memberlist | ||
files: | ||
- configs/secretkey | ||
|
||
generatorOptions: | ||
disableNameSuffixHash: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Grafana | ||
|
||
- Git: https://github.com/grafana/grafana | ||
- HELM Chart: https://github.com/grafana/helm-charts/tree/main/charts/grafana |
72 changes: 72 additions & 0 deletions
72
Sources/monitoring-system/grafana/grafana-chart-values.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# https://github.com/grafana/grafana/blob/master/conf/defaults.ini | ||
grafana.ini: | ||
server: | ||
domain: graf.vejlupek.org | ||
root_url: "%(protocol)s://%(domain)s/" | ||
serve_from_sub_path: false | ||
dashboards: | ||
default_home_dashboard_path: /var/lib/grafana/dashboards/default/overview.json | ||
analytics: | ||
reporting_enabled: false | ||
check_for_updates: false | ||
|
||
ingress: | ||
enabled: true | ||
annotations: | ||
cert-manager.io/cluster-issuer: "ingress" | ||
tls: | ||
- secretName: grafana-tls | ||
hosts: | ||
- graf.vejlupek.org | ||
hosts: | ||
- "graf.vejlupek.org" | ||
path: "/" | ||
|
||
testFramework: | ||
enabled: false # Until https://github.com/bats-core/bats-core/issues/356 is resolved | ||
|
||
admin: | ||
existingSecret: "adminpass" | ||
userKey: adminuser | ||
passwordKey: adminpass | ||
|
||
datasources: | ||
datasources.yaml: | ||
apiVersion: 1 | ||
datasources: | ||
- name: VictoriaMetrics | ||
type: prometheus | ||
url: http://vmselect-vmcluster-persistent.monitoring-system.svc.cluster.local:8481/select/0/prometheus/ | ||
isDefault: true | ||
|
||
dashboards: | ||
default: | ||
overview: | ||
gnetId: 13043 | ||
revision: 1 | ||
datasource: VictoriaMetrics | ||
victoriametrics: | ||
gnetId: 11831 | ||
revision: 6 | ||
datasource: VictoriaMetrics | ||
pod-metrics: | ||
gnetId: 13025 | ||
revision: 1 | ||
datasource: VictoriaMetrics | ||
node-exporter: | ||
gnetId: 1860 | ||
revision: 21 | ||
datasource: VictoriaMetrics | ||
|
||
dashboardProviders: | ||
dashboardproviders.yaml: | ||
apiVersion: 1 | ||
providers: | ||
- name: 'default' | ||
orgId: 1 | ||
folder: '' | ||
type: file | ||
disableDeletion: false | ||
editable: false | ||
options: | ||
path: /var/lib/grafana/dashboards/default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# https://github.com/grafana/helm-charts/tree/main/charts/grafana | ||
apiVersion: helm.kustomize.mgoltzsche.github.com/v1 | ||
kind: ChartRenderer | ||
metadata: | ||
name: grafana | ||
namespace: monitoring-system | ||
# repository: ./ | ||
repository: https://grafana.github.io/helm-charts # https://github.com/grafana/helm-charts | ||
# chart: ./Sources/monitoring-system/grafana/ | ||
# chart: file:///workdir/Sources/monitoring-system/grafana/grafana | ||
chart: grafana | ||
version: 5.6.7 | ||
valueFiles: | ||
- grafana-chart-values.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
generatorOptions: | ||
disableNameSuffixHash: true | ||
|
||
secretGenerator: | ||
- name: adminpass | ||
envs: | ||
- ../../../tmp/adminpass | ||
|
||
generators: | ||
- grafana-chart.yml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
namespace: monitoring-system | ||
|
||
resources: | ||
- victoriametrics | ||
- node-exporter | ||
- grafana |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Node exporter | ||
|
||
- Git: https://github.com/prometheus/node_exporter | ||
- HELM Chart: https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-node-exporter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
generators: | ||
- node-exporter-chart.yml |
9 changes: 9 additions & 0 deletions
9
Sources/monitoring-system/node-exporter/node-exporter-chart.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-node-exporter | ||
apiVersion: helm.kustomize.mgoltzsche.github.com/v1 | ||
kind: ChartRenderer | ||
metadata: | ||
name: node-exporter | ||
namespace: monitoring-system | ||
repository: https://prometheus-community.github.io/helm-charts | ||
chart: prometheus-node-exporter | ||
version: 1.11.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# VistoriaMetrics Operator | ||
|
||
- Git: https://github.com/VictoriaMetrics/operator | ||
- Kustomize: https://github.com/VictoriaMetrics/operator/tree/master/config/default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: kubelet | ||
namespace: monitoring | ||
annotations: | ||
prometheus.io/scrape: "true" | ||
labels: | ||
app: prometheus-node-exporter | ||
heritage: Helm | ||
release: eit | ||
chart: prometheus-node-exporter-1.10.0 | ||
jobLabel: node-exporter | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: 9100 | ||
targetPort: 9100 | ||
protocol: TCP | ||
name: metrics | ||
selector: | ||
app: prometheus-node-exporter | ||
release: eit |
19 changes: 19 additions & 0 deletions
19
Sources/monitoring-system/victoriametrics/kustomization.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# https://github.com/VictoriaMetrics/operator/tree/master/config/default | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- github.com/victoriametrics/operator/config/default?ref=master | ||
- vmagent-view-metrics-rbac.yml | ||
- vmagent.yml | ||
- vmcluster.yml | ||
- vmservicescrape-kubelet.yml | ||
- vmservicescrape-metrics-server.yml | ||
- vmservicescrape-node-exporter.yml | ||
|
||
images: | ||
- name: victoriametrics/operator | ||
newTag: docker-multiarch-manifest | ||
|
||
patches: | ||
- manager.patch.yml |
15 changes: 15 additions & 0 deletions
15
Sources/monitoring-system/victoriametrics/manager.patch.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
control-plane: vm-operator | ||
name: vm-operator | ||
namespace: monitoring-system | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: manager | ||
env: | ||
- name: VM_VMAGENTDEFAULT_CONFIGRELOADIMAGE | ||
value: quay.io/coreos/prometheus-config-reloader:v0.42.0 |
Oops, something went wrong.