From cf31dd7453823146a82c749a037b5d4607333de2 Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Mon, 16 Nov 2026 09:30:13 +0000 Subject: [PATCH 1/2] chart: Track generated Helm manifests Keeping generated CRDs and templates in Git makes chart changes reviewable and lets users inspect chart contents at a commit without running the generator. Dependency archives remain local; they come from the in-tree CRD chart. Assisted-by: AI Signed-off-by: Alice Frosi --- .gitignore | 14 +- CONTRIBUTING.md | 6 + .../node.bootc.dev_bootcnodepools.yaml | 321 ++++++++++++++++++ .../templates/node.bootc.dev_bootcnodes.yaml | 299 ++++++++++++++++ .../templates/controller-clusterrole.yaml | 87 +++++ .../controller-clusterrolebinding.yaml | 14 + .../templates/controller-deployment.yaml | 86 +++++ .../templates/controller-role.yaml | 27 ++ .../templates/controller-rolebinding.yaml | 15 + .../templates/controller-serviceaccount.yaml | 7 + .../templates/daemon-clusterrole.yaml | 24 ++ .../templates/daemon-clusterrolebinding.yaml | 14 + .../templates/daemon-daemonset.yaml | 62 ++++ .../templates/daemon-serviceaccount.yaml | 7 + .../templates/leader-election-role.yaml | 28 ++ .../leader-election-rolebinding.yaml | 14 + 16 files changed, 1012 insertions(+), 13 deletions(-) create mode 100644 chart/bootc-operator-crds/templates/node.bootc.dev_bootcnodepools.yaml create mode 100644 chart/bootc-operator-crds/templates/node.bootc.dev_bootcnodes.yaml create mode 100644 chart/bootc-operator/templates/controller-clusterrole.yaml create mode 100644 chart/bootc-operator/templates/controller-clusterrolebinding.yaml create mode 100644 chart/bootc-operator/templates/controller-deployment.yaml create mode 100644 chart/bootc-operator/templates/controller-role.yaml create mode 100644 chart/bootc-operator/templates/controller-rolebinding.yaml create mode 100644 chart/bootc-operator/templates/controller-serviceaccount.yaml create mode 100644 chart/bootc-operator/templates/daemon-clusterrole.yaml create mode 100644 chart/bootc-operator/templates/daemon-clusterrolebinding.yaml create mode 100644 chart/bootc-operator/templates/daemon-daemonset.yaml create mode 100644 chart/bootc-operator/templates/daemon-serviceaccount.yaml create mode 100644 chart/bootc-operator/templates/leader-election-role.yaml create mode 100644 chart/bootc-operator/templates/leader-election-rolebinding.yaml diff --git a/.gitignore b/.gitignore index c1d5cf8b..dd49bedd 100644 --- a/.gitignore +++ b/.gitignore @@ -4,19 +4,7 @@ bin/ kubeconfig-* docs/book/ user-docs +# Helm dependency artifacts are built locally from the in-tree CRD chart. chart/bootc-operator/crds/ chart/bootc-operator/charts/ chart/bootc-operator/Chart.lock -chart/bootc-operator-crds/templates/ -chart/bootc-operator/templates/controller-clusterrole.yaml -chart/bootc-operator/templates/controller-role.yaml -chart/bootc-operator/templates/controller-rolebinding.yaml -chart/bootc-operator/templates/daemon-clusterrole.yaml -chart/bootc-operator/templates/leader-election-role.yaml -chart/bootc-operator/templates/controller-deployment.yaml -chart/bootc-operator/templates/daemon-daemonset.yaml -chart/bootc-operator/templates/controller-clusterrolebinding.yaml -chart/bootc-operator/templates/daemon-clusterrolebinding.yaml -chart/bootc-operator/templates/leader-election-rolebinding.yaml -chart/bootc-operator/templates/controller-serviceaccount.yaml -chart/bootc-operator/templates/daemon-serviceaccount.yaml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cd6f0f13..58dbf220 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -88,8 +88,14 @@ After modifying API types in `api/`, regenerate CRDs and code: ```shell make manifests # Regenerate CRD and RBAC manifests make generate # Regenerate DeepCopy implementations +make helm # Regenerate the Helm charts from the manifests ``` +Commit regenerated chart templates and CRDs alongside their sources. Keeping +them in Git makes chart changes reviewable and lets users verify the chart at a +given commit without running the generator. CI checks that regeneration leaves +no changed, new, or missing chart files. + ## Testing ### Running Unit Tests diff --git a/chart/bootc-operator-crds/templates/node.bootc.dev_bootcnodepools.yaml b/chart/bootc-operator-crds/templates/node.bootc.dev_bootcnodepools.yaml new file mode 100644 index 00000000..2332791a --- /dev/null +++ b/chart/bootc-operator-crds/templates/node.bootc.dev_bootcnodepools.yaml @@ -0,0 +1,321 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.20.1 + name: bootcnodepools.node.bootc.dev +spec: + group: node.bootc.dev + names: + kind: BootcNodePool + listKind: BootcNodePoolList + plural: bootcnodepools + shortNames: + - bnp + singular: bootcnodepool + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.nodeCount + name: Nodes + type: integer + - jsonPath: .status.updatedCount + name: Updated + type: integer + - jsonPath: .status.updatingCount + name: Updating + type: integer + - jsonPath: .status.degradedCount + name: Degraded + type: integer + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + BootcNodePool defines a group of nodes and their desired OS image state. + Users create BootcNodePool resources to register nodes with the bootc + operator and specify what image they should be running. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec defines the desired state of the pool. + properties: + disruption: + description: disruption controls the disruption behavior during updates. + properties: + rebootPolicy: + default: RebootOnly + description: |- + rebootPolicy defines how nodes should be rebooted during updates. + "RebootOnly" always performs a full node reboot. + "AllowSoftReboot" performs a userspace-only restart when the + update supports it, falling back to a full reboot otherwise. + Defaults to "RebootOnly". + enum: + - RebootOnly + - AllowSoftReboot + type: string + type: object + image: + description: image defines the desired OS image for nodes in this + pool. + properties: + ref: + description: |- + ref is the image reference, either a tag (e.g. "quay.io/example/myos:latest") + or a digest (e.g. "quay.io/example/myos@sha256:abc123"). + minLength: 1 + type: string + required: + - ref + type: object + nodeSelector: + description: |- + nodeSelector selects which nodes belong to this pool. Each node can + belong to at most one pool; overlapping selectors cause the + conflicting pools to be marked Degraded with reason NodeConflict. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: |- + A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: |- + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: |- + values is an array of string values. If the operator is In or NotIn, + the values array must be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + description: |- + matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, whose key field is "key", the + operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + pullSecretRef: + description: |- + pullSecretRef references a Secret containing image pull credentials + for the OS image. The operator propagates this secret to managed nodes. + properties: + name: + description: name is the name of the Secret. + minLength: 1 + type: string + namespace: + description: namespace is the namespace of the Secret. + minLength: 1 + type: string + required: + - name + - namespace + type: object + rollout: + description: rollout controls how updates are rolled out across pool + nodes. + properties: + drainTimeoutSeconds: + description: |- + drainTimeoutSeconds is the maximum time in seconds to wait for a + node drain to complete before marking the node degraded and freeing + the reboot slot. If not set, drains block indefinitely. + format: int32 + minimum: 0 + type: integer + maxUnavailable: + anyOf: + - type: integer + - type: string + description: |- + maxUnavailable is the maximum number of nodes that can be unavailable + during a rolling update. Value can be an absolute number (e.g. 1) or + a percentage of total nodes in the pool (e.g. "25%"). Defaults to 1. + x-kubernetes-int-or-string: true + paused: + description: |- + paused prevents the operator from starting new rollouts. Nodes that + are already mid-staging will complete their staging. Tag resolution + continues and status.targetDigest is kept current. + type: boolean + rebootTimeoutSeconds: + description: |- + rebootTimeoutSeconds is the maximum time in seconds to wait for a + node to boot the desired image after a reboot is issued. If the node + stays in the Rebooting state longer than this (e.g. it failed to + boot the new image or never rejoined the cluster), it is reported as + degraded at the pool level. If not set, the controller waits + indefinitely. + format: int32 + minimum: 0 + type: integer + type: object + required: + - image + - nodeSelector + type: object + status: + description: status defines the observed state of the pool. + properties: + conditions: + description: |- + conditions represent the current state of the pool. + Known condition types are "UpToDate" and "Degraded". + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + degradedCount: + description: degradedCount is the number of nodes in a degraded state. + format: int32 + minimum: 0 + type: integer + deployedDigest: + description: |- + deployedDigest is the last digest fully rolled out to all nodes in + the pool. + type: string + nextTagResolutionTime: + description: |- + nextTagResolutionTime is when the controller will next resolve a + tag ref to a digest. Only set for tag-based image refs. + format: date-time + type: string + nodeCount: + description: nodeCount is the total number of nodes in this pool. + format: int32 + minimum: 0 + type: integer + observedGeneration: + description: |- + observedGeneration is the most recent generation observed by the + controller. It corresponds to the pool's metadata.generation which + is updated on spec mutations. + format: int64 + type: integer + targetDigest: + description: |- + targetDigest is the image digest the pool is rolling out to. For + digest refs, this is set directly from spec.image.ref. For tag refs, + this is the resolved digest from the registry. + type: string + updateAvailable: + description: updateAvailable is true when targetDigest differs from + deployedDigest. + type: boolean + updatedCount: + description: updatedCount is the number of nodes running the target + digest. + format: int32 + minimum: 0 + type: integer + updatingCount: + description: |- + updatingCount is the number of nodes actively being updated + (staging, staged, or rebooting). + format: int32 + minimum: 0 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/chart/bootc-operator-crds/templates/node.bootc.dev_bootcnodes.yaml b/chart/bootc-operator-crds/templates/node.bootc.dev_bootcnodes.yaml new file mode 100644 index 00000000..2de0e122 --- /dev/null +++ b/chart/bootc-operator-crds/templates/node.bootc.dev_bootcnodes.yaml @@ -0,0 +1,299 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.20.1 + name: bootcnodes.node.bootc.dev +spec: + group: node.bootc.dev + names: + kind: BootcNode + listKind: BootcNodeList + plural: bootcnodes + shortNames: + - bn + singular: bootcnode + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + BootcNode represents a single node managed by the bootc operator. + BootcNode objects are auto-created by the controller (one per managed + node) and named after the Node they represent. The controller writes + spec, the daemon writes status. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec defines the desired state, written by the controller. + properties: + desiredImage: + description: |- + desiredImage is the image the node should be running, specified + as a pullspec with digest (e.g. + "quay.io/example/myos@sha256:abc123"). Set by the controller + from the owning pool's targetDigest. + minLength: 1 + type: string + desiredImageState: + description: |- + desiredImageState is the target state the daemon should drive + the node toward. "Staged" means stage the image but do not + reboot. "Booted" means apply the staged image and reboot. + enum: + - Staged + - Booted + type: string + pullSecretHash: + description: |- + pullSecretHash is a hash of the pull secret's content, used to + detect changes. When this value changes, the daemon re-fetches + the secret and updates the host filesystem. + type: string + pullSecretRef: + description: |- + pullSecretRef references a Secret containing image pull + credentials. Copied from the owning pool's spec. + properties: + name: + description: name is the name of the Secret. + minLength: 1 + type: string + namespace: + description: namespace is the namespace of the Secret. + minLength: 1 + type: string + required: + - name + - namespace + type: object + rebootPolicy: + description: |- + rebootPolicy defines how the node should be rebooted during + updates. Copied from the owning pool's disruption.rebootPolicy. + enum: + - RebootOnly + - AllowSoftReboot + type: string + required: + - desiredImage + - desiredImageState + type: object + status: + description: status defines the observed state, written by the daemon. + properties: + bootcVersion: + description: |- + bootcVersion is the version of the bootc binary on the host + (e.g. "1.8.0"), as reported by bootc --version. + maxLength: 256 + type: string + booted: + description: booted describes the currently booted OS image. + properties: + architecture: + description: |- + architecture is the hardware architecture of the image + (e.g. "amd64"). + type: string + image: + description: |- + image is the full image pullspec (e.g. + "quay.io/example/myos@sha256:abc123"). + type: string + imageDigest: + description: imageDigest is the image digest (e.g. "sha256:abc123"). + type: string + incompatible: + description: |- + incompatible is true if the boot entry has local mutations that + bootc cannot manage (e.g. package layering via rpm-ostree). + type: boolean + softRebootCapable: + description: |- + softRebootCapable is true if this boot entry supports a + userspace-only restart relative to the currently booted system. + type: boolean + timestamp: + description: timestamp is the image build timestamp, if any. + format: date-time + type: string + version: + description: version is the image version string, if any. + type: string + required: + - image + - imageDigest + type: object + conditions: + description: |- + conditions represent the daemon's current state. + Known condition types are "Idle" and "Degraded". + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + observedGeneration is the most recent generation observed by the + daemon. It corresponds to the BootcNode's metadata.generation + which is updated on spec mutations. + format: int64 + type: integer + rollback: + description: |- + rollback describes the previous OS image available for rollback, + if any. + properties: + architecture: + description: |- + architecture is the hardware architecture of the image + (e.g. "amd64"). + type: string + image: + description: |- + image is the full image pullspec (e.g. + "quay.io/example/myos@sha256:abc123"). + type: string + imageDigest: + description: imageDigest is the image digest (e.g. "sha256:abc123"). + type: string + incompatible: + description: |- + incompatible is true if the boot entry has local mutations that + bootc cannot manage (e.g. package layering via rpm-ostree). + type: boolean + softRebootCapable: + description: |- + softRebootCapable is true if this boot entry supports a + userspace-only restart relative to the currently booted system. + type: boolean + timestamp: + description: timestamp is the image build timestamp, if any. + format: date-time + type: string + version: + description: version is the image version string, if any. + type: string + required: + - image + - imageDigest + type: object + staged: + description: staged describes the OS image staged for the next boot, + if any. + properties: + architecture: + description: |- + architecture is the hardware architecture of the image + (e.g. "amd64"). + type: string + image: + description: |- + image is the full image pullspec (e.g. + "quay.io/example/myos@sha256:abc123"). + type: string + imageDigest: + description: imageDigest is the image digest (e.g. "sha256:abc123"). + type: string + incompatible: + description: |- + incompatible is true if the boot entry has local mutations that + bootc cannot manage (e.g. package layering via rpm-ostree). + type: boolean + softRebootCapable: + description: |- + softRebootCapable is true if this boot entry supports a + userspace-only restart relative to the currently booted system. + type: boolean + timestamp: + description: timestamp is the image build timestamp, if any. + format: date-time + type: string + version: + description: version is the image version string, if any. + type: string + required: + - image + - imageDigest + type: object + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/chart/bootc-operator/templates/controller-clusterrole.yaml b/chart/bootc-operator/templates/controller-clusterrole.yaml new file mode 100644 index 00000000..18a205fc --- /dev/null +++ b/chart/bootc-operator/templates/controller-clusterrole.yaml @@ -0,0 +1,87 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "bootc-operator.fullname" . }}-controller + labels: + {{- include "bootc-operator.labels" . | nindent 4 }} + app.kubernetes.io/component: controller +rules: +- apiGroups: + - "" + resources: + - nodes + verbs: + - get + - list + - patch + - update + - watch +- apiGroups: + - "" + resources: + - pods + verbs: + - get + - list +- apiGroups: + - "" + resources: + - pods/eviction + verbs: + - create +- apiGroups: + - "" + - events.k8s.io + resources: + - events + verbs: + - create + - patch +- apiGroups: + - apps + resources: + - daemonsets + verbs: + - get +- apiGroups: + - karpenter.sh + resources: + - nodeclaims + verbs: + - get + - list + - patch + - watch +- apiGroups: + - node.bootc.dev + resources: + - bootcnodepools + - bootcnodes + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - node.bootc.dev + resources: + - bootcnodepools/finalizers + verbs: + - update +- apiGroups: + - node.bootc.dev + resources: + - bootcnodepools/status + verbs: + - get + - patch + - update +- apiGroups: + - node.bootc.dev + resources: + - bootcnodes/status + verbs: + - get diff --git a/chart/bootc-operator/templates/controller-clusterrolebinding.yaml b/chart/bootc-operator/templates/controller-clusterrolebinding.yaml new file mode 100644 index 00000000..239bd61a --- /dev/null +++ b/chart/bootc-operator/templates/controller-clusterrolebinding.yaml @@ -0,0 +1,14 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "bootc-operator.fullname" . }}-controller + labels: + {{- include "bootc-operator.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "bootc-operator.fullname" . }}-controller +subjects: + - kind: ServiceAccount + name: {{ include "bootc-operator.fullname" . }}-controller + namespace: {{ .Release.Namespace }} diff --git a/chart/bootc-operator/templates/controller-deployment.yaml b/chart/bootc-operator/templates/controller-deployment.yaml new file mode 100644 index 00000000..34ead8f1 --- /dev/null +++ b/chart/bootc-operator/templates/controller-deployment.yaml @@ -0,0 +1,86 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "bootc-operator.fullname" . }}-controller + namespace: {{ .Release.Namespace }} + labels: + {{- include "bootc-operator.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + control-plane: controller-manager + app.kubernetes.io/name: bootc-operator + app.kubernetes.io/component: controller + replicas: 1 + template: + metadata: + annotations: + kubectl.kubernetes.io/default-container: manager + labels: + control-plane: controller-manager + app.kubernetes.io/name: bootc-operator + app.kubernetes.io/component: controller + spec: + tolerations: + - key: node-role.kubernetes.io/control-plane + operator: Exists + effect: NoSchedule + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - command: + - manager + args: + - --leader-elect + - --health-probe-bind-address=:8081 + - {{ printf "--pull-secret-namespaces=%s" (include "bootc-operator.pullSecretNamespaces" .) | quote }} + {{- range .Values.controller.extraArgs }} + - {{ . | quote }} + {{- end }} + image: {{ include "bootc-operator.image" . }} + {{- with .Values.image.pullPolicy }} + imagePullPolicy: {{ . }} + {{- end }} + name: manager + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + ports: + - containerPort: 8081 + name: health + protocol: TCP + securityContext: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + capabilities: + drop: + - "ALL" + livenessProbe: + httpGet: + path: /healthz + port: 8081 + initialDelaySeconds: 15 + periodSeconds: 20 + readinessProbe: + httpGet: + path: /readyz + port: 8081 + initialDelaySeconds: 5 + periodSeconds: 10 + resources: + limits: + cpu: 500m + memory: 128Mi + requests: + cpu: 10m + memory: 64Mi + serviceAccountName: {{ include "bootc-operator.fullname" . }}-controller + terminationGracePeriodSeconds: 10 diff --git a/chart/bootc-operator/templates/controller-role.yaml b/chart/bootc-operator/templates/controller-role.yaml new file mode 100644 index 00000000..97468edd --- /dev/null +++ b/chart/bootc-operator/templates/controller-role.yaml @@ -0,0 +1,27 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ include "bootc-operator.fullname" . }}-controller + namespace: {{ .Release.Namespace }} + labels: + {{- include "bootc-operator.labels" . | nindent 4 }} + app.kubernetes.io/component: controller +rules: +- apiGroups: + - "" + resources: + - secrets + verbs: + - create + - get + - list + - watch +- apiGroups: + - "" + resourceNames: + - bootc-pull-secrets + resources: + - secrets + verbs: + - patch + - update diff --git a/chart/bootc-operator/templates/controller-rolebinding.yaml b/chart/bootc-operator/templates/controller-rolebinding.yaml new file mode 100644 index 00000000..8bc4d930 --- /dev/null +++ b/chart/bootc-operator/templates/controller-rolebinding.yaml @@ -0,0 +1,15 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ include "bootc-operator.fullname" . }}-controller + namespace: {{ .Release.Namespace }} + labels: + {{- include "bootc-operator.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "bootc-operator.fullname" . }}-controller +subjects: + - kind: ServiceAccount + name: {{ include "bootc-operator.fullname" . }}-controller + namespace: {{ .Release.Namespace }} diff --git a/chart/bootc-operator/templates/controller-serviceaccount.yaml b/chart/bootc-operator/templates/controller-serviceaccount.yaml new file mode 100644 index 00000000..713235b5 --- /dev/null +++ b/chart/bootc-operator/templates/controller-serviceaccount.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "bootc-operator.fullname" . }}-controller + namespace: {{ .Release.Namespace }} + labels: + {{- include "bootc-operator.labels" . | nindent 4 }} diff --git a/chart/bootc-operator/templates/daemon-clusterrole.yaml b/chart/bootc-operator/templates/daemon-clusterrole.yaml new file mode 100644 index 00000000..efd8e8f7 --- /dev/null +++ b/chart/bootc-operator/templates/daemon-clusterrole.yaml @@ -0,0 +1,24 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "bootc-operator.fullname" . }}-daemon + labels: + {{- include "bootc-operator.labels" . | nindent 4 }} + app.kubernetes.io/component: daemon +rules: +- apiGroups: + - node.bootc.dev + resources: + - bootcnodes + verbs: + - get + - list + - watch +- apiGroups: + - node.bootc.dev + resources: + - bootcnodes/status + verbs: + - get + - update + - patch diff --git a/chart/bootc-operator/templates/daemon-clusterrolebinding.yaml b/chart/bootc-operator/templates/daemon-clusterrolebinding.yaml new file mode 100644 index 00000000..a7440382 --- /dev/null +++ b/chart/bootc-operator/templates/daemon-clusterrolebinding.yaml @@ -0,0 +1,14 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "bootc-operator.fullname" . }}-daemon + labels: + {{- include "bootc-operator.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "bootc-operator.fullname" . }}-daemon +subjects: + - kind: ServiceAccount + name: {{ include "bootc-operator.fullname" . }}-daemon + namespace: {{ .Release.Namespace }} diff --git a/chart/bootc-operator/templates/daemon-daemonset.yaml b/chart/bootc-operator/templates/daemon-daemonset.yaml new file mode 100644 index 00000000..db22677f --- /dev/null +++ b/chart/bootc-operator/templates/daemon-daemonset.yaml @@ -0,0 +1,62 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: {{ include "bootc-operator.fullname" . }}-daemon + namespace: {{ .Release.Namespace }} + labels: + {{- include "bootc-operator.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: bootc-operator + app.kubernetes.io/component: daemon + template: + metadata: + labels: + app.kubernetes.io/name: bootc-operator + app.kubernetes.io/component: daemon + spec: + nodeSelector: + bootc.dev/managed: "" + hostPID: true + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: daemon + command: + - daemon + image: {{ include "bootc-operator.image" . }} + {{- with .Values.image.pullPolicy }} + imagePullPolicy: {{ . }} + {{- end }} + env: + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + securityContext: + privileged: true + runAsUser: 0 + runAsGroup: 0 + resources: + limits: + cpu: 500m + memory: 128Mi + requests: + cpu: 10m + memory: 64Mi + volumeMounts: + - name: pull-secrets + mountPath: /var/run/bootc-pull-secrets + readOnly: true + volumes: + - name: pull-secrets + secret: + secretName: bootc-pull-secrets + optional: true + tolerations: + - operator: Exists + serviceAccountName: {{ include "bootc-operator.fullname" . }}-daemon + terminationGracePeriodSeconds: 10 diff --git a/chart/bootc-operator/templates/daemon-serviceaccount.yaml b/chart/bootc-operator/templates/daemon-serviceaccount.yaml new file mode 100644 index 00000000..cce28b96 --- /dev/null +++ b/chart/bootc-operator/templates/daemon-serviceaccount.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "bootc-operator.fullname" . }}-daemon + namespace: {{ .Release.Namespace }} + labels: + {{- include "bootc-operator.labels" . | nindent 4 }} diff --git a/chart/bootc-operator/templates/leader-election-role.yaml b/chart/bootc-operator/templates/leader-election-role.yaml new file mode 100644 index 00000000..facb1ef8 --- /dev/null +++ b/chart/bootc-operator/templates/leader-election-role.yaml @@ -0,0 +1,28 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ include "bootc-operator.fullname" . }}-leader-election + namespace: {{ .Release.Namespace }} + labels: + {{- include "bootc-operator.labels" . | nindent 4 }} + app.kubernetes.io/component: controller +rules: +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch diff --git a/chart/bootc-operator/templates/leader-election-rolebinding.yaml b/chart/bootc-operator/templates/leader-election-rolebinding.yaml new file mode 100644 index 00000000..368903a3 --- /dev/null +++ b/chart/bootc-operator/templates/leader-election-rolebinding.yaml @@ -0,0 +1,14 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ include "bootc-operator.fullname" . }}-leader-election + labels: + {{- include "bootc-operator.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "bootc-operator.fullname" . }}-leader-election +subjects: + - kind: ServiceAccount + name: {{ include "bootc-operator.fullname" . }}-controller + namespace: {{ .Release.Namespace }} From ed12b7d8b79bc6822211048c5a1280e69ce8c7e6 Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Mon, 16 Nov 2026 09:30:13 +0000 Subject: [PATCH 2/2] ci: Verify committed Helm manifests are current Regenerate the chart in the existing generated-file check so stale templates fail CI. Also detect new chart files, which git diff misses. Assisted-by: AI Signed-off-by: Alice Frosi --- .github/workflows/ci.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7af66b59..eccf7d08 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,8 +36,13 @@ jobs: - name: Check generated files run: | - make fmt manifests generate - git diff --exit-code || { echo "Run 'make fmt manifests generate' and commit the results"; exit 1; } + make fmt manifests generate helm + git diff --exit-code || { echo "Run 'make fmt manifests generate helm' and commit the results"; exit 1; } + if [[ -n "$(git ls-files --others --exclude-standard -- chart/)" ]]; then + git ls-files --others --exclude-standard -- chart/ + echo "Run 'make helm' and commit the new chart files" + exit 1 + fi - name: Unit tests run: make unit