Skip to content

Commit

Permalink
@ teracyhq#2 | create zalenium helm chart into incubator
Browse files Browse the repository at this point in the history
  • Loading branch information
hieptranquoc committed Jun 27, 2019
1 parent da51b07 commit 4c2acdc
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 677 deletions.
24 changes: 0 additions & 24 deletions incubator/zalenium/.helmignore

This file was deleted.

11 changes: 0 additions & 11 deletions incubator/zalenium/Chart.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions incubator/zalenium/OWNERS

This file was deleted.

122 changes: 22 additions & 100 deletions incubator/zalenium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,122 +2,44 @@

This chart bootstraps a zalenium deployment on a kubernetes cluster using the [Helm](https://helm.sh) package manager.

# Prerequisites
## Prerequisites

- `vagrant` https://www.vagrantup.com/docs/installation/.
- `virtualbox` https://www.virtualbox.org/wiki/Downloads.
- `teracy-dev` v0.6.0-a4+. Fork repo https://github.com/teracyhq/dev and its extensions in https://github.com/teracyhq-incubator to set up `teracy-dev`.
- `helm` v2.10.0+. Default installed in teracy-dev.
- Fork repo https://github.com/teracyhq/dev and its extensions in https://github.com/teracyhq-incubator to set up `teracy-dev`.
- `helm` and `kubectl` must be installed.
- Follow the docs on https://github.com/teracyhq-incubator/teracy-dev-entry-k8s to set up a local k8s cluster.

# How to get it works
## Install

## Setup `zalenium` from the scratch
- Install `zalenium` repo:

- Installing the chart
```bash
$ helm repo add zalenium https://raw.githubusercontent.com/zalando/zalenium/master/charts/zalenium
```

To install the chart with the release name `example-name`:
- Install `zalenium` chart:

```console
$ helm install --name example-name teracy-incubator/zalenium
```bash
$ helm install --name zalenium --namespace hieptq zalenium/zalenium --tiller-namespace=hieptq
```

The command deploys Zalenium on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
## Uninstall

> **Tip**: List all releases using `helm list`
- To uninstall/delete the `zalenium` deployment:

- Uninstalling the chart
```bash
$ helm delete zalenium --tiller-namespace=hieptq --namepace=hieptq
```

To uninstall/delete the `example-name` deployment:
- To remove the release name from the Helm store (so you may use it again), issue the following command:

```console
$ helm delete example-name --purge
```bash
$ helm delete zalenium --purge --tiller-namespace=hieptq --namespace=hieptq
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

- Configuration

The following tables lists the configurable parameters of the Selenium chart and their default values.

| Parameter | Description | Default |
| --------- | ----------- | ------- |
| `rbac.create` | If your cluster has RBAC enabled, set rbac.create to true | false |
| `rbac.clusterWideAccess` | Set true to use ClusterRole and ClusterRoleBinding instead of Role and RoleBinding | true |
| `serviceAccount.create` | Set serviceAccount.create to true if you want to create an service account for zalenium | true |
| `serviceAccount.name` | Set serviceAccount.name | zalenium |
| `hub.image.repository` | The zalenium hub image | `dosel/zalenium` |
| `hub.image.tag` | The zalenium hub image tag | `3` |
| `hub.image.pullPolicy` | The pull policy for the hub image | `IfNotPresent` |
| `hub.port` | The port the hub listens on | `4444` |
| `hub.livenessProbe.enabled` | Set hub.livenessProbe.enabled to true if you want to use livenessProbe | true |
| `hub.readinessProbe.enabled` | Set hub.readinessProbe.enabled to true if you want to use readinessProbe | true |
| `hub.javaOpts` | The java options for the selenium hub JVM, default sets the maximum heap size to 400 mb | `-Xmx400m -XX:+UseSerialGC` |
| `hub.localVolumesRoot` | The root directory to store HostPath volumes (e.g. if running in minikube) | `/tmp` |
| `hub.resources` | The resources for the hub container, defaults to minimum half a cpu and maximum 512 mb RAM | `{"limits":{"cpu":".5", "memory":"512Mi"}}` |
| `hub.desiredContainers` | How many pods to launch at start | 2 |
| `hub.maxDockerSeleniumContainers` | Maximum number of Selenium containers to run simultaneously | 10 |
| `hub.sauceLabsEnabled` | Enable SauceLabs | false |
| `hub.browserStackEnabled` | Enable BrowserStack | false |
| `hub.testingBotEnabled` | Enable TestingBot | false |
| `hub.videoRecordingEnabled` | Enable video recording | true |
| `hub.cpuRequest` | CPU requested for browser pods. The hub passes this value to the k8s API | 200m |
| `hub.cpuLimit` | CPU limit for browser pods. The hub passes this value to the k8s API | 400m |
| `hub.memRequest` | Memory requested for browser pods. The hub passes this value to the k8s API | 200Mi |
| `hub.screenWidth` | Screen resolution to use | 1440 |
| `hub.screenHeight` | Screen resolution to use | 900 |
| `hub.timeZone` | Time zone | UTC |
| `hub.seleniumImageName` | The Selenium grid image | `elgalu/selenium` |
| `hub.maxTestSessions` | The number of tests to run on each grid container before killing it and starting a new one | 1 |
| `hub.debugEnabled` | Enables LogLevel.FINE | false |
| `hub.keepOnlyFailedTests` | Keeps only failed tests on the dashboard (you need to send a cookie with the test result) | false |
| `hub.sendAnonymousUsageInfo` | Allows sending anonymous usage info | true |
| `hub.sauceUserName` | Username to log into saucelabs. Use if hub.sauceLabsEnabled set to true | blank |
| `hub.sauceAccessKey` | Access key to log into saucelabs. Use if hub.sauceLabsEnabled set to true | blank |
| `hub.browserStackUser` | Credentials for browserstack. Use if hub.browserStackEnabled set to true | blank |
| `hub.browserStackKey` | Credentials for browserstack. Use if hub.browserStackEnabled set to true | blank |
| `hub.testingBotKey` | Credentials for testingbot. Use if hub.testingBotEnabled set to true | blank |
| `hub.testingBotSecret` | Credentials for testingbot. Use if hub.testingBotEnabled set to true | blank |
| `ingress.enabled` | Set ingress.enabled to true if you want to create an ingress entry for zalenium | false |
| `ingress.hostname` | Set ingress.hostname to which host you want | `#` |
| `services.type` | Set services.type | `ClusterIP` |
| `mountStorage.videos.enabled` | Whether to use a videos mount volume. Set mountStorage.videos.enabled to true | true |
| `mountStorage.data.enabled` | Whether to use a data mount volume. Set mountStorage.data.enabled to true | true |
| `mountStorage.videos.pvcs.enabled` | Whether to use a persistent volume claim for storage. Set mountStorage.videos.pvcs.enabled to true | false |
| `mountStorage.data.pvcs.enabled` | Whether to use a persistent volume claim for storage. Set mountStorage.data.pvcs.enabled to true | false |

Specify each parameter using the `--set key0=value0,key1=value1,key..n=value..n` argument to `helm install`. For example,

```console
$ helm install --name example-name \
--set rbac.create=false \
teracy-incubator/zelenium
```
## Configuration

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart.
See more at https://github.com/zalando/zalenium/tree/master/charts/zalenium#configuration

## How to run

- Live Preview

Displaying the live preview.

Go to http://k8s.local:4444/grid/admin/live.

> **Tip**: You can replace k8s.local for the IP/machine name where Zalenium is running.
Auto-refresh, add ?refresh=numberOfSeconds to refresh the view automatically.

E.g. http://k8s.local:4444/grid/admin/live?refresh=20 will refresh the page every 20 seconds.

- Dashboard

Go to http://k8s.local:4444/grid/dashboard.

> **Tip**: You can replace k8s.local for the IP/machine name where Zalenium is running.
Check all the recorded videos and aggregated logs after your tests completed.

Click on Cleanup to remove all videos and logs from the local drive and the dashboard.

> **Tip**: Also reset the dashboard via http://k8s.local:4444/dashboard/cleanup?action=doReset or cleanup via http://k8s.local:4444/dashboard/cleanup?action=doCleanup.
See more at https://opensource.zalando.com/zalenium/#usage
1 change: 0 additions & 1 deletion incubator/zalenium/templates/NOTES.txt

This file was deleted.

34 changes: 0 additions & 34 deletions incubator/zalenium/templates/_helpers.tpl

This file was deleted.

139 changes: 0 additions & 139 deletions incubator/zalenium/templates/deployment.yaml

This file was deleted.

31 changes: 0 additions & 31 deletions incubator/zalenium/templates/ingress.yaml

This file was deleted.

Loading

0 comments on commit 4c2acdc

Please sign in to comment.