Skip to content

Commit 1e415db

Browse files
committed
new helm plugin
1 parent 68c7e58 commit 1e415db

File tree

7 files changed

+126
-49
lines changed

7 files changed

+126
-49
lines changed

incubator/helm/.swp

12 KB
Binary file not shown.

stable/helm/README.md renamed to incubator/helm/README.md

Lines changed: 50 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,59 @@
11
# Codefresh Helm Plugin
22

3-
Use Codefresh [Helm](https://helm.sh) plugin to deploy a Helm chart into specified (by context) Kubernetes cluster.
3+
Use Codefresh [Helm](https://helm.sh) plugin to deploy a Helm chart into specified Kubernetes cluster.
44

55
## Usage
66

7-
Set required and optional environment variable and add the following step to your Codefresh pipeline:
7+
Set required and optional environment variable and add the following step to your Codefresh pipeline like so:
88

9-
Example Variables:
9+
```yaml
10+
Helm Upgrade:
11+
image: 'codefresh/plugin-helm:2.8.0'
12+
```
13+
14+
## Environment Variables
15+
16+
Name|Required|Description
17+
---|---|---
18+
KUBE_CONTEXT|required|Kubernetes context to use (the name of the cluster as configured in Codefresh)
19+
CHART_NAME|required|Helm chart name to release (path to chart folder, or name of packaged chart)
20+
RELEASE_NAME|required|Helm release name
21+
NAMESPACE|required|target Kubernetes namespace
22+
TILLER_NAMESPACE|required|Kubernetes namespace where tiller is at
23+
CHART_VERSION|required|application chart version to install
24+
CHART_REPO_URL|required|Helm chart repository URL (overriden by injected Helm repository context)
25+
CUSTOMFILE_|optional|Values file to provide to Helm (as --file). see usage information below.
26+
CUSTOM_|optional|Value to provide to Helm (as --set). see usage information below.
27+
28+
## Helm Values
29+
30+
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.
31+
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.
32+
33+
Examples:
34+
```text
35+
CUSTOM_myimage_pullPolicy=Always
36+
# Codefresh Helm plugin will add option below to the 'helm update --install' command
37+
--set myimage.pullPolicy=Always
38+
39+
CUSTOMFILE_prod='values-prod.yaml'
40+
# Codefresh Helm plugin will add option below to the 'helm update --install' command
41+
--values values-prod.yaml
42+
```
43+
44+
If a variable contains a `_`, replace the `_` character with `__`.
45+
46+
```text
47+
custom_env_open_STORAGE__AMAZON__BUCKET=my-s3-bucket
48+
# translates to ...
49+
--set env.open.STORAGE_AMAZON_BUCKET=my-s3-bucket
50+
```
51+
52+
## Kubernetes Configuration
53+
54+
Add Kubernetes integration to Codefresh: `> Account Settings > Integration > Kubernetes`. From now on, you can use added Kubernetes cluster in Codefresh pipeline, addressing its context by the name you see in `Clusters` menu.
55+
56+
## Example
1057

1158
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.
1259

@@ -40,48 +87,3 @@ steps:
4087
...
4188
4289
```
43-
44-
## Environment Variables
45-
46-
| Variables | Required | Default | Description |
47-
|----------------|----------|---------|-----------------------------------------------------------------------------------------|
48-
| CHART_NAME | YES | | Helm chart name |
49-
| RELEASE_NAME | YES | | Helm release name |
50-
| KUBE_CONTEXT | YES | | Kubernetes context to use (Custom Cluster Name in Codefresh) |
51-
| NAMESPACE | NO | | Target Kubernetes namespace |
52-
| CHART_VERSION | NO | | Helm chart version to install |
53-
| CHART_REPO_URL | NO | | Helm chart repository URL (Required unless code repository contains Helm chart) |
54-
| DRY_RUN | NO | | Do a "dry run" installation (do not install anything, useful for Debug) |
55-
| DEBUG | NO | | Print verbose install output |
56-
| WAIT | NO | | Block step execution till installation completed and all Kubernetes resources are ready |
57-
| TIMEOUT | NO | 5 Min | Wait Timeout |
58-
59-
### Overriding Helm Variables
60-
61-
Codefresh Helm plugin supports overriding Helm variables.
62-
63-
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.
64-
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.
65-
66-
Examples:
67-
```text
68-
CUSTOM_myimage_pullPolicy=Always
69-
# Codefresh Helm plugin will add option below to the 'helm update --install' command
70-
--set myimage.pullPolicy=Always
71-
72-
CUSTOMFILE_prod='values-prod.yaml'
73-
# Codefresh Helm plugin will add option below to the 'helm update --install' command
74-
--values values-prod.yaml
75-
```
76-
77-
If a variable contains a `_`, replace the `_` character with `__`.
78-
79-
```text
80-
custom_env_open_STORAGE__AMAZON__BUCKET=my-s3-bucket
81-
# translates to ...
82-
--set env.open.STORAGE_AMAZON_BUCKET=my-s3-bucket
83-
```
84-
85-
## Kubernetes Configuration
86-
87-
Add Kubernetes integration to Codefresh: `> Account Settings > Integration > Kubernetes`. From now on, you can use added Kubernetes cluster in Codefresh pipeline, addressing its context by the name you see in `Clusters` menu.

incubator/helm/plugin.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
image: codefresh/cfstep-helm
2+
tag: 2.8.1
3+
version: 1.0.0
4+
description: Release a Helm chart (update or install)
5+
keywords:
6+
- helm
7+
- kubernetes
8+
home: https://github.com/codefresh-io/pugins/tree/master/incubator/helm
9+
sources:
10+
- https://github.com/codefresh-contrib/cfplugin-step
11+
maintainers: # (optional)
12+
- name: Itay Shakury
13+
email: itaysk@codefresh.io
14+
icon: https://avatars0.githubusercontent.com/u/29493517?v=4&s=400
15+
envs:
16+
- name: KUBE_CONTEXT
17+
type: required
18+
description: Kubernetes context to use (the name of the cluster as configured in Codefresh)
19+
- name: CHART_NAME
20+
type: required
21+
description: Helm chart name to release (path to chart folder, or name of packaged chart)
22+
- name: RELEASE_NAME
23+
description: Helm release name
24+
- name: NAMESPACE
25+
description: target Kubernetes namespace
26+
- name: TILLER_NAMESPACE
27+
description: Kubernetes namespace where tiller is at
28+
- name: CHART_VERSION
29+
description: application chart version to install
30+
- name: CHART_REPO_URL
31+
description: Helm chart repository URL (overriden by injected Helm repository context)
32+
- name: CUSTOMFILE_<name>
33+
description: Values file to provide to Helm (as --file). see usage information below.
34+
- name: CUSTOM_<name>
35+
description: Value to provide to Helm (as --set). see usage information below.
36+
context:
37+
- kind: kubernetes

stable/helm-legacy/.swp

12 KB
Binary file not shown.
File renamed without changes.

stable/helm-legacy/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
> There is a new Helm plugin with added capabilities, we are keeping this plugin as is for backward-compatibility.
2+
The new plugin can be found here: [/incubator/helm](https://github.com/codefresh-io/plugins/tree/master/incubator/helm)
3+
4+
# Codefresh Helm Plugin
5+
6+
Use Codefresh [Helm](https://helm.sh) plugin to deploy a Helm chart into specified (by context) Kubernetes cluster.
7+
8+
## Usage
9+
10+
Set required and optional environment variable and add the following step to your Codefresh pipeline:
11+
12+
```yaml
13+
---
14+
version: '1.0'
15+
16+
steps:
17+
18+
...
19+
20+
release_to_env:
21+
image: codefresh/plugin-helm:2.7.2
22+
23+
...
24+
25+
```
26+
27+
## Environment Variables
28+
29+
- **required** `CHART_NAME` - Helm chart name
30+
- **required** `RELEASE_NAME` - Helm release name
31+
- **required** `KUBE_CONTEXT` - Kubernetes context to use (cluster name from Codefresh-Kubernetes integration)
32+
- `NAMESPACE` - target Kubernetes namespace
33+
- `CHART_VERSION` - application chart version to install
34+
- `CHART_REPO_URL` - Helm chart repository URL
35+
- `DRY_RUN` - do a "dry run" installation (do not install anything, useful for Debug)
36+
- `DEBUG` - print verbose install output
37+
- `WAIT` - block step execution till installation completed and all Kubernetes resources are ready
38+
- `TIMEOUT` - wait timeout (5min by default)

stable/helm/plugin.yaml renamed to stable/helm-legacy/plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
image: codefresh/plugin-helm
22
tag: 2.7.2
33
version: 1.1.0
4-
description: Release a Helm chart (update or install)
4+
description: Release a Helm chart (update or install). There is a new Helm plugin with added capabilities, we are keeping this plugin as is for backward-compatibility. The new plugin is at /incubator/helm (https://github.com/codefresh-io/plugins/tree/master/incubator/helm)
55
keywords:
66
- helm
77
- kubernetes

0 commit comments

Comments
 (0)