-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1338 from axeII/feat/kromgo
feat: adds kromgo configurations to the cluster
- Loading branch information
Showing
6 changed files
with
225 additions
and
0 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
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,122 @@ | ||
--- | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: &app kromgo | ||
spec: | ||
interval: 30m | ||
chart: | ||
spec: | ||
chart: app-template | ||
version: 3.4.0 | ||
sourceRef: | ||
kind: HelmRepository | ||
name: bjw-s-charts | ||
namespace: flux-system | ||
install: | ||
remediation: | ||
retries: 3 | ||
upgrade: | ||
cleanupOnFail: true | ||
remediation: | ||
strategy: rollback | ||
retries: 3 | ||
values: | ||
controllers: | ||
kromgo: | ||
replicas: 2 | ||
strategy: RollingUpdate | ||
annotations: | ||
reloader.stakater.com/auto: "true" | ||
containers: | ||
app: | ||
image: | ||
repository: ghcr.io/kashalls/kromgo | ||
tag: v0.4.1@sha256:237e6ac3f3bc791343e1ee84122ce9b97abf7eed86cd522d8bf4cba10a041e9f | ||
env: | ||
HEALTH_HOST: 0.0.0.0 | ||
HEALTH_PORT: &healthPort 8888 | ||
PROMETHEUS_URL: http://thanos-query-frontend.monitoring.svc.cluster.local:10902 | ||
SERVER_HOST: 0.0.0.0 | ||
SERVER_PORT: &port 8080 | ||
probes: | ||
liveness: &probes | ||
enabled: true | ||
custom: true | ||
spec: | ||
httpGet: | ||
path: /-/ready | ||
port: *healthPort | ||
initialDelaySeconds: 0 | ||
periodSeconds: 10 | ||
timeoutSeconds: 1 | ||
failureThreshold: 3 | ||
readiness: *probes | ||
resources: | ||
requests: | ||
cpu: 10m | ||
limits: | ||
memory: 64Mi | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
readOnlyRootFilesystem: true | ||
capabilities: | ||
drop: | ||
- ALL | ||
defaultPodOptions: | ||
dnsConfig: | ||
options: | ||
- name: ndots | ||
value: "1" | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 1000 | ||
runAsGroup: 1000 | ||
topologySpreadConstraints: | ||
- maxSkew: 1 | ||
topologyKey: kubernetes.io/hostname | ||
whenUnsatisfiable: DoNotSchedule | ||
labelSelector: | ||
matchLabels: | ||
app.kubernetes.io/name: *app | ||
ingress: | ||
app: | ||
className: external | ||
annotations: | ||
gatus.io/status-code: "404" | ||
hajimari.io/enable: "false" | ||
hosts: | ||
- host: &host "{{ .Release.Name }}.${SECRET_DOMAIN}" | ||
paths: | ||
- path: / | ||
service: | ||
identifier: app | ||
port: http | ||
tls: | ||
- hosts: | ||
- *host | ||
persistence: | ||
config: | ||
type: configMap | ||
name: kromgo-configmap | ||
globalMounts: | ||
- path: /kromgo/config.yaml | ||
subPath: config.yaml | ||
readOnly: true | ||
service: | ||
app: | ||
controller: *app | ||
ports: | ||
http: | ||
port: *port | ||
health: | ||
port: *healthPort | ||
serviceMonitor: | ||
app: | ||
serviceName: *app | ||
endpoints: | ||
- port: health | ||
scheme: http | ||
path: /metrics | ||
interval: 1m | ||
scrapeTimeout: 10s |
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,11 @@ | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./helmrelease.yaml | ||
configMapGenerator: | ||
- name: kromgo-configmap | ||
files: | ||
- ./resources/config.yaml | ||
generatorOptions: | ||
disableNameSuffixHash: true |
59 changes: 59 additions & 0 deletions
59
kubernetes/apps/monitoring/kromgo/app/resources/config.yaml
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,59 @@ | ||
--- | ||
metrics: | ||
- name: cluster_node_count | ||
query: count(count by (node) (kube_node_status_condition{condition="Ready"})) | ||
colors: | ||
- { color: green, min: 0, max: 9999 } | ||
|
||
- name: cluster_pod_count | ||
query: sum(kube_pod_status_phase{phase="Running"}) | ||
colors: | ||
- { color: green, min: 0, max: 9999 } | ||
|
||
- name: cluster_cpu_usage | ||
query: round(avg(cluster:node_cpu:ratio_rate5m) * 100, 0.1) | ||
suffix: "%" | ||
colors: | ||
- { color: green, min: 0, max: 35 } | ||
- { color: orange, min: 36, max: 75 } | ||
- { color: red, min: 76, max: 9999 } | ||
|
||
- name: cluster_memory_usage | ||
query: round(sum(node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes) / sum(node_memory_MemTotal_bytes) * 100, 0.1) | ||
suffix: "%" | ||
colors: | ||
- { color: green, min: 0, max: 35 } | ||
- { color: orange, min: 36, max: 75 } | ||
- { color: red, min: 76, max: 9999 } | ||
|
||
# - name: cluster_power_usage | ||
# query: round(upsHighPrecOutputLoad, 0.1) | ||
# suffix: w | ||
# colors: | ||
# - { color: green, min: 0, max: 400 } | ||
# - { color: orange, min: 401, max: 750 } | ||
# - { color: red, min: 751, max: 9999 } | ||
|
||
- name: cluster_age_days | ||
query: round((time() - min(kube_node_created)) / 86400) | ||
suffix: d | ||
colors: | ||
- { color: green, min: 0, max: 180 } | ||
- { color: orange, min: 181, max: 360 } | ||
- { color: red, min: 361, max: 9999 } | ||
|
||
- name: cluster_uptime_days | ||
query: round(avg(node_time_seconds - node_boot_time_seconds) / 86400) | ||
suffix: d | ||
colors: | ||
- { color: green, min: 0, max: 180 } | ||
- { color: orange, min: 181, max: 360 } | ||
- { color: red, min: 361, max: 9999 } | ||
|
||
- name: kubernetes_version | ||
query: kubernetes_build_info{service="kubernetes"} | ||
label: git_version | ||
|
||
# - name: talos_version | ||
# query: node_os_info{name="Talos"} | ||
# label: version_id |
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,20 @@ | ||
--- | ||
apiVersion: kustomize.toolkit.fluxcd.io/v1 | ||
kind: Kustomization | ||
metadata: | ||
name: &app kromgo | ||
namespace: flux-system | ||
spec: | ||
targetNamespace: monitoring | ||
commonMetadata: | ||
labels: | ||
app.kubernetes.io/name: *app | ||
path: ./kubernetes/apps/monitoring/kromgo/app | ||
prune: true | ||
sourceRef: | ||
kind: GitRepository | ||
name: home-kubernetes | ||
wait: true | ||
interval: 30m | ||
retryInterval: 1m | ||
timeout: 5m |
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 |
---|---|---|
|
@@ -11,3 +11,4 @@ resources: | |
- ./kubernetes-dashboard/ks.yaml | ||
- ./gatus/ks.yaml | ||
- ./karma/ks.yaml | ||
- ./kromgo/ks.yaml |