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

https://github.com/hyperspike/pivot

Pivot from bootstrapping to GitOps
https://github.com/hyperspike/pivot

argocd ci-cd gitops kubernetes

Last synced: 20 days ago
JSON representation

Pivot from bootstrapping to GitOps

Awesome Lists containing this project

README

          

# Pivot

pivot from cluster-bootstraping to GitOps, Self-hosted, and self-managed, with a single command. Using [Gitea](https://github.com/hyperspike/gitea-operator) and [ArgoCD](https://argo-cd.readthedocs.io/en/stable/).

skip to the tutorial: [here](./TUTORIAL.md)

## Usage

```bash
$ pivot --help
Pivot is a tool for pivoting from bootstrap to GitOps

Usage:
pivot [command]

Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
run start pivoting

Flags:
-h, --help help for pivot

Use "pivot [command] --help" for more information about a command.
```

```bash
$ pivot run --help
start pivoting

Usage:
pivot run [flags]

Flags:
-c, --context string use an explicit Kubernetes context [env PIVOT_CONTEXT]
-d, --dry-run dry run
-h, --help help for run
-n, --namespace string namespace (context default if not set) [env PIVOT_NAMESPACE]
-p, --password string remote password (generated if not set) [env PIVOT_PASSWD]
-r, --remote string remote repository [env PIVOT_REMOTE] (default "git.local.net")
-u, --user string remote user [env PIVOT_USER] (default "pivot")

```

## How it works

Pivot builds a local `infra' repository with all the necessary files to bootstrap a Gitea Instance, and ArgoCD.

It then applies the manifests to the cluster, and pushes the `infra` repository to the remote repository.

Finally it wires up the now cluster local `infra` repository to ArgoCD for continuous deployment.

### GitOps Repository

The `infra` repository is a GitOps repository that contains the manifests for bootstrapping bare Cluster to self-hosted, self-managed, GitOps.

```bash
$ tree infra/
infra/
├── argocd
│   ├── argocd.yaml
│   ├── kustomization.yaml
│   └── namespace.yaml
├── cert-manager
│   ├── cert-manager.yaml
│   └── kustomization.yaml
├── gitea
│   ├── gitea.yaml
│   └── kustomization.yaml
├── gitea-operator
│   ├── gitea-operator.yaml
│   └── kustomization.yaml
├── init
│   ├── init.yaml
│   └── kustomization.yaml
├── postgres-operator
│   ├── kustomization.yaml
│   └── postgres-operator.yaml
├── README.md
└── valkey-operator
├── kustomization.yaml
└── valkey-operator.yaml
```

## Making Changes

The `infra` directory generated by `pivot` is a fully functional Git repository. To make changes to your infrastructure (e.g., adding new applications, changing configurations):

1. **Edit Files**: Make your desired changes within the `infra/` directory.
2. **Commit**: Commit your changes to the local git repository.
```bash
cd infra
git add .
git commit -m "Update configuration"
```
3. **Proxy**: Open a tunnel to the in-cluster Gitea instance.
```bash
pivot proxy
```
*Note: This command runs in the foreground. Keep this terminal open and use a new terminal for the next steps.*
4. **Password**: Retrieve the generated Gitea password (if you didn't specify one).
```bash
pivot password
```
5. **Push**: Push your changes to the cluster.
```bash
git push local main
```
Use `pivot` (default) or your configured username, and the password from the previous step.

## Installation

```bash
$ go install github.com/hyperspike/pivot/cmd@latest
```