An open API service indexing awesome lists of open source software.

https://github.com/johnlam90/clusterapi-gitops-helm


https://github.com/johnlam90/clusterapi-gitops-helm

argocd cicd cluster-api clusterctl devops git helm-charts kubeadm kubernetes vsphere

Last synced: 29 days ago
JSON representation

Awesome Lists containing this project

README

          

# Cluster API GitOps using helm and ArgoCD








## Goals

- To bring [declarative style](https://cluster-api.sigs.k8s.io/introduction.html), 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](https://github.com/argoproj/argo-cd)) to deploy, scale-in/scale-out and rollback your Kubernetes clusters.

argo

## Prerequisites

- [kind](https://kind.sigs.k8s.io/) - This will act as your management cluster for bootstrapping cluster-api components.
- [clusterctl](https://cluster-api.sigs.k8s.io/user/quick-start.html) - The clusterctl CLI tool handles the lifecycle of a Cluster API management cluster.
- [Govc](https://github.com/vmware/govmomi/tree/master/govc) - Govc will be used to interact with your vSphere environment.
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
- [helm](https://github.com/helm/helm)
- vSphere 6.7U3 or above

For more information refer to the cluster-api [quickstart](https://cluster-api.sigs.k8s.io/user/quick-start.html)

## 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](https://argoproj.github.io/argo-cd/getting_started/)

```
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