This commit is contained in:
2026-10-22 02:06:39 +00:00
commit 05c3339f1e
82 changed files with 3202 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
apiVersion: v2
name: generic-http-service
description: One HTTP workload with stable logical-service discovery.
type: application
version: 2.0.0

View File

@@ -0,0 +1,82 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
{{- $needsBind := false -}}
{{- range $s.runtime.ports }}{{- if lt (int .containerPort) 1024 }}{{- $needsBind = true }}{{- end }}{{- end -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $p.workloadName }}
namespace: {{ $p.namespace }}
labels:
{{- toYaml $p.labels | nindent 4 }}
annotations:
{{- toYaml $p.annotations | nindent 4 }}
spec:
replicas: {{ $s.replicas }}
{{- with (default (dict) $p.rollout).progressDeadlineSeconds }}
progressDeadlineSeconds: {{ . }}
{{- end }}
selector:
matchLabels:
{{- toYaml $p.selector | nindent 6 }}
template:
metadata:
labels:
{{- toYaml $p.labels | nindent 8 }}
annotations:
{{- toYaml $p.annotations | nindent 8 }}
spec:
automountServiceAccountToken: false
{{- if $s.runtime.runAsRoot }}
securityContext:
runAsNonRoot: false
{{- end }}
{{- with (default (dict) $p.scheduling).nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default (dict) $p.scheduling).tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: app
image: {{ $s.runtime.resolvedImage | quote }}
{{- with $s.runtime.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $s.runtime.args }}
args:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
{{- toYaml $s.runtime.ports | nindent 12 }}
{{- if $s.env }}
env:
{{- range $name, $value := $s.env }}
- name: {{ $name }}
value: {{ $value | quote }}
{{- end }}
{{- else }}
env: []
{{- end }}
resources:
{{- toYaml $p.resources | nindent 12 }}
securityContext:
allowPrivilegeEscalation: false
{{- $add := list }}
{{- if $needsBind }}{{- $add = append $add "NET_BIND_SERVICE" }}{{- end }}
{{- if $s.runtime.runAsRoot }}
{{- $add = concat $add (list "CHOWN" "DAC_OVERRIDE" "FOWNER" "FSETID" "KILL" "SETGID" "SETUID") }}
{{- end }}
{{- with $add }}
capabilities:
add:
{{- toYaml . | nindent 16 }}
{{- end }}
readinessProbe:
httpGet:
path: {{ $s.healthCheck.path | quote }}
port: {{ $s.healthCheck.port }}
initialDelaySeconds: {{ $s.healthCheck.initialDelaySeconds }}

View File

@@ -0,0 +1,34 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
{{- if $s.exposure.public -}}
{{- $i := $p.ingress -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $p.workloadName }}
namespace: {{ $p.namespace }}
labels:
{{- toYaml $p.labels | nindent 4 }}
annotations:
{{- toYaml $p.annotations | nindent 4 }}
cert-manager.io/cluster-issuer: {{ $i.clusterIssuer | quote }}
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
spec:
ingressClassName: {{ $i.className | quote }}
tls:
- hosts:
- {{ $i.host | quote }}
secretName: {{ $p.workloadName }}-tls
rules:
- host: {{ $i.host | quote }}
http:
paths:
- path: {{ $s.exposure.path | quote }}
pathType: Prefix
backend:
service:
name: {{ $p.serviceName }}
port:
number: {{ $p.servicePort }}
{{- end }}

View File

@@ -0,0 +1,15 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
apiVersion: v1
kind: Service
metadata:
name: {{ $p.serviceName }}
namespace: {{ $p.namespace }}
spec:
type: ClusterIP
selector:
{{- toYaml $p.selector | nindent 4 }}
ports:
- name: http
port: {{ $p.servicePort }}
targetPort: {{ (index $s.runtime.ports 0).name }}

View File

@@ -0,0 +1,3 @@
# The gateway supplies both roots. The chart never derives identity or endpoints itself.
spec: {}
platform: {}

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: generic-http-service
description: One HTTP workload with stable logical-service discovery.
type: application
version: 3.0.0
appVersion: "3"

View File

@@ -0,0 +1,97 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
{{- $needsBind := false -}}
{{- range $s.runtime.ports }}{{- if lt (int .containerPort) 1024 }}{{- $needsBind = true }}{{- end }}{{- end -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $p.workloadName }}
namespace: {{ $p.namespace }}
labels:
{{- toYaml $p.labels | nindent 4 }}
annotations:
{{- toYaml $p.annotations | nindent 4 }}
spec:
replicas: {{ $s.replicas }}
{{- with (default (dict) $p.rollout).progressDeadlineSeconds }}
progressDeadlineSeconds: {{ . }}
{{- end }}
selector:
matchLabels:
{{- toYaml $p.selector | nindent 6 }}
template:
metadata:
labels:
{{- toYaml $p.labels | nindent 8 }}
annotations:
{{- toYaml $p.annotations | nindent 8 }}
spec:
automountServiceAccountToken: false
{{- if $s.runtime.runAsRoot }}
securityContext:
runAsNonRoot: false
{{- end }}
{{- with (default (dict) $p.scheduling).nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default (dict) $p.scheduling).tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $p.volumeAttachments }}
volumes:
{{- range . }}
- name: {{ .name }}
persistentVolumeClaim:
claimName: {{ .claimName }}
{{- end }}
{{- end }}
containers:
- name: app
image: {{ $s.runtime.resolvedImage | quote }}
{{- with $s.runtime.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $s.runtime.args }}
args:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
{{- toYaml $s.runtime.ports | nindent 12 }}
{{- if $s.env }}
env:
{{- range $name, $value := $s.env }}
- name: {{ $name }}
value: {{ $value | quote }}
{{- end }}
{{- else }}
env: []
{{- end }}
{{- with $p.volumeAttachments }}
volumeMounts:
{{- range . }}
- name: {{ .name }}
mountPath: {{ .mountPath | quote }}
{{- end }}
{{- end }}
resources:
{{- toYaml $p.resources | nindent 12 }}
securityContext:
allowPrivilegeEscalation: false
{{- $add := list }}
{{- if $needsBind }}{{- $add = append $add "NET_BIND_SERVICE" }}{{- end }}
{{- if $s.runtime.runAsRoot }}
{{- $add = concat $add (list "CHOWN" "DAC_OVERRIDE" "FOWNER" "FSETID" "KILL" "SETGID" "SETUID") }}
{{- end }}
{{- with $add }}
capabilities:
add:
{{- toYaml . | nindent 16 }}
{{- end }}
readinessProbe:
httpGet:
path: {{ $s.healthCheck.path | quote }}
port: {{ $s.healthCheck.port }}
initialDelaySeconds: {{ $s.healthCheck.initialDelaySeconds }}

