Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update neon-proxy.sh monitor install #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,11 @@ If you need monitoring part
PYTH_MAPPING_ACCOUNT
PP_SOLANA_URL

## Helmfile setup

mkdir helmfile && cd helmfile
wget https://github.com/helmfile/helmfile/releases/download/v0.160.0/helmfile_0.160.0_linux_amd64.tar.gz
tar -xzvf helmfile_0.160.0_linux_amd64.tar.gz
chmod +x helmfile
sudo mv helmfile /usr/bin/helmfile
helm plugin install https://github.com/databus23/helm-diff
7 changes: 7 additions & 0 deletions config.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,10 @@ GRAFANA_ADMIN_USER="admin"
GRAFANA_ADMIN_PASSWD="grafana"
GRAFANA_INGRESS_ENABLED="true"
GRAFANA_INGRESS_PATH="/grafana"


################
## Loki
################
LOKI_STORAGE_SIZE="10Gi"
LOKI_STORAGE_CLASS="standard"
86 changes: 86 additions & 0 deletions helmfile_config/helmfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
repositories:
- name: metrics-server
url: https://kubernetes-sigs.github.io/metrics-server/
- name: grafana
url: https://grafana.github.io/helm-charts
- name: prometheus-community
url: https://prometheus-community.github.io/helm-charts


environments:
default:
values:
- ./values.yaml
- namespace:
monitoring: 'neon-proxy'

---
releases:
- name: metrics-server
chart: metrics-server/metrics-server
namespace: kube-system
atomic: true
installed: {{ .Values.metrics_server.installed }}
set:
- name: args[0]
value: --kubelet-insecure-tls

- name: kube-state-metrics
chart: prometheus-community/kube-state-metrics
namespace: {{ .Values.namespace.monitoring }}
atomic: true
version: 5.15.3
installed: {{ .Values.prometheus.installed }}

- name: prometheus
chart: prometheus-community/prometheus
namespace: {{ .Values.namespace.monitoring }}
atomic: true
version: 25.8.2
installed: {{ .Values.prometheus.installed }}
values:
- ../monitoring/prometheus/values.yaml
set:
- name: extraScrapeConfigs
file: '../monitoring/prometheus/extraScrapeConfigs.yaml'
{{- range $key, $value := .Values.prometheus }}
- name: {{ $key }}
value: {{ $value }}
{{- end }}

- name: loki
chart: grafana/loki
namespace: {{ .Values.namespace.monitoring }}
atomic: true
version: 5.41.6
installed: {{ .Values.loki.installed }}
values:
- ../monitoring/loki/values.yaml
set:
{{- range $key, $value := .Values.loki }}
- name: {{ $key }}
value: {{ $value }}
{{- end }}

- name: promtail
chart: grafana/promtail
namespace: {{ .Values.namespace.monitoring }}
atomic: true
version: 6.15.3
installed: {{ .Values.promtail.installed }}

- name: grafana
chart: grafana/grafana
namespace: {{ .Values.namespace.monitoring }}
atomic: true
version: 7.1.0
installed: {{ .Values.grafana.installed }}
values:
- ../monitoring/grafana/values.yaml
set:
- name: namespace
value: {{ .Values.namespace.monitoring }}
{{- range $key, $value := .Values.grafana }}
- name: {{ $key }}
value: {{ $value }}
{{- end }}
35 changes: 35 additions & 0 deletions helmfile_config/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
namespace:
monitoring: 'neon-proxy'
system: 'neon-proxy'

metrics_server:
installed: false

prometheus:
installed: false
server.persistentVolume.storageClass: 'standard'
server.persistentVolume.size: '3Gi'
alertmanager.persistence.storageClass: 'standard'
alertmanager.persistence.size: '3Gi'
server.ingress.host: ''
server.ingress.className: 'nginx'
server.ingress.path: '/prometheus'

loki:
installed: true
singleBinary.persistence.storageClass: 'standard'
singleBinary.persistence.size: '3Gi'

promtail:
installed: false

grafana:
installed: false
persistence.storageClassName: 'standard'
persistence.size: '3Gi'
ingress.enabled: 'true'
ingress.host: ''
ingress.className: 'nginx'
ingress.path: '/grafana'
adminUser: 'admin'
adminPassword: 'grafana'
4 changes: 2 additions & 2 deletions monitoring/grafana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ datasources:
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus-server.neon-proxy.svc.cluster.local
url: http://prometheus-server.{{ .Values.namespace }}.svc.cluster.local
access: proxy
isDefault: true
- name: Loki
type: loki
url: http://loki.neon-proxy.svc.cluster.local:3100
url: http://loki.{{ .Values.namespace }}.svc.cluster.local:3100
access: proxy
isDefault: false

Expand Down
122 changes: 8 additions & 114 deletions monitoring/loki/values.yaml
Original file line number Diff line number Diff line change
@@ -1,115 +1,9 @@
test_pod:
enabled: true
image: bats/bats:1.8.2
pullPolicy: IfNotPresent

#https://github.com/grafana/loki/blob/main/production/helm/loki/values.yaml
loki:
enabled: true
isDefault: true
url: http://{{(include "loki.serviceName" .)}}:{{ .Values.loki.service.port }}
readinessProbe:
httpGet:
path: /ready
port: http-metrics
initialDelaySeconds: 45
livenessProbe:
httpGet:
path: /ready
port: http-metrics
initialDelaySeconds: 45
datasource:
jsonData: "{}"
uid: ""


promtail:
enabled: true
config:
snippets:
pipelineStages:
- cri: {}
- docker: {}
logLevel: info
serverPort: 3101
clients:
- url: http://{{ .Release.Name }}:3100/loki/api/v1/push

fluent-bit:
enabled: false

grafana:
enabled: false
sidecar:
datasources:
label: ""
labelValue: ""
enabled: true
maxLines: 1000
image:
tag: 8.3.5

prometheus:
enabled: false
isDefault: false
url: http://{{ include "prometheus.fullname" .}}:{{ .Values.prometheus.server.service.servicePort }}{{ .Values.prometheus.server.prefixURL }}
datasource:
jsonData: "{}"

filebeat:
enabled: false
filebeatConfig:
filebeat.yml: |
# logging.level: debug
filebeat.inputs:
- type: container
paths:
- /var/log/containers/*.log
processors:
- add_kubernetes_metadata:
host: ${NODE_NAME}
matchers:
- logs_path:
logs_path: "/var/log/containers/"
output.logstash:
hosts: ["logstash-loki:5044"]

logstash:
enabled: false
image: grafana/logstash-output-loki
imageTag: 1.0.1
filters:
main: |-
filter {
if [kubernetes] {
mutate {
add_field => {
"container_name" => "%{[kubernetes][container][name]}"
"namespace" => "%{[kubernetes][namespace]}"
"pod" => "%{[kubernetes][pod][name]}"
}
replace => { "host" => "%{[kubernetes][node][name]}"}
}
}
mutate {
remove_field => ["tags"]
}
}
outputs:
main: |-
output {
loki {
url => "http://loki:3100/loki/api/v1/push"
#username => "test"
#password => "test"
}
# stdout { codec => rubydebug }
}

# proxy is currently only used by loki test pod
# Note: If http_proxy/https_proxy are set, then no_proxy should include the
# loki service name, so that tests are able to communicate with the loki
# service.
proxy:
http_proxy: ""
https_proxy: ""
no_proxy: ""
auth_enabled: false
commonConfig:
replication_factor: 1
storage:
type: 'filesystem'
singleBinary:
replicas: 1
Loading