feat: Add openbao example, open-source fork of vault
Some checks failed
Run Check Script / check (pull_request) Failing after 5s
Some checks failed
Run Check Script / check (pull_request) Failing after 5s
This commit is contained in:
parent
c84b2413ed
commit
4a500e4eb7
14
examples/openbao/Cargo.toml
Normal file
14
examples/openbao/Cargo.toml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
[package]
|
||||||
|
name = "example-openbao"
|
||||||
|
edition = "2024"
|
||||||
|
version.workspace = true
|
||||||
|
readme.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
harmony = { path = "../../harmony" }
|
||||||
|
harmony_cli = { path = "../../harmony_cli" }
|
||||||
|
harmony_macros = { path = "../../harmony_macros" }
|
||||||
|
harmony_types = { path = "../../harmony_types" }
|
||||||
|
tokio.workspace = true
|
||||||
|
url.workspace = true
|
7
examples/openbao/README.md
Normal file
7
examples/openbao/README.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
To install an openbao instance with harmony simply `cargo run -p example-openbao` .
|
||||||
|
|
||||||
|
Depending on your environement configuration, it will either install a k3d cluster locally and deploy on it, or install to a remote cluster.
|
||||||
|
|
||||||
|
Then follow the openbao documentation to initialize and unseal, this will make openbao usable.
|
||||||
|
|
||||||
|
https://openbao.org/docs/platform/k8s/helm/run/
|
66
examples/openbao/src/main.rs
Normal file
66
examples/openbao/src/main.rs
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
use std::{collections::HashMap, str::FromStr};
|
||||||
|
|
||||||
|
use harmony::{
|
||||||
|
inventory::Inventory,
|
||||||
|
modules::helm::chart::{HelmChartScore, HelmRepository, NonBlankString},
|
||||||
|
topology::K8sAnywhereTopology,
|
||||||
|
};
|
||||||
|
use harmony_macros::hurl;
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let values_yaml = Some(
|
||||||
|
r#"server:
|
||||||
|
standalone:
|
||||||
|
enabled: true
|
||||||
|
config: |
|
||||||
|
listener "tcp" {
|
||||||
|
tls_disable = true
|
||||||
|
address = "[::]:8200"
|
||||||
|
cluster_address = "[::]:8201"
|
||||||
|
}
|
||||||
|
|
||||||
|
storage "file" {
|
||||||
|
path = "/openbao/data"
|
||||||
|
}
|
||||||
|
|
||||||
|
service:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
dataStorage:
|
||||||
|
enabled: true
|
||||||
|
size: 10Gi
|
||||||
|
storageClass: null
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
|
||||||
|
auditStorage:
|
||||||
|
enabled: true
|
||||||
|
size: 10Gi
|
||||||
|
storageClass: null
|
||||||
|
accessMode: ReadWriteOnce"#.to_string(),
|
||||||
|
);
|
||||||
|
let openbao = HelmChartScore {
|
||||||
|
namespace: Some(NonBlankString::from_str("openbao").unwrap()),
|
||||||
|
release_name: NonBlankString::from_str("openbao").unwrap(),
|
||||||
|
chart_name: NonBlankString::from_str("openbao/openbao").unwrap(),
|
||||||
|
chart_version: None,
|
||||||
|
values_overrides: None,
|
||||||
|
values_yaml,
|
||||||
|
create_namespace: true,
|
||||||
|
install_only: true,
|
||||||
|
repository: Some(HelmRepository::new(
|
||||||
|
"openbao".to_string(),
|
||||||
|
hurl!("https://openbao.github.io/openbao-helm"),
|
||||||
|
true,
|
||||||
|
)),
|
||||||
|
};
|
||||||
|
|
||||||
|
harmony_cli::run(
|
||||||
|
Inventory::autoload(),
|
||||||
|
K8sAnywhereTopology::from_env(),
|
||||||
|
vec![Box::new(openbao)],
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user