This section describes how to create External References using Helm Chart.
Perform the following steps to have your External References in a Helm chart:
Create an External Reference Profile with the type Kubernetes Properties described in External Reference (4.0) and save it.
Change to the YAML tab and click on the download button to download the YAML file of the ConfigMap.
Example - ConfigMap.yaml downloaded from External Reference Profile
--- apiVersion: "v1" data: time_unit: "" interval: "" kind: "ConfigMap" metadata: labels: app.kubernetes.io/component: "extref" name: "default.k8s-extref"
Create a Helm chart with one or more ConfigMaps that will be used in your configuration by following these steps:
Create an empty Helm chart using the following command:
$ helm create [name of helm chart]
A new directory is created with the specified name.
Delete everything in the templates directory in the new Helm chart.
$ rm -rf [name of helm chart]/templates/*
Add your ConfigMap YAML file downloaded in step 1.b into the templates directory.
External Reference values will be received from the data field. Update the values for your keys.
Install your Helm chart.
$ helm install [release name] ./[name of helm chart]
Optional step: To easily maintain your External Reference data you can move it to the values.yaml file.
Add the following parameter in your ConfigMap YAML file in the
templates
directory:data: {{ toYaml .Values.externalReference.data | indent 2 }}
See the following ConfigMap as an example:
Example - ConfigMap.yaml file
apiVersion: v1 kind: "ConfigMap" data: {{ toYaml .Values.externalReference.data | indent 2 }} metadata: labels: app.kubernetes.io/component: "extref" name: "default.k8s-extref"
Move the data field from your ConfigMap YAML file to the values.yaml file. For example:
Example - values.yaml file
# Default values for [name of helm chart]. # This is a YAML-formatted file. # Declare variables to be passed into your templates. externalReference: data: interval: "2" time_unit: "seconds"
Note!
All the default values created by Helm can be deleted if you don't want to use them.