Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 3. Using MicroShift configuration snippets


If you want to configure one or two settings, use the /etc/microshift/config.d/ configuration directory to drop in configuration snippet YAML files.

3.1. How configuration snippets work

If you want to configure one or two settings, such as adding subject alternative names (SANs), you can use the /etc/microshift/config.d/ configuration directory to drop in configuration snippet YAML files. You must restart MicroShift for new configurations to apply.

To return to previous values, you can delete a configuration snippet and restart MicroShift.

At runtime, the YAML files inside /etc/microshift/config.d are merged into the existing MicroShift configuration, whether that configuration is a result of default values or a user-created config.yaml file. You do not need to create a config.yaml file to use a configuration snippet.

Files in the snippet directory are sorted in lexicographical order and run sequentially. You can use numerical prefixes for snippets so that each is read in the order you want. The last-read file takes precedence when there is more than one YAML for the same parameter.

Important

Configuration snippets take precedence over both default values and a customized config.yaml configuration file.

3.2. Examples of configuration snippet lists or arrays

Lists, or arrays, are not merged, they are overwritten. For example, you can replace a SAN or list of SANs by creating an additional snippet for the same field that is read after the first:

MicroShift configuration directory contents

  • /etc/microshift/config.yaml.default or /etc/microshift/config.yaml

Example MicroShift configuration snippet directory contents

  • /etc/microshift/config.d/10-san.yaml
  • /etc/microshift/config.d/20-san.yaml

    Example 10-san.yaml snippet

    apiServer:
      subjectAltNames:
        - host1
        - host2
    Copy to Clipboard Toggle word wrap

    Example 20-san.yaml snippet

    apiServer:
      subjectAltNames:
        - hostZ
    Copy to Clipboard Toggle word wrap

    Example configuration result

    apiServer:
      subjectAltNames:
        - hostZ
    Copy to Clipboard Toggle word wrap

If you want to add a value to an existing list, you can add it to an existing snippet. For example, to add hostZ to an existing list of SANs, edit the snippet you have instead of creating a new one:

Example 10-san.yaml snippet

apiServer:
  subjectAltNames:
    - host1
    - host2
    - hostZ
Copy to Clipboard Toggle word wrap

Example configuration result

apiServer:
  subjectAltNames:
    - host1
    - host2
    - hostZ
Copy to Clipboard Toggle word wrap

3.3. Example configuration snippets that are objects

Objects are merged together when you use a configuration snippet.

Example 10-advertiseAddress.yaml snippet

apiServer:
  advertiseAddress: "microshift-example"
Copy to Clipboard Toggle word wrap

Example 20-audit-log.yaml snippet

apiServer:
  auditLog:
    maxFileAge: 12
Copy to Clipboard Toggle word wrap

Example configuration result

apiServer:
  advertiseAddress: "microshift-example"
  auditLog:
    maxFileAge: 12
Copy to Clipboard Toggle word wrap

3.4. Examples of mixed configuration snippets

In this example, the values of both advertiseAddress and auditLog.maxFileAge fields merge into the configuration, but only the c.com and d.com subjectAltNames values are retained. This happens because the numbering in the filename indicates that the c.com and d.com values are higher priority.

Example 10-advertiseAddress.yaml snippet

apiServer:
  advertiseAddress: "microshift-example"
Copy to Clipboard Toggle word wrap

Example 20-audit-log.yaml snippet

apiServer:
  auditLog:
    maxFileAge: 12
Copy to Clipboard Toggle word wrap

Example 30-SAN.yaml snippet

apiServer:
  subjectAltNames:
    - a.com
    - b.com
Copy to Clipboard Toggle word wrap

Example 40-SAN.yaml snippet

apiServer:
  subjectAltNames:
    - c.com
    - d.com
Copy to Clipboard Toggle word wrap

Example configuration result

apiServer:
  advertiseAddress: "microshift-example"
  auditLog:
    maxFileAge: 12
  subjectAltNames:
    - c.com
    - d.com
Copy to Clipboard Toggle word wrap

Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat