Skip to content
This repository was archived by the owner on Nov 10, 2019. It is now read-only.

need to update readme here to match plugin readme #20

Merged
merged 1 commit into from
Feb 2, 2018
Merged
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
68 changes: 48 additions & 20 deletions stable/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ Use Codefresh [Helm](https://helm.sh) plugin to deploy a Helm chart into specifi

Set required and optional environment variable and add the following step to your Codefresh pipeline:

Example Variables:

The example below will run `helm upgrade` using Helm chart with the name `mychart` located in `https://helmrepo.codefresh.io/codefresh/helm` Helm chart repository using the `myrelease` Helm release name against `mycluster` Kubernetes cluster in the `mynamespace` Kubernetes Namespace.

```text
CHART_NAME=mychart
RELEASE_NAME=myrelease
KUBE_CONTEXT=mycluster
NAMESPACE=mynamespace
CHART_REPO_URL=https://helmrepo.codefresh.io/codefresh/helm
```

```yaml
---
version: '1.0'
Expand All @@ -14,44 +26,60 @@ steps:

...

release_to_env:
image: codefresh/plugin-helm:2.7.2
Helm Upgrade:
title: Helm Upgrade
image: 'codefresh/plugin-helm:2.8.0'
environment:
- CHART_NAME=${{CHART_NAME}}
- RELEASE_NAME=${{RELEASE_NAME}}
- KUBE_CONTEXT=${{KUBE_CONTEXT}}
- NAMESPACE=${{NAMESPACE}}
- DEBUG_CHART=${{DEBUG_CHART}}
- CHART_REPO_URL=${{CHART_REPO_URL}}

...

```

## Environment Variables

- **required** `CHART_NAME` - Helm chart name
- **required** `RELEASE_NAME` - Helm release name
- **required** `KUBE_CONTEXT` - Kubernetes context to use
- `NAMESPACE` - target Kubernetes namespace
- `CHART_VERSION` - application chart version to install
- `CHART_REPO_URL` - Helm chart repository URL
- `DRY_RUN` - do a "dry run" installation (do not install anything, useful for Debug)
- `DEBUG` - print verbose install output
- `WAIT` - block step execution till installation completed and all Kubernetes resources are ready
- `TIMEOUT` - wait timeout (5min by default)
| Variables | Required | Default | Description |
|----------------|----------|---------|-----------------------------------------------------------------------------------------|
| CHART_NAME | YES | | Helm chart name |
| RELEASE_NAME | YES | | Helm release name |
| KUBE_CONTEXT | YES | | Kubernetes context to use (Custom Cluster Name in Codefresh) |
| NAMESPACE | NO | | Target Kubernetes namespace |
| CHART_VERSION | NO | | Helm chart version to install |
| CHART_REPO_URL | NO | | Helm chart repository URL (Required unless code repository contains Helm chart) |
| DRY_RUN | NO | | Do a "dry run" installation (do not install anything, useful for Debug) |
| DEBUG | NO | | Print verbose install output |
| WAIT | NO | | Block step execution till installation completed and all Kubernetes resources are ready |
| TIMEOUT | NO | 5 Min | Wait Timeout |

### Overriding Helm Variables

Codefresh Helm plugin supports overriding Helm variables.

#### Naming Guide

Prefix environment variable with `custom_` (or `CUSTOM_`) and replace any `.` character with `_`.
To supply value file, add an environment variable with the name prefix of `CUSTOMFILE_` (case *in*sensitive), and the value should point to an existing values file.
To override specific values, add an environment variable with the name prefix of `CUSTOM_` (case *in*sensitive), and replace any `.` characters in the name with `_`. The value should be the value for the variable.

Examples:
```text
# set ENV variable in Codefresh UI
custom_myimage_pullPolicy=Always
CUSTOM_myimage_pullPolicy=Always
# Codefresh Helm plugin will add option below to the 'helm update --install' command
--set myimage.pullPolicy=Always

# Another example
CUSTOM_redis_resources_requests_memory=256Mi
CUSTOMFILE_prod='values-prod.yaml'
# Codefresh Helm plugin will add option below to the 'helm update --install' command
--values values-prod.yaml
```

If a variable contains a `_`, replace the `_` character with `__`.

```text
custom_env_open_STORAGE__AMAZON__BUCKET=my-s3-bucket
# translates to ...
--set redis.resources.requests.memory=256Mi
--set env.open.STORAGE_AMAZON_BUCKET=my-s3-bucket
```

## Kubernetes Configuration
Expand Down