View File

@@ -0,0 +1,34 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
{{- if $s.exposure.public -}}
{{- $i := $p.ingress -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $p.workloadName }}
namespace: {{ $p.namespace }}
labels:
{{- toYaml $p.labels | nindent 4 }}
annotations:
{{- toYaml $p.annotations | nindent 4 }}
cert-manager.io/cluster-issuer: {{ $i.clusterIssuer | quote }}
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
spec:
ingressClassName: {{ $i.className | quote }}
tls:
- hosts:
- {{ $i.host | quote }}
secretName: {{ $p.workloadName }}-tls
rules:
- host: {{ $i.host | quote }}
http:
paths:
- path: {{ $s.exposure.path | quote }}
pathType: Prefix
backend:
service:
name: {{ $p.serviceName }}
port:
number: {{ $p.servicePort }}
{{- end }}

View File

@@ -0,0 +1,19 @@
{{- $p := .Values.platform -}}
{{- range $p.volumeAttachments }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .claimName }}
namespace: {{ $p.namespace }}
labels:
{{- toYaml $p.labels | nindent 4 }}
spec:
storageClassName: {{ .storageClassName | quote }}
accessModes:
{{- toYaml .accessModes | nindent 4 }}
volumeMode: {{ .volumeMode }}
resources:
requests:
storage: {{ .size | quote }}
{{- end }}

