Compare commits
19
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01999ce28f | ||
|
|
8e87e33937 | ||
|
|
1c1a1b2441 | ||
|
|
eb7794962f | ||
|
|
f25d2fdfe9 | ||
|
|
2b5637516a | ||
|
|
ce6173b06a | ||
|
|
22dfe9a26b | ||
|
|
185e0c96d5 | ||
|
|
e55e46d020 | ||
|
|
cf139cd580 | ||
|
|
0623e151bb | ||
|
|
17a8061722 | ||
|
|
f6a708e897 | ||
|
|
b8516bae50 | ||
|
|
6d05f426d0 | ||
|
|
0466bd6929 | ||
|
|
8f9b6fda24 | ||
|
|
6ad6007df4 |
No files matched your search
@@ -101,8 +101,8 @@ jobs:
|
||||
run: |
|
||||
pulumi login "$PULUMI_BACKEND_URL"
|
||||
pulumi refresh --yes --stack dev \
|
||||
--target 'urn:pulumi:dev::proxmox-infra::proxmoxve*' \
|
||||
--target 'urn:pulumi:dev::proxmox-infra::tls*'
|
||||
--target 'urn:pulumi:dev::proxmox-infra::proxmoxve**' \
|
||||
--target 'urn:pulumi:dev::proxmox-infra::tls**'
|
||||
working-directory: 01-proxmox-infra
|
||||
env:
|
||||
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
name: Deploy Openbao
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "06-openbao/**"
|
||||
- ".gitea/workflows/06-deploy-openbao.yaml"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "06-openbao/**"
|
||||
- ".gitea/workflows/**"
|
||||
|
||||
jobs:
|
||||
preview:
|
||||
name: Pulumi Preview
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'pull_request'
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24"
|
||||
|
||||
- name: Checkout Stack Config
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: kasun/homelab-pulumi-config
|
||||
ref: main
|
||||
token: ${{ secrets.PULUMI_CONFIG_REPO_TOKEN }}
|
||||
path: .pulumi-config
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
working-directory: 06-openbao
|
||||
|
||||
- name: Preview
|
||||
uses: pulumi/actions@v5
|
||||
with:
|
||||
command: preview
|
||||
stack-name: dev
|
||||
work-dir: 06-openbao
|
||||
cloud-url: ${{ secrets.PULUMI_BACKEND_URL }}
|
||||
env:
|
||||
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
|
||||
|
||||
deploy:
|
||||
name: Pulumi Deploy
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24"
|
||||
|
||||
- name: Checkout Stack Config
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: kasun/homelab-pulumi-config
|
||||
ref: main
|
||||
token: ${{ secrets.PULUMI_CONFIG_REPO_TOKEN }}
|
||||
path: .pulumi-config
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
working-directory: 06-openbao
|
||||
|
||||
- name: Refresh State
|
||||
uses: pulumi/actions@v5
|
||||
with:
|
||||
command: refresh
|
||||
stack-name: dev
|
||||
work-dir: 06-openbao
|
||||
cloud-url: ${{ secrets.PULUMI_BACKEND_URL }}
|
||||
env:
|
||||
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
|
||||
|
||||
- name: Deploy
|
||||
uses: pulumi/actions@v5
|
||||
with:
|
||||
command: up
|
||||
stack-name: dev
|
||||
work-dir: 06-openbao
|
||||
cloud-url: ${{ secrets.PULUMI_BACKEND_URL }}
|
||||
env:
|
||||
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
|
||||
@@ -391,6 +391,7 @@ new proxmox.ContainerLegacy( // NOSONAR typescript:S1848
|
||||
},
|
||||
started: true,
|
||||
startOnBoot: true,
|
||||
protection: true,
|
||||
},
|
||||
{
|
||||
provider: ansibleHost.provider,
|
||||
|
||||
Generated
+16
-16
@@ -608,9 +608,9 @@
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@pulumi/pulumi": {
|
||||
"version": "3.277.0",
|
||||
"resolved": "https://registry.npmjs.org/@pulumi/pulumi/-/pulumi-3.277.0.tgz",
|
||||
"integrity": "sha512-EvvBo55xmGByLRWjIqp24k4vzmPoKmZ6nTmK8EHzRb9veLCNISN3/Fq4RlJxrEt5+HmNkZveEasI+z0UCgkMxw==",
|
||||
"version": "3.278.0",
|
||||
"resolved": "https://registry.npmjs.org/@pulumi/pulumi/-/pulumi-3.278.0.tgz",
|
||||
"integrity": "sha512-PedUCQG6IciTBYA5MUYeiFbeoqaI/0hlA7rtrjkETk949BZ4bpLejoHmENifAAdBk0+h0oUv+BdVNtlMQ+AhRA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@grpc/grpc-js": "^1.10.1",
|
||||
@@ -655,9 +655,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@pulumi/tls": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@pulumi/tls/-/tls-5.5.0.tgz",
|
||||
"integrity": "sha512-OTGxp4sgDEuXlXrd7NtxrhhciPgcn9rqDIZlGOTmTaeGo+tlVMwv73FFqiVrzAmBiILdU8tLXHfxhjc+bTLdrQ==",
|
||||
"version": "5.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@pulumi/tls/-/tls-5.6.3.tgz",
|
||||
"integrity": "sha512-glAX4KYmsEGOXPz7yFKcErSogfknYB/4h2/EdeVXifZGW8ic47HCjNI5zPHF4+0DcwmNdLGA7fm2qQz69wS9EA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@pulumi/pulumi": "^3.142.0"
|
||||
@@ -670,12 +670,12 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "24.13.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.13.1.tgz",
|
||||
"integrity": "sha512-RSpUJGmvsJ1ZeBehQZFhIdpsz+bIpES0nIQXko4Ybq+N+kX6XvOq3Jo+iJ82FWLdblFq85AsMikd3m35jgezYg==",
|
||||
"version": "24.19.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.4.tgz",
|
||||
"integrity": "sha512-s04odlR3ksJrLu7QLi+pddkWLD0RmSbcP9KuWn2/ozQKAp/YgwBC/6x9kJj8yAzZnGPfxePm7zm7nysVPCRagw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~7.18.0"
|
||||
"undici-types": ">=7.24.0 <7.24.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/semver": {
|
||||
@@ -1266,9 +1266,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "7.18.2",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz",
|
||||
"integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==",
|
||||
"version": "7.24.6",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
|
||||
"integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/upath": {
|
||||
@@ -1365,9 +1365,9 @@
|
||||
}
|
||||
},
|
||||
"sdks/pfsense/node_modules/@types/node": {
|
||||
"version": "20.19.41",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.41.tgz",
|
||||
"integrity": "sha512-ECymXOukMnOoVkC2bb1Vc/w/836DXncOg5m8Xj1RH7xSHZJWNYY6Zh7EH477vcnD5egKNNfy2RpNOmuChhFPgQ==",
|
||||
"version": "20.19.43",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz",
|
||||
"integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~6.21.0"
|
||||
|
||||
Generated
+375
-1807
File diff suppressed because it is too large.
Load diff
@@ -10,7 +10,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@pulumi/command": "^1.2.1",
|
||||
"@pulumi/kubernetes": "^4.31.1",
|
||||
"@pulumi/pulumi": "^3.244.0"
|
||||
}
|
||||
}
|
||||
Generated
+392
-1682
File diff suppressed because it is too large.
Load diff
@@ -5,11 +5,11 @@
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18",
|
||||
"typescript": "^5.0.0"
|
||||
"@types/node": "^24.19.4",
|
||||
"typescript": "^6.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pulumi/kubernetes": "^4.0.0",
|
||||
"@pulumi/pulumi": "^3.113.0"
|
||||
"@pulumi/kubernetes": "^4.31.1",
|
||||
"@pulumi/pulumi": "^3.278.0"
|
||||
}
|
||||
}
|
||||
Generated
+385
-1675
File diff suppressed because it is too large.
Load diff
Generated
+385
-1675
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,7 @@
|
||||
name: openbao
|
||||
description: Openbao stack for centralized ha secret management
|
||||
runtime:
|
||||
name: nodejs
|
||||
options:
|
||||
packagemanager: npm
|
||||
stackConfigDir: ../.pulumi-config/06-openbao
|
||||
@@ -0,0 +1,260 @@
|
||||
import * as pulumi from "@pulumi/pulumi";
|
||||
import * as k8s from "@pulumi/kubernetes";
|
||||
|
||||
const bootstrapRef = new pulumi.StackReference(
|
||||
`${pulumi.getOrganization()}/k8s-bootstrap/dev`,
|
||||
);
|
||||
const appsRef = new pulumi.StackReference(
|
||||
`${pulumi.getOrganization()}/k8s-apps/dev`,
|
||||
);
|
||||
|
||||
const kubeconfig = bootstrapRef.requireOutput("kubeconfig");
|
||||
const domain = appsRef.requireOutput("domain");
|
||||
const openbaoHost = pulumi.interpolate`bao.${domain}`;
|
||||
|
||||
const k8sProvider = new k8s.Provider("k3s", {
|
||||
kubeconfig,
|
||||
clusterIdentifier: "homelab-k3s",
|
||||
});
|
||||
|
||||
const opts = (extras?: pulumi.ResourceOptions): pulumi.ResourceOptions => ({
|
||||
provider: k8sProvider,
|
||||
...extras,
|
||||
});
|
||||
|
||||
const openbaoNs = new k8s.core.v1.Namespace(
|
||||
"openbao",
|
||||
{ metadata: { name: "openbao" } },
|
||||
{ provider: k8sProvider, protect: true },
|
||||
);
|
||||
|
||||
const selfsigned = new k8s.apiextensions.CustomResource(
|
||||
"openbao-selfsigned",
|
||||
{
|
||||
apiVersion: "cert-manager.io/v1",
|
||||
kind: "Issuer",
|
||||
metadata: {
|
||||
name: "openbao-selfsigned",
|
||||
namespace: openbaoNs.metadata.name,
|
||||
},
|
||||
spec: {
|
||||
selfSigned: {},
|
||||
},
|
||||
},
|
||||
opts(),
|
||||
);
|
||||
|
||||
const caCert = new k8s.apiextensions.CustomResource(
|
||||
"openbao-ca",
|
||||
{
|
||||
apiVersion: "cert-manager.io/v1",
|
||||
kind: "Certificate",
|
||||
metadata: { name: "openbao-ca", namespace: openbaoNs.metadata.name },
|
||||
spec: {
|
||||
secretName: "openbao-ca",
|
||||
commonName: "openbao-ca",
|
||||
isCA: true,
|
||||
issuerRef: { name: "openbao-selfsigned", kind: "Issuer" },
|
||||
duration: "87600h",
|
||||
},
|
||||
},
|
||||
opts({ dependsOn: [selfsigned] }),
|
||||
);
|
||||
|
||||
const caIssuer = new k8s.apiextensions.CustomResource(
|
||||
"openbao-ca-issuer",
|
||||
{
|
||||
apiVersion: "cert-manager.io/v1",
|
||||
kind: "Issuer",
|
||||
metadata: { name: "openbao-ca", namespace: openbaoNs.metadata.name },
|
||||
spec: {
|
||||
ca: { secretName: "openbao-ca" },
|
||||
},
|
||||
},
|
||||
opts({ dependsOn: [caCert] }),
|
||||
);
|
||||
|
||||
const serverCert = new k8s.apiextensions.CustomResource(
|
||||
"openbao-server-tls",
|
||||
{
|
||||
apiVersion: "cert-manager.io/v1",
|
||||
kind: "Certificate",
|
||||
metadata: {
|
||||
name: "openbao-server-tls",
|
||||
namespace: openbaoNs.metadata.name,
|
||||
},
|
||||
spec: {
|
||||
secretName: "openbao-server-tls",
|
||||
dnsNames: [
|
||||
"openbao-0.openbao-internal",
|
||||
"openbao-1.openbao-internal",
|
||||
"openbao-2.openbao-internal",
|
||||
"openbao-active.openbao.svc",
|
||||
"localhost",
|
||||
],
|
||||
ipAddresses: ["127.0.0.1"],
|
||||
issuerRef: { name: "openbao-ca", kind: "Issuer" },
|
||||
},
|
||||
},
|
||||
opts({ dependsOn: [caIssuer] }),
|
||||
);
|
||||
|
||||
const serversTransport = new k8s.apiextensions.CustomResource(
|
||||
"openbao-servers-transport",
|
||||
{
|
||||
apiVersion: "traefik.io/v1alpha1",
|
||||
kind: "ServersTransport",
|
||||
metadata: {
|
||||
name: "openbao-servers-transport",
|
||||
namespace: openbaoNs.metadata.name,
|
||||
},
|
||||
spec: {
|
||||
serverName: "openbao-active.openbao.svc",
|
||||
rootCAs: [{ secret: "openbao-server-tls" }],
|
||||
},
|
||||
},
|
||||
opts({ dependsOn: [serverCert] }),
|
||||
);
|
||||
|
||||
new k8s.helm.v3.Release(
|
||||
"openbao",
|
||||
{
|
||||
name: "openbao",
|
||||
chart: "openbao",
|
||||
repositoryOpts: { repo: "https://openbao.github.io/openbao-helm" },
|
||||
namespace: "openbao",
|
||||
version: "0.30.8",
|
||||
// Pods stay unready until they are initialised and unsealed by hand.
|
||||
skipAwait: true,
|
||||
values: {
|
||||
global: {
|
||||
tlsDisable: false,
|
||||
},
|
||||
injector: {
|
||||
enabled: false,
|
||||
},
|
||||
server: {
|
||||
podManagementPolicy: "Parallel",
|
||||
resources: {
|
||||
requests: { cpu: "100m", memory: "256Mi" },
|
||||
limits: { memory: "512Mi" },
|
||||
},
|
||||
volumes: [
|
||||
{ name: "server-tls", secret: { secretName: "openbao-server-tls" } },
|
||||
],
|
||||
volumeMounts: [
|
||||
{
|
||||
name: "server-tls",
|
||||
mountPath: "/openbao/userconfig/openbao-server-tls",
|
||||
readOnly: true,
|
||||
},
|
||||
],
|
||||
extraEnvironmentVars: {
|
||||
BAO_CACERT: "/openbao/userconfig/openbao-server-tls/ca.crt",
|
||||
},
|
||||
service: {
|
||||
active: {
|
||||
annotations: {
|
||||
"traefik.ingress.kubernetes.io/service.serverstransport":
|
||||
"openbao-openbao-servers-transport@kubernetescrd",
|
||||
},
|
||||
},
|
||||
},
|
||||
ingress: {
|
||||
enabled: true,
|
||||
ingressClassName: "traefik",
|
||||
annotations: { "cert-manager.io/cluster-issuer": "letsencrypt-prod" },
|
||||
hosts: [{ host: openbaoHost, paths: ["/"] }],
|
||||
tls: [{ secretName: "openbao-ingress-tls", hosts: [openbaoHost] }],
|
||||
},
|
||||
networkPolicy: {
|
||||
enabled: true,
|
||||
ingress: [
|
||||
{
|
||||
from: [
|
||||
{
|
||||
namespaceSelector: {
|
||||
matchLabels: {
|
||||
"kubernetes.io/metadata.name": "kube-system",
|
||||
},
|
||||
},
|
||||
podSelector: {
|
||||
matchLabels: { "app.kubernetes.io/name": "traefik" },
|
||||
},
|
||||
},
|
||||
],
|
||||
ports: [{ port: 8200, protocol: "TCP" }],
|
||||
},
|
||||
{
|
||||
from: [
|
||||
{
|
||||
podSelector: {
|
||||
matchLabels: {
|
||||
"app.kubernetes.io/name": "openbao",
|
||||
"app.kubernetes.io/instance": "openbao",
|
||||
component: "server",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
ports: [
|
||||
{ port: 8200, protocol: "TCP" },
|
||||
{ port: 8201, protocol: "TCP" },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
ha: {
|
||||
enabled: true,
|
||||
replicas: 3,
|
||||
apiAddr: "https://$(BAO_K8S_POD_NAME).openbao-internal:8200",
|
||||
raft: {
|
||||
enabled: true,
|
||||
setNodeId: true,
|
||||
config: `ui = true
|
||||
|
||||
listener "tcp" {
|
||||
address = "[::]:8200"
|
||||
cluster_address = "[::]:8201"
|
||||
tls_cert_file = "/openbao/userconfig/openbao-server-tls/tls.crt"
|
||||
tls_key_file = "/openbao/userconfig/openbao-server-tls/tls.key"
|
||||
tls_auto_reload = true
|
||||
}
|
||||
|
||||
storage "raft" {
|
||||
path = "/openbao/data"
|
||||
|
||||
retry_join {
|
||||
leader_api_addr = "https://openbao-0.openbao-internal:8200"
|
||||
leader_ca_cert_file = "/openbao/userconfig/openbao-server-tls/ca.crt"
|
||||
}
|
||||
retry_join {
|
||||
leader_api_addr = "https://openbao-1.openbao-internal:8200"
|
||||
leader_ca_cert_file = "/openbao/userconfig/openbao-server-tls/ca.crt"
|
||||
}
|
||||
retry_join {
|
||||
leader_api_addr = "https://openbao-2.openbao-internal:8200"
|
||||
leader_ca_cert_file = "/openbao/userconfig/openbao-server-tls/ca.crt"
|
||||
}
|
||||
}
|
||||
|
||||
service_registration "kubernetes" {}
|
||||
|
||||
audit "file" "stdout" {
|
||||
options {
|
||||
file_path = "stdout"
|
||||
}
|
||||
}
|
||||
`,
|
||||
},
|
||||
},
|
||||
dataStorage: {
|
||||
enabled: true,
|
||||
storageClass: "local-path",
|
||||
size: "2Gi",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
opts({ dependsOn: [serversTransport], protect: true }),
|
||||
);
|
||||
Generated
+1499
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "openbao",
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^24.19.4",
|
||||
"typescript": "^6.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pulumi/kubernetes": "^4.31.1",
|
||||
"@pulumi/pulumi": "^3.278.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"outDir": "bin",
|
||||
"target": "es2024",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"sourceMap": true,
|
||||
"experimentalDecorators": true,
|
||||
"pretty": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitReturns": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.ts"
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user