Skip to content

How to deploy workload on K8S with Flux and Helm Operator

Notifications You must be signed in to change notification settings

melvinlee/flux-helloworld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flux HelloWorld

This example demostrate how to install and configure Flux and Helm Operator on AKS cluter.

In this example, we are deploying Istio, Nginx Ingress, Weavescope, etc with FluxCD.

This config has the following folder structure.

.
├── README.md
├── launch.config
├── launch.sh
├── namespaces
│   ├── ingress.yaml
│   ├── istio-system.yaml
│   ├── monitoring.yaml
│   └── weavescope.yaml
├── releases
│   ├── grafana.yaml
│   ├── nginx-ingress.yaml
│   ├── prometheus.yaml
│   └── weavescope.yaml
└── workloads
    ├── istio-controlplane.yaml
    ├── istio-operator.yaml
    └── ms-agentconfig.yaml

Inside the release directory there are HelmRelease defination.

The workloads directory contain workload for the chart that we deployed or additional resources to be deployed.

Prerequisite (Optional)

To setup a new AKS cluster on Azure, simple execute the launch-pad, it will create a new resources group and a new aks cluster.

./launch aks

To connect to your cluster using kubectl, run the following command (replace your-rg and your-aks with your resources group and aks name)

az aks get-credentials --resource-group <your-rg> --name <your-aks>

QuickStart (Get started with Flux using Helm)

  1. Create the fluxcd namespace:
kubectl create ns fluxcd
  1. Add FluxCD repository:
helm repo add fluxcd https://charts.fluxcd.io
  1. Install Flux by specifying your fork URL (replace fluxcd with your GitHub username):
helm upgrade -i flux fluxcd/flux --wait \
--namespace fluxcd \
--set registry.pollInterval=1m \
--set git.pollInterval=1m \
--set syncGarbageCollection.enabled=true \
--set git.readonly=true \
--set git.url=git@github.com:melvinlee/flux-helloworld
  1. Install the HelmRelease Kubernetes custom resource definition:
kubectl apply -f https://raw.githubusercontent.com/fluxcd/helm-operator/master/deploy/crds.yaml
  1. Install Flux Helm Operator with Helm v3 support:
helm upgrade -i helm-operator fluxcd/helm-operator --wait \
--namespace fluxcd \
--set git.ssh.secretName=flux-git-deploy \
--set helm.versions=v3
  1. Cleanup
./launch destroy