---
toc_max_heading_level: 2
---

# Template Functions for Embedded Cluster (Beta)

This topic lists the Replicated template functions for Embedded Cluster. For more imformation about how to use Replicated template functions, including a list of all available template functions, see [About Template Functions](/reference/template-functions-about).

## HelmValue {#helmvalue-func}

```go
func HelmValue(path string) string
```

Returns the value from the chart's `values.yaml` at the given dotted path. Use this to read the chart's default image values and pass them to the [ReplicatedImageName](#replicatedimagename), [ReplicatedImageRegistry](#replicatedimagerepository), or [ReplicatedImageRegistry](#replicatedimageregistry) template functions.

### Examples

#### Return a top-level value

```yaml
# HelmChart custom resource
values:
  initImage: '{{repl ReplicatedImageName (HelmValue ".initImage") true }}'
```

#### Return a value from a subchart

```yaml
# HelmChart custom resource
values:
  my-subchart:
    image:
      registry: '{{repl ReplicatedImageRegistry (HelmValue ".my-subchart.image.registry") }}'
      repository: '{{repl ReplicatedImageRepository (HelmValue ".my-subchart.image.repository") true }}'
```

## ReplicatedImageName

```go
func ReplicatedImageName(image string, noProxy ...bool) string
```

Returns a full image reference, including the registry, repository, and any tags.

Use this when a chart expects the entire image reference in a single field.

### Parameters

#### image

The image reference to rewrite.
Use the [HelmValue](#helmvalue-func) function to return the value from the chart's `values.yaml` at the given dotted path.

#### noProxy

The following table describes the value returned by ReplicatedImageName in online or air gap installations, when the `noProxy` field is omitted or set to `true`:

| Install type | noProxy | Result |
|------|---------|--------|
| Online | Omitted | Returns the proxy registry URL for the image in the format: `proxy.replicated.com/proxy/<app-slug>/<image>`, where `app-slug` is the unique application slug |
| Online | `true` | Returns the image reference with no changes |
| Air gap | `true` or omitted | Returns the location of the image at the local image registry in the format: `<local-registry>/<app-slug>/<name>:<tag>` |

### Examples

#### Public image (noProxy)

```yaml
# HelmChart custom resource
values:
  publicImage: '{{repl ReplicatedImageName (HelmValue ".publicImage") true }}'
```

#### Private image

```yaml
# HelmChart custom resource
apiVersion: kots.io/v1beta2
kind: HelmChart
spec:
  values:
    initImage: '{{repl ReplicatedImageName (HelmValue ".initImage") }}'
```

## ReplicatedImageRegistry

```go
func ReplicatedImageRegistry(registry string, noProxy ...bool) string
```

Returns the registry host.

Use this with the ReplicatedImageRepository template function when the image reference in the Helm chart uses separate `registry` and `repository` fields.

### Parameters

#### image

The image reference to rewrite.
Use the [HelmValue](#helmvalue-func) function to return the value from the chart's `values.yaml` at the given dotted path.

#### noProxy

The following table describes the value returned by ReplicatedImageName in online or air gap installations when the `noProxy` field is omitted or set to `true`:

| Install type | noProxy | Result |
|------|---------|--------|
| Online | Omitted | Returns the proxy registry domain (either `proxy.replicated.com` or your [custom domain](/vendor/custom-domains-using)) |
| Online | `true` | Returns the image registry value with no changes |
| Air gap | `true` or omitted | Returns the local registry address |

### Examples

#### Rewrite image references using HelmValues

```yaml
# HelmChart custom resource
apiVersion: kots.io/v1beta2
kind: HelmChart
spec:
  values:
    image:
      registry: '{{repl ReplicatedImageRegistry (HelmValue ".image.registry") }}'
      repository: '{{repl ReplicatedImageRepository (HelmValue ".image.repository") true }}'
```

#### Rewrite upstream image references for third-party Helm extensions

```yaml
# Embedded Cluster Config
extensions:
  helmCharts:
    - chart:
        name: ingress-nginx
        chartVersion: "4.11.3"
      releaseName: ingress-nginx
      namespace: ingress-nginx
      values: |
        controller:
          image:
            registry: 'repl{{ ReplicatedImageRegistry "registry.k8s.io" }}'
            repository: 'repl{{ ReplicatedImageRepository "registry.k8s.io/ingress-nginx/controller" }}'
```

## ReplicatedImageRepository

```go
func ReplicatedImageRepository(repository string, noProxy ...bool) string
```

Returns the repository path.

Use this with the ReplicatedImageRegistry template function when the image reference in the Helm chart uses separate `registry` and `repository` fields.

### Parameters

#### image

The image reference to rewrite.
Use the [HelmValue](#helmvalue-func) function to return the value from the chart's `values.yaml` at the given dotted path.

#### noProxy

The following table describes the value returned by ReplicatedImageName in online or air gap installations, when the `noProxy` field is omitted or set to `true`:

| Install type | noProxy | Result |
|------|---------|--------|
| Online | Omitted | Returns the proxy registry image repository in the format: `proxy/<app-slug>/<repository>`, where `app_slug` is the unique application slug |
| Online | `true` | Returns the image repository value with no changes |
| Air gap | `true` or omitted | Returns the local image repository in the format: `<app-slug>/<name>` |

### Examples

#### Rewrite image references using HelmValues

```yaml
# HelmChart custom resource
apiVersion: kots.io/v1beta2
kind: HelmChart
spec:
  values:
    image:
      registry: '{{repl ReplicatedImageRegistry (HelmValue ".image.registry") }}'
      repository: '{{repl ReplicatedImageRepository (HelmValue ".image.repository") true }}'
```

#### Rewrite upstream image references for third-party Helm extensions

```yaml
# Embedded Cluster Config
extensions:
  helmCharts:
    - chart:
        name: ingress-nginx
        chartVersion: "4.11.3"
      releaseName: ingress-nginx
      namespace: ingress-nginx
      values: |
        controller:
          image:
            registry: 'repl{{ ReplicatedImageRegistry "registry.k8s.io" }}'
            repository: 'repl{{ ReplicatedImageRepository "registry.k8s.io/ingress-nginx/controller" }}'
```