File tree Expand file tree Collapse file tree 17 files changed +294
-91
lines changed
Expand file tree Collapse file tree 17 files changed +294
-91
lines changed Original file line number Diff line number Diff line change 1+ repos :
2+ - repo : https://github.com/pre-commit/pre-commit-hooks
3+ rev : v5.0.0
4+ hooks :
5+ - id : check-yaml
6+ exclude : ^chart\/.*\/templates\/.*yaml
7+ - id : end-of-file-fixer
8+ - id : trailing-whitespace
9+ - id : detect-aws-credentials
10+ - id : detect-private-key
11+ - id : check-shebang-scripts-are-executable
12+ - id : check-executables-have-shebangs
13+ - repo : https://github.com/gitleaks/gitleaks
14+ rev : v8.24.2
15+ hooks :
16+ - id : gitleaks
17+ - repo : https://github.com/gruntwork-io/pre-commit
18+ rev : v0.1.15
19+ hooks :
20+ - id : helmlint
21+ # - repo: https://github.com/norwoodj/helm-docs
22+ # rev: v1.10.0
23+ # hooks:
24+ # - id: helm-docs
25+ # files: (README\.md\.gotmpl|(Chart|requirements|values)\.yaml)$
Original file line number Diff line number Diff line change 1- FROM golang:1.24.2 -bookworm AS builder
1+ FROM golang:1.24.4 -bookworm AS builder
22
33ENV APP_PORT=3080
4+ ENV METRICS_PORT=3088
45
56WORKDIR /build
67COPY src/* ./
78COPY .git ./
89RUN go mod tidy
910RUN APP_VERSION=$(git describe --tags || echo '0.0.0' ) && APP_BUILD_DATE=$(date +%Y%m%d.%H%M) &&\
10- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 \
11- go build -o ledlighter -ldflags "-X main.appVersion=$APP_VERSION -X main.buildDate=$APP_BUILD_DATE" .
11+ CGO_ENABLED=0 GOOS=linux \
12+ go build -o ledlighter -ldflags "-X main.appVersion=$APP_VERSION -X main.buildDate=$APP_BUILD_DATE" .
1213
1314FROM alpine:3.21.3
14- RUN apk --no-cache add ca-certificates curl htop
1515RUN addgroup -S web && adduser -S web -G web
1616USER web
1717WORKDIR /
1818COPY --from=builder /build/ledlighter /bin
1919HEALTHCHECK --interval=30s --timeout=3s \
20- CMD curl -f http://localhost:${APP_PORT}/healthz || exit 1
20+ CMD curl -f http://localhost:${APP_PORT}/healthz || exit 1
2121EXPOSE $APP_PORT
22+ EXPOSE $METRICS_PORT
2223USER root
2324ENTRYPOINT ["/bin/ledlighter" ]
25+ USER web
Original file line number Diff line number Diff line change 11FROM scratch
22
33ENV APP_PORT=3080
4+ ENV METRICS_PORT=3088
45
56COPY ledlighter /ledlighter
67
78HEALTHCHECK --interval=30s --timeout=3s \
8- CMD curl -f http://localhost:${APP_PORT}/healthz || exit 1
9+ CMD curl -f http://localhost:${APP_PORT}/healthz || exit 1
10+
911EXPOSE $APP_PORT
12+ EXPOSE $METRICS_PORT
1013
1114ENTRYPOINT ["/ledlighter"]
Original file line number Diff line number Diff line change @@ -2,5 +2,5 @@ apiVersion: v2
22name : ledlighter
33description : ledlighter, a proxy for LED APIs
44type : application
5- version : 0.1.0
6- appVersion : " 0.0.1 "
5+ version : 0.1.1
6+ appVersion : " 0.0.2 "
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ helm.sh/chart: {{ include "ledlighter.chart" . }}
4040app.kubernetes.io /version: {{ .Chart.AppVersion | quote }}
4141{{- end }}
4242app.kubernetes.io /managed-by: {{ .Release.Service }}
43+ app: {{ include " ledlighter.name" . }}
4344{{- end }}
4445
4546{{/*
Original file line number Diff line number Diff line change 4444 - name : http
4545 containerPort : {{ .Values.service.port }}
4646 protocol : TCP
47+ - name : metrics
48+ containerPort : {{ .Values.service.metricsPort }}
49+ protocol : TCP
4750 {{- with .Values.livenessProbe }}
4851 livenessProbe :
4952 {{- toYaml . | nindent 12 }}
Original file line number Diff line number Diff line change 1111 targetPort : http
1212 protocol : TCP
1313 name : http
14+ - port : {{ .Values.service.metricsPort }}
15+ targetPort : metrics
16+ protocol : TCP
17+ name : metrics
1418 selector :
1519 {{- include "ledlighter.selectorLabels" . | nindent 4 }}
Original file line number Diff line number Diff line change 1+ ---
2+ {{ if .Values.prometheus.serviceMonitor.enabled }}
3+ apiVersion : monitoring.coreos.com/v1
4+ kind : ServiceMonitor
5+ metadata :
6+ labels :
7+ {{- include "ledlighter.labels" . | nindent 4 }}
8+ {{- with .Values.prometheus.serviceMonitor.labels }}
9+ {{- toYaml . | nindent 4 }}
10+ {{- end }}
11+ name : {{ include "ledlighter.fullname" . }}
12+ namespace : {{ .Values.prometheus.serviceMonitor.namespace | default .Release.Namespace }}
13+ spec :
14+ endpoints :
15+ - interval : {{ .Values.prometheus.serviceMonitor.scrapingInterval | default "30s" }}
16+ targetPort : {{ .Values.service.metricsPort }}
17+ path : {{ .Values.prometheus.serviceMonitor.metricsPath | default "/metrics" }}
18+ namespaceSelector :
19+ {{- with .Values.prometheus.serviceMonitor.namespaceSelector }}
20+ {{- toYaml . | nindent 4 }}
21+ {{- end }}
22+ selector :
23+ matchLabels :
24+ {{- with .Values.additionalLabels }}
25+ {{- toYaml . | nindent 6 }}
26+ {{- end }}
27+ {{ end }}
28+
Original file line number Diff line number Diff line change 1+ ---
2+ image :
3+ repository : registry.0.os76.xyz/xeno/ledlighter
4+ pullPolicy : IfNotPresent
5+ tag : 0.0.12
Original file line number Diff line number Diff line change 1+ ---
12nameOverride : " "
23fullnameOverride : " "
4+
35replicaCount : 1
6+
47image :
58 repository : ghcr.io/xenos76/ledlighter
69 pullPolicy : IfNotPresent
710 tag : " "
11+
812imagePullSecrets : []
13+
14+ additionalLabels :
15+ app : ledlighter
16+
917#
1018# Application Configuration via configMap
1119# and volume mounts
@@ -20,29 +28,31 @@ appConfig:
2028 description : " RGB bulb, back of desk's monitor"
2129 address : 192.168.1.85
2230 kind : shelly
23- #
31+
2432volumes :
2533 - name : config-volume
2634 configMap :
2735 name : ledlighter-config
28- #
36+
2937volumeMounts :
3038 - name : config-volume
3139 mountPath : /config.yaml
3240 subPath : config.yaml
33- #
41+
3442podAnnotations : {}
3543podLabels : {}
36- #
44+
3745serviceAccount :
3846 create : true
3947 automount : true
4048 annotations : {}
4149 name : " "
50+
4251service :
4352 type : ClusterIP
4453 port : 3080
45- #
54+ metricsPort : 3088
55+
4656resources : {}
4757# limits:
4858# cpu: 100m
@@ -55,10 +65,12 @@ livenessProbe:
5565 httpGet :
5666 path : /livez
5767 port : http
68+
5869readinessProbe :
5970 httpGet :
6071 path : /readyz
6172 port : http
73+
6274#
6375# Istio config
6476#
@@ -69,3 +81,18 @@ istio:
6981 - ledlighter.k3s.os76.xyz
7082 gateways :
7183 - istio-system/gateway-priv-os76
84+
85+ #
86+ # Prometheus
87+ #
88+ prometheus :
89+ serviceMonitor :
90+ enabled : true
91+ namespace : monitoring
92+ namespaceSelector :
93+ matchNames :
94+ - default
95+ labels :
96+ release : kube-prometheus-stack
97+ scrapingInterval : 30s
98+ metricsPath : " /metrics"
You can’t perform that action at this time.
0 commit comments