Skip to content

Conversation

@tmalove
Copy link
Contributor

@tmalove tmalove commented Jan 17, 2026

Version(s):
4.21+

Issue:
OSDOCS-15568

Link to docs preview:
Configuring custom hostnames
Parameters and values for the MicroShift config.yaml file

QE review:

  • [x ] QE has approved this change. (Kasturi)

@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 17, 2026
@ocpdocs-previewbot
Copy link

ocpdocs-previewbot commented Jan 17, 2026

🤖 Thu Jan 29 18:22:54 - Prow CI generated the docs preview:

https://104923--ocpdocs-pr.netlify.app/microshift/latest/microshift_configuring/microshift-using-config-yaml.html

* Add the following `hosts` plugin at the end of the file:

[source,yaml]
----
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] AsciiDocDITA.TaskStep: Content other than a single list cannot be mapped to DITA tasks.


* Save your change in the file.

[NOTE]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] AsciiDocDITA.TaskStep: Content other than a single list cannot be mapped to DITA tasks.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After editing Microshift configuration, a service restart is required.
After the restart, will be monitored for changes (without requiring further service restarts),
So we need to restart to activate the feature (so it will start monitoring the specified file), after that, no restart is needed. (unless we change )

* You have root access to the node.

.Procedure
. Edit the `config.yaml` file in the `etc/hosts` directory.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config.yaml is the standard Microshift configuration file, and that's what we are editing,
/etc/hosts is the default file on the Microshift hosts that will be propagated to the coreDNS to respond to DNS queries originating from the pods (in case is not set).
That file can be changed with the "file: " in the hosts section, as mentioned below.


.Procedure
. Edit the `config.yaml` file in the `etc/hosts` directory.
. Add the following `hosts` plugin at the end of the file:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
. Add the following `hosts` plugin at the end of the file:
. Add the following `hosts` configuration at the end of the file:

plugin is not the correct term we use.

@tmalove tmalove changed the title OSDOCS#15568: Add MicroShift DNS hosts plugin feature OSDOCS#15568: Add MicroShift DNS hosts configuration feature Jan 20, 2026
* You have root access to the node.

.Procedure
. Edit the `/etc/hosts` file.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
. Edit the `/etc/hosts` file.
. Edit the microShift configuration in `/etc/microshift/config.yaml` file.

There is a table describing all the various configuration options in config.yaml, we should add the new options under dns.baseDomain

| hosts.status | Enabled, Disabled | by default set to Disabled  when not configured |
| host.file |  String|  filepath by default set to '/etc/hosts' |

hosts:
----

. Save your file update.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
. Save your file update.
. Save your configuration yaml file.

$ sudo systemctl restart microshift
----
+
After this initial restart, MicroShift automatically monitors the `hosts` file for updates. You do not have to restart the service for additional changes to the `hosts` file to take effect.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
After this initial restart, MicroShift automatically monitors the `hosts` file for updates. You do not have to restart the service for additional changes to the `hosts` file to take effect.
After this initial restart, MicroShift automatically monitors the `hosts.file` for updates. You do not have to restart the service for additional changes to the `hosts.file` file to take effect.

= Configuring custom hostnames

[role="_abstract"]
You can use the `hosts` file to resolve custom hostnames for pod workloads. This enables applications to resolve fixed hostnames, such as the local machine or external services, by applying `/etc/hosts` functionality to DNS queries within the node. The functionality is applied by adding specific configuration to the `etc/hosts` file and completing a service restart.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can use the `hosts` file to resolve custom hostnames for pod workloads. This enables applications to resolve fixed hostnames, such as the local machine or external services, by applying `/etc/hosts` functionality to DNS queries within the node. The functionality is applied by adding specific configuration to the `etc/hosts` file and completing a service restart.
You can use the `hosts` file to resolve custom hostnames for pod workloads. This enables applications to resolve fixed hostnames, such as the local machine or external services, by applying `/etc/hosts` functionality to DNS queries within the node. The functionality is applied by adding specific configuration to the Microshift configuration yaml file and completing a service restart.

@tmalove tmalove force-pushed the ms-osdocs-15568-tlove branch from 30079b3 to 513c0d9 Compare January 22, 2026 03:58
@tmalove
Copy link
Contributor Author

tmalove commented Jan 22, 2026

@eslutsky @kasturinarra I have the updated section links available. Thanks!

|`valid domain`
|Base domain of the node. All managed DNS records are subdomains of this base.

|`hosts.status`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
|`hosts.status`
|`dns.hosts.status`

|`Enabled`, `Disabled`
|Default set to `Disabled` when not configured.

|`host.file`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
|`host.file`
|`dns.hosts.file`

$ sudo systemctl restart microshift
----
+
After this initial restart, MicroShift automatically monitors the `hosts.file` file for updates. You do not have to restart the service for additional changes to the `hosts.file` file to take effect.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
After this initial restart, MicroShift automatically monitors the `hosts.file` file for updates. You do not have to restart the service for additional changes to the `hosts.file` file to take effect.
After this initial restart, if dns.hosts.status is Enabled , MicroShift automatically monitors the `dns.hosts.file` file for updates. You do not have to restart the service for additional changes to the `dns.hosts.file` file to take effect.

