Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emc-mongoose/mongoose-helm-charts
The repository that contains the helm charts for automatic Mongoose deployment on a k8s cluster.
https://github.com/emc-mongoose/mongoose-helm-charts
helm-charts helm-mongoose kubernetes mongoose mongoose-debugging mongoose-service
Last synced: about 2 months ago
JSON representation
The repository that contains the helm charts for automatic Mongoose deployment on a k8s cluster.
- Host: GitHub
- URL: https://github.com/emc-mongoose/mongoose-helm-charts
- Owner: emc-mongoose
- License: mit
- Created: 2019-05-27T10:14:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-02T20:17:55.000Z (over 3 years ago)
- Last Synced: 2024-03-26T22:35:21.131Z (10 months ago)
- Topics: helm-charts, helm-mongoose, kubernetes, mongoose, mongoose-debugging, mongoose-service
- Language: Smarty
- Size: 315 KB
- Stars: 1
- Watchers: 4
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Table of Contents
=================- [Deploying Mongoose with Helm](#deploying-mongoose-with-helm)
- [About Helm](#about-helm)
+ [Basic terms:](#basic-terms-)
- [Steps to deploy](#steps-to-deploy)
* [Install Helm](#install-helm)
* [Using Repo](#using-repo)
* [Installation from sources (good for tests)](#installation-from-sources--good-for-tests-)
* [Remove release](#remove-release)
* [Detailed Mongoose installation](#detailed-mongoose-installation)
+ [Parametrisation](#parametrisation)
- [Custom service type](#custom-service-type)
- [Custom image](#custom-image)
- [CLI arguments](#cli-arguments)
- [Custom scenario](#custom-scenario)
- [List of all params](#list-of-all-params)
+ [Distributed mode](#distributed-mode)
- [Classic installation](#classic-installation)
- [Installation as a service (recommended)](#installation-as-a-service--recommended-)
* [Design](#design)
* [Usage](#usage)
- [Debugging](#debugging)
* [Mongoose debugging](#mongoose-debugging)
- [Releasing](#releasing)
- [Issue tracking](#issue-tracking)# Deploying Mongoose with Helm
Mongoose can be deployed in a kubernetes cluster. Deploy description can be found in the [documentation on the mongoose-base repository](https://github.com/emc-mongoose/mongoose-base/tree/master/doc/deployment#kubernetes).
One of the ways to deploy an application on kubernetes is to use helm.---
# About Helm
[Helm](https://helm.sh/docs/) is the package manager for Kubernetes.
> [Helm 3 release](https://helm.sh/blog/helm-3-released/)
### Basic terms:
`helm` - client tool running on your workstation
`tiller` (only for helm 2) - server component running on kubernetes cluster
`charts` - packages
`release` - instance of chart
Below are the steps to deploy a mongoose-storage-driver-pravega on kubernetes using the chart.
---
# Steps to deploy
## Install Helm>Note: since helm is a kubernetes package manager, kubectl tool must first be installed on the current maschine and a k8s cluster deployed.
Сlient installation.
Get the latest tarball from https://github.com/helm/helm/releases```bash
wget https://get.helm.sh/helm-v3.2.4-linux-amd64.tar.gz
tar -xzf helm-*
sudo mv linux-amd64/helm /usr/local/bin/
```> For helm 2:
> Next command will install Tiller in the cluster.
> Note: Tiller is installed by default in the kubectl context cluster. Accordingly, the machine must be switched to the cluster context (see command `kubectl config use-context [cluster-name]` ). Otherwise, you may get errors.
> ```bash
> helm init
> ```## Using Repo
To install a chart, you can run the helm `install` command. Helm has several ways to find and install a chart, but the easiest is to use one of the chart registry.
By default helm use `stable/` repo with url: `https://kubernetes-charts.storage.googleapis.com`
>Note: `helm repo add stable https://kubernetes-charts.storage.googleapis.com/`
Adding our repo:
```bash
helm repo add emc-mongoose https://emc-mongoose.github.io/mongoose-helm-charts/
```Or update repo:
```bash
helm repo update
```To check chart:
```bash
$ helm search repo mongooseNAME CHART VERSION APP VERSION DESCRIPTION
emc-mongoose/mongoose 0.1.9 4.2.17 Mongoose is a horizontally scalable and configu...
emc-mongoose/mongoose-pravega alpha 4.2.17 Mongoose chart with Pravega storage driver and ...
emc-mongoose/mongoose-service 0.1.11 4.2.18 Chart for deploying mongoose-nodes
```
To get more information:
```bash
$ helm inspect chart emc-mongoose/mongooseapiVersion: v1
appVersion: 4.2.17
description: Mongoose is a horizontally scalable and configurable performance testing
utility.
home: https://github.com/emc-mongoose/mongoose
name: mongoose
version: 0.1.9
```To install chart (create kubernetes object defined in a chart):
```bash
helm install [release-name] --namespace [namespace-name] emc-mongoose/mongoose-service [args]
```or with random name and default namespace
```bash
helm install --generate-name emc-mongoose/mongoose-service [args]
```and you can see list of releases with command:
```bash
$ helm ls -A -a
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
mongoose mongoose 1 2020-07-28 16:20:43.0715076 +0300 STD deployed mongoose-service-0.1.11 4.2.18
mongoose-service-1595942475 default 1 2020-07-28 16:21:19.298276 +0300 STD deployed mongoose-service-0.1.11 4.2.18
```## Installation from sources (good for tests)
It is also possible to install a chart from source.
```bash
git clone https://github.com/emc-mongoose/mongoose-helm-charts.git
helm install [release-name] --namespace [namespace-name] mongoose-helm-charts/mongoose-service
```## Remove release
> Note: It is **strongly recommended** to remove the releases with the help of helm. If the release was installed with command `helm install` and will be removed with `kubectl`, it can lead to unexpected behavior.
```bash
helm uninstall --namespace [namespace-name] [release-name]
```## Detailed Mongoose installation
### Parametrisation
**!!!** All subsequent parameterization steps are available for all charts in this repo
#### Custom service type
Mongoose service is deployed by default with type LoadBalancer. To specify other service type, use option `service.type`:```
helm install mongoose emc-mongoose/mongoose --set service.type=NodePort ...
```#### Custom image
By default the chart uses the `mongoose-base` image. To specify a custom image, use the following parameters:```bash
helm install mongoose emc-mongoose/mongoose \
--set image.name=emcmongoose/mongoose-storage-driver-pravega
```
where `emcmongoose/mongoose-storage-driver-pravega` - name of docker image#### CLI arguments
To set mongoose CLI arguments use helm argument `--set args=...`:
```bash
helm install mongoose \
emc-mongoose/mongoose \
--set "args=\"--storage-driver-limit-concurrency=5\"\,\"--load-step-limit-time=60s\""
```Example with custom image:
```bash
helm install mongoose \
emc-mongoose/mongoose \
--set "args=\"--storage-net-node-addrs=\"\,\"--storage-namespace=scope4\"\,\"--load-step-limit-time=10s\"" \
--set "image.name=emcmongoose/mongoose-storage-driver-pravega"
```#### Custom scenario
Mongoose supports custom scenarios. There are 3 ways to supply the scenario to mongoose:
1. Sending the scenario content via the REST API (mongoose service mode) (see [REST API](#rest-api) )
The option #2 may require external connectivity so the additional option is necessary.2. Prepare the custom mongoose image containing the scenario which is required need to run. (see [Custom image](#custom-image))
3. Specifying the file via the command line (mongoose interactive mode):
With `scenario` option:
```bash
helm install mongoose emc-mongoose/mongoose --set scenario='$(cat .js)'
```With `values.yaml` overwriting:
```yaml
scenario: 'while(true) {
Load.config(
{"load":{
"step":{
"limit":{
"time": 1
}
}
}
}).run();
}'
```
```bash
helm install -n mongoose emc-mongoose/mongoose --values values.yaml
```> Limitations: Inside the scenario, use only double quotes ("), or escape single quotes (\\').
#### List of all params
To get list of all chart parameters:
```bash
$ helm inspect values emc-mongoose/mongoose
```As a result, a `values.yaml` is displayed, each of whose parameters can be overridden with `--set .keyN>=` command.
```bash
########################################################
#### Default values for demo-chart.
############################################################ Number of Mongoose replicas to deploy
replicas: 1
#### Since mongoose version 4 there is one image for controller and for peer (driver) nodes
#### The mongoose image configurationimage:
name: emcmongoose/mongoose-base
tag: "latest"
pullPolicy: Alwayspod:
name: mongoose-nodeservice:
name: mongoose-svc
type: LoadBalancerresources:
limits:
cpu: "4"
memory: "4Gi"
requests:
cpu: "4"
memory: "4Gi"serviceAccount : ""
debug: false
################## Mongoose CLI args ##################
args: ""
############### Mongoose scenario #####################
scenario: 'Load.run();'
```
> Note: about [serviceAccount](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/)
---
### Distributed mode
Mongoose can be deployed in 2 ways (charts):
* `mongoose` chart - Classic way - That is, helm deploys several additional nodes at once and one entry node, from which the scenario and, accordingly, the load **immediately starts to run**.
* `mongoose-service` chart - Service mode (with Remote API). Helm deploys several mongoose nodes that are pending a request. The **load starts after a remote request**. And after the end of the scenario, these nodes go into pending state again.
> [More about distributed mode](https://github.com/emc-mongoose/mongoose-base/tree/master/doc/design/modes/distributed_mode#distributed-mode)
#### Classic installation
As can be seen from the `replicas` parameter, Mongoose by default run in standalone mode with count of node = "1".
To change count of Mongoose node use parametr `--set "replicas="`
```
helm install mongoose emc-mongoose/mongoose --set "replicas=4"
```
Let's see the list of pods
```
NAME READY STATUS RESTARTS AGE
mongoose 0/1 Completed 0 11s
mongoose-node-0 1/1 Running 0 11s
mongoose-node-1 1/1 Running 0 11s
mongoose-node-2 1/1 Running 0 11s
```It creates pods
* `mongoose` - entry node
* `mongoose-node-<>` - additional node#### Installation as a service (recommended)
##### Design
![high level design](mongoose-helm-chart.png)
To use mongoose with REST, it is needed to deploy one (standalone mode) or more (distributed mode) nodes with a key `--run-node`. After that, they are waiting for requests. External access is provided through the service (`mongoose-entry-node-svc`). Internal access for internal mongoose-node communication is provided through the service (`mongoose-svc`, ClusterIP type). The node with 0 serial number (`mongoose-node-0`) is selected as the entry node. And the `mongoose-entry-node-svc` communicates with this node, all the requests come to `mongoose-node-0`.
##### Usage
To deploy Mongoose as service (`--run-node`) use `mongoose-service` chart:
```bash
helm install mongoose emc-mongoose/mongoose-service --set replicas=3
```With command `kubectl get -n mongoose pods` you can see inforamtion about running pods (`mongoose-node`). For this example:
```
NAME READY STATUS RESTARTS AGE
mongoose-node-0 1/1 Running 0 11s
mongoose-node-1 1/1 Running 0 11s
mongoose-node-2 1/1 Running 0 11s
```With command `kubectl get -n mongoose svc` you can see inforamtion about running service (`mongoose-entry-node-svc`). For this example:
|NAME |TYPE |CLUSTER-IP |EXTERNAL-IP |PORT(S) |AGE
| --- | --- | --- | --- | --- | ---
|mongoose-entry-node-svc |LoadBalancer |a.b.c.d |**x.y.z.j** |9999:31687/TCP |25m> By default, the type of service is the `LoadBalancer`, but it can be [changed](#custom-service-type).
To run mongoose scenario it is needed to send HTTP-requests to the external ip **x.y.z.j** [(see Remote API)](doc/interfaces/api/remote). For example:
```
curl -v -X POST http://x.y.z.j:9999/run
```Example of mongoose `defaults.yaml` for distributed mode:
```
...
load:
step:
node:
addrs:
- mongoose-node-1.mongoose-svc
- mongoose-node-2.mongoose-svc
...
```> REST API doc: https://github.com/emc-mongoose/mongoose-base/tree/master/doc/usage/api/remote
---
# Debugging
```bash
helm template --debug mongoose-helm-charts/mongoose ...
```> See more in the helm docs.
## Mongoose debugging
To debug mongoose with some IDE use option `debug`. Example:
```bash
helm install mongoose emc-mongoose/mongoose-service --set debug=true ...
```This option exposes port for mongoose debugging (5005 by default) and run container with `entrypoint_debug.sh`.
> [More](https://github.com/emc-mongoose/mongoose-base/tree/master/doc/deployment#debugging)
---
# Releasing
> Note: `master` branch is used to store charts code, and `gh-pages` branch as charts repository.
0) Ensure that all changes were committed and pushed
1) Ensure that the `version: ` is changed in `Chart.yaml`
2) Ensure the new version documentation is ready
3) Merge to the `master` branch
4) Publish new release in to helm repo (`gh-pages` branch):
```bash
cd $PATH_TO_REPO/mongoose-helm-charts/
helm package $CHART_PATH/ # to build the .tgz file and copy it here
git stash -u # save untracked .tgz file
git checkout gh-pages
git stash pop
helm repo index . --url https://emc-mongoose.github.io/mongoose-helm-charts/ # create or update the index.yaml for repo
git add index.yaml *.tgz
git commit -m 'New chart version'
git push# helm repo add $REPO_NAME https://emc-mongoose.github.io/mongoose-helm-charts/
helm repo update
helm install $REPO_NAME/$CHART_NAME
```
>For example:
>* REPO_NAME=emc-mongoose
>* CHART_NAME=mongoose
>* CHART_PATH=$CHART_NAME/# Issue tracking
https://mongoose-issues.atlassian.net/projects/HELM/issues