Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 1 addition & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
321 changes: 321 additions & 0 deletions chart/bootc-operator-crds/templates/node.bootc.dev_bootcnodepools.yaml
Original file line number Diff line number Diff line change
@@ -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: {}
Loading
Loading