Table of Contents
Titan is a sandbox for deploying Prometheus, Thanos, and Grafana to K8s with ArgoCD.
Titan assumes you're running on a Mac, and have the following installed. If you don't have them, you can install them with Homebrew:
Service | Installation |
---|---|
Docker | brew install docker |
Kind | brew install kind |
Kubectl | brew install kubectl |
Helm | brew install helm |
ArgoCD | brew install argocd |
- Create a fork of this repo, and clone it to your local machine.
- Open a terminal on the cloned directory and run
./titan init
. - When you're done, run
./titan kill
to tear down the clusters.
Titan will create local Kind clusters for management and delivery, and deploy ArgoCD to the management cluster. It will also deploy Prometheus, Thanos, and Grafana to the delivery cluster.
ArgoCD needs access to the delivery cluster, so it can deploy the applications. To do this, titan uses a kind config file to create a cluster with an apiServerAddress
set to the host machine's IP address.
As an added convenience, the build script will attempt to detect your IP address, using the en0
and en1
interfaces, and update the config for you. If it can't detect your IP address, you can set it manually in the delivery/cluster.yaml
file.
ArgoCD needs access to the repo. GitOps works by pulling the manifests from a git repository, and applying them to the cluster. If you're happy with the manifests in this repo, you can leave them as-is. If you want to make changes, you'll need to fork the repo, and edit the manifests to point to your fork (use https
, not ssh
):
File | Field |
---|---|
management/manifests/application.yaml | repoURL |
management/manifests/repository.yaml | url |
delivery/manifests/shared.yaml | repoURL |
Once the clusters are up, you can access the UIs. You'll need to forward the ports for each service. First, set the context for the cluster you want to access:
$ kubectl config use-context kind-{delivery|management}
Then, forward the ports (in separate terminals):
$ kubectl port-forward svc/{service} -n {namespace} {ports}
List of values to pass into kubectl port-forward
:
Service | Namespace | Ports |
---|---|---|
argocd-server | argocd | 8080:443 |
grafana | monitoring | 3000:3000 |
prometheus | monitoring | 9090:9090 |
thanos-query | monitoring | 9090:9090 |
Helm doesn't support upgrading CRDs in the default /crds
directory, so titan uses braid to manage the CRDs for ArgoCD and Prometheus externally. To update the CRDs, run the following:
$ braid update # and commit the changes
$ kubectl config use-context kind-{management|delivery}
$ kubectl apply -f {management|delivery}/shared/crds
Titan provides a cli to help you raise and lower the stack. It's a simple wrapper around kind
, kubectl
, and helm
, so you can use those tools directly if you prefer.
Command | Description |
---|---|
./titan init |
Create clusters and deploy apps. |
./titan kill |
Tear down clusters. |
./titan help |
Print help text. |