Class BareMetalHostingManager
Manages cluster provisioning directly on (mostly) bare manually provisioned machines or virtual machines.
Implements
Inherited Members
Namespace: Neon.Kube.Hosting.BareMetal
Assembly: Neon.Kube.BareMetal.dll
Syntax
[HostingProvider(HostingEnvironment.BareMetal)]
public class BareMetalHostingManager : HostingManager, IHostingManager
Remarks
Constructors
BareMetalHostingManager()
Creates an instance that is only capable of validating the hosting related options in the cluster definition.
Declaration
public BareMetalHostingManager()
BareMetalHostingManager(ClusterProxy, bool, string, string, string)
Creates an instance that is capable of provisioning a cluster on manually provisioned servers or virtual machines.
Declaration
public BareMetalHostingManager(ClusterProxy cluster, bool cloudMarketplace, string nodeImageUri = null, string nodeImagePath = null, string logFolder = null)
Parameters
Type | Name | Description |
---|---|---|
ClusterProxy | cluster | The cluster being managed. |
bool | cloudMarketplace | Ignored |
string | nodeImageUri | Optionally specifies the node image URI (one of |
string | nodeImagePath | Optionally specifies the path to the local node image file (one of |
string | logFolder | The folder where log files are to be written, otherwise or |
Remarks
note
One of nodeImageUri
or nodeImagePath
must be specified.
Properties
Capabilities
Returns flags describing any optional capabilities supported by the hosting manager.
Declaration
public override HostingCapabilities Capabilities { get; }
Property Value
Type | Description |
---|---|
HostingCapabilities |
Overrides
HostingEnvironment
Returns the hosting environment implemented by the manager.
Declaration
public override HostingEnvironment HostingEnvironment { get; }
Property Value
Type | Description |
---|---|
HostingEnvironment |
Overrides
RequiresNodeAddressCheck
Returns true
if the hosting manager requires that the LAN be scanned
for devices assigned IP addresses that may conflict with node addresses. This
is typically required only for clusters deployed on-premise because cloud
clusters are typically provisioned to their own isolated network.
Declaration
public override bool RequiresNodeAddressCheck { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Methods
AddProvisioningSteps(SetupController<NodeDefinition>)
Adds the steps required to the setup controller passed that creates and initializes the cluster resources such as the virtual machines, networks, load balancers, network security groups, public IP addresses.
Declaration
public override void AddProvisioningSteps(SetupController<NodeDefinition> controller)
Parameters
Type | Name | Description |
---|---|---|
SetupController<NodeDefinition> | controller | The setup controller. |
Overrides
CheckDeploymentReadinessAsync(ClusterDefinition)
Performs any final hosting environmet readiness check before deploying a cluster.
Declaration
public override Task CheckDeploymentReadinessAsync(ClusterDefinition clusterDefinition)
Parameters
Type | Name | Description |
---|---|---|
ClusterDefinition | clusterDefinition | Specifies the cluster definition. |
Returns
Type | Description |
---|---|
Task | The tracking Task. |
Overrides
Exceptions
Type | Condition |
---|---|
HostingReadinessException | Thrown if any problems were detected. |
Dispose(bool)
Releases any important resources associated with the instance.
Declaration
public override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | Pass |
Overrides
GetClusterAddresses()
Returns the IP address to be used to access the cluster. For clusters deployed the the cloud, this will be the ingress IP address assigned to the load balancer. For on-premise clusters, this returns the private IP addresses for the control-plane nodes.
Declaration
public override IEnumerable<string> GetClusterAddresses()
Returns
Type | Description |
---|---|
IEnumerable<string> | The list of cluster IP addresses. |
Overrides
GetClusterHealthAsync(TimeSpan)
Retrieves the health status of the current cluster from the hosting manager's perspective This includes information about the infrastructure provisioned for the cluster.
Declaration
public override Task<ClusterHealth> GetClusterHealthAsync(TimeSpan timeout = default)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | timeout | Optionally specifies the maximum time to wait for the result. This defaults to 15 seconds. |
Returns
Type | Description |
---|---|
Task<ClusterHealth> | The ClusterHealth information for the current cluster. noteWhen there is no current cluster, the health information will return indicating that no cluster was found. |
Overrides
GetDataDisk(LinuxSshProxy)
Identifies the data disk device for a node. This returns the data disk's device name when an uninitialized data disk exists or "PRIMARY" when the OS disk will be used for data.
Declaration
public override string GetDataDisk(LinuxSshProxy node)
Parameters
Type | Name | Description |
---|---|---|
LinuxSshProxy | node |
Returns
Type | Description |
---|---|
string | The disk device name or "PRIMARY". |
Overrides
Remarks
note
This will not work after the node's data disk has been initialized.
GetResourceAvailabilityAsync(long, long)
Returns the availability of resources required to deploy a cluster.
Declaration
public override Task<HostingResourceAvailability> GetResourceAvailabilityAsync(long reserveMemory = 0, long reserveDisk = 0)
Parameters
Type | Name | Description |
---|---|---|
long | reserveMemory | Optionally specifies the amount of host memory (in bytes) to be reserved for host operations. |
long | reserveDisk |
Returns
Type | Description |
---|---|
Task<HostingResourceAvailability> | Details about whether cluster deployment can proceed. |
Overrides
Remarks
The optional reserveMemory
and reservedDisk
parameters
can be used to specify memory and disk that are to be reserved for the host environment. Hosting
manager implementations are free to ignore this when they don't really makse sense.
This is currently used for Hyper-V based clusters running on a user workstation or laptop to ensure that deployed clusters don't adverserly impact the host machine too badly.
These parameters don't really make sense for cloud or dedicated hypervisor hosting environments because those environemnts will still work well when all available resources are consumed.
GetSshEndpoint(string)
Returns the FQDN or IP address (as a string) and the port to use to establish a SSH connection to a specific node.
Declaration
public override (string Address, int Port) GetSshEndpoint(string nodeName)
Parameters
Type | Name | Description |
---|---|---|
string | nodeName | The target node's name. |
Returns
Type | Description |
---|---|
(string Address, int Port) | A (string Address, int Port) tuple. |
Overrides
Remarks
This will return the direct private node endpoint by default. If EnableInternetSshAsync() has been called and is supported by the hosting manager, then this returns the public address of the cluster along with the public NAT port.
Load()
Ensures that the assembly hosting this hosting manager is loaded.
Declaration
public static void Load()
Validate(ClusterDefinition)
Verifies that a cluster is valid for the hosting manager, customizing properties as required.
Declaration
public override void Validate(ClusterDefinition clusterDefinition)
Parameters
Type | Name | Description |
---|---|---|
ClusterDefinition | clusterDefinition |
Overrides
Exceptions
Type | Condition |
---|---|
ClusterDefinitionException | Thrown if any problems were detected. |