View File

@@ -0,0 +1,15 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
apiVersion: v1
kind: Service
metadata:
name: {{ $p.serviceName }}
namespace: {{ $p.namespace }}
spec:
type: ClusterIP
selector:
{{- toYaml $p.selector | nindent 4 }}
ports:
- name: http
port: {{ $p.servicePort }}
targetPort: {{ (index $s.runtime.ports 0).name }}

View File

@@ -0,0 +1,3 @@
# The gateway supplies both roots. The chart never derives identity or endpoints itself.
spec: {}
platform: {}

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: generic-http-service
description: One HTTP workload with stable logical-service discovery.
type: application
version: 4.0.0
appVersion: "4"

View File

@@ -0,0 +1,98 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
{{- $needsBind := false -}}
{{- range $s.runtime.ports }}{{- if lt (int .containerPort) 1024 }}{{- $needsBind = true }}{{- end }}{{- end -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $p.workloadName }}
namespace: {{ $p.namespace }}
labels:
{{- toYaml $p.labels | nindent 4 }}
annotations:
{{- toYaml $p.annotations | nindent 4 }}
spec:
replicas: {{ $s.replicas }}
{{- with (default (dict) $p.rollout).progressDeadlineSeconds }}
progressDeadlineSeconds: {{ . }}
{{- end }}
selector:
matchLabels:
{{- toYaml $p.selector | nindent 6 }}
template:
metadata:
labels:
{{- toYaml $p.labels | nindent 8 }}
annotations:
{{- toYaml $p.annotations | nindent 8 }}
spec:
automountServiceAccountToken: false
{{- if $s.runtime.runAsRoot }}
securityContext:
runAsNonRoot: false
{{- end }}
{{- with (default (dict) $p.scheduling).nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default (dict) $p.scheduling).tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $p.volumeAttachments }}
volumes:
{{- range . }}
- name: {{ .name }}
persistentVolumeClaim:
claimName: {{ .claimName }}
{{- end }}
{{- end }}
containers:
- name: app
image: {{ $s.runtime.resolvedImage | quote }}
{{- with $s.runtime.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $s.runtime.args }}
args:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
{{- toYaml $s.runtime.ports | nindent 12 }}
{{- if $s.env }}
env:
{{- range $name, $value := $s.env }}
- name: {{ $name }}
value: {{ $value | quote }}
{{- end }}
{{- else }}
env: []
{{- end }}
{{- with $p.volumeAttachments }}
volumeMounts:
{{- range . }}
- name: {{ .name }}
mountPath: {{ .mountPath | quote }}
readOnly: {{ .readOnly }}
{{- end }}
{{- end }}
resources:
{{- toYaml $p.resources | nindent 12 }}
securityContext:
allowPrivilegeEscalation: false
{{- $add := list }}
{{- if $needsBind }}{{- $add = append $add "NET_BIND_SERVICE" }}{{- end }}
{{- if $s.runtime.runAsRoot }}
{{- $add = concat $add (list "CHOWN" "DAC_OVERRIDE" "FOWNER" "FSETID" "KILL" "SETGID" "SETUID") }}
{{- end }}
{{- with $add }}
capabilities:
add:
{{- toYaml . | nindent 16 }}
{{- end }}
readinessProbe:
httpGet:
path: {{ $s.healthCheck.path | quote }}
port: {{ $s.healthCheck.port }}
initialDelaySeconds: {{ $s.healthCheck.initialDelaySeconds }}

View File

@@ -0,0 +1 @@
{{/* Public ingress for v4 is reconciled by Cluster Gateway per named port. */}}

View File

@@ -0,0 +1,19 @@
{{- $p := .Values.platform -}}
{{- range $p.volumeAttachments }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .claimName }}
namespace: {{ $p.namespace }}
labels:
{{- toYaml $p.labels | nindent 4 }}
spec:
storageClassName: {{ .storageClassName | quote }}
accessModes:
{{- toYaml .accessModes | nindent 4 }}
volumeMode: {{ .volumeMode }}
resources:
requests:
storage: {{ .size | quote }}
{{- end }}

View File

@@ -0,0 +1,19 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
apiVersion: v1
kind: Service
metadata:
name: {{ $p.serviceName }}
namespace: {{ $p.namespace }}
spec:
type: ClusterIP
selector:
{{- toYaml $p.selector | nindent 4 }}
ports:
{{- range $s.runtime.ports }}
- name: {{ .name }}
protocol: TCP
appProtocol: http
port: {{ .containerPort }}
targetPort: {{ .name }}
{{- end }}

View File

@@ -0,0 +1,3 @@
# The gateway supplies both roots. The chart never derives identity or endpoints itself.
spec: {}
platform: {}

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: generic-http-service
description: One HTTP workload with port-free headless discovery.
type: application
version: 5.0.0
appVersion: "5"

View File

@@ -0,0 +1,95 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $p.workloadName }}
namespace: {{ $p.namespace }}
labels:
{{- toYaml $p.labels | nindent 4 }}
annotations:
{{- toYaml $p.annotations | nindent 4 }}
spec:
replicas: {{ $s.replicas }}
{{- with (default (dict) $p.rollout).progressDeadlineSeconds }}
progressDeadlineSeconds: {{ . }}
{{- end }}
selector:
matchLabels:
{{- toYaml $p.selector | nindent 6 }}
template:
metadata:
labels:
{{- toYaml $p.labels | nindent 8 }}
annotations:
{{- toYaml $p.annotations | nindent 8 }}
spec:
automountServiceAccountToken: false
{{- if $s.runtime.runAsRoot }}
securityContext:
runAsNonRoot: false
{{- end }}
{{- with (default (dict) $p.scheduling).nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default (dict) $p.scheduling).tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $p.volumeAttachments }}
volumes:
{{- range . }}
- name: {{ .name }}
persistentVolumeClaim:
claimName: {{ .claimName }}
{{- end }}
{{- end }}
containers:
- name: app
image: {{ $s.runtime.resolvedImage | quote }}
{{- with $s.runtime.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $s.runtime.args }}
args:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if $s.env }}
env:
{{- range $name, $value := $s.env }}
- name: {{ $name }}
value: {{ $value | quote }}
{{- end }}
{{- else }}
env: []
{{- end }}
{{- with $p.volumeAttachments }}
volumeMounts:
{{- range . }}
- name: {{ .name }}
mountPath: {{ .mountPath | quote }}
readOnly: {{ .readOnly }}
{{- end }}
{{- end }}
resources:
{{- toYaml $p.resources | nindent 12 }}
securityContext:
allowPrivilegeEscalation: false
{{- $add := list "NET_BIND_SERVICE" }}
{{- if $s.runtime.runAsRoot }}
{{- $add = concat $add (list "CHOWN" "DAC_OVERRIDE" "FOWNER" "FSETID" "KILL" "SETGID" "SETUID") }}
{{- end }}
{{- with $add }}
capabilities:
add:
{{- toYaml . | nindent 16 }}
{{- end }}
{{- with $s.healthCheck }}
readinessProbe:
httpGet:
path: {{ .path | quote }}
port: {{ .port }}
initialDelaySeconds: {{ .initialDelaySeconds }}
{{- end }}

View File

@@ -0,0 +1,19 @@
{{- $p := .Values.platform -}}
{{- range $p.volumeAttachments }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .claimName }}
namespace: {{ $p.namespace }}
labels:
{{- toYaml $p.labels | nindent 4 }}
spec:
storageClassName: {{ .storageClassName | quote }}
accessModes:
{{- toYaml .accessModes | nindent 4 }}
volumeMode: {{ .volumeMode }}
resources:
requests:
storage: {{ .size | quote }}
{{- end }}

View File

@@ -0,0 +1,14 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
apiVersion: v1
kind: Service
metadata:
name: {{ $p.serviceName }}
namespace: {{ $p.namespace }}
labels:
{{- toYaml $p.labels | nindent 4 }}
spec:
type: ClusterIP
clusterIP: None
selector:
{{- toYaml $p.selector | nindent 4 }}

View File

@@ -0,0 +1,3 @@
# The gateway supplies both roots. The chart never derives identity or endpoints itself.
spec: {}
platform: {}

View File

@@ -0,0 +1,8 @@
apiVersion: v2
name: generic-http-service
description: One HTTP workload — a Deployment and a ClusterIP Service for in-cluster traffic.
type: application
# Chart version, not the contract version. What a revision pins is templateRef{name, version};
# these bytes are one build behind that contract, identified by their content digest.
version: 1.0.0
appVersion: "1"

View File

@@ -0,0 +1,94 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
{{- /* A port below 1024 is privileged: without NET_BIND_SERVICE nothing can bind it, root
included, because the container drops every capability. Added exactly when a declared
port needs it rather than whenever the pod runs as root. */ -}}
{{- $needsBind := false -}}
{{- range $s.runtime.ports }}{{- if lt (int .containerPort) 1024 }}{{- $needsBind = true }}{{- end }}{{- end -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $p.name }}
namespace: {{ $p.namespace }}
labels:
{{- toYaml $p.labels | nindent 4 }}
annotations:
{{- toYaml $p.annotations | nindent 4 }}
spec:
replicas: {{ $s.replicas }}
{{- with (default (dict) $p.rollout).progressDeadlineSeconds }}
# How long a rollout may make no progress before Kubernetes reports Progressing=False, which is
# what the gateway turns into a FAILED phase. Without it a pod that can never start leaves the
# console saying "deploying" until the 600s default expires.
progressDeadlineSeconds: {{ . }}
{{- end }}
selector:
matchLabels:
{{- toYaml $p.selector | nindent 6 }}
template:
metadata:
labels:
{{- toYaml $p.labels | nindent 8 }}
annotations:
{{- toYaml $p.annotations | nindent 8 }}
spec:
automountServiceAccountToken: false
{{- if $s.runtime.runAsRoot }}
# Explicit, never by omission: manifests.py forces runAsNonRoot whenever this is absent.
securityContext:
runAsNonRoot: false
{{- end }}
{{- with (default (dict) $p.scheduling).nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default (dict) $p.scheduling).tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: app
image: {{ $s.runtime.resolvedImage | quote }}
{{- with $s.runtime.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $s.runtime.args }}
args:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
{{- toYaml $s.runtime.ports | nindent 12 }}
{{- if $s.env }}
env:
{{- range $name, $value := $s.env }}
- name: {{ $name }}
value: {{ $value | quote }}
{{- end }}
{{- else }}
env: []
{{- end }}
resources:
{{- toYaml $p.resources | nindent 12 }}
# Pod Security Admission "restricted" is completed after render in manifests.py, so a
# chart cannot forget it. Only the container-level opt-out is stated here.
securityContext:
allowPrivilegeEscalation: false
{{- $add := list }}
{{- if $needsBind }}{{- $add = append $add "NET_BIND_SERVICE" }}{{- end }}
{{- if $s.runtime.runAsRoot }}
{{- /* A stock root image chowns its state and then drops its workers to a service
user; without these it starts as root and dies on the first chown. The set is
fixed by the platform, not reachable from a spec - see manifests.py. */}}
{{- $add = concat $add (list "CHOWN" "DAC_OVERRIDE" "FOWNER" "FSETID" "KILL" "SETGID" "SETUID") }}
{{- end }}
{{- with $add }}
capabilities:
add:
{{- toYaml . | nindent 16 }}
{{- end }}
readinessProbe:
httpGet:
path: {{ $s.healthCheck.path | quote }}
port: {{ $s.healthCheck.port }}
initialDelaySeconds: {{ $s.healthCheck.initialDelaySeconds }}

View File

@@ -0,0 +1,35 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
{{- if $s.exposure.public -}}
{{- $i := $p.ingress -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $p.name }}
namespace: {{ $p.namespace }}
labels:
{{- toYaml $p.labels | nindent 4 }}
annotations:
{{- toYaml $p.annotations | nindent 4 }}
# cert-manager watches this and issues a Let's Encrypt certificate into tls.secretName.
cert-manager.io/cluster-issuer: {{ $i.clusterIssuer | quote }}
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
spec:
ingressClassName: {{ $i.className | quote }}
tls:
- hosts:
- {{ $i.host | quote }}
secretName: {{ $p.name }}-tls
rules:
- host: {{ $i.host | quote }}
http:
paths:
- path: {{ $s.exposure.path | quote }}
pathType: Prefix
backend:
service:
name: {{ $p.name }}
port:
number: {{ $p.servicePort }}
{{- end }}

View File

@@ -0,0 +1,15 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
apiVersion: v1
kind: Service
metadata:
name: {{ $p.name }}
namespace: {{ $p.namespace }}
spec:
type: ClusterIP
selector:
{{- toYaml $p.selector | nindent 4 }}
ports:
- name: http
port: {{ $p.servicePort }}
targetPort: {{ (index $s.runtime.ports 0).name }}

View File

@@ -0,0 +1,8 @@
# Defaults only. Every render supplies both layers explicitly:
# spec.* — the user's, projected from a schema-validated resolvedSpec
# platform.* — the gateway's, derived from platform config and never reachable from a spec
#
# Disjoint roots are deliberate: a spec cannot name a platform value at all, which is a stronger
# guarantee than relying on merge order.
spec: {}
platform: {}

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: generic-inference-service
description: HTTP inference runtime that downloads a pinned model during pod startup
type: application
version: 0.1.0
appVersion: "1"

View File

@@ -0,0 +1,105 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $p.workloadName }}
namespace: {{ $p.namespace }}
labels:
{{- toYaml $p.labels | nindent 4 }}
annotations:
{{- toYaml $p.annotations | nindent 4 }}
spec:
replicas: {{ $s.replicas }}
progressDeadlineSeconds: {{ default 1800 (default (dict) $p.rollout).progressDeadlineSeconds }}
selector:
matchLabels:
{{- toYaml $p.selector | nindent 6 }}
template:
metadata:
labels:
{{- toYaml $p.labels | nindent 8 }}
annotations:
{{- toYaml $p.annotations | nindent 8 }}
spec:
automountServiceAccountToken: false
securityContext:
runAsNonRoot: {{ if $s.runtime.runAsRoot }}false{{ else }}true{{ end }}
fsGroup: 10001
seccompProfile:
type: RuntimeDefault
{{- with (default (dict) $p.scheduling).nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default (dict) $p.scheduling).tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: model
emptyDir: {}
initContainers:
- name: download-model
image: {{ $p.modelDownload.fetchImage | quote }}
command: ["python", "/app/model_fetcher.py"]
env:
- name: HF_REPO_ID
value: {{ $s.resolvedModel.source.repoId | quote }}
- name: HF_COMMIT
value: {{ $s.resolvedModel.source.commit | quote }}
- name: MODEL_MAX_BYTES
value: {{ $p.modelDownload.maxBytes | quote }}
- name: HF_HOME
value: /tmp/huggingface
{{- with $s.resolvedModel.credentialRef }}
- name: HF_TOKEN
valueFrom:
secretKeyRef:
name: {{ . | quote }}
key: token
{{- end }}
volumeMounts:
- name: model
mountPath: /models
resources:
{{- toYaml $p.modelDownload.resources | nindent 12 }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ALL]
containers:
- name: runtime
image: {{ $s.runtime.resolvedImage | quote }}
{{- with $s.runtime.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $s.runtime.args }}
args:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
{{- toYaml $s.runtime.ports | nindent 12 }}
env:
- name: MODEL_PATH
value: /models/model
{{- range $name, $value := $s.env }}
- name: {{ $name }}
value: {{ $value | quote }}
{{- end }}
volumeMounts:
- name: model
mountPath: /models
readOnly: true
resources:
{{- toYaml $p.resources | nindent 12 }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ALL]
readinessProbe:
httpGet:
path: {{ $s.healthCheck.path | quote }}
port: {{ $s.healthCheck.port }}
initialDelaySeconds: {{ $s.healthCheck.initialDelaySeconds }}

View File

@@ -0,0 +1,22 @@
{{- $s := .Values.spec -}}
{{- $p := .Values.platform -}}
apiVersion: v1
kind: Service
metadata:
name: {{ $p.serviceName }}
namespace: {{ $p.namespace }}
labels:
{{- toYaml $p.labels | nindent 4 }}
annotations:
{{- toYaml $p.annotations | nindent 4 }}
spec:
type: ClusterIP
selector:
{{- toYaml $p.selector | nindent 4 }}
ports:
{{- range $s.runtime.ports }}
- name: {{ .name }}
port: {{ .containerPort }}
targetPort: {{ .containerPort }}
protocol: TCP
{{- end }}

View File

@@ -0,0 +1,12 @@
spec: {}
platform:
modelDownload:
fetchImage: example/model-fetcher@sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
maxBytes: 20000000000
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: "2"
memory: 2Gi

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: minio-service
description: Pass-through chart for data-service objects built by the cluster gateway
type: application
version: 1.0.0
appVersion: "1"

View File

@@ -0,0 +1,5 @@
{{- /* The gateway builds and checks every object; this chart only emits them. */}}
{{- range .Values.platform.manifests }}
---
{{ toYaml . }}
{{- end }}

View File

@@ -0,0 +1,2 @@
spec: {}
platform: {}

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: minio-service
description: Standalone data-service objects built by the cluster gateway
type: application
version: 2.0.0
appVersion: "2"

View File

@@ -0,0 +1,5 @@
{{- /* The gateway builds and checks every object; this chart only emits them. */}}
{{- range .Values.platform.manifests }}
---
{{ toYaml . }}
{{- end }}

View File

@@ -0,0 +1,3 @@
spec: {}
platform:
manifests: []

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: postgresql-service
description: Pass-through chart for data-service objects built by the cluster gateway
type: application
version: 1.0.0
appVersion: "1"

View File

@@ -0,0 +1,5 @@
{{- /* The gateway builds and checks every object; this chart only emits them. */}}
{{- range .Values.platform.manifests }}
---
{{ toYaml . }}
{{- end }}

View File

@@ -0,0 +1,2 @@
spec: {}
platform: {}

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: postgresql-service
description: Standalone data-service objects built by the cluster gateway
type: application
version: 2.0.0
appVersion: "2"

View File

@@ -0,0 +1,5 @@
{{- /* The gateway builds and checks every object; this chart only emits them. */}}
{{- range .Values.platform.manifests }}
---
{{ toYaml . }}
{{- end }}

View File

@@ -0,0 +1,3 @@
spec: {}
platform:
manifests: []

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: redis-service
description: Pass-through chart for data-service objects built by the cluster gateway
type: application
version: 1.0.0
appVersion: "1"

View File

@@ -0,0 +1,5 @@
{{- /* The gateway builds and checks every object; this chart only emits them. */}}
{{- range .Values.platform.manifests }}
---
{{ toYaml . }}
{{- end }}

View File

@@ -0,0 +1,2 @@
spec: {}
platform: {}

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: redis-service
description: Standalone data-service objects built by the cluster gateway
type: application
version: 2.0.0
appVersion: "2"

View File

@@ -0,0 +1,5 @@
{{- /* The gateway builds and checks every object; this chart only emits them. */}}
{{- range .Values.platform.manifests }}
---
{{ toYaml . }}
{{- end }}

View File

@@ -0,0 +1,3 @@
spec: {}
platform:
manifests: []