Skip to content

Commit

Permalink
Add distribution artifact to API
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
  • Loading branch information
stefanprodan committed Jun 15, 2024
1 parent 6832068 commit d698cca
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/v1/fluxinstance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ type Distribution struct {
// to use for pulling images.
// +optional
ImagePullSecret string `json:"imagePullSecret,omitempty"`

// Artifact is the URL to the OCI artifact containing
// the latest Kubernetes manifests for the distribution,
// e.g. 'oci://ghcr.io/controlplaneio-fluxcd/flux-operator-manifests:latest'.
// +kubebuilder:validation:Pattern="^oci://.*$"
// +optional
Artifact string `json:"manifestsURL,omitempty"`
}

// Component is the name of a controller to install.
Expand Down
7 changes: 7 additions & 0 deletions config/crd/bases/fluxcd.controlplane.io_fluxinstances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ spec:
ImagePullSecret is the name of the Kubernetes secret
to use for pulling images.
type: string
manifestsURL:
description: |-
Artifact is the URL to the OCI artifact containing
the latest Kubernetes manifests for the distribution,
e.g. 'oci://ghcr.io/controlplaneio-fluxcd/flux-operator-manifests:latest'.
pattern: ^oci://.*$
type: string
registry:
description: |-
Registry address to pull the distribution images from
Expand Down
17 changes: 17 additions & 0 deletions docs/api/v1/fluxinstance.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,23 @@ kubectl create secret docker-registry flux-enterprise-auth \
--docker-password=$ENTERPRISE_TOKEN
```

#### Distribution artifact

The `.spec.distribution.artifact` field is optional and specifies the OCI artifact URL
containing the Flux distribution manifests. When specified, the operator will pull the
artifact on a regular interval to determine the latest Flux version available
including CVE patches and hotfixes.

Example using the official distribution artifact:

```yaml
spec:
distribution:
version: "2.x"
registry: "ghcr.io/fluxcd"
artifact: "oci://ghcr.io/controlplaneio-fluxcd/flux-operator-manifests"
```

### Components configuration

The `.spec.components` field is optional and specifies the list of Flux components to install.
Expand Down

0 comments on commit d698cca

Please sign in to comment.