# Preparing Git repos and management cluster for Flux This guide describes an **alternative installation path** for OSM in environments where a Kubernetes management cluster already exists and the Git repositories for the SW catalog and the fleet of clusters have been pre-created. This is the recommended approach for production deployments and for organisations that manage their own Git infrastructure. If you are starting from scratch (no existing cluster, no Git repos), use the [standard OSM installation](installing-osm.md) instead, which provisions everything automatically. ## Pre-requirements An installer machine is required to run the setup scripts. The recommended OS is Ubuntu 24.04, though other distributions may also work. Before running any script, make sure the following are available: - A running Kubernetes cluster to be used as the **management cluster**, with its kubeconfig accessible from the installer machine. - Two empty Git repositories to host the SW catalog and the cluster fleet. Recommended names are `sw-catalogs-osm` and `fleet-osm`. - A Git user with HTTP and SSH access to both repositories. This user will be used both during initial population and by Flux for ongoing synchronisation. ## Initial setup Clone the OSM devops repository, which contains the installation scripts: ```bash git clone "https://osm.etsi.org/gitlab/osm/devops" cd devops git checkout "v18.0" git pull ``` Configure `~/.osm/user-install-options.rc` with the path to the management cluster kubeconfig: ```bash export KUBECONFIG_MGMT_CLUSTER=~/.kube/management-cluster-kubeconfig.yaml # export MGMT_CLUSTER_CA_FILE="/usr/local/share/ca-certificates/your-ca-cert.crt" ``` Configure `~/.osm/.credentials/git_environment.rc` with your Git server credentials. Replace the placeholders with your actual values: ```bash export FLEET_REPO_HTTP_URL="http:////fleet-osm.git" export FLEET_REPO_SSH_URL="ssh://git@://fleet-osm.git" export FLEET_REPO_GIT_USERNAME="" export FLEET_REPO_GIT_USER_PASS='' export SW_CATALOGS_REPO_HTTP_URL="http:////sw-catalogs-osm.git" export SW_CATALOGS_REPO_SSH_URL="ssh://git@://sw-catalogs-osm.git" export SW_CATALOGS_REPO_GIT_USERNAME="" export SW_CATALOGS_REPO_GIT_USER_PASS='' ``` ## Install client tools The following script installs the required tools on the installer machine: `kubectl`, `helm`, `curl`, the Flux CLI, `git`, `age`, and the Argo Workflows CLI. ```bash ./installers/10-install-client-tools.sh ``` ## Deploy the management cluster This script deploys Flux and the CRDs and operators required to manage cluster lifecycle (Crossplane, CAPI, etc.) into the management cluster. It also configures Flux to synchronise with the Git repositories and populates them with their initial content. ```bash ./installers/30-deploy-mgmt-cluster.sh ``` Once complete, the Git repositories are populated and a local copy is available under `~/.osm/repos`. Verify that Flux is running and the repositories and kustomizations are visible: ```bash kubectl get gitrepo -A kubectl get ks -A ```