Skip to content

Commit 0dc9efb

Browse files
committed
Add initial documentation with with mkdocs
1 parent 9ad7325 commit 0dc9efb

File tree

17 files changed

+1019
-0
lines changed

17 files changed

+1019
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish docs via GitHub Pages
2+
on:
3+
push:
4+
branches: [ main ]
5+
6+
jobs:
7+
build:
8+
name: Deploy docs
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout main
12+
uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: 'pypy3.9'
16+
- uses: actions/cache@v4
17+
with:
18+
key: ${{ github.ref }}
19+
path: .cache
20+
- name: Deploy docs
21+
uses: afritzler/mkdocs-gh-pages-action@main
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.reuse/dep5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Files:
2727
test/*
2828
CONTRIBUTING.md
2929
PROJECT
30+
mkdocs.yml
3031
.dockerignore
3132
.golangci.yml
3233
Copyright: 2024 SAP SE or an SAP affiliate company and IronCore contributors

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ IMG ?= controller:latest
44
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
55
ENVTEST_K8S_VERSION = 1.31.0
66

7+
# Docker image name for the mkdocs based local development setup
8+
IMAGE=ironcore-dev/boot-operator-docs
9+
710
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
811
ifeq (,$(shell go env GOBIN))
912
GOBIN=$(shell go env GOPATH)/bin
@@ -171,6 +174,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest-$(ENVTEST_VERSION)
171174
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
172175
ADDLICENSE ?= $(LOCALBIN)/addlicense
173176
GOIMPORTS ?= $(LOCALBIN)/goimports-$(GOIMPORTS_VERSION)
177+
GEN_CRD_API_REFERENCE_DOCS ?= $(LOCALBIN)/gen-crd-api-reference-docs-$(GEN_CRD_API_REFERENCE_DOCS_VERSION)
174178

175179
## Tool Versions
176180
KUSTOMIZE_VERSION ?= v5.3.0
@@ -179,6 +183,7 @@ ENVTEST_VERSION ?= latest
179183
GOLANGCI_LINT_VERSION ?= v1.61.0
180184
ADDLICENSE_VERSION ?= v1.1.1
181185
GOIMPORTS_VERSION ?= v0.26.0
186+
GEN_CRD_API_REFERENCE_DOCS_VERSION ?= v0.3.0
182187

183188
.PHONY: kustomize
184189
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
@@ -200,6 +205,16 @@ golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
200205
$(GOLANGCI_LINT): $(LOCALBIN)
201206
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,${GOLANGCI_LINT_VERSION})
202207

208+
209+
.PHONY: startdocs
210+
startdocs: ## Start the local mkdocs based development environment.
211+
docker build -t $(IMAGE) -f docs/Dockerfile . --load
212+
docker run -p 8000:8000 -v `pwd`/:/docs $(IMAGE)
213+
214+
.PHONY: cleandocs
215+
cleandocs: ## Remove all local mkdocs Docker images (cleanup).
216+
docker container prune --force --filter "label=project=boot_operator"
217+
203218
.PHONY: addlicense
204219
addlicense: $(ADDLICENSE) ## Download addlicense locally if necessary.
205220
$(ADDLICENSE): $(LOCALBIN)
@@ -210,6 +225,15 @@ goimports: $(GOIMPORTS) ## Download goimports locally if necessary.
210225
$(GOIMPORTS): $(LOCALBIN)
211226
$(call go-install-tool,$(GOIMPORTS),golang.org/x/tools/cmd/goimports,$(GOIMPORTS_VERSION))
212227

228+
.PHONY: docs
229+
docs: gen-crd-api-reference-docs ## Run go generate to generate API reference documentation.
230+
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir ./api/v1alpha1 -config ./hack/api-reference/config.json -template-dir ./hack/api-reference/template -out-file ./docs/api-reference/api.md
231+
232+
.PHONY: gen-crd-api-reference-docs
233+
gen-crd-api-reference-docs: $(GEN_CRD_API_REFERENCE_DOCS) ## Download gen-crd-api-reference-docs locally if necessary.
234+
$(GEN_CRD_API_REFERENCE_DOCS): $(LOCALBIN)
235+
$(call go-install-tool,$(GEN_CRD_API_REFERENCE_DOCS),github.com/ahmetb/gen-crd-api-reference-docs,$(GEN_CRD_API_REFERENCE_DOCS_VERSION))
236+
213237
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
214238
# $1 - target path with name of binary (ideally with version)
215239
# $2 - package url which can be installed

api/v1alpha1/doc.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and IronCore contributors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
// Package v1alpha1 contains API Schema definitions for the settings.gardener.cloud API group
5+
// +groupName=metal.ironcore.dev
6+
// +kubebuilder:object:generate=true
7+
package v1alpha1

docs/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM squidfunk/mkdocs-material:latest
2+
3+
LABEL project=boot_operator
4+
5+
WORKDIR /docs
6+
7+
COPY docs/requirements.txt requirements.txt
8+
RUN pip install --no-cache-dir -r requirements.txt
9+
10+
EXPOSE 8000
11+
12+
# Start development server by default
13+
ENTRYPOINT ["mkdocs"]
14+
CMD ["serve", "--dev-addr=0.0.0.0:8000"]

docs/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Metal-Operator Documentation
2+
3+
**Welcome to the Metal-Operator Documentation!**
4+
5+
The `metal-operator` is a Kubernetes-native operator, part of the IronCore open-source project, designed for robust bare metal infrastructure management. By leveraging Baseboard Management Controllers (BMCs) and the Redfish API, `metal-operator` enables streamlined and automated server discovery, provisioning, and lifecycle management. Using the Kubernetes Controller pattern, `metal-operator` provides a CRD-based operational model that standardizes bare metal management across different hardware environments. Integration with vendor-specific tooling is also possible for enhanced functionality when needed.
6+
7+
---
8+
9+
## Key Features
10+
11+
### 1. **Discover and Onboard Bare Metal Servers**
12+
- Automatically detect and register bare metal servers through BMCs and the Redfish API.
13+
- Efficiently gather hardware specs, network configurations, and initial health checks directly from BMC interfaces.
14+
15+
### 2. **Provision Software on Bare Metal Servers**
16+
- Deploy and configure software on registered servers using BMC interactions and standardized provisioning workflows.
17+
- Support for dynamic software configuration and Redfish API-based management for consistent, vendor-neutral provisioning.
18+
19+
### 3. **Manage Server Reservations**
20+
- Reserve specific bare metal resources based on workload needs.
21+
- Prevent resource conflicts by managing reservations via Kubernetes-native CRDs, ensuring that workloads align with available hardware resources.
22+
23+
### 4. **Perform Day 2 Operations**
24+
- Utilize the Redfish API to manage BIOS, firmware, and driver updates.
25+
- Automate ongoing maintenance tasks and operational workflows to maintain infrastructure resilience and uptime.
26+
27+
### 5. **Decommission and Maintain Faulty Servers**
28+
- Decommission servers via BMC controls for clean removal from active pools.
29+
- Schedule and perform maintenance tasks with BMC data to optimize uptime and maintain hardware reliability.
30+
31+
---
32+
33+
## How It Works
34+
35+
The `metal-operator` relies on **BMCs and the Redfish API** to handle bare metal server management tasks. Through a CRD-based operational model, `metal-operator` provides Kubernetes-native management of bare metal infrastructure, enabling consistent, vendor-neutral interactions.
36+
37+
### Core Components
38+
- **Custom Resources (CRs)**: Extend Kubernetes to manage server configurations, reservations, and operational workflows.
39+
- **Controllers**: Automate lifecycle management through Redfish-enabled interactions, from provisioning to decommissioning.
40+
- **Reconcilers**: Ensure the desired state matches the actual state by continuously monitoring hardware via BMC integrations.
41+
42+
### Architecture Overview
43+
44+
1. **Discovery**: Register new bare metal servers through BMCs and Redfish API, creating CRDs for streamlined management.
45+
2. **Provisioning**: Apply software images and configurations using Redfish API, based on templates or custom configurations.
46+
3. **Operations**: Execute BIOS, firmware updates, and other maintenance tasks through standardized workflows.
47+
4. **Decommissioning**: Safely remove or maintain servers using Redfish and BMC controls, marking them for reuse or retirement as needed.
48+
49+
---
50+
51+
The `metal-operator` is a core component of the IronCore project, designed to simplify and automate bare metal management across various hardware environments using BMC and Redfish API integrations. Expect continuous updates to expand capabilities and enhance usability.

0 commit comments

Comments
 (0)