mirror of
https://github.com/fluxcd/flux2-hub-spoke-example.git
synced 2025-07-28 00:03:19 +00:00
Add fleet provisioning scripts
This commit is contained in:
parent
078241aa82
commit
df51542b21
3 changed files with 95 additions and 0 deletions
37
scripts/flux-up.sh
Executable file
37
scripts/flux-up.sh
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This script configures Flux on the hub cluster.
|
||||
|
||||
# Copyright 2024 The Flux authors. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
||||
repo_root=$(git rev-parse --show-toplevel)
|
||||
mkdir -p "${repo_root}/bin"
|
||||
|
||||
CLUSTER_VERSION="${CLUSTER_VERSION:=v1.29.2}"
|
||||
|
||||
CLUSTER_HUB="flux-hub"
|
||||
|
||||
echo "INFO - Installing Flux in the hub cluster"
|
||||
|
||||
flux --context "kind-${CLUSTER_HUB}" install \
|
||||
--components-extra=image-reflector-controller,image-automation-controller
|
||||
|
||||
flux --context "kind-${CLUSTER_HUB}" create source git flux-system \
|
||||
--url=https://github.com/fluxcd/flux2-hub-spoke-example \
|
||||
--branch=main \
|
||||
--interval=1m \
|
||||
--username=git \
|
||||
--password=${GITHUB_TOKEN}
|
||||
|
||||
flux --context "kind-${CLUSTER_HUB}" create kustomization flux-system \
|
||||
--source=GitRepository/flux-system \
|
||||
--ignore-paths="hub/flux-system/"
|
||||
--path="./hub" \
|
||||
--prune=true \
|
||||
--interval=10m
|
||||
|
||||
echo "INFO - Flux configured successfully"
|
Loading…
Add table
Add a link
Reference in a new issue