Skip to content

Commit 45bad15

Browse files
authored
Refactor for kubecon (#35)
refactor for kubecon na 2023
1 parent 40227ea commit 45bad15

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2534
-1289
lines changed

README.md

+31-20
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
11
# GitOps Bridge
22

3-
The GitOps Bridge is a community project to show best practices and patterms on how to bridge the process of creating a Kubernetes Cluster to then delegate everything after that to GitOps using [ArgoCD](https://www.cncf.io/projects/argo/) or [FluxCD](https://www.cncf.io/projects/flux/) both CNCF graduated projects.
3+
The [GitOps Bridge](https://github.com/gitops-bridge-dev/gitops-bridge) is a community project that aims to showcase best practices and patterns for bridging the process of creating a Kubernetes cluster to subsequently managing everything through GitOps. It focuses on using [ArgoCD](https://www.cncf.io/projects/argo/) or [FluxCD](https://www.cncf.io/projects/flux/), both of which are CNCF-graduated projects.
44

5-
See the git repository [GitOps Control Plane](https://github.com/gitops-bridge-dev/gitops-bridge-argocd-control-plane-template) for an example template on bootstrapping ArgoCD
5+
For an example template on bootstrapping ArgoCD, see the GitHub repository [GitOps Control Plane](https://github.com/gitops-bridge-dev/gitops-bridge-argocd-control-plane-template).
66

7-
There are many tools to create Kubernetes clusters, this include roll your own like kubeadmin/minikube/kind or a cloud managed service like Amazon EKS. It should not matter how the the cluster is created in terms of GitOps, GitOps engines should be compatible with any tool that the user choose to use to create the cluster include cases using Kubernetes to create other Kubernetes clusters like CAPI/CAPA, Crossplane, ACK, or any tool running inside Kubernetes to deploy Kubernetes.
7+
There are many tools available for creating Kubernetes clusters. These include "roll-your-own" solutions like `kubeadm`, `minikube`, and `kind`, as well as cloud-managed services like Amazon EKS. The method of cluster creation should not impact GitOps compatibility; GitOps engines should work with any tool that the user chooses for cluster creation. This includes scenarios where Kubernetes is used to create other Kubernetes clusters, such as with CAPI/CAPA, Crossplane, ACK, or any tool running inside Kubernetes to deploy Kubernetes.
88

9-
The GitOps Bridge becomes extremely important for cloud managed kubernetes, this cluster have integrations with cloud services. When using GitOps to install a tool in this cases, the tool usually via helm needs to be configure with metadata about resources or workload identity (IAM) that is available as a result of running a IaC tool such terraform, cloudformation, or cloud cli. The GitOps Bridge would show patterns on how to bridge this metadata about the cluster to GitOps using features specific GitOps engine combined.
9+
The GitOps Bridge becomes extremely important in the context of cloud-managed Kubernetes clusters, as these clusters often have integrations with cloud services. When using GitOps to install a tool in such cases, the tool—usually configured via Helm—needs to be set up with metadata about resources or workload identities (like IAM). This metadata is often available as a result of running an Infrastructure as Code (IaC) tool such as Terraform, CloudFormation, or a cloud CLI. The GitOps Bridge provides patterns for bridging this metadata to GitOps, using features specific to the GitOps engine in use.
10+
11+
The GitOps Bridge should also be compatible with GitOps engines that run as SaaS and are not installed inside the cluster, such as the Akuity Platform, CodeFresh, Weaveworks, and others.
12+
13+
14+
<img src="https://raw.githubusercontent.com/gitops-bridge-dev/gitops-bridge/addons-variables/argocd/iac/terraform/examples/eks/getting-started/static/gitops-bridge.drawio.png" width=100%>
15+
16+
17+
The [GitOps Bridge Pattern](https://github.com/gitops-bridge-dev) enables Kubernetes administrators to utilize Infrastructure as Code (IaC) and GitOps tools for deploying Kubernetes Addons and Workloads. Addons often depend on Cloud resources that are external to the cluster. The configuration metadata for these external resources is required by the Addons' Helm charts. While IaC is used to create these cloud resources, it is not used to install the Helm charts. Instead, the IaC tool stores this metadata either within GitOps resources in the cluster or in a Git repository. The GitOps tool then extracts these metadata values and passes them to the Helm chart during the Addon installation process. This mechanism forms the bridge between IaC and GitOps, hence the term "GitOps Bridge."
18+
19+
Try out the [Getting Started](https://github.com/gitops-bridge-dev/gitops-bridge/tree/main/argocd/iac/terraform/examples/eks/getting-started) example.
20+
21+
Additional examples available on the [GitOps Bridge Pattern](https://github.com/gitops-bridge-dev):
22+
- [argocd-ingress](https://github.com/gitops-bridge-dev/gitops-bridge/tree/main/argocd/iac/terraform/examples/eks/argocd-ingress)
23+
- [aws-secrets-manager](https://github.com/gitops-bridge-dev/gitops-bridge/tree/main/argocd/iac/terraform/examples/eks/aws-secrets-manager)
24+
- [crossplane](https://github.com/gitops-bridge-dev/gitops-bridge/tree/main/argocd/iac/terraform/examples/eks/crossplane)
25+
- [external-secrets](https://github.com/gitops-bridge-dev/gitops-bridge/tree/main/argocd/iac/terraform/examples/eks/external-secrets)
26+
- [multi-cluster/distributed](https://github.com/gitops-bridge-dev/gitops-bridge/tree/main/argocd/iac/terraform/examples/eks/multi-cluster/distributed)
27+
- [multi-cluster/hub-spoke](https://github.com/gitops-bridge-dev/gitops-bridge/tree/main/argocd/iac/terraform/examples/eks/multi-cluster/hub-spoke)
28+
- [multi-cluster/hub-spoke-shared](https://github.com/gitops-bridge-dev/gitops-bridge/tree/main/argocd/iac/terraform/examples/eks/multi-cluster/hub-spoke-shared)
29+
- [private-git](https://github.com/gitops-bridge-dev/gitops-bridge/tree/main/argocd/iac/terraform/examples/eks/private-git)
1030

11-
The GitOps Bridge should also be compatible with GitOps engines that run as Saas and not install inside the cluster such as Akuity Platform, CodeFresh, Weaveworks and others.
1231

1332
### ArgoCD
1433

@@ -22,30 +41,22 @@ of the Kubernetes resources, any changes to these resources outside Terraform fo
2241
### ArgoCD Status
2342
| IaC | GitOps | Status |
2443
| :--- | :----: | ---: |
25-
| Terraform | ArgoCD | Stable [try it!](argocd/iac/terraform/examples/eks/) |
44+
| Terraform | ArgoCD | Stable [try it!](argocd/iac/terraform/examples/eks/getting-started) |
2645
| EKSCTL | ArgoCD | |
2746
| CDK | ArgoCD | |
2847
| Crossplane | ArgoCD | |
2948
| CAPI | ArgoCD | |
3049
| Pulumi | ArgoCD | |
31-
| ACK | ArgoCD | |
32-
| CloudFormation | ArgoCD | |
33-
| Kops | ArgoCD | |
34-
| Ansible | ArgoCD | |
3550

3651
### FluxCD Status
3752
| IaC | GitOps | Status |
3853
| :--- | :----: | ---: |
39-
| Terraform | FluxCD | Soon |
40-
| EKSCTL | FluxCD | |
41-
| CDK | FluxCD | |
42-
| Crossplane | FluxCD | |
43-
| CAPI | FluxCD | |
44-
| Pulumi | FluxCD | |
45-
| ACK | FluxCD | |
46-
| CloudFormation | FluxCD | |
47-
| Kops | FluxCD | |
48-
| Ansible | FluxCD | |
54+
| Terraform | FluxCD | [In Progress](https://github.com/gitops-bridge-dev/gitops-bridge/issues/32) |
55+
| EKSCTL | ArgoCD | |
56+
| CDK | ArgoCD | |
57+
| Crossplane | ArgoCD | |
58+
| CAPI | ArgoCD | |
59+
| Pulumi | ArgoCD | |
4960

5061
#### Researched Resources:
5162
- https://docs.akuity.io/tutorials/adv-gitops

argocd/iac/terraform/examples/eks/README.md

-44
This file was deleted.

argocd/iac/terraform/examples/eks/argocd-ingress/README.md

+32-8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ Example on how to deploy Amazon EKS with addons configured via ArgoCD.
44
In this example the ArgoCD is configured with ingress using a https domain name managed on Route53
55

66

7+
## Prerequisites
8+
Before you begin, make sure you have the following command line tools installed:
9+
- git
10+
- terraform
11+
- kubectl
12+
- argocd
13+
14+
## Fork the Git Repositories
15+
16+
### Fork the Addon GitOps Repo
17+
1. Fork the git repository for addons [here](https://github.com/gitops-bridge-dev/gitops-bridge-argocd-control-plane-template).
18+
2. Update the following environment variables to point to your fork by changing the default values:
19+
```shell
20+
export TF_VAR_gitops_addons_org=https://github.com/gitops-bridge-dev
21+
export TF_VAR_gitops_addons_repo=gitops-bridge-argocd-control-plane-template
22+
```
23+
24+
725
**Create DNS Hosted Zone in Route 53:**
826

927
In this step you will delegate your registered domain DNS to Amazon Route53. You can either delegate the top level domain or a subdomain.
@@ -18,24 +36,30 @@ aws route53 create-hosted-zone --name $TF_VAR_domain_name --caller-reference "$(
1836
Use the NameServers in the DelegatoinSet to update your registered domain NS records at the registrar.
1937

2038

21-
After creating the Route53 zone deploy the EKS Cluster
39+
## Deploy the EKS Cluster
40+
Initialize Terraform and deploy the EKS cluster:
2241
```shell
2342
terraform init
24-
terraform apply
43+
terraform apply -auto-approve
44+
```
45+
Retrieve `kubectl` config, then execute the output command:
46+
```shell
47+
terraform output -raw configure_kubectl
2548
```
2649

27-
Access Terraform output to configure `kubectl` and `argocd`
50+
### Monitor GitOps Progress for Addons
51+
Wait until all the ArgoCD applications' `HEALTH STATUS` is `Healthy`. Use Crl+C to exit the `watch` command
2852
```shell
29-
terraform output
53+
watch kubectl get applications -n argocd
3054
```
3155

32-
To access ArgoCD thru ingress https use the following command to get URL and passwords
56+
## Access ArgoCD
57+
Access ArgoCD's UI, run the command from the output:
3358
```shell
34-
echo "URL: https://$(kubectl get ing -n argocd argo-cd-argocd-server -o jsonpath='{.spec.tls[0].hosts[0]}')"
35-
echo "Username: admin"
36-
echo "Password: $(kubectl get secrets argocd-initial-admin-secret -n argocd --template="{{index .data.password | base64decode}}")"
59+
terraform output -raw access_argocd
3760
```
3861

62+
3963
Destroy EKS Cluster
4064
```shell
4165
./destroy.sh

argocd/iac/terraform/examples/eks/argocd-ingress/bootstrap/addons.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: argoproj.io/v1alpha1
22
kind: ApplicationSet
33
metadata:
4-
name: bootstrap-addons
4+
name: cluster-addons
55
namespace: argocd
66
spec:
77
syncPolicy:

0 commit comments

Comments
 (0)