Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add environment snapshotting scopes table #367

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions docs.kosli.com/content/getting_started/environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ You can also create an environment directly from [app.kosli.com](https://app.kos
- Fill in the environment name and description and select a type, then click `Save Environment`.


After the new environment is created you'll be redirected to its page - with "No events have been found for [...]" message. Once you start reporting your actual runtime environment to Kosli you'll see all the events (such as which artifacts started or stopped running) listed on that page.
After the new environment is created you'll be redirected to its page, which will initially have no snapshots. Once you start reporting your actual runtime environment to Kosli you'll be able to find snapshots and events (such as which artifacts started or stopped running) listed on that page.

## Snapshoting an environment

To record the current status of your environment you need to make Kosli CLI scrape the running artifacts in it and report it to Kosli.
To record the current status of your environment you need to make Kosli CLI snapshot the running artifacts in it and report it to Kosli.
When Kosli receives an environment report, if the received list of running artifacts is different than what is in the latest environment snapshot, a new environment snapshot is created. Snapshots are immutable and can't be tampered with.

Currently, the following environment types are supported:
Expand All @@ -52,12 +52,26 @@ Currently, the following environment types are supported:
- AWS Lambda
- AWS Elastic Container Service (ECS)

While you can report environment snapshots manually using the `kosli snapshot [...]` commands for testing, for production use, you would configure the reporting to happen automatically on regular intervals, e.g. via a cron job or scheduled CI job, or on certain events.
You can report environment snapshots manually using the `kosli snapshot [...]` commands for testing. For production use, however, you would configure the reporting to happen automatically on regular intervals, e.g. via a cron job or scheduled CI job, or on certain events.

You can follow one of the tutorials below to setup automatic snapshot reporting for your environment:
- [Kubernetes environment reporting](/tutorials/report_k8s_envs)
- [AWS ECS/S3/Lambda environment reporting](/tutorials/report_aws_envs)

### Snapshotting scopes

Depending on the type of your environment, you can scope what to snapshot from the environment. The following table shows the different scoping options currently available for different environment types:

| what to snapshot -> | all resources | resources by names | resources by Regex | exclude by names | exclude by Regex |
|----------------------------|---------------|--------------------|--------------------|------------------|------------------|
| ECS (clusters) | √ | √ | √ | √ | √ |
| Lambda (functions) | √ | √ | √ | √ | √ |
| S3 (buckets) | | | | | |
| docker (containers) | √ | | | | |
| k8s (namespaces) | √ | √ | √ | √ | √ |
| azure (functions and apps) | √ | | | | |


## Logical Environments

Logical environments are a way to group your Kosli environments so you can view all changes happening in your group in the same place. For example, if what you consider to be “Production” is a combination of a Kubernetes cluster, an S3 bucket, and a configuration file, you can combine the reports sent to these Kosli environments into a “Production” logical environment.
Expand Down
14 changes: 7 additions & 7 deletions docs.kosli.com/content/tutorials/report_aws_envs.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ resource "random_pet" "this" {

module "lambda_reporter" {
source = "kosli-dev/kosli-reporter/aws"
version = "0.5.3"
version = "0.5.7"

name = local.reporter_name
kosli_environment_type = "ecs"
kosli_cli_version = "v2.7.8"
kosli_cli_version = "v2.11.0"
kosli_environment_name = "aws-env-tutorial"
kosli_org = "<your-org-name>"
reported_aws_resource_name = "<your-ecs-cluster>"
reported_aws_resource_name = "<your-ecs-cluster-name>"
}
```
{{< /tab >}}
Expand Down Expand Up @@ -190,11 +190,11 @@ variable "my_lambda_functions" {

module "lambda_reporter" {
source = "kosli-dev/kosli-reporter/aws"
version = "0.5.3"
version = "0.5.7"

name = local.reporter_name
kosli_environment_type = "lambda"
kosli_cli_version = "v2.7.8"
kosli_cli_version = "v2.11.0"
kosli_environment_name = "aws-env-tutorial"
kosli_org = "<your-org-name>"
reported_aws_resource_name = var.my_lambda_functions
Expand Down Expand Up @@ -268,11 +268,11 @@ variable "my_lambda_functions" {

module "lambda_reporter" {
source = "kosli-dev/kosli-reporter/aws"
version = "0.5.3"
version = "0.5.7"

name = local.reporter_name
kosli_environment_type = "s3"
kosli_cli_version = "v2.7.8"
kosli_cli_version = "v2.11.0"
kosli_environment_name = "aws-env-tutorial"
kosli_org = "<your-org-name>"
reported_aws_resource_name = "<your-s3-bucket-name>"
Expand Down
Loading