metal-basecamp

module
v1.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2023 License: MIT

README

= Metal Basecamp
:toc:
:toclevels: 3

image:https://github.com/Cray-HPE/metal-basecamp/actions/workflows/ci.yml/badge.svg[Continuous Integration,link=https://github.com/Cray-HPE/metal-basecamp/actions/workflows/ci.yml]

This repo provides the metadata datasource for cloud-init during bootstrap and recovery.

The sister-service, CRAY-BSS, provides this same capability to scale through Kubernetes. Baecamp can be
used in Docker or Podman quickly for bootstrapping a kubernetes cluster. The data served by Basecamp
is compatible with Cray-BSS, and is handed-off as part of the deployment process.

== Usage - Server

Basecamp can be ran multiple ways. For the full experience, we suggest using the Docker image.
Developers should use whichever environment they like, whether that's the Docker container
or their local Go-lang env.

=== Podman (or Docker)

. Create configuration directories
+
[source,bash]
----
mkdir -p configs
touch configs/server.yaml # fill this in
touch configs/data.json # fill this in
----

. Run the container:
+
[source,bash]
----
image='arti.dev.cray.com/csm-docker-master-local/metal-basecamp'
podman create --net host --volume $(pwd)/configs:/app/configs --name basecamp "$image"
----

. You should now be able to run queries against the container:
+
[source,bash]
----
curl http://localhost:8888/meta-data
curl http://localhost:8888/user-data
----

=== Daemon

There is a systemd-daemon in this repo for running the Basecamp container in the background. The 
daemon can be obtained through linux package managers.

The daemon will setup `configs/data.json` and `configs/server.yaml` if they do not already exist.

[source,bash]
----
systemctl enable basecamp
systemctl start basecamp
----

====  Logs

Basecamp outputs logs in two places; container logs and daemon logs.

===== Container logs

[source,bash]
----
podman logs -f basecamp
----

==== Daemon logs

[source,bash]
----
journalctl -xeu basecamp -f
----

== Usage - Client

Two steps for usage.

. Install cloud-init
+
[source,bash]
----
zypper install cloud-init
systemctl enable cloud-configs cloud-init-local cloud-init cloud-final
----

. Configure cloud-init

.. Option 1: Add the following to `/etc/cloud/cloud.cfg`
+
[source,yaml]
----
datasource:
  NoCloud:
    seedfrom: http://{IP OF METADATA SERVER}:{PORT}/
----

.. Option 2: Boot the server with the `ds` kernel parameter set to `nocloud-net`
+
[source]
----
ds=nocloud-net;s=http://{IP OF METADATA SERVER}:{PORT}/
----
+
.For scripts such as iPXE scripts or GRUB config files, the `;` must be escaped with a `\`.
+
[source]
----
ds=nocloud-net\;s=http://{IP OF METADATA SERVER}:{PORT}/
----

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL