- Minikube cluster is already installed and running
- Linux-based machine
- Open a terminal window.
- Run the following command to download the Flux CLI binary:
curl -s https://fluxcd.io/install.sh | sudo bash sudo chmod +x /usr/local/bin/flux
- Verify the installation by running the following command:
You should see the version of Flux CLI printed on the console.
flux --version
- Open your web browser and go to GitHub.
- Navigate to your GitHub profile settings.
- Go to "Developer settings" > "Personal access tokens".
- Click on "Generate new token".
- Provide a meaningful name for the token and select the required scopes (repo full).
- Click on "Generate token" and make a note of the generated token.
export GITHUB_USER=<your-github-username>
sed -i "s/angrajales/$GITHUB_USER/g" ./clusters/minikube/flux-system/gotk-sync.yaml
git add -A
git commit -m "Change github user"
git push
kubectl create ns dev
kubectl create ns qa
kubectl label ns dev istio-injection=enabled
kubectl label ns qa istio-injection=enabled
-
Open a terminal window.
-
Run the following command to set up the FluxCD namespace and configure it to use HTTPS + GitHub + GitHub PAT:
export GITHUB_TOKEN=<your-github-token> export GITHUB_USER=<your-github-username> export GITHUB_REPO=fluxcd-flagger-workshop export GITHUB_BRANCH=main export FLUX_FORWARD_NAMESPACE=flux-system export CLUSTER_NAME=minikube flux bootstrap github \ --token-auth \ --owner=$GITHUB_USER \ --repository=$GITHUB_REPO \ --branch=$GITHUB_BRANCH \ --path=./clusters/$CLUSTER_NAME \ --personal \ --namespace=$FLUX_FORWARD_NAMESPACE
Replace the placeholders with your actual values.
-
FluxCD will now sync with your GitHub repository and start deploying the defined resources to your Minikube cluster.
-
Run the following command to check the status of FluxCD:
flux check
You should see a summary of the resources that FluxCD has deployed.
-
To view the deployed resources, run the following command:
kubectl get all -n $FLUX_FORWARD_NAMESPACE
You should see a list of resources deployed by FluxCD.
-
Execute reconcile process to validate the setup:
flux reconcile source git flux-system
You should see a list of resources deployed by FluxCD.
Congratulations! You have successfully set up FluxCD with Minikube using HTTPS + GitHub + GitHub PAT.