# Helm

## Helm

### Continuous Integration

#### chart testing (ct)

**Example**

```
ct lint --config ./utils/ci/ct.yaml
```

#### yamllint

Use yamllint to verify quality YAML is being used!

**Example**

```
yamllint --config-file lintconf.yaml values.yaml
```

**Example lintconf.yaml**

### Flow Control

#### if/else

create conditional blocks

```
{{- if eq .Values.favorite.drink "coffee" }}
mug: "true"
{{- end }}
```

#### with

Allows the user to specify scope

```
{{- with .Values.resources }}
	{{- toYaml . | nindent 4 }}
{{- end }}
```

### Sprig functions

#### [printf](https://helm.sh/docs/chart_template_guide/function_list/#printf)

Useful for string interpolation

```
printf "%s has %d dogs." .Name .NumberDogs
```

#### [ternary](https://helm.sh/docs/chart_template_guide/function_list/#ternary)

Useful for one liner if/else statements

```
serviceAccountName: {{ ternary (include "notifier.fullname" .) "default" .Values.serviceAccount.create }}
```

### Monitoring

#### [Helm Exporter](https://github.com/sstarcher/helm-exporter)

Allows users to export Helm metrics to Prometheus to use within Grafana

The following query will display all the current helm deployments followed by their status !\[\[2022-02-02-grafana-helm-exporter.png]]

```
min(helm_chart_info) by (chart, namespace, appVersion, release, version) != 2
```

The following status codes can help adjust the colors as well:

| Status Code | Result           |
| ----------- | ---------------- |
| -1          | Failed           |
| 0           | Unknown          |
| 1           | Deployed         |
| 2           | Deleted          |
| 3           | Superseded       |
| 5           | Deleting         |
| 6           | Pending Install  |
| 7           | Pending Upgrade  |
| 8           | Pending Rollback |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.harrison.kim/notes/helm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
