Skip to content

Commit

Permalink
Merge pull request #3 from Scalr/SCALRCORE-26690
Browse files Browse the repository at this point in the history
SCALRCORE-26690 Adding charts descriptions with deployment diagrams
  • Loading branch information
vmotso authored May 24, 2023
2 parents e3d6cbb + 696cc29 commit 4b81cf9
Show file tree
Hide file tree
Showing 14 changed files with 179 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-test-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }} --helm-extra-set-args '--set agent.url=https://scalr.test --set agent.token=foo'
run: ct install --target-branch ${{ github.event.repository.default_branch }} --helm-extra-set-args '--set agent.url=https://scalr.test --set agent.token=foo'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.ct
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
99 changes: 99 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,104 @@
.PHONY: docs

# Configure development environment
platform = $(shell uname -s)
arch = $(shell uname -m)
ct_version = 3.8.0
kelik = "\\xF0\\x9F\\x8D\\xBA"

dev:
# Prerequisites
if [ "$(platform)" = "Linux" ]; then \
which curl >/dev/null || { apt-get update -yq && apt-get install -yq curl; }; \
elif [ "$(platform)" = "Darwin" ]; then \
which brew >/dev/null || { echo "Missing requirement: brew. Install Homebrew https://brew.sh/"; exit 1; } \
fi;
# Install [helm](https://github.com/helm/helm#install)
version=3.12.0; \
set -e; \
echo "=> Installing helm..."; \
case $(arch) in \
x86_64) normarch="amd64" ;; \
aarch64|arm64) normarch="arm64" ;; \
*) echo "Unsupported architecture: $(arch)"; exit 1 ;; \
esac; \
\
if [ "$(platform)" = "Linux" ]; then \
curl -sSLo helm.tar.gz \
https://get.helm.sh/helm-v$${version}-linux-$${normarch}.tar.gz \
&& tar -xz -C /usr/local/bin -f helm.tar.gz --strip-components 1 linux-$${normarch}/helm \
&& chmod +x /usr/local/bin/helm \
&& rm -f helm.tar.gz; \
elif [ "$(platform)" = "Darwin" ]; then \
brew install helm; \
else \
echo "Unsupported platform: $(platform)" \
&& exit 1; \
fi; \
helm version; \
echo "$(kelik) Installed helm";
# Install [helm-docs](https://github.com/norwoodj/helm-docs#installation)
version="1.11.0"; \
set -e; \
echo "=> Installing helm-docs..."; \
case $(arch) in \
x86_64) normarch=$(arch) ;; \
aarch64|arm64) normarch="arm64" ;; \
*) echo "Unsupported architecture: $(arch)"; exit 1 ;; \
esac; \
\
if [ "$(platform)" = "Linux" ]; then \
curl -sSLo helm-docs.tar.gz \
https://github.com/norwoodj/helm-docs/releases/download/v$${version}/helm-docs_$${version}_$(platform)_$${normarch}.tar.gz \
&& tar -xz -C /usr/local/bin -f helm-docs.tar.gz helm-docs \
&& chmod +x /usr/local/bin/helm-docs \
&& rm -f helm-docs.tar.gz; \
elif [ "$(platform)" = "Darwin" ]; then \
brew install norwoodj/tap/helm-docs; \
else \
echo "Unsupported platform: $(platform)" \
&& exit 1; \
fi; \
helm-docs --version; \
echo "$(kelik) Installed helm-docs";
# Install [chart-testing](https://github.com/helm/chart-testing#installation)
set -e; \
echo "=> Installing chart-testing..."; \
case $(arch) in \
x86_64) normarch="amd64" ;; \
aarch64|arm64) normarch="arm64" ;; \
*) echo "Unsupported architecture: $(arch)"; exit 1 ;; \
esac; \
\
if [ "$(platform)" = "Linux" ]; then \
curl -sSLo chart-testing.tar.gz \
https://github.com/helm/chart-testing/releases/download/v$(ct_version)/chart-testing_$(ct_version)_$(platform)_$${normarch}.tar.gz \
&& tar -xz -C /usr/local/bin -f chart-testing.tar.gz ct \
&& chmod +x /usr/local/bin/ct \
&& rm -f chart-testing.tar.gz; \
elif [ "$(platform)" = "Darwin" ]; then \
brew install chart-testing; \
else \
echo "Unsupported platform: $(platform)" \
&& exit 1; \
fi; \
ct version; \
echo "$(kelik) Installed chart-testing";
# Importing ct config from the chart-testing repository.
set -e; \
echo "=> Importing ct config..."; \
ct_config_dir=".ct"; \
mkdir -p $$ct_config_dir; \
cd $$ct_config_dir; \
curl -sSLO https://raw.githubusercontent.com/helm/chart-testing/v$(ct_version)/etc/chart_schema.yaml; \
curl -sSLO https://raw.githubusercontent.com/helm/chart-testing/v$(ct_version)/etc/lintconf.yaml; \
cd -;
echo "$(kelik) Imported ct config";

# Generate documentation using helm-docs
docs:
helm-docs

# Linting
lint:
env CT_CONFIG=.ct ct lint
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ helm repo add scalr-agent-helm https://scalr.github.io/agent-helm/

You can then run `helm search repo scalr-agent-helm` to see the charts.

## Releasing
## Releasing

Bump the version in `Chart.yaml`, commit and push.

