# alert-helm
Helm Charts for Synopsys Alert
## Table Of Contents
- [Prerequisites](#prerequisites)
- [Installing the Chart -- Helm 2](#installing-the-chart----helm-2)
- [Installing the Chart -- Helm 3](#installing-the-chart----helm-3)
- [Quick Start with Helm 3](#quick-start-with-helm-3)
- [Finding Alert External Port](#finding-alert-external-port)
- [Upgrading the Chart](#upgrading-the-chart)
- [Uninstalling the Chart](#uninstalling-the-chart)
- [Configuration](#configuration)
- [Configuration Parameters](#configuration-parameters)
- [Database Credential Secrets](#database-credential-secrets)
- [RabbitMQ Credential Secrets](#create-the-rabbitmq-credentials-secret)
- [Custom Certificates](#custom-certificates)
- [Persistent Storage](#persistent-storage)
- [External Postgres Database](#external-postgres-database)
- [External Postgres Database Requirements](#external-postgres-database-requirements)
- [Configuring the External Postgres Database](#configuring-the-external-postgres-database)
- [Database Admin User Password](#database-admin-user-password)
- [Installing with Black Duck](#installing-with-black-duck)
## Prerequisites
- Kubernetes 1.9+
- Helm2 or Helm3
## Installing the Chart -- Helm 2
### Add the helm repository
```bash
$ helm repo add synopsys https://sig-repo.synopsys.com/artifactory/sig-cloudnative
```
### Create the Namespace
```bash
$ kubectl create ns <namespace>
```
### Configure your Alert Instance
Modify the values.yaml file or pass in values to `helm install` with --set.
### Install the Alert Chart
```bash
$ helm install synopsys/synopsys-alert --name <name> --namespace <namespace>
```
> **Tip**: List all releases using `helm list`
## Installing the Chart -- Helm 3
### Add the helm repository
```bash
$ helm repo add synopsys https://sig-repo.synopsys.com/artifactory/sig-cloudnative
```
### Create the Namespace and TLS Secrets
```bash
$ kubectl create ns <namespace>
```
### Configure your Alert Instance
Modify the values.yaml file or pass in values to `helm install` with --set.
Please see the [Configuration](#configuration) section for more details.
### Install the Alert Chart
```bash
$ helm install <name> synopsys/synopsys-alert --namespace <namespace>
```
### Quick Start with Helm 3
#### Step 1
Navigate to the alert-helm chart repository in your terminal
```bash
$ cd <path>/alert-helm
```
#### Step 2
```bash
$ kubectl create ns myalert
```
#### Step 3
Deploy Alert
```bash
$ helm install myalert synopsys/synopsys-alert --namespace myalert
```
## Finding Alert External Port
Once Alert has been deployed if the `exposeui` parameter is true, then Alert will be available via an exposed port.
To determine the port to access the Alert UI execute the following command:
```bash
$ kubectl -n <NAMESPACE> get services
```
From the output find the Alert exposed service. This service will be your Alert installation name with the `-exposed` suffix in the name.
If the installation name is 'myalert' then there will be a service `myalert-exposed` in the list of services.
It will display a port with the following format:
`<INTERNAL_PORT>:<EXTERNAL_PORT>/TCP`
For example:
`8443:31594/TCP`
The internal port is 8443 and the external port is 31594. When accessing the Alert UI the external port will be used in the URL. Once the external port is identified the URL to access the UI will be in the following format:
`https://<EXTERNAL_NODE_IP>:<EXTERNAL_PORT>/alert`
```bash
$ kubectl get nodes -o wide
```
For Example:
`https://127.0.0.0:31594/alert`
## Upgrading the Chart
### Update the repository
```bash
$ helm repo update
```
### Create a database backup
1. Execute the script database-utilities.sh to create a database backup
```
database-utilities -b -p -n <namespace> -f <DATABASE_DUMP_FILE>
```
NOTE: Use the -h option for the database-utilities script to see the usage and get an explanation of the parameters.
If something goes wrong the database-utilities script can be used to restore the database backup with the -r option.
### Perform upgrade
```bash
$ helm upgrade <name> synopsys/synopsys-alert --namespace <namespace>
```
## Uninstalling the Chart
To uninstall/delete the deployment:
```bash
$ helm delete <name>
```
The command removes all the Kubernetes components associated with the chart and deletes the release.
## Configuration
The following table lists the configurable parameters of the Alert chart and their default values.
### Configuration Parameters
This contains a table briefly describing each parameter in the values.yaml file.
| Parameter | Description | Default |
|------------------------------------------|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------|
| `alert.imageTag` | Image tag for the Alert container | `docker.io/blackducksoftware/blackduck-alert:ALERT_VERSION_TOKEN` |
| `alert.registy` | The container registry for the Alert pod | `""` |
| `alert.port` | The internal port the Alert pod will use | `8443` |
| `alert.resources.limits.memory` | Alert container Memory Limit | `2560M` |
| `alert.resources.requests.memory` | Alert container Memory Request | `2560M` |
| `alert.persistentVolumeClaimName` | The name of the persistent storage claim | `""` |
| `alert.claimSize` | The persistent storage claim size limit | `5Gi` |
| `alert.storageClass` | The name of the storage class for persistent storage | `""` |
| `alert.volumeName` | The name of the persistent storage volume | `""` |
| `alert.nodeSelector` | Alert node labels for pod assignment | `{}` |
| `alert.tolerations` | Alert node tolerations for pod assignment | `[]` |
| `alert.affinity` | Alert node affinity for pod assignment | `{}` |
| `alert.securityContext` | Alert security context | `{}` |
| `alert.podSecurityContext` | Alert pod security context | `{}` |
| `cfssl.imageTag`