@tmalove tmalove force-pushed the ms-osdocs-15568-tlove branch 2 times, most recently from 834fba4 to a5d8a72 Compare January 23, 2026 05:30
@tmalove
Copy link
Contributor Author

tmalove commented Jan 23, 2026

@eslutsky one more review...thank you!

$ sudo systemctl restart microshift
----
+
After this initial restart, if `dns.hosts.status` is set to `Enabled`, MicroShift automatically monitors the `dns.hosts.file` file for updates. You do not have to restart the service before additional changes to the `dns.hosts.file` file are active.
Copy link

@eslutsky eslutsky Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
After this initial restart, if `dns.hosts.status` is set to `Enabled`, MicroShift automatically monitors the `dns.hosts.file` file for updates. You do not have to restart the service before additional changes to the `dns.hosts.file` file are active.
After this initial restart, if `dns.hosts.status` is set to `Enabled`, MicroShift automatically monitors the `dns.hosts.file` file for updates. You do not have to restart the MicroShift service until the MicroShift configuration yaml is edited again.
.

Comment on lines 27 to 32
dns:
hosts:
status: <Enabled|Disabled>
file: <filepath>
dns:
hosts:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dns:
hosts:
status: <Enabled|Disabled>
file: <filepath>
dns:
hosts:

This part is a duplicate and not needed

Copy link

@eslutsky eslutsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few nits.

@tmalove
Copy link
Contributor Author

tmalove commented Jan 27, 2026

Thanks @eslutsky, I made the updates. @kasturinarra will you review? Thanks !

@eslutsky
Copy link

/lgtm
look goods to me

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 27, 2026
@kasturinarra
Copy link

/lgtm

@tmalove tmalove force-pushed the ms-osdocs-15568-tlove branch from 888c1c2 to 7ba0eb6 Compare January 28, 2026 20:19
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 28, 2026
@openshift-ci
Copy link

openshift-ci bot commented Jan 28, 2026

New changes are detected. LGTM label has been removed.

@tmalove
Copy link
Contributor Author

tmalove commented Jan 28, 2026

/label merge-review-needed

@openshift-ci openshift-ci bot added the merge-review-needed Signifies that the merge review team needs to review this PR label Jan 28, 2026
@bergerhoffer
Copy link
Contributor

/label merge-review-in-progress

@openshift-ci openshift-ci bot added the merge-review-in-progress Signifies that the merge review team is reviewing this PR label Jan 28, 2026
Copy link
Contributor

@bergerhoffer bergerhoffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One blocker (the DITA migration error) and a few other suggestions to fix before merging!

+
After this initial restart, if `dns.hosts.status` is set to `Enabled`, MicroShift automatically monitors the `dns.hosts.file` file for updates. You do not have to restart the {microshift-short} service until the {microshift-short} configuration YAML file is changed again.

[NOTE]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DITA message above is correct - you can't have this NOTE here after the procedure steps. You either have to attach it at the end of the last step, or move it up above the prerequisites. Check out the confluence page if you need more info: https://spaces.redhat.com/spaces/OSDOCS/pages/654185635/Content+updates+in+preparation+for+migrating+to+DITA

$ sudo systemctl restart microshift
----
+
After this initial restart, if `dns.hosts.status` is set to `Enabled`, MicroShift automatically monitors the `dns.hosts.file` file for updates. You do not have to restart the {microshift-short} service until the {microshift-short} configuration YAML file is changed again.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a handful of places that hardcode "MicroShift" - not critical but consider using the attribute like you do elsewhere

@@ -0,0 +1,42 @@
// Module included in the following assemblies:
//
// * microshift/using-config-tools.adoc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it should be:

Suggested change
// * microshift/using-config-tools.adoc
// * microshift_configuring/microshift-using-config-yaml.adoc

@bergerhoffer bergerhoffer added branch/enterprise-4.21 and removed merge-review-in-progress Signifies that the merge review team is reviewing this PR merge-review-needed Signifies that the merge review team needs to review this PR labels Jan 28, 2026
@bergerhoffer bergerhoffer added this to the Planned for 4.21 GA milestone Jan 28, 2026
@tmalove tmalove force-pushed the ms-osdocs-15568-tlove branch from db36ae1 to 8563937 Compare January 29, 2026 18:15
@openshift-ci
Copy link

openshift-ci bot commented Jan 29, 2026

@tmalove: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@tmalove
Copy link
Contributor Author

tmalove commented Jan 29, 2026

@bergerhoffer I updated the content per your feedback...thanks!

Copy link
Contributor

@bergerhoffer bergerhoffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, thanks! Merging

@bergerhoffer bergerhoffer merged commit 185916c into openshift:main Jan 29, 2026
2 checks passed
@bergerhoffer
Copy link
Contributor

/cherrypick enterprise-4.21

@openshift-cherrypick-robot

@bergerhoffer: new pull request created: #105698

Details

In response to this:

/cherrypick enterprise-4.21

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch/enterprise-4.21 size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants