All checks were successful
Run Check Script / check (pull_request) Successful in 2m44s
Chapter 3 scaffolding. Chart layout mirrors the CloudNativePG convention after reviewing the CRD-in-chart vs CRD-as-hook tradeoff: CRDs live inside templates/ (so helm upgrade re-applies schema changes) with helm.sh/resource-policy: keep so helm uninstall never deletes them. Chart publication target is hub.nationtech.io. CRD yaml is generated at chart-release time by a new `iot-operator-v0 gen-chart-crd` subcommand reading Deployment::crd() — the runtime install path remains the typed Score; only the chart deliverable uses generated yaml. Wrapped with the helm conditional + annotations by templates/crds.yaml via .Files.Get so the generated yaml stays pure. Install / upgrade / uninstall-preserves-CRD validated against a scratch k3d cluster; the operator pod naturally stays pending because the hub.nationtech.io image hasn't been published yet.
64 lines
2.0 KiB
YAML
64 lines
2.0 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "iot-operator-v0.fullname" . }}
|
|
namespace: {{ .Release.Namespace }}
|
|
labels:
|
|
{{- include "iot-operator-v0.labels" . | nindent 4 }}
|
|
spec:
|
|
replicas: {{ .Values.replicaCount }}
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
{{- include "iot-operator-v0.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "iot-operator-v0.selectorLabels" . | nindent 8 }}
|
|
{{- with .Values.podLabels }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.podAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
serviceAccountName: {{ include "iot-operator-v0.serviceAccountName" . }}
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- name: operator
|
|
image: {{ include "iot-operator-v0.image" . | quote }}
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
args: ["run"]
|
|
env:
|
|
- name: NATS_URL
|
|
value: {{ .Values.nats.url | quote }}
|
|
{{- if .Values.kvBucket }}
|
|
- name: KV_BUCKET
|
|
value: {{ .Values.kvBucket | quote }}
|
|
{{- end }}
|
|
- name: RUST_LOG
|
|
value: {{ .Values.logLevel | quote }}
|
|
securityContext:
|
|
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|