Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

The ConfigMap template

Pragya Keshap answered on February 18, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • kubernetes demo configmap
  • ConfigMap#
  • Creating a ConfigMap from multiple files#
  • ConfigMaps
  • configmap in kubernetes
  • ConfigMap - Secret
  • Extracting Configs to a ConfigMap
  • Creating a ConfigMap from a directory#
  • Names of all the configMaps
  • Creating ConfigMap using literals#
  • A Plea NOT to Use ConfigMaps!
  • A Plea NOT to Use ConfigMaps!
  • Why No ConfigMaps?#
  • From which of the following source(s) ConfigMaps can be create?
  • Which of the following command is used to create ConfigMaps?
  • create configmap

  • The ConfigMap template

    0

    This template is designed to create ConfigMaps from files in the folder config-repo. Each ConfigMap will contain all non-sensitive configuration required by a specific Deployment. The Deployment manifest will map the content of the ConfigMap as a volume in its Pod template. This will result in Pods created by the Deployment being able to access the configuration as files in their local filesystem. See the section The Deployment template below for details. The config-repo folder needs to be placed in the charts that use the common chart.

    The first line, {{- define "common.configmap_from_file " -}}, is used to declare the name of the reusable template. The scope of the template ends with a matching {{- end -}}, the last line in this example.

    To set the name of the ConfigMap, the template common.fullname from the file _helpers.tpl is used.

    Next, a number of labels are defined to make it easier to identify the ConfigMap later on. Again, templates from the _helpers.tpl file are used to set the name and specify the chart used. To mark that this Service has been created using Helm, the label app.kubernetes.io/managed-by is set to the value for the field .Release.Service. From the earlier description of the Release object, we know that it always returns the value Helm.

    Next comes the core part of the ConfigMap, its data section. To specify the actual configuration in the ConfigMap, the Glob function in the Files object is used to get all files in the folder config-repo. Next, the function AsConfig is applied to the content in the files to form a proper YAML map. The result is piped to the indent function that ensures a proper indentation is rendered, in this case using two characters.

    Popularity 1/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Feb 18 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.