Documentation ¶
Overview ¶
Package hostsfile implements a service which owns and writes all node-local files/interfaces used by the system to resolve the local node's name and the names of other nodes in the cluster:
- All cluster node names are written into /etc/hosts for DNS resolution.
- The local node's name is written into /etc/machine-id.
- The local node's name is set as the UNIX hostname of the machine (via the sethostname call).
- The local node's ClusterDirectory is updated with the same set of addresses as the one used in /etc/hosts.
The hostsfile Service can start up in two modes: with cluster connectivity and without cluster connectivity. Without cluster connectivity, only information about the current node (as retrieved from the network service) will be used to populate local data. In cluster mode, information about other nodes is also used.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterDialer ¶
type ClusterDialer func(ctx context.Context) (*grpc.ClientConn, error)
type Config ¶
type Config struct { // Network will be read to retrieve the current status of the Network service. Network *network.Service // Ephemeral is the root of the ephemeral storage of the node, into which the // service will write its managed files. Ephemeral *localstorage.EphemeralDirectory // ESP is the root of the node's EFI System Partition. ESP *localstorage.ESPDirectory // NodeID of the node the service is running on. NodeID string // Curator gRPC client authenticated as local node. Curator ipb.CuratorClient // ClusterDirectorySaved will be written with a boolean indicating whether the // ClusterDirectory has been successfully persisted to the ESP. ClusterDirectorySaved event.Value[bool] }
Click to show internal directories.
Click to hide internal directories.