Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [CoreDHCP](#coredhcp)
- [CoreDNS](#coredns)
- [Overview](#overview)
- [Configuration](#configuration)
- [Build and Install](#build-and-install)
- [Build/Install with GoReleaser](#buildinstall-with-goreleaser)
- [Environment Variables](#environment-variables)
Expand All @@ -18,7 +19,7 @@
- [CoreDHCP](#coredhcp-1)
- [CoreDNS](#coredns-1)
- [Running](#running)
- [Configuration](#configuration)
- [Configuration](#configuration-1)
- [Preparation: SMD and BSS](#preparation-smd-and-bss)
- [Preparation: TFTP](#preparation-tftp)
- [Running](#running-1)
Expand Down Expand Up @@ -62,6 +63,10 @@ CoreSMD acts as a pull-through cache of DHCP and DNS information from SMD, ensur

---

## Configuration

Take a look at [**examples/**](examples/). In there are configuration examples and documentation for both CoreDHCP and CoreDNS.

## Build and Install

The plugins in this repository can be built into CoreDHCP/CoreDNS either using a container-based approach (via the provided Dockerfile) or by statically compiling them into CoreDHCP/CoreDNS on bare metal. Additionally, this project uses [GoReleaser](https://goreleaser.com/) to automate releases and include build metadata.
Expand Down
11 changes: 11 additions & 0 deletions examples/coredhcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

This directory contains example CoreDHCP configurations for the CoreSMD plugin.

## Contents

- [CoreDHCP Configuration Examples for CoreSMD](#coredhcp-configuration-examples-for-coresmd)
- [Contents](#contents)
- [Positional vs. Key-Value Format](#positional-vs-key-value-format)
- [Custom Hostnames](#custom-hostnames)

## Positional vs. Key-Value Format

Prior to CoreSMD v0.5.0, positional arguments were used to configure CoreSMD which made it difficult to match configuration values to configuration keys. An example of such configuration would be:
Expand Down Expand Up @@ -33,3 +40,7 @@ plugins:
```

See [coredhcp.yaml](coredhcp.yaml) for a full example with documentation comments.

## Custom Hostnames

Hostname patterns can be used to specify custom hostnames for nodes and BMCs. See [**hostnames.md**](hostnames.md) for more details.
53 changes: 53 additions & 0 deletions examples/coredhcp/coredhcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,43 @@ server4:
# The format of configuration options below is "key=value", with no spaces
# on either side of the equal sign. Quotes around values are optional.
#
# CUSTOM HOSTNAMES
#
# For node_pattern and bmc_pattern (see CONFIGURATION KEYS below), custom
# hostname patterns can be specified to dynamically generate custom
# hostnames for BMCs and nodes in SMD.
#
# Hostname Placeholder Syntax:
#
# {Nd} - Zero-padded NID where N is the number of digits
# Examples: {04d} -> 0001, 0042, 1234
# {02d} -> 01, 42, 99
# {05d} -> 00001, 00042, 12345
# {id} - Component xname (e.g., x3000c0s0b0n0 for nodes, x3000c0s0b1 for
# BMCs)
#
# Literal text can be mixed with placeholders:
#
# "compute-{04d}" -> compute-0001, compute-0042
# "node-{id}" -> node-x3000c0s0b0n0
# "dev-s{02d}" -> dev-s01, dev-s42
#
# CUSTOM DOMAINS:
#
# If 'domain' is specified (see CONFIGURATION KEYS below), a custom domain
# will be appended to hostnames generated using the custom hostname
# mechanism above, making generated hostnames fully-qualified.
#
# For instance, for the following configuration:
#
# - coresmd: ... node_pattern="{id}" bmc_pattern="{id}" domain=cluster.local
#
# {id} will be expanded to the node/BMC's xname and the domain cluster.local
# will be appended. For example:
#
# BMC hostname: x3000c0s0b1.cluster.local
# Node hostname: x3000c0s0b1n0.cluster.local
#
# CONFIGURATION KEYS
#
# svc_base_uri (REQUIRED, string)
Expand Down Expand Up @@ -85,6 +122,19 @@ server4:
# tftp_port (OPTIONAL, integer, default=69)
# The transport layer network port to bind to. If omitted, the default
# value will be used.
#
# node_pattern (OPTIONAL, string, default=id{04d})
# The hostname pattern to use to generate hostnames for nodes in SMD. See
# CUSTOM HOSTNAMES above for details.
#
# bmc_pattern (OPTIONAL, string, default=bmc{04d})
# The hostname pattern to use to generate hostnames for BMCs in SMD. See
# CUSTOM HOSTNAMES above for details.
#
# domain (OPTIONAL, string)
# An optional domain to append to hostnames generated with node_pattern
# and bmc_pattern. If omitted, no domain will be appended. See CUSTOM
# DOMAINS above for details.
- coresmd: |
svc_base_uri=https://foobar.openchami.cluster
ipxe_base_uri=http://172.16.0.253:8081
Expand All @@ -94,6 +144,9 @@ server4:
single_port=false
tftp_dir=/tftpboot
tftp_port=69
node_pattern=nid{04d}
bmc_pattern=bmc{04d}
domain=openchami.cluster

# Any requests reaching this point are unknown to SMD and it is up to the
# administrator to decide how to handle unknown packets.
Expand Down
Loading
Loading