Skip to content

A demo for the vcluster meetup

License

Notifications You must be signed in to change notification settings

mtougeron/vcluster-meetup-demo

Repository files navigation

vcluster-meetup-demo

The demo stuff for the loft.sh vcluster meetup on Sept 26th, 2022.

Links

Quick links

View the presentation slides

Slides: One, Two, Green & Blue; See The Ways Vcluster Can Work For You but the demo in the video or the code described below is really the interesting stuff...

View the recording

Quick & dirty steps for how to run this demo

Warning: Thar might be dragons here... I always recommend understanding what you're doing rather than blindly copy/pasting commands...

  1. If you need to build a Kubernetes cluster, follow this quick-start guide
  2. Install clusterctl
  3. Modify ~/.cluster-api/clusterctl.yaml and add the vcluster provider
    providers:
    - name: vcluster
        url: https://github.com/loft-sh/cluster-api-provider-vcluster/releases/latest/infrastructure-components.yaml
        type: InfrastructureProvider      
  4. Make sure your KUBECONFIG is pointing to the cluster you want to have Argo CD and the vcluster(s) installed on
  5. Install Argo CD on the cluster
  6. Initialize cluster-api clusterctl init --infrastructure vcluster
  7. Create a namespace to run in kubectl create ns vcluster
  8. Fork this repo so you can make modifications and test out the process
  9. Take the argocd/applicationset.yaml and modify to set any helm values as appropriate. e.g., set the base_domain_name and ingress_class if you want (I prefer to use some form of ingress over vcluster connect)
    • NOTE: If you don't use Contour for your ingress, you'll want to change from HTTPProxy to your ingress object of choice for the helm chart.
    • Be sure to update the Chart.yaml with a new version number with each change
    • Point the spec.generators.pullRequest.github.owner & spec.generators.pullRequest.github.repo to your forked repo
    • Update the spec.template.spec.source.repoURL to your forked repo
  10. Apply the ApplicationSet by running kubectl apply -f applicationset.yaml -n argocd
  11. Create a PR against your forked repo
  12. Check that a new Argo CD Application has been automatically created kubectl get applications -n argocd
  13. Check that a new vcluster is being created kubectl get cluster -n vcluster by the cluster-api
  14. Get the KUBECONFIG for the new vcluster clusterctl get kubeconfig <cluster name from above> --namespace vcluster > kubeconfig.yaml
  15. Use the new vcluster export KUBECONFIG="$(pwd)/kubeconfig.yaml"
  16. Profit!

About

A demo for the vcluster meetup

Resources

License

Stars

Watchers

Forks