Skip to content

Commit

Permalink
feat: added docs on how to use the ksctl application components
Browse files Browse the repository at this point in the history
Signed-off-by: Dipankar Das <65275144+dipankardas011@users.noreply.github.com>
  • Loading branch information
dipankardas011 committed Jun 1, 2024
1 parent d28481d commit 98b7851
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 5 deletions.
17 changes: 12 additions & 5 deletions content/en/docs/Ksctl Operators/_index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
---
title: Ksctl Components
description: Place of all the documentation for the Operators used specifically for k8s clusters
categories: [Examples, Placeholders]
tags: [test, docs]
tags: [docs]
---

Operators
## Components
- ksctl agent
- ksctl stateimporter
- ksctl application controller



## Sequence diagram on how its deployed
```mermaid
flowchart TD
Base(Ksctl Infra and Bootstrap) -->|Cluster is created| KC(Ksctl controller)
KC -->|Creates| Storage{storageProvider=='local'}
Storage -->|Yes| KSI(Ksctl Storage Importer)
Storage -->|No| KA(Ksctl Agent)
KSI -->KA
KA -->|Health| D(Deploy other ksctl controllers)
```
18 changes: 18 additions & 0 deletions content/en/docs/Ksctl Operators/agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Ksctl Agent
description: Documentation on ksctl agent
categories: [Examples, Placeholders]
tags: [docs]
---


{{% pageinfo %}}
It is a ksctl's solution to infrastructure management and also kubernetes management.

Especially inside the kubertes cluster
{{% /pageinfo %}}


It is a GRPC server running as a deployment. and a fleet of controllers will call it to perform certain operations. For instance, application installation via `stack.application.ksctl.com/v1alpha`, etc.

It will be installed on all kubernetes cluster created via ksctl from >= v1.2.0
68 changes: 68 additions & 0 deletions content/en/docs/Ksctl Operators/application.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: Ksctl Application Controller
description: Documentation on ksctl application controller
categories: [Examples, Placeholders]
tags: [docs]
---

{{% pageinfo %}}
It helps in deploying applications using crd to help manage with installaztion, upgrades, downgrades, uninstallaztion. from one version to another and provide a single place of truth where to look for which applications are installed
{{% /pageinfo %}}

## Types

### Stack

For defining a hetrogenous components we came up with a stack which contains `M` number of components which are different applications with their versions

{{% alert title="Info" color="info" %}}
this is current available on all clusters created by `ksctl@v1.2.0`
{{% /alert %}}

{{% alert title="Note" color="info" %}}
It has a dependency on `ksctl agent`
{{% /alert %}}

#### Example usage

Lets deploy `argocd@v2.9.X`, `prometheus-stack@v55.X.Y`
```yaml
apiVersion: application.ksctl.com/v1alpha1
kind: Stack
metadata:
name: monitoring-plus-gitops
spec:
components:
- appName: argocd
appType: app
version: v2.9.12

- appName: prometheus-stack
appType: app
version: "55.0.0"
```

You can see once its deployed it fetch and deploys them

Lets try to upgrade them to their latest versions
```bash
kubeclt edit stack monitoring-plus-gitops
```

```yaml
apiVersion: application.ksctl.com/v1alpha1
kind: Stack
metadata:
name: monitoring-plus-gitops
spec:
components:
- appName: argocd
appType: app
version: latest

- appName: prometheus-stack
appType: app
version: latest
```

once edited it will uninstall the previous install and reinstalls the latest deployments
21 changes: 21 additions & 0 deletions content/en/docs/Ksctl Operators/stateimporter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Ksctl State-Importer
description: Documentation on ksctl stateimporter
categories: [Examples, Placeholders]
tags: [docs]
---

{{% pageinfo %}}
It is a helper deployment to transfer state information from one storage option to another.
{{% /pageinfo %}}

It is used to transfer data in `~/.ksctl` location (provided the cluster is created via `storageProvider: store-local`).


It utilizes the these 2 methods:
- `Export`: [StorageFactory Interface](https://github.com/ksctl/ksctl/blob/d3c2d74fe03ab1e8ad48d45290662c878196889b/pkg/types/typesStorage.go#L34)
- `Import`: [StorageFactory Interface](https://github.com/ksctl/ksctl/blob/d3c2d74fe03ab1e8ad48d45290662c878196889b/pkg/types/typesStorage.go#L37)

so before the ksctl agent is deployed we first create this pod which in turn runs a http server having `storageProvider: store-kubernetes` and uses `storage.Import()` method

once we get 200 OK responses from the http server we remove the pod and move to ksctl agent deployment so that it can use the state file present in configmaps, secrets

0 comments on commit 98b7851

Please sign in to comment.