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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ wazuh/wazuh-certificates
wazuh/wazuh-certificates/*
wazuh/wazuh-certificates-tool.log
tests/__pycache__/
.pytest_cache/
.pytest_cache/

# Documentation
docs/book/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.

### Changed

- Updated wazuh-kubernetes documentation config and tooling versions to meet new standards. ([#1358](https://github.com/wazuh/wazuh-kubernetes/pull/1358))
- Change config.yml configuration on test and deployment doc ([#1355](https://github.com/wazuh/wazuh-kubernetes/pull/1355))
- Change paths and binary names of Wazuh manager. ([#1339](https://github.com/wazuh/wazuh-kubernetes/pull/1339))
- Update kubernetes deployment documentation to attend #1305 ([#1314](https://github.com/wazuh/wazuh-kubernetes/pull/1314))
Expand Down
115 changes: 115 additions & 0 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Documentation installation and setup

This guide covers how to set up the documentation build environment for the Wazuh Kubernetes documentation.

## Prerequisites

The documentation is built using [mdBook](https://rust-lang.github.io/mdBook/), a command-line tool for creating books
with Markdown, along with [mdBook Mermaid](https://github.com/badboy/mdbook-mermaid) for diagram support.

## Required versions

- **mdbook**: 0.5.2
- **mdbook-mermaid**: 0.17.0

## Installation

Install tools:

```bash
cargo install mdbook --version 0.5.2
cargo install mdbook-mermaid --version 0.17.0
```

Verify installation:

```bash
mdbook --version
mdbook-mermaid --version
```

## Building the documentation

Once you have installed mdBook and mdBook Mermaid:

```bash
# Navigate to the docs directory
cd docs

# Build the documentation (generates html in docs/book/)
mdbook build

# Serve locally with live reload (recommended for development)
mdbook serve --open
```

The documentation will be available at `http://localhost:3000` when using `mdbook serve`.

## Development workflow

When editing documentation:

1. Run `mdbook serve --open` from the `docs/` directory
2. Edit markdown files in `docs/ref/`
3. Changes are automatically reflected in the browser
4. Navigation structure is defined in `docs/SUMMARY.md`

## Troubleshooting

### Version mismatch errors

If you encounter build errors, verify you have the correct versions installed:

```bash
mdbook --version
mdbook-mermaid --version
```

If you have different versions, uninstall the current ones and reinstall by following the [Installation section](#installation):

```bash
cargo uninstall mdbook
cargo uninstall mdbook-mermaid
```

### Cargo install fails with feature 'edition2024' is required

You may see an error like:

```sh
failed to download `globset v0.4.18`
failed to parse manifest ... feature `edition2024` is required
The package requires the Cargo feature called `edition2024`, but that feature is not stabilized in this version of Cargo.
```

This can happen when installing `mdbook` version 0.5.2 because one of its transitive dependencies has been updated to
use Rust edition 2024, which is only supported on nightly Rust toolchains.

To fix it, install the required `mdbook` version (0.5.2) using nightly Rust:

```sh
rustup install nightly
rustup run nightly cargo install mdbook --version 0.5.2
```

### Mermaid diagrams not rendering

If Mermaid diagrams are not rendering in the browser:

1. Clear your browser cache
2. Run `mdbook clean` to remove the build directory
3. Run `mdbook serve --open` again

### Port already in use

If port 3000 is already in use, specify a different port:

```bash
mdbook serve --port 3001 --open
```

## Additional resources

- [mdBook documentation](https://rust-lang.github.io/mdBook/)
- [mdBook Mermaid documentation](https://github.com/badboy/mdbook-mermaid)
- [Mermaid diagram syntax](https://mermaid.js.org/)
26 changes: 25 additions & 1 deletion docs/book.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
[book]
title = "Wazuh Kubernetes Documentation"
description = "The technical documentation for Wazuh Kubernetes deployment method, composed by the development documentation and the reference manual."
authors = ["Wazuh DevOps Team"]
authors = ["Wazuh XDRSIEM DevOps Team"]
language = "en"
src = "."

[build]
build-dir = "book"
create-missing = false

[preprocessor.mermaid]
command = "mdbook-mermaid"

[output.html]
default-theme = "light"
preferred-dark-theme = "navy"
git-repository-url = "https://github.com/wazuh/wazuh-kubernetes"
additional-js = ["mermaid.min.js", "mermaid-init.js"]

[output.html.fold]
enable = true
level = 0

[output.html.search]
enable = true

[output.html.playground]
editable = false
copyable = true
35 changes: 35 additions & 0 deletions docs/mermaid-init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
(() => {
const darkThemes = ['ayu', 'navy', 'coal'];
const lightThemes = ['light', 'rust'];

const classList = document.getElementsByTagName('html')[0].classList;

let lastThemeWasLight = true;
for (const cssClass of classList) {
if (darkThemes.includes(cssClass)) {
lastThemeWasLight = false;
break;
}
}

const theme = lastThemeWasLight ? 'default' : 'dark';
mermaid.initialize({ startOnLoad: true, theme });

// Simplest way to make mermaid re-render the diagrams in the new theme is via refreshing the page

for (const darkTheme of darkThemes) {
document.getElementById(darkTheme).addEventListener('click', () => {
if (lastThemeWasLight) {
window.location.reload();
}
});
}

for (const lightTheme of lightThemes) {
document.getElementById(lightTheme).addEventListener('click', () => {
if (!lastThemeWasLight) {
window.location.reload();
}
});
}
})();
2,609 changes: 2,609 additions & 0 deletions docs/mermaid.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ref/uninstall.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Steps to perform a clean up of our deployments, services and volumes used in our

## Delete the cluster

To delete your Wazuh cluster just use `kubectl delete -k envs/<ENVIRONMENT>` from this repository directory. (being <ENVIRONMENT> one of `EKS` or `local-env`)
To delete your Wazuh cluster just use `kubectl delete -k envs/<ENVIRONMENT>` from this repository directory. (being `<ENVIRONMENT>` one of `EKS` or `local-env`)

## Delete Traefik Ingress Controller

Expand Down
Loading