Skip to content

johnlam90/clusterapi-gitops-helm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cluster API GitOps using helm and ArgoCD

Goals

  • To bring declarative style, Kubernetes style APIs to cluster creation
  • Use helm to modify k8 cluster values based on requirement. This helps in code reusability
  • Version control
  • Using GitOps(ArgoCD) to deploy, scale-in/scale-out and rollback your Kubernetes clusters.

argo

Prerequisites

  • kind - This will act as your management cluster for bootstrapping cluster-api components.
  • clusterctl - The clusterctl CLI tool handles the lifecycle of a Cluster API management cluster.
  • Govc - Govc will be used to interact with your vSphere environment.
  • kubectl
  • helm
  • vSphere 6.7U3 or above

For more information refer to the cluster-api quickstart

Installation

Clone repository

git clone https://github.com/johnlam90/capv-helm.git
cd capv-helm 

Install argocd on you kind cluster

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Access the GUI using port forwarding

Note: Ideally you will use LoadBalancer or Ingress in production deployments, but port forwarding will do for our kind cluster. Refer to the argo doc

kubectl port-forward svc/argocd-server -n argocd 8080:443

Deploy the Application

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: capv
  namespace: argocd
spec:
  destination:
    namespace: 'default'
    server: https://kubernetes.default.svc
  project: default
  source:
    helm:
      valueFiles:
      - values.yaml
    path: capv
    repoURL: https://github.com/johnlam90/capv-helm.git
    targetRevision: HEAD
  syncPolicy:
    automated: {}

Note: Change the repoURL to your git repository