Merge pull request #45 from jk-cluster/feat/conventions-batch2-additive
Conventions batch 2: flexible ingress standard, configurable probes
This commit is contained in:
11 files changed
+98
-60
No files matched your search
@@ -58,7 +58,7 @@ App-version updates go through PRs (so the validate and install-test pipelines r
|
|||||||
- All resources are named `{{ .Release.Name }}-{{ .Chart.Name }}-<kind>` (e.g. `...-deployment`, `...-service`, `...-secret`).
|
- All resources are named `{{ .Release.Name }}-{{ .Chart.Name }}-<kind>` (e.g. `...-deployment`, `...-service`, `...-secret`).
|
||||||
- Image tags come from `{{ .Chart.AppVersion }}`.
|
- Image tags come from `{{ .Chart.AppVersion }}`.
|
||||||
- Secrets are 1Password `OnePasswordItem` CRs: values expose `secrets.<name>SecretRef` holding an `op://` item path; the operator materializes the Kubernetes Secret.
|
- Secrets are 1Password `OnePasswordItem` CRs: values expose `secrets.<name>SecretRef` holding an `op://` item path; the operator materializes the Kubernetes Secret.
|
||||||
- Ingress assumes `ingressClassName: nginx` and cert-manager: `ingress.clusterIssuer` and `ingress.domain` are `required` values, TLS secret named `tls-<release>-<chart>-ingress`.
|
- Ingress standard: `ingress.domain` and `ingress.clusterIssuer` (cert-manager) are `required` values; `ingress.className` defaults to `nginx`; optional `ingress.annotations` are merged with the cert-manager annotation; TLS secret named `tls-<release>-<chart>-ingress`.
|
||||||
- `env` entries in values support Helm templating — the deployment renders them through `tpl`, and supports `value`, `secretKeyRef`, and `configMapKeyRef` forms.
|
- `env` entries in values support Helm templating — the deployment renders them through `tpl`, and supports `value`, `secretKeyRef`, and `configMapKeyRef` forms.
|
||||||
- Hardened defaults: `automountServiceAccountToken: false`, non-root user, `readOnlyRootFilesystem: true`, all capabilities dropped; probes and resource requests/limits always set. Security contexts are values-configurable (`securityContext.pod` / `securityContext.container`); image-forced deviations are documented with a comment in the chart's `values.yaml`.
|
- Hardened defaults: `automountServiceAccountToken: false`, non-root user, `readOnlyRootFilesystem: true`, all capabilities dropped; probes and resource requests/limits always set. Security contexts are values-configurable (`securityContext.pod` / `securityContext.container`); image-forced deviations are documented with a comment in the chart's `values.yaml`.
|
||||||
- Stateful apps use a StatefulSet in a `<app>.sfs.yaml` template instead of a deployment.
|
- Stateful apps use a StatefulSet in a `<app>.sfs.yaml` template instead of a deployment.
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ For runtime verification (do the workloads actually start, do probes/security se
|
|||||||
- Image tags come from `{{ .Chart.AppVersion }}`.
|
- Image tags come from `{{ .Chart.AppVersion }}`.
|
||||||
- Auxiliary/sidecar images (images other than the app image, currently only the delegation nginx in matrix-synapse) are pinned via values (`<workload>.image.repository` / `<workload>.image.tag`) instead of being hardcoded in templates, and their pinned versions are reviewed alongside every app-version update round.
|
- Auxiliary/sidecar images (images other than the app image, currently only the delegation nginx in matrix-synapse) are pinned via values (`<workload>.image.repository` / `<workload>.image.tag`) instead of being hardcoded in templates, and their pinned versions are reviewed alongside every app-version update round.
|
||||||
- Secrets are **1Password `OnePasswordItem` CRs**: values expose `secrets.<name>SecretRef` holding an `op://` item path; the 1Password operator materializes the Kubernetes Secret in-cluster.
|
- Secrets are **1Password `OnePasswordItem` CRs**: values expose `secrets.<name>SecretRef` holding an `op://` item path; the 1Password operator materializes the Kubernetes Secret in-cluster.
|
||||||
- Ingress assumes ingress-nginx (`ingressClassName: nginx`) and cert-manager: `ingress.clusterIssuer` and `ingress.domain` are required values; the TLS secret is named `tls-<release>-<chart>-ingress`.
|
- Ingress standard: `ingress.domain` and `ingress.clusterIssuer` (cert-manager) are the only required values. `ingress.className` selects the ingress class and defaults to `nginx`; `ingress.annotations` takes optional extra annotations that are merged with the cert-manager `cluster-issuer` annotation the chart always sets. The TLS secret is named `tls-<release>-<chart>-ingress`. (homeassistant deliberately keeps its upstream-style flexible ingress values instead.)
|
||||||
- `env` entries in `values.yaml` are rendered through `tpl`, so values may contain Helm templating; `value`, `secretKeyRef` and `configMapKeyRef` forms are supported.
|
- `env` entries in `values.yaml` are rendered through `tpl`, so values may contain Helm templating; `value`, `secretKeyRef` and `configMapKeyRef` forms are supported.
|
||||||
- Hardened defaults: `automountServiceAccountToken: false`, non-root user, `readOnlyRootFilesystem: true`, all capabilities dropped, probes and resource requests always set. Pod and container contexts are configurable via `securityContext.pod` / `securityContext.container` in each chart's values; writable paths (e.g. `/tmp`, nginx cache dirs, s6-overlay's `/run`) are emptyDirs. Where an image cannot satisfy the full standard (e.g. Home Assistant must start as root for s6-overlay, paperless needs a root init container to hand over `/run`), the deviation is minimal and justified with a comment in that chart's `values.yaml`.
|
- Hardened defaults: `automountServiceAccountToken: false`, non-root user, `readOnlyRootFilesystem: true`, all capabilities dropped, probes and resource requests always set. Pod and container contexts are configurable via `securityContext.pod` / `securityContext.container` in each chart's values; writable paths (e.g. `/tmp`, nginx cache dirs, s6-overlay's `/run`) are emptyDirs. Where an image cannot satisfy the full standard (e.g. Home Assistant must start as root for s6-overlay, paperless needs a root init container to hand over `/run`), the deviation is minimal and justified with a comment in that chart's `values.yaml`.
|
||||||
- Resource requests ship as chart defaults and are user-overridable; limits are computed by a per-chart `_helpers.tpl` helper (reference implementation in `template-chart/templates/_helpers.tpl`): an explicitly set limit always wins, missing memory and ephemeral-storage limits default to `resources.limitFactor` × the request (factor default `3`), and a CPU limit is only rendered when set explicitly — otherwise CPU stays unlimited (it is compressible, throttling instead of OOM-killing). The helper is duplicated into every chart because charts have no dependencies.
|
- Resource requests ship as chart defaults and are user-overridable; limits are computed by a per-chart `_helpers.tpl` helper (reference implementation in `template-chart/templates/_helpers.tpl`): an explicitly set limit always wins, missing memory and ephemeral-storage limits default to `resources.limitFactor` × the request (factor default `3`), and a CPU limit is only rendered when set explicitly — otherwise CPU stays unlimited (it is compressible, throttling instead of OOM-killing). The helper is duplicated into every chart because charts have no dependencies.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ icon: https://raw.githubusercontent.com/gchq/CyberChef/master/src/web/static/ima
|
|||||||
|
|
||||||
type: application
|
type: application
|
||||||
|
|
||||||
version: 5.0.1+up11.4.0
|
version: 5.1.0+up11.4.0
|
||||||
appVersion: "11.4.0"
|
appVersion: "11.4.0"
|
||||||
|
|
||||||
maintainers:
|
maintainers:
|
||||||
|
|||||||
@@ -3,9 +3,12 @@ kind: Ingress
|
|||||||
metadata:
|
metadata:
|
||||||
name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/cluster-issuer: {{ required "A Cluster-Issuer must be provided" .Values.ingress.clusterIssuer}}
|
cert-manager.io/cluster-issuer: {{ required "A Cluster-Issuer must be provided" .Values.ingress.clusterIssuer }}
|
||||||
|
{{- with .Values.ingress.annotations }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: nginx
|
ingressClassName: {{ .Values.ingress.className }}
|
||||||
rules:
|
rules:
|
||||||
- host: {{ required "A Domain/Host must be provided" .Values.ingress.domain }}
|
- host: {{ required "A Domain/Host must be provided" .Values.ingress.domain }}
|
||||||
http:
|
http:
|
||||||
|
|||||||
@@ -59,3 +59,7 @@ ingress:
|
|||||||
enabled: true
|
enabled: true
|
||||||
clusterIssuer: letsencrypt
|
clusterIssuer: letsencrypt
|
||||||
domain: null
|
domain: null
|
||||||
|
className: nginx
|
||||||
|
# Extra annotations for the Ingress; merged with the cert-manager
|
||||||
|
# cluster-issuer annotation the chart always sets.
|
||||||
|
annotations: {}
|
||||||
+1
-1
@@ -5,7 +5,7 @@ icon: https://raw.githubusercontent.com/PatchMon/PatchMon/main/frontend/public/a
|
|||||||
|
|
||||||
type: application
|
type: application
|
||||||
|
|
||||||
version: 5.0.1+up2.1.3
|
version: 5.1.0+up2.1.3
|
||||||
appVersion: "2.1.3"
|
appVersion: "2.1.3"
|
||||||
|
|
||||||
maintainers:
|
maintainers:
|
||||||
|
|||||||
@@ -143,44 +143,14 @@ spec:
|
|||||||
- name: GUACD_ADDRESS
|
- name: GUACD_ADDRESS
|
||||||
value: "127.0.0.1:4822"
|
value: "127.0.0.1:4822"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
# The server exposes GET /health returning {"status": "ok"}. The
|
# Probe values are rendered through tpl (see values.yaml for the
|
||||||
# 2.x server rejects requests whose Host header is neither loopback
|
# defaults and why the probes send a Host header).
|
||||||
# nor a CORS_ORIGIN host with 403 — kubelet probes target the pod
|
|
||||||
# IP, so they must send the public hostname as Host header.
|
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
{{- tpl (toYaml .Values.patchmon.server.livenessProbe) . | nindent 12 }}
|
||||||
path: /health
|
|
||||||
port: 3000
|
|
||||||
httpHeaders:
|
|
||||||
- name: Host
|
|
||||||
value: {{ .Values.ingress.domain }}
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 3
|
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
{{- tpl (toYaml .Values.patchmon.server.readinessProbe) . | nindent 12 }}
|
||||||
path: /health
|
|
||||||
port: 3000
|
|
||||||
httpHeaders:
|
|
||||||
- name: Host
|
|
||||||
value: {{ .Values.ingress.domain }}
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 3
|
|
||||||
# The startup probe gates liveness/readiness. The server waits for
|
|
||||||
# the database and runs migrations on startup; upstream warns that
|
|
||||||
# the first 2.x boot rebuilds database indexes, which can take
|
|
||||||
# minutes on slow storage: budget 10s * 60 = 600s.
|
|
||||||
startupProbe:
|
startupProbe:
|
||||||
httpGet:
|
{{- tpl (toYaml .Values.patchmon.server.startupProbe) . | nindent 12 }}
|
||||||
path: /health
|
|
||||||
port: 3000
|
|
||||||
httpHeaders:
|
|
||||||
- name: Host
|
|
||||||
value: {{ .Values.ingress.domain }}
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 60
|
|
||||||
resources:
|
resources:
|
||||||
{{- include "patchmon.resources" .Values.patchmon.server.resources | nindent 12 }}
|
{{- include "patchmon.resources" .Values.patchmon.server.resources | nindent 12 }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
@@ -199,23 +169,11 @@ spec:
|
|||||||
protocol: TCP
|
protocol: TCP
|
||||||
name: guacd
|
name: guacd
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
tcpSocket:
|
{{- tpl (toYaml .Values.patchmon.guacd.livenessProbe) . | nindent 12 }}
|
||||||
port: 4822
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 3
|
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
tcpSocket:
|
{{- tpl (toYaml .Values.patchmon.guacd.readinessProbe) . | nindent 12 }}
|
||||||
port: 4822
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 3
|
|
||||||
startupProbe:
|
startupProbe:
|
||||||
tcpSocket:
|
{{- tpl (toYaml .Values.patchmon.guacd.startupProbe) . | nindent 12 }}
|
||||||
port: 4822
|
|
||||||
periodSeconds: 5
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 30
|
|
||||||
resources:
|
resources:
|
||||||
{{- include "patchmon.resources" .Values.patchmon.guacd.resources | nindent 12 }}
|
{{- include "patchmon.resources" .Values.patchmon.guacd.resources | nindent 12 }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
|||||||
@@ -3,9 +3,12 @@ kind: Ingress
|
|||||||
metadata:
|
metadata:
|
||||||
name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/cluster-issuer: {{ required "A Cluster-Issuer must be provided" .Values.ingress.clusterIssuer}}
|
cert-manager.io/cluster-issuer: {{ required "A Cluster-Issuer must be provided" .Values.ingress.clusterIssuer }}
|
||||||
|
{{- with .Values.ingress.annotations }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: nginx
|
ingressClassName: {{ .Values.ingress.className }}
|
||||||
rules:
|
rules:
|
||||||
- host: {{ required "A Domain/Host must be provided" .Values.ingress.domain }}
|
- host: {{ required "A Domain/Host must be provided" .Values.ingress.domain }}
|
||||||
http:
|
http:
|
||||||
|
|||||||
@@ -38,6 +38,45 @@ patchmon:
|
|||||||
cpu: 0.1
|
cpu: 0.1
|
||||||
memory: 256Mi
|
memory: 256Mi
|
||||||
ephemeral-storage: 10Mi
|
ephemeral-storage: 10Mi
|
||||||
|
# Probes hit GET /health ({"status": "ok"}). The 2.x server rejects
|
||||||
|
# requests whose Host header is neither loopback nor a CORS_ORIGIN host
|
||||||
|
# with 403 — kubelet probes target the pod IP, so they must send the
|
||||||
|
# public hostname as Host header. Probe values are rendered through tpl,
|
||||||
|
# so the default Host header follows ingress.domain.
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: 3000
|
||||||
|
httpHeaders:
|
||||||
|
- name: Host
|
||||||
|
value: "{{ .Values.ingress.domain }}"
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: 3000
|
||||||
|
httpHeaders:
|
||||||
|
- name: Host
|
||||||
|
value: "{{ .Values.ingress.domain }}"
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
# The startup probe gates liveness/readiness. The server waits for the
|
||||||
|
# database and runs migrations on startup; upstream warns that the first
|
||||||
|
# 2.x boot rebuilds database indexes, which can take minutes on slow
|
||||||
|
# storage: budget 10s * 60 = 600s.
|
||||||
|
startupProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: 3000
|
||||||
|
httpHeaders:
|
||||||
|
- name: Host
|
||||||
|
value: "{{ .Values.ingress.domain }}"
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 60
|
||||||
guacd:
|
guacd:
|
||||||
# In-browser RDP for Windows hosts (beta) via the Apache Guacamole daemon,
|
# In-browser RDP for Windows hosts (beta) via the Apache Guacamole daemon,
|
||||||
# run as a sidecar container in the server pod. Disabled by default; when
|
# run as a sidecar container in the server pod. Disabled by default; when
|
||||||
@@ -67,10 +106,34 @@ patchmon:
|
|||||||
cpu: 0.05
|
cpu: 0.05
|
||||||
memory: 64Mi
|
memory: 64Mi
|
||||||
ephemeral-storage: 10Mi
|
ephemeral-storage: 10Mi
|
||||||
|
# Probe values are rendered through tpl.
|
||||||
|
livenessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: 4822
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: 4822
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
# The startup probe gates liveness/readiness. Startup budget = 5s * 30 = 150s.
|
||||||
|
startupProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: 4822
|
||||||
|
periodSeconds: 5
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 30
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
clusterIssuer: null
|
clusterIssuer: null
|
||||||
domain: null
|
domain: null
|
||||||
|
className: nginx
|
||||||
|
# Extra annotations for the Ingress; merged with the cert-manager
|
||||||
|
# cluster-issuer annotation the chart always sets.
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
redisSecretRef: null
|
redisSecretRef: null
|
||||||
|
|||||||
@@ -4,9 +4,12 @@ kind: Ingress
|
|||||||
metadata:
|
metadata:
|
||||||
name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/cluster-issuer: {{ required "A Cluster-Issuer must be provided" .Values.ingress.clusterIssuer}}
|
cert-manager.io/cluster-issuer: {{ required "A Cluster-Issuer must be provided" .Values.ingress.clusterIssuer }}
|
||||||
|
{{- with .Values.ingress.annotations }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: nginx
|
ingressClassName: {{ .Values.ingress.className }}
|
||||||
rules:
|
rules:
|
||||||
- host: {{ required "A Domain/Host must be provided" .Values.ingress.domain }}
|
- host: {{ required "A Domain/Host must be provided" .Values.ingress.domain }}
|
||||||
http:
|
http:
|
||||||
|
|||||||
@@ -84,3 +84,7 @@ ingress:
|
|||||||
enabled: true
|
enabled: true
|
||||||
clusterIssuer: null
|
clusterIssuer: null
|
||||||
domain: null
|
domain: null
|
||||||
|
className: nginx
|
||||||
|
# Extra annotations for the Ingress; merged with the cert-manager
|
||||||
|
# cluster-issuer annotation the chart always sets.
|
||||||
|
annotations: {}
|
||||||
Reference in new issue
Block a user