> **Warning**
> **Warning**
> do not create a tag yourself!
GitHub Action release workflow will then using [Helm chart releaser](https://github.com/helm/chart-releaser-action)
Expand All @@ -27,7 +27,7 @@ GitHub Action release workflow will then using [Helm chart releaser](https://git
* commit an updated index.yaml with the new release
* redeploy the GitHub pages to serve the new index.yaml

> **Note**
> **Note**
> there might be a slight delay between the release and the `index.yaml` update, as GitHub pages have to be re-deployed.

Expand Down
6 changes: 6 additions & 0 deletions charts/agent-docker/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED]

## [v0.3.1]

### Added
- Chart description
- Kubernetes deployment diagram

## [v0.3.0]

### Updated
Expand Down
15 changes: 13 additions & 2 deletions charts/agent-docker/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
apiVersion: v2
name: agent-docker
description: Scalr agent for a self-hosted pool.
description: |
A Helm chart for the scalr-agent deployment on ths Kubernetes cluster,
where runs are executed in [dind](https://hub.docker.com/_/docker) sidecar container.
Run phases are isolated into docker containers.
Kuberentes deployment doesn't scale on multiple replicas.
Consequently, the capacity of compute resources that can be managed
by a single agent remains constrained by a single node.
Multiple Deployments can be created within a single Kubernetes cluster.
![Agent in Docker deployment diagram](/charts/agent-docker/assets/agent-docker-deploy-diagram.jpg)
type: application
version: 0.3.0
version: 0.3.1
appVersion: "0.1.33"
home: https://github.com/Scalr/agent-helm/tree/master/charts/agent-docker
maintainers:
Expand Down
14 changes: 12 additions & 2 deletions charts/agent-docker/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# agent-docker

![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.33](https://img.shields.io/badge/AppVersion-0.1.33-informational?style=flat-square)
![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.33](https://img.shields.io/badge/AppVersion-0.1.33-informational?style=flat-square)

Scalr agent for a self-hosted pool.
A Helm chart for the scalr-agent deployment on ths Kubernetes cluster,
where runs are executed in [dind](https://hub.docker.com/_/docker) sidecar container.
Run phases are isolated into docker containers.

Kuberentes deployment doesn't scale on multiple replicas.
Consequently, the capacity of compute resources that can be managed
by a single agent remains constrained by a single node.

Multiple Deployments can be created within a single Kubernetes cluster.

![Agent in Docker deployment diagram](/charts/agent-docker/assets/agent-docker-deploy-diagram.jpg)

**Homepage:** <https://github.com/Scalr/agent-helm/tree/master/charts/agent-docker>

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion charts/agent-docker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ resources:
memory: 2048Mi
requests:
cpu: 500m
memory: 2048Mi
memory: 2048Mi
6 changes: 6 additions & 0 deletions charts/agent-k8s/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED]

## [v0.2.1]

### Added
- Chart description
- Kubernetes deployment diagram

## [v0.2.0]

### Added
Expand Down
16 changes: 14 additions & 2 deletions charts/agent-k8s/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
apiVersion: v2
name: agent-k8s
description: A Helm chart for the Scalr Agent deployment on the Kubernetes cluster.
description: |
A Helm chart for the scalr-agent deployment on the Kubernetes cluster,
where runs are executed in Pods in the same cluster.
Run phases are isolated in kubernetes containers with resource limits.
Agent pool DaemomSet scales up/down with the cluster, registering
and deregistering agents from the pool. When an Agent receives a job from Scalr,
it schedules a Pod for execution. The Kubernetes workload scheduler assigns the Pod
to a specific Node, where the Agent running on that Node oversees the execution
of the job. By enabling the Kubernetes auto-scaler, Terraform workloads can scale
linearly based on the load.
![Agent in Kubernetes deployment diagram](/charts/agent-k8s/assets/agent-k8s-deploy-diagram.jpg)
type: application
version: 0.2.0
version: 0.2.1
appVersion: "0.1.33"
home: https://github.com/Scalr/agent-helm/tree/master/charts/agent-k8s
maintainers:
Expand Down
15 changes: 13 additions & 2 deletions charts/agent-k8s/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# agent-k8s

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.33](https://img.shields.io/badge/AppVersion-0.1.33-informational?style=flat-square)
![Version: 0.2.1](https://img.shields.io/badge/Version-0.2.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.33](https://img.shields.io/badge/AppVersion-0.1.33-informational?style=flat-square)

A Helm chart for the Scalr Agent deployment on the Kubernetes cluster.
A Helm chart for the scalr-agent deployment on the Kubernetes cluster,
where runs are executed in Pods in the same cluster.
Run phases are isolated in kubernetes containers with resource limits.

Agent pool DaemomSet scales up/down with the cluster, registering
and deregistering agents from the pool. When an Agent receives a job from Scalr,
it schedules a Pod for execution. The Kubernetes workload scheduler assigns the Pod
to a specific Node, where the Agent running on that Node oversees the execution
of the job. By enabling the Kubernetes auto-scaler, Terraform workloads can scale
linearly based on the load.

![Agent in Kubernetes deployment diagram](/charts/agent-k8s/assets/agent-k8s-deploy-diagram.jpg)

**Homepage:** <https://github.com/Scalr/agent-helm/tree/master/charts/agent-k8s>

Expand Down
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 4b81cf9

Please sign in to comment.