flux
No long description provided.
Installation
dagger install gitlab.com/abes140377/daggerverse/flux@92d471a47a29cf2329fd810369150a261e769a79Entrypoint
Return Type
Flux Example
dagger -m gitlab.com/abes140377/daggerverse/flux@92d471a47a29cf2329fd810369150a261e769a79 call \
func (m *MyModule) Example() *dagger.Flux {
return dag.
Flux()
}@function
def example() -> dagger.Flux:
return (
dag.flux()
)@func()
example(): Flux {
return dag
.flux()
}Types
Flux 🔗
bootstrap() 🔗
Bootstraps the Flux Operator on an existing Kubernetes cluster.
Step 1: Checks prerequisites with flux check --pre
Step 2: Installs the Flux Operator via Helm
Step 3: Creates the GitLab pull secret (flux-system)
Step 4: Creates the SOPS AGE secret (flux-sops)
Step 5 (optional): Applies cluster manifests (runtime-info.yaml + flux-instance.yaml)
Step 6 (optional): Waits for the FluxInstance to be ready (with diagnostic output on failure)
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| kubeconfig | File ! | - | - Kubeconfig file of the target cluster |
| gitlabUser | String ! | - | - GitLab username (e.g. abes140377) |
| gitlabToken | Secret ! | - | - GitLab Personal Access Token (as a Dagger Secret) |
| sopsAgeKey | Secret ! | - | - AGE key for SOPS decryption (as a Dagger Secret) |
| k3Sservice | Service | - | - Optional k3s service binding for internal cluster access |
| clusterDir | Directory | - | - Optional directory containing cluster manifests (enables steps 5+6) |
| timeout | String ! | "2m" | - Timeout for waiting for FluxInstance readiness (default: 2m) |
Example
dagger -m gitlab.com/abes140377/daggerverse/flux@92d471a47a29cf2329fd810369150a261e769a79 call \
bootstrap --kubeconfig file:path --gitlab-user string --gitlab-token env:MYSECRET --sops-age-key env:MYSECRET --timeout stringfunc (m *MyModule) Example(ctx context.Context, kubeconfig *dagger.File, gitlabUser string, gitlabToken *dagger.Secret, sopsAgeKey *dagger.Secret, timeout string) string {
return dag.
Flux().
Bootstrap(ctx, kubeconfig, gitlabUser, gitlabToken, sopsAgeKey, timeout)
}@function
async def example(kubeconfig: dagger.File, gitlab_user: str, gitlab_token: dagger.Secret, sops_age_key: dagger.Secret, timeout: str) -> str:
return await (
dag.flux()
.bootstrap(kubeconfig, gitlab_user, gitlab_token, sops_age_key, timeout)
)@func()
async example(kubeconfig: File, gitlabUser: string, gitlabToken: Secret, sopsAgeKey: Secret, timeout: string): Promise<string> {
return dag
.flux()
.bootstrap(kubeconfig, gitlabUser, gitlabToken, sopsAgeKey, timeout)
}pushArtifact() 🔗
Pushes OCI artifacts to a registry and optionally signs them with Cosign.
In single mode (components empty) the entire source directory is pushed as a single OCI artifact under registry:version.
In multi mode (components provided) each component from the subdirectory components/ is pushed as a separate OCI artifact under registry/:version.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | - Source directory |
| registry | String ! | - | - OCI registry URL without prefix, e.g. "registry.gitlab.com/user/repo" |
| gitlabUser | String ! | - | - GitLab username for registry authentication |
| gitlabToken | Secret ! | - | - GitLab token for registry authentication |
| gitUrl | String ! | - | - Git URL of the source (for artifact metadata) |
| gitRevision | String ! | - | - Git revision (for artifact metadata) |
| version | String ! | - | - Version tag of the artifact, e.g. "1.0.0" or a Git SHA |
| tag | String ! | "latest" | - Mutable tag set after the push (default: "latest") |
| components | [String ! ] | - | - Component names below components/ (multi mode when provided) |
| sign | Boolean ! | true | - Enable Cosign signing (default: true) |
Example
dagger -m gitlab.com/abes140377/daggerverse/flux@92d471a47a29cf2329fd810369150a261e769a79 call \
push-artifact --source DIR_PATH --registry string --gitlab-user string --gitlab-token env:MYSECRET --git-url string --git-revision string --version string --tag string --sign booleanfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, registry string, gitlabUser string, gitlabToken *dagger.Secret, gitUrl string, gitRevision string, version string, tag string, sign bool) string {
return dag.
Flux().
PushArtifact(ctx, source, registry, gitlabUser, gitlabToken, gitUrl, gitRevision, version, tag, sign)
}@function
async def example(source: dagger.Directory, registry: str, gitlab_user: str, gitlab_token: dagger.Secret, git_url: str, git_revision: str, version: str, tag: str, sign: bool) -> str:
return await (
dag.flux()
.push_artifact(source, registry, gitlab_user, gitlab_token, git_url, git_revision, version, tag, sign)
)@func()
async example(source: Directory, registry: string, gitlabUser: string, gitlabToken: Secret, gitUrl: string, gitRevision: string, version: string, tag: string, sign: boolean): Promise<string> {
return dag
.flux()
.pushArtifact(source, registry, gitlabUser, gitlabToken, gitUrl, gitRevision, version, tag, sign)
}