Skip to content

Commit

Permalink
🤖 git write docs (#754)
Browse files Browse the repository at this point in the history
* remove roadmap from docs

* add write to git docs

* bump to v0.17.0
  • Loading branch information
petar-cvit authored Feb 13, 2025
1 parent b014301 commit 3d50daf
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Cyclops can either be installed manually by applying the latest manifest, by usi
To install Cyclops using `kubectl` into your cluster, run the commands below:

```bash
kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.15.4/install/cyclops-install.yaml && kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.15.4/install/demo-templates.yaml
kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.17.0/install/cyclops-install.yaml && kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.17.0/install/demo-templates.yaml
```

It will create a new namespace called `cyclops` and deploy everything you need for your Cyclops instance to run.
Expand Down
56 changes: 56 additions & 0 deletions web/docs/installation/git-write.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Write Module config to git

:::info
Available from version **v0.17.0**
:::

By default, Cyclops applies your configuration directly to the cluster. However, you also have the option to push it to a Git repository instead. Before using this GitOps workflow, you'll need to grant Cyclops access to the repository.

## Injecting credentials

Before deploying a module, you need to configure credentials for your git repos so changes can be pushed to a remote repo. For GitHub, you will need to create a token (can be fine-grained just for a single repo) that has `read and write` access to `contents`.

You can use that token to create a secret in your cluster with the following command:

```
kubectl create secret generic my-cyclops-secret \
-n cyclops \
--from-literal=username=<github-username> \
--from-literal=password=<github-token>
```

Once that is created, you can apply the following resource, which maps credentials to a specific repo. You can [read more about it here](https://cyclops-ui.com/docs/templates/private_templates)

```
apiVersion: cyclops-ui.com/v1alpha1
kind: TemplateAuthRule
metadata:
name: private-repo-rule
namespace: cyclops # has to be in cyclops namespace
spec:
repo: <git-repo> # git repo you want to push configuration to
password:
name: my-cyclops-secret # name of the previously created secret
key: password
username:
name: my-cyclops-secret # name of the previously created secret
key: username
```

The `<git-repo>` is the repo to which you want Cyclops to push the configuration to. In the example image below it would be [https://github.com/petar-cvit/gitops-infra](https://github.com/petar-cvit/gitops-infra/blob/brand-new-cyc-branch/my-apps/applications/api.yaml/testing-again.yaml).

## Deploying a module via GitOps

When creating a new module, in the advanced section, you can toggle the `Push changes to Git?` and you will be able to see fields to specify which repo you want to commit your Module configuration.

For the configuration in the image below, Cyclops will commit your Module as yaml to the repository https://github.com/petar-cvit/gitops-infra on branch `main`, and create a file `applications/my-module.yaml`. The name of the file of your Module is constructed as `{path}/{module name}.yaml`. If you want to create a file in the root of your repo, you can set the path to “.”

![](../../static/img/install/gitops-repo.png)

From your git repository, you can sync Modules into the cluster with other tools. With such a setup, you still get a custom UI for your apps, but you also get all the benefits of the GitOps approach.

## Deleting Modules

When deleting modules, you have the option to delete the module from the cluster or delete them in the git repository and let other tools take care of its removal. This option is visible only if the module has the configuration for writing back to git.

![](../../static/img/install/select-delete-option.png)
2 changes: 1 addition & 1 deletion web/docs/installation/install/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_label: Using kubectl
To install Cyclops in your cluster, run commands below:

```bash
kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.15.4/install/cyclops-install.yaml && kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.15.4/install/demo-templates.yaml
kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.17.0/install/cyclops-install.yaml && kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.17.0/install/demo-templates.yaml
```

It will create a new namespace called `cyclops` and deploy everything you need for your Cyclops instance to run.
Expand Down
13 changes: 0 additions & 13 deletions web/docs/roadmap/roadmap.md

This file was deleted.

6 changes: 1 addition & 5 deletions web/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const sidebars = {
"installation/demo/feedback",
],
},
"installation/git-write",
"installation/namespace-scope",
],
},
Expand Down Expand Up @@ -108,11 +109,6 @@ const sidebars = {
"cyctl/cyctl_version",
],
},
{
label: "Roadmap",
id: "roadmap/roadmap",
type: "doc",
},
{
label: "Usage metrics",
id: "usage_metrics/usage_metrics",
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/Install/Install/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const InstallCmd = () => {
<center className={styles.command}>
<h2 className={styles.commandDesc}>Install it with a single command</h2>
<CodeBlockString language={"sh"}>
{"kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.15.4/install/cyclops-install.yaml && \n" +
"kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.15.4/install/demo-templates.yaml"}
{"kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.17.0/install/cyclops-install.yaml && \n" +
"kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/cyclops/v0.17.0/install/demo-templates.yaml"}
</CodeBlockString>
</center>
);
Expand Down
Binary file added web/static/img/install/gitops-repo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/static/img/install/select-delete-option.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3d50daf

Please sign in to comment.