An open API service indexing awesome lists of open source software.

https://github.com/lazychanger/helm-viv

Helm plugin to use variable in values
https://github.com/lazychanger/helm-viv

helm helm-plugin variable-in-values viv

Last synced: about 1 month ago
JSON representation

Helm plugin to use variable in values

Awesome Lists containing this project

README

          

# Helm-variable-in-values

Part of the code in this repository comes from [helm](https://github.com/helm/helm)
and [helm-cm-push](https://github.com/chartmuseum/helm-push).

## Install
```shell
helm plugin install https://github.com/lazychanger/helm-viv
```

### version
```shell
helm viv version
```

## Usage

### 1. Create viv-chart project

```shell
helm create example
```

### 2. Add your variable-in-values to `vivs/xxx.yaml`

**values.yaml**

```yaml
...

subChart:
serviceSelector:
name:

subChart2:
# realname is <.ReleaseName>-<.Values.subChart2.serviceName>
serviceName: subChart
```

**vivs/overrideSubChartServiceName.yaml**

```yaml
subChart:
serviceSelector:
name: "{{ .Release.Name }}.{{ .Values.subChart2.serviceName }}"
```

### 3. Install

```shell
$ helm viv install --generate-name exmaple/simple-exmaple -f ./values.yaml --dry-run
```

## Debug

add `--debug` to your command, and then you can see *vivTemp* dir in your chart.

**command**
```shell
$ helm viv template --generate-name exmaple/simple-exmaple -f ./values.yaml --debug
```

**example/simple-example directory**
```shell
$ tree ./example/simple-example

#./example/simple-example
#├── Chart.lock
#├── Chart.yaml
#├── charts
#│   └── ingress-0.1.0.tgz
#├── templates
#│   ├── NOTES.txt
#│   ├── _helpers.tpl
#│   ├── deployment.yaml
#│   ├── hpa.yaml
#│   └── serviceaccount.yaml
#├── values.yaml
#├── vivTemp
#│   ├── _charts_ingressAlias_charts_service_vivs_values.yaml
#│   ├── _charts_ingressAlias_vivs_values.yaml
#│   ├── vivs_autoscaling.yaml
#│   └── vivs_values.yaml
#└── vivs
# ├── autoscaling.yaml
# └── values.yaml
```
## Config

### Env
| name | default | desc |
|------------------|---------|-----------------------------------------|
| HELM_VIV_HELMBIN | helm | use helmbin when viv proxy helm command |