Compare commits
162 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e335541c6c | ||
|
|
3c1fcd9d6e | ||
|
|
4fca94d863 | ||
|
|
a3d49f0d6e | ||
|
|
f432a445a0 | ||
|
|
effaa9badf | ||
|
|
ac6be04859 | ||
|
|
c0ca7e7392 | ||
|
|
2f0b883724 | ||
|
|
7b8eed0347 | ||
|
|
230a2f18b8 | ||
|
|
89578d891f | ||
|
|
8995af06fa | ||
|
|
55752aee1c | ||
|
|
a90ba17904 | ||
|
|
6f78984561 | ||
|
|
b927caed96 | ||
|
|
e4e8a5e217 | ||
|
|
804bafd4e6 | ||
|
|
f2a9508aba | ||
|
|
392b9f711b | ||
|
|
2d9f35067f | ||
|
|
a0fd53deaa | ||
|
|
e346e10c07 | ||
|
|
f1dc54650e | ||
|
|
9ed5d588d0 | ||
|
|
6eb24faf63 | ||
|
|
daa13906b5 | ||
|
|
b2ce455aa2 | ||
|
|
90629b84b5 | ||
|
|
7f077f5347 | ||
|
|
327193215b | ||
|
|
b98b5cae3f | ||
|
|
ddba69517f | ||
|
|
e28642bca7 | ||
|
|
dceb37b7ab | ||
|
|
f6340ea4fe | ||
|
|
3845174738 | ||
|
|
f0bc21a606 | ||
|
|
6d0e48fccb | ||
|
|
f5035ce699 | ||
|
|
3c694d2a92 | ||
|
|
b8592b0b72 | ||
|
|
cf2289ef19 | ||
|
|
5e5b9c97d4 | ||
|
|
a19e0ff3f3 | ||
|
|
ac632cb407 | ||
|
|
154bbabf01 | ||
|
|
95e45d59cb | ||
|
|
a45abedd32 | ||
|
|
a644b1181b | ||
|
|
861b552b0b | ||
|
|
5d0212e832 | ||
|
|
9f434928d6 | ||
|
|
5b1fa4b046 | ||
|
|
ae4614c35b | ||
|
|
e99a00f0a1 | ||
|
|
e89dcb9783 | ||
|
|
05806cb439 | ||
|
|
bfb8458bcb | ||
|
|
55d4033116 | ||
|
|
276dc95029 | ||
|
|
c473321817 | ||
|
|
1b539b8874 | ||
|
|
1892fe31ae | ||
|
|
b9c1e49822 | ||
|
|
f31a630139 | ||
|
|
a4445c7d17 | ||
|
|
d0b392cfe0 | ||
|
|
efc215dc8c | ||
|
|
2f446bd60a | ||
|
|
92889cb9a4 | ||
|
|
c53e00f609 | ||
|
|
5e2c0e7d64 | ||
|
|
adbffe34d8 | ||
|
|
5e62008d78 | ||
|
|
af1c009dad | ||
|
|
53cb9ba7fb | ||
|
|
4cc139b372 | ||
|
|
8bc7804a9c | ||
|
|
a39807a858 | ||
|
|
5170650760 | ||
|
|
1d81b3c3b4 | ||
|
|
33970dafe8 | ||
|
|
faa46c54d8 | ||
|
|
42509a34cf | ||
|
|
ef369d4860 | ||
|
|
747ed3462a | ||
|
|
1fb1798f60 | ||
|
|
accf80200f | ||
|
|
4522ee1d4e | ||
|
|
313ebc6817 | ||
|
|
e0f439515f | ||
|
|
caa7560ab9 | ||
|
|
bbcf280da7 | ||
|
|
6d2daacb7b | ||
|
|
62f96a2d6c | ||
|
|
50f414d520 | ||
|
|
882f3894f3 | ||
|
|
30ddde7b49 | ||
|
|
5cced6fb51 | ||
|
|
a82ebf43b6 | ||
|
|
ebb6d6205a | ||
|
|
58950c469a | ||
|
|
0eebdaf0c7 | ||
|
|
54e2f28f4c | ||
|
|
d4d50ef12b | ||
|
|
075f2b16a4 | ||
|
|
6f8008a53c | ||
|
|
0618b52bae | ||
|
|
f1951c5db3 | ||
|
|
dad12acd8d | ||
|
|
a4503e076f | ||
|
|
09ddd339b8 | ||
|
|
bc94f4b6b8 | ||
|
|
564406f60f | ||
|
|
7845ce62e0 | ||
|
|
a1542752b7 | ||
|
|
7956475363 | ||
|
|
004ed56591 | ||
|
|
d497df3c27 | ||
|
|
3a8d46234f | ||
|
|
4d24dc5149 | ||
|
|
8eb7fbf7dc | ||
|
|
ffeeb7c553 | ||
|
|
c3c174155c | ||
|
|
2c2d2a9fd9 | ||
|
|
d692e2a6d5 | ||
|
|
e4cebddd0c | ||
|
|
0e48537d65 | ||
|
|
a461a96b9c | ||
|
|
9524c4f7c3 | ||
|
|
64b04d9cfd | ||
|
|
b419ad8caf | ||
|
|
8036c17916 | ||
|
|
220d498be0 | ||
|
|
0f5b6a2d6e | ||
|
|
36369d75c7 | ||
|
|
059b8283fd | ||
|
|
386eb2452a | ||
|
|
38e9a97fd2 | ||
|
|
ecca40e9d5 | ||
|
|
9d08e27e31 | ||
|
|
969bf5e867 | ||
|
|
3b5f28f4df | ||
|
|
df5619f988 | ||
|
|
a6d8383176 | ||
|
|
dbc7e374cd | ||
|
|
d81729857b | ||
|
|
d3d8a7b73c | ||
|
|
d9e6776b95 | ||
|
|
bde98faffa | ||
|
|
c2847554e0 | ||
|
|
9411a65dd8 | ||
|
|
9c1165e77e | ||
|
|
a02c7a4015 | ||
|
|
bdcde88e6f | ||
|
|
a32b100192 | ||
|
|
670d716403 | ||
|
|
bba3895f35 | ||
|
|
9e60ddbe85 | ||
|
|
44334fca52 |
88
.cspell.json
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"version": "0.2",
|
||||
"language": "en",
|
||||
"enableFiletypes": [
|
||||
"mdx"
|
||||
],
|
||||
"words": [
|
||||
"applicationset",
|
||||
"argoproj",
|
||||
"authcode",
|
||||
"authpolicy",
|
||||
"authproxy",
|
||||
"authroutes",
|
||||
"buildplan",
|
||||
"cainjector",
|
||||
"clusterissuer",
|
||||
"cookiesecret",
|
||||
"coredns",
|
||||
"crds",
|
||||
"crossplane",
|
||||
"cuecontext",
|
||||
"cuelang",
|
||||
"devicecode",
|
||||
"dnsmasq",
|
||||
"dscacheutil",
|
||||
"entgo",
|
||||
"errgroup",
|
||||
"fieldmaskpb",
|
||||
"flushcache",
|
||||
"gitops",
|
||||
"grpcreflect",
|
||||
"grpcurl",
|
||||
"holos",
|
||||
"holoslogger",
|
||||
"httpbin",
|
||||
"Infima",
|
||||
"isatty",
|
||||
"istiod",
|
||||
"jetstack",
|
||||
"killall",
|
||||
"kubeadm",
|
||||
"kubeconfig",
|
||||
"kubelogin",
|
||||
"Kustomization",
|
||||
"kustomize",
|
||||
"ldflags",
|
||||
"libnss",
|
||||
"loadbalancer",
|
||||
"mattn",
|
||||
"mxcl",
|
||||
"myhostname",
|
||||
"nameserver",
|
||||
"organizationconnect",
|
||||
"orgid",
|
||||
"otelconnect",
|
||||
"Parentspanid",
|
||||
"pflag",
|
||||
"PKCE",
|
||||
"platformconnect",
|
||||
"promhttp",
|
||||
"protojson",
|
||||
"putenv",
|
||||
"quickstart",
|
||||
"retryable",
|
||||
"ropc",
|
||||
"spanid",
|
||||
"spiffe",
|
||||
"startupapicheck",
|
||||
"structpb",
|
||||
"systemconnect",
|
||||
"tablewriter",
|
||||
"Tiltfile",
|
||||
"timestamppb",
|
||||
"tlsclientconfig",
|
||||
"tokencache",
|
||||
"Tokener",
|
||||
"Traceid",
|
||||
"traefik",
|
||||
"uibutton",
|
||||
"Upsert",
|
||||
"urandom",
|
||||
"usecases",
|
||||
"userconnect",
|
||||
"userdata",
|
||||
"zerolog",
|
||||
"zitadel"
|
||||
]
|
||||
}
|
||||
@@ -41,10 +41,6 @@ jobs:
|
||||
run: |
|
||||
set -x
|
||||
make tools
|
||||
make buf
|
||||
go generate ./...
|
||||
make frontend
|
||||
go mod tidy
|
||||
|
||||
- name: Test
|
||||
run: ./scripts/test
|
||||
4
.github/workflows/lint.yaml
vendored
@@ -37,10 +37,6 @@ jobs:
|
||||
run: |
|
||||
set -x
|
||||
make tools
|
||||
make buf
|
||||
go generate ./...
|
||||
make frontend
|
||||
go mod tidy
|
||||
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v4
|
||||
|
||||
4
.github/workflows/release.yaml
vendored
@@ -40,10 +40,6 @@ jobs:
|
||||
run: |
|
||||
set -x
|
||||
make tools
|
||||
make buf
|
||||
go generate ./...
|
||||
make frontend
|
||||
go mod tidy
|
||||
|
||||
- name: Import GPG key
|
||||
uses: crazy-max/ghaction-import-gpg@v6
|
||||
|
||||
6
.gitignore
vendored
@@ -7,3 +7,9 @@ coverage.out
|
||||
/deploy/
|
||||
.vscode/
|
||||
tmp/
|
||||
.DS_*
|
||||
|
||||
# In case we run through the tutorial in this directory.
|
||||
/holos-k3d/
|
||||
/holos-infra/
|
||||
node_modules/
|
||||
|
||||
13
.ko.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
# Refer to https://ko.build/configuration/#overriding-go-build-settings
|
||||
builds:
|
||||
- id: holos
|
||||
dir: .
|
||||
main: ./cmd/holos
|
||||
env:
|
||||
- GOPRIVATE=github.com/holos-run/\*
|
||||
ldflags:
|
||||
- -s
|
||||
- -w
|
||||
- -X
|
||||
# Makefile provides GIT_DETAIL and GIT_SUFFIX.
|
||||
- github.com/holos-run/holos/version.GitDescribe={{.Env.GIT_DETAIL}}{{.Env.GIT_SUFFIX}}
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM 271053619184.dkr.ecr.us-east-2.amazonaws.com/holos-run/container-images/debian:bullseye AS final
|
||||
FROM quay.io/holos-run/debian:bullseye AS final
|
||||
USER root
|
||||
WORKDIR /app
|
||||
ADD bin bin
|
||||
202
LICENSE
Normal file
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
77
Makefile
@@ -7,7 +7,7 @@ REPO_PATH=$(ORG_PATH)/$(PROJ)
|
||||
VERSION := $(shell cat version/embedded/major version/embedded/minor version/embedded/patch | xargs printf "%s.%s.%s")
|
||||
BIN_NAME := holos
|
||||
|
||||
DOCKER_REPO=quay.io/openinfrastructure/holos
|
||||
DOCKER_REPO=quay.io/holos-run/holos
|
||||
IMAGE_NAME=$(DOCKER_REPO)
|
||||
|
||||
$( shell mkdir -p bin)
|
||||
@@ -16,10 +16,12 @@ $( shell mkdir -p bin)
|
||||
export PATH := $(PWD)/internal/frontend/holos/node_modules/.bin:$(PATH)
|
||||
|
||||
GIT_COMMIT=$(shell git rev-parse HEAD)
|
||||
GIT_SUFFIX=$(shell test -n "`git status --porcelain`" && echo "-dirty" || echo "")
|
||||
GIT_DETAIL=$(shell git describe --tags HEAD)
|
||||
GIT_TREE_STATE=$(shell test -n "`git status --porcelain`" && echo "dirty" || echo "clean")
|
||||
BUILD_DATE=$(shell date -Iseconds)
|
||||
|
||||
LD_FLAGS="-w -X ${ORG_PATH}/${PROJ}/version.GitCommit=${GIT_COMMIT} -X ${ORG_PATH}/${PROJ}/version.GitTreeState=${GIT_TREE_STATE} -X ${ORG_PATH}/${PROJ}/version.BuildDate=${BUILD_DATE}"
|
||||
LD_FLAGS="-w -X ${ORG_PATH}/${PROJ}/version.GitDescribe=${GIT_DETAIL}${GIT_SUFFIX} -X ${ORG_PATH}/${PROJ}/version.GitCommit=${GIT_COMMIT} -X ${ORG_PATH}/${PROJ}/version.GitTreeState=${GIT_TREE_STATE} -X ${ORG_PATH}/${PROJ}/version.BuildDate=${BUILD_DATE}"
|
||||
|
||||
.PHONY: default
|
||||
default: test
|
||||
@@ -46,6 +48,10 @@ bumpmajor: ## Bump the major version.
|
||||
show-version: ## Print the full version.
|
||||
@echo $(VERSION)
|
||||
|
||||
.PHONY: tag
|
||||
tag: ## Tag a release
|
||||
git tag v$(VERSION)
|
||||
|
||||
.PHONY: tidy
|
||||
tidy: ## Tidy go module.
|
||||
go mod tidy
|
||||
@@ -53,38 +59,28 @@ tidy: ## Tidy go module.
|
||||
.PHONY: fmt
|
||||
fmt: ## Format code.
|
||||
cd docs/examples && cue fmt ./...
|
||||
cd internal/generate/platforms && cue fmt ./...
|
||||
go fmt ./...
|
||||
|
||||
.PHONY: vet
|
||||
vet: ## Vet Go code.
|
||||
go vet ./...
|
||||
|
||||
.PHONY: gencue
|
||||
gencue: ## Generate CUE definitions
|
||||
cd internal/generate/platforms && cue get go github.com/holos-run/holos/api/v1alpha1/...
|
||||
|
||||
.PHONY: rmgen
|
||||
rmgen: ## Remove generated code
|
||||
git rm -rf service/gen/ internal/frontend/holos/src/app/gen/ || true
|
||||
rm -rf service/gen/ internal/frontend/holos/src/app/gen/
|
||||
git rm -rf internal/ent/
|
||||
rm -rf internal/ent/
|
||||
git restore --staged internal/ent/generate.go internal/ent/schema/
|
||||
git restore internal/ent/generate.go internal/ent/schema/
|
||||
|
||||
.PHONY: regenerate
|
||||
regenerate: generate ## Re-generate code (delete and re-create)
|
||||
|
||||
.PHONY: generate
|
||||
generate: buf gencue ## Generate code.
|
||||
generate: ## Generate code.
|
||||
go generate ./...
|
||||
|
||||
.PHONY: build
|
||||
build: generate frontend ## Build holos executable.
|
||||
build: ## Build holos executable.
|
||||
@echo "building ${BIN_NAME} ${VERSION}"
|
||||
@echo "GOPATH=${GOPATH}"
|
||||
go build -trimpath -o bin/$(BIN_NAME) -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/$(BIN_NAME)
|
||||
|
||||
linux: ## Build holos executable for tilt.
|
||||
@echo "building ${BIN_NAME}.linux ${VERSION}"
|
||||
@echo "GOPATH=${GOPATH}"
|
||||
GOOS=linux go build -trimpath -o bin/$(BIN_NAME).linux -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/$(BIN_NAME)
|
||||
|
||||
.PHONY: install
|
||||
install: build ## Install holos to GOPATH/bin
|
||||
install bin/$(BIN_NAME) $(shell go env GOPATH)/bin/$(BIN_NAME)
|
||||
@@ -102,6 +98,7 @@ lint: ## Run linters.
|
||||
buf lint
|
||||
cd internal/frontend/holos && ng lint
|
||||
golangci-lint run
|
||||
./hack/cspell
|
||||
|
||||
.PHONY: coverage
|
||||
coverage: test ## Test coverage profile.
|
||||
@@ -111,39 +108,41 @@ coverage: test ## Test coverage profile.
|
||||
snapshot: ## Go release snapshot
|
||||
goreleaser release --snapshot --clean
|
||||
|
||||
.PHONY: buf
|
||||
buf: ## buf generate
|
||||
cd service && buf dep update
|
||||
buf generate
|
||||
|
||||
.PHONY: tools
|
||||
tools: go-deps frontend-deps ## install tool dependencies
|
||||
tools: go-deps frontend-deps website-deps ## install tool dependencies
|
||||
|
||||
.PHONY: go-deps
|
||||
go-deps: ## tool versions pinned in tools.go
|
||||
go install cuelang.org/go/cmd/cue
|
||||
go install github.com/bufbuild/buf/cmd/buf
|
||||
go install github.com/fullstorydev/grpcurl/cmd/grpcurl
|
||||
go install google.golang.org/protobuf/cmd/protoc-gen-go
|
||||
go install connectrpc.com/connect/cmd/protoc-gen-connect-go
|
||||
go install honnef.co/go/tools/cmd/staticcheck@latest
|
||||
go install honnef.co/go/tools/cmd/staticcheck
|
||||
go install golang.org/x/tools/cmd/godoc
|
||||
go install github.com/princjef/gomarkdoc/cmd/gomarkdoc
|
||||
go install github.com/google/ko
|
||||
# curl https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash
|
||||
|
||||
.PHONY: frontend-deps
|
||||
frontend-deps: ## Setup npm and vite
|
||||
frontend-deps: ## Install Angular deps for go generate
|
||||
cd internal/frontend/holos && npm install
|
||||
cd internal/frontend/holos && npm install --save-dev @bufbuild/buf @connectrpc/protoc-gen-connect-es
|
||||
cd internal/frontend/holos && npm install @connectrpc/connect @connectrpc/connect-web @bufbuild/protobuf
|
||||
# https://github.com/connectrpc/connect-query-es/blob/1350b6f07b6aead81793917954bdb1cc3ce09df9/packages/protoc-gen-connect-query/README.md?plain=1#L23
|
||||
cd internal/frontend/holos && npm install --save-dev @connectrpc/protoc-gen-connect-query @bufbuild/protoc-gen-es
|
||||
cd internal/frontend/holos && npm install @connectrpc/connect-query @bufbuild/protobuf
|
||||
|
||||
.PHONY: website-deps
|
||||
website-deps: ## Install Docusaurus deps for go generate
|
||||
cd doc/website && npm install
|
||||
|
||||
.PHONY: frontend
|
||||
frontend: buf
|
||||
cd internal/frontend/holos && rm -rf dist
|
||||
mkdir -p internal/frontend/holos/dist
|
||||
cd internal/frontend/holos && ng build
|
||||
touch internal/frontend/frontend.go
|
||||
.PHONY: image # refer to .ko.yaml as well
|
||||
image: ## Container image build
|
||||
KO_DOCKER_REPO=$(DOCKER_REPO) GIT_DETAIL=$(GIT_DETAIL) GIT_SUFFIX=$(GIT_SUFFIX) ko build --platform=all --bare ./cmd/holos --tags $(GIT_DETAIL)$(GIT_SUFFIX)
|
||||
|
||||
.PHONY: deploy
|
||||
deploy: image ## DEPLOY TO PROD
|
||||
GIT_DETAIL=$(GIT_DETAIL) GIT_SUFFIX=$(GIT_SUFFIX) bash ./hack/deploy
|
||||
|
||||
.PHONY: website
|
||||
website: ## Build website
|
||||
./hack/build-website
|
||||
|
||||
.PHONY: help
|
||||
help: ## Display this help menu.
|
||||
|
||||
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# k3d Platform
|
||||
|
||||
Refer to https://holos.run/docs/tutorial/local/k3d
|
||||
237
Tiltfile
@@ -1,5 +1,5 @@
|
||||
# -*- mode: Python -*-
|
||||
# This Tiltfile manages a Go project with live leload in Kubernetes
|
||||
# This Tiltfile manages a Go project with live reload in Kubernetes
|
||||
|
||||
listen_port = 3000
|
||||
metrics_port = 9090
|
||||
@@ -8,56 +8,21 @@ metrics_port = 9090
|
||||
if os.getenv('TILT_WRAPPER') != '1':
|
||||
fail("could not run, ./hack/tilt/bin/tilt was not used to start tilt")
|
||||
|
||||
# AWS Account to work in
|
||||
aws_account = '271053619184'
|
||||
aws_region = 'us-east-2'
|
||||
|
||||
# Resource ids
|
||||
holos_backend = 'Holos Backend'
|
||||
pg_admin = 'pgAdmin'
|
||||
pg_cluster = 'PostgresCluster'
|
||||
pg_svc = 'Database Pod'
|
||||
holos_backend = 'Holos Server'
|
||||
compile_id = 'Go Build'
|
||||
auth_id = 'Auth Policy'
|
||||
lint_id = 'Run Linters'
|
||||
tests_id = 'Run Tests'
|
||||
|
||||
# PostgresCluster resource name in k8s
|
||||
pg_cluster_name = 'holos'
|
||||
# Database name inside the PostgresCluster
|
||||
pg_database_name = 'holos'
|
||||
# PGAdmin name
|
||||
pg_admin_name = 'pgadmin'
|
||||
|
||||
# Default Registry.
|
||||
# See: https://github.com/tilt-dev/tilt.build/blob/master/docs/choosing_clusters.md#manual-configuration
|
||||
# Note, Tilt will append the image name to the registry uri path
|
||||
default_registry('{account}.dkr.ecr.{region}.amazonaws.com/holos-run/holos-server'.format(account=aws_account, region=aws_region))
|
||||
# default_registry('{account}.dkr.ecr.{region}.amazonaws.com/holos-run/holos'.format(account=aws_account, region=aws_region))
|
||||
|
||||
# Set a name prefix specific to the user. Multiple developers share the tilt-holos namespace.
|
||||
developer = os.getenv('USER')
|
||||
holos_server = 'holos'
|
||||
# See ./hack/tilt/bin/tilt
|
||||
namespace = os.getenv('NAMESPACE')
|
||||
# We always develop against the k1 cluster.
|
||||
|
||||
# We always develop against the k3d-workload cluster
|
||||
os.putenv('KUBECONFIG', os.path.abspath('./hack/tilt/kubeconfig'))
|
||||
# The context defined in ./hack/tilt/kubeconfig
|
||||
allow_k8s_contexts('sso@k1')
|
||||
allow_k8s_contexts('sso@k2')
|
||||
allow_k8s_contexts('sso@k3')
|
||||
allow_k8s_contexts('sso@k4')
|
||||
allow_k8s_contexts('sso@k5')
|
||||
# PG db connection for localhost -> k8s port-forward
|
||||
os.putenv('PGHOST', 'localhost')
|
||||
os.putenv('PGPORT', '15432')
|
||||
# We always develop in the dev aws account.
|
||||
os.putenv('AWS_CONFIG_FILE', os.path.abspath('./hack/tilt/aws.config'))
|
||||
os.putenv('AWS_ACCOUNT', aws_account)
|
||||
os.putenv('AWS_DEFAULT_REGION', aws_region)
|
||||
os.putenv('AWS_PROFILE', 'dev-holos')
|
||||
os.putenv('AWS_SDK_LOAD_CONFIG', '1')
|
||||
# Authenticate to AWS ECR when tilt up is run by the developer
|
||||
local_resource('AWS Credentials', './hack/tilt/aws-login.sh', auto_init=True)
|
||||
|
||||
# Extensions are open-source, pre-packaged functions that extend Tilt
|
||||
#
|
||||
@@ -81,8 +46,8 @@ developer_paths = [
|
||||
'./service/holos',
|
||||
]
|
||||
|
||||
# Builds the holos-server executable
|
||||
local_resource(compile_id, 'make build', deps=developer_paths)
|
||||
# Builds the holos executable GOOS=linux
|
||||
local_resource(compile_id, 'make linux', deps=developer_paths)
|
||||
|
||||
# Build Docker image
|
||||
# Tilt will automatically associate image builds with the resource(s)
|
||||
@@ -91,84 +56,33 @@ local_resource(compile_id, 'make build', deps=developer_paths)
|
||||
# More info: https://docs.tilt.dev/api.html#api.docker_build
|
||||
#
|
||||
docker_build_with_restart(
|
||||
'holos',
|
||||
'k3d-registry.holos.localhost:5100/holos',
|
||||
context='.',
|
||||
entrypoint=[
|
||||
'/app/bin/holos',
|
||||
'/app/bin/holos.linux',
|
||||
'server',
|
||||
'--listen-port={}'.format(listen_port),
|
||||
'--oidc-issuer=https://login.ois.run',
|
||||
'--oidc-audience=262096764402729854@holos_platform',
|
||||
'--log-level=debug',
|
||||
'--metrics-port={}'.format(metrics_port),
|
||||
'--log-format=text',
|
||||
'--oidc-issuer=https://login.holos.run',
|
||||
'--oidc-audience=275804490387516853@holos_quickstart', # auth proxy
|
||||
'--oidc-audience=270319630705329162@holos_platform', # holos cli
|
||||
],
|
||||
dockerfile='./hack/tilt/Dockerfile',
|
||||
dockerfile='./Dockerfile',
|
||||
only=['./bin'],
|
||||
# (Recommended) Updating a running container in-place
|
||||
# https://docs.tilt.dev/live_update_reference.html
|
||||
live_update=[
|
||||
# Sync files from host to container
|
||||
sync('./bin', '/app/bin'),
|
||||
# Wait for aws-login https://github.com/tilt-dev/tilt/issues/3048
|
||||
sync('./tilt/aws-login.last', '/dev/null'),
|
||||
# Execute commands in the container when paths change
|
||||
# run('/app/hack/codegen.sh', trigger=['./app/api'])
|
||||
sync('./bin/', '/app/bin/'),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
# Run local commands
|
||||
# Local commands can be helpful for one-time tasks like installing
|
||||
# project prerequisites. They can also manage long-lived processes
|
||||
# for non-containerized services or dependencies.
|
||||
#
|
||||
# More info: https://docs.tilt.dev/local_resource.html
|
||||
#
|
||||
# local_resource('install-helm',
|
||||
# cmd='which helm > /dev/null || brew install helm',
|
||||
# # `cmd_bat`, when present, is used instead of `cmd` on Windows.
|
||||
# cmd_bat=[
|
||||
# 'powershell.exe',
|
||||
# '-Noninteractive',
|
||||
# '-Command',
|
||||
# '& {if (!(Get-Command helm -ErrorAction SilentlyContinue)) {scoop install helm}}'
|
||||
# ]
|
||||
# )
|
||||
|
||||
# Teach tilt about our custom resources (Note, this may be intended for workloads)
|
||||
# k8s_kind('authorizationpolicy')
|
||||
# k8s_kind('requestauthentication')
|
||||
# k8s_kind('virtualservice')
|
||||
k8s_kind('pgadmin')
|
||||
|
||||
|
||||
# Troubleshooting
|
||||
def resource_name(id):
|
||||
print('resource: {}'.format(id))
|
||||
return id.name
|
||||
|
||||
|
||||
workload_to_resource_function(resource_name)
|
||||
|
||||
# Apply Kubernetes manifests
|
||||
# Tilt will build & push any necessary images, re-deploying your
|
||||
# resources as they change.
|
||||
#
|
||||
# More info: https://docs.tilt.dev/api.html#api.k8s_yaml
|
||||
#
|
||||
|
||||
def holos_yaml():
|
||||
"""Return a k8s Deployment personalized for the developer."""
|
||||
k8s_yaml_template = str(read_file('./hack/tilt/k8s.yaml'))
|
||||
return k8s_yaml_template.format(
|
||||
name=holos_server,
|
||||
developer=developer,
|
||||
namespace=namespace,
|
||||
listen_port=listen_port,
|
||||
metrics_port=metrics_port,
|
||||
tz=os.getenv('TZ'),
|
||||
)
|
||||
|
||||
# Customize a Kubernetes resource
|
||||
# By default, Kubernetes resource names are automatically assigned
|
||||
# based on objects in the YAML manifests, e.g. Deployment name.
|
||||
@@ -179,133 +93,18 @@ def holos_yaml():
|
||||
#
|
||||
# More info: https://docs.tilt.dev/api.html#api.k8s_resource
|
||||
#
|
||||
k8s_yaml(blob(holos_yaml()))
|
||||
k8s_yaml(blob(str(read_file('./hack/tilt/k8s/dev-holos-app/deployment.yaml'))))
|
||||
|
||||
# Backend server process
|
||||
k8s_resource(
|
||||
workload=holos_server,
|
||||
new_name=holos_backend,
|
||||
objects=[
|
||||
'{}:serviceaccount'.format(holos_server),
|
||||
'{}:servicemonitor'.format(holos_server),
|
||||
],
|
||||
objects=[],
|
||||
resource_deps=[compile_id],
|
||||
links=[
|
||||
link('https://{}.app.dev.k2.holos.run/ui/'.format(developer), "Holos Web UI")
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
# AuthorizationPolicy - Beyond Corp functionality
|
||||
k8s_resource(
|
||||
new_name=auth_id,
|
||||
objects=[
|
||||
'{}:virtualservice'.format(holos_server),
|
||||
link('https://app.holos.localhost/ui/'.format(developer), "Holos Web UI")
|
||||
],
|
||||
)
|
||||
|
||||
# Database
|
||||
# Note: Tilt confuses the backup pods with the database server pods, so this code is careful to tease the pods
|
||||
# apart so logs are streamed correctly.
|
||||
# See: https://github.com/tilt-dev/tilt.specs/blob/master/resource_assembly.md
|
||||
|
||||
# pgAdmin Web UI
|
||||
k8s_resource(
|
||||
workload=pg_admin_name,
|
||||
new_name=pg_admin,
|
||||
port_forwards=[
|
||||
port_forward(15050, 5050, pg_admin),
|
||||
],
|
||||
)
|
||||
|
||||
# Disabled because these don't group resources nicely
|
||||
# k8s_kind('postgrescluster')
|
||||
|
||||
# Postgres database in-cluster
|
||||
k8s_resource(
|
||||
new_name=pg_cluster,
|
||||
objects=['holos:postgrescluster'],
|
||||
)
|
||||
|
||||
# Needed to select the database by label
|
||||
# https://docs.tilt.dev/api.html#api.k8s_custom_deploy
|
||||
k8s_custom_deploy(
|
||||
pg_svc,
|
||||
apply_cmd=['./hack/tilt/k8s-get-db-sts', pg_cluster_name],
|
||||
delete_cmd=['echo', 'Skipping delete. Object managed by custom resource.'],
|
||||
deps=[],
|
||||
)
|
||||
k8s_resource(
|
||||
pg_svc,
|
||||
port_forwards=[
|
||||
port_forward(15432, 5432, 'psql'),
|
||||
],
|
||||
resource_deps=[pg_cluster]
|
||||
)
|
||||
|
||||
|
||||
# Run tests
|
||||
local_resource(
|
||||
tests_id,
|
||||
'make test',
|
||||
allow_parallel=True,
|
||||
auto_init=False,
|
||||
deps=developer_paths,
|
||||
)
|
||||
|
||||
# Run linter
|
||||
local_resource(
|
||||
lint_id,
|
||||
'make lint',
|
||||
allow_parallel=True,
|
||||
auto_init=False,
|
||||
deps=developer_paths,
|
||||
)
|
||||
|
||||
# UI Buttons for helpful things.
|
||||
# Icons: https://fonts.google.com/icons
|
||||
os.putenv("GH_FORCE_TTY", "80%")
|
||||
cmd_button(
|
||||
'{}:go-test-failfast'.format(tests_id),
|
||||
argv=['./hack/tilt/go-test-failfast'],
|
||||
resource=tests_id,
|
||||
icon_name='quiz',
|
||||
text='Fail Fast',
|
||||
)
|
||||
cmd_button(
|
||||
'{}:issues'.format(holos_server),
|
||||
argv=['./hack/tilt/gh-issues'],
|
||||
resource=holos_backend,
|
||||
icon_name='folder_data',
|
||||
text='Issues',
|
||||
)
|
||||
cmd_button(
|
||||
'{}:gh-issue-view'.format(holos_server),
|
||||
argv=['./hack/tilt/gh-issue-view'],
|
||||
resource=holos_backend,
|
||||
icon_name='task',
|
||||
text='View Issue',
|
||||
)
|
||||
cmd_button(
|
||||
'{}:get-pgdb-creds'.format(holos_server),
|
||||
argv=['./hack/tilt/get-pgdb-creds', pg_cluster_name, pg_database_name],
|
||||
resource=pg_svc,
|
||||
icon_name='lock_open_right',
|
||||
text='DB Creds',
|
||||
)
|
||||
cmd_button(
|
||||
'{}:get-pgdb-creds'.format(pg_admin_name),
|
||||
argv=['./hack/tilt/get-pgdb-creds', pg_cluster_name, pg_database_name],
|
||||
resource=pg_admin,
|
||||
icon_name='lock_open_right',
|
||||
text='DB Creds',
|
||||
)
|
||||
cmd_button(
|
||||
'{}:get-pgadmin-creds'.format(pg_admin_name),
|
||||
argv=['./hack/tilt/get-pgadmin-creds', pg_admin_name],
|
||||
resource=pg_admin,
|
||||
icon_name='lock_open_right',
|
||||
text='pgAdmin Login',
|
||||
)
|
||||
|
||||
print("✨ Tiltfile evaluated")
|
||||
|
||||
44
api/core/v1alpha2/apiobjects.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package v1alpha2
|
||||
|
||||
import "google.golang.org/protobuf/types/known/structpb"
|
||||
|
||||
// Label is an arbitrary unique identifier internal to holos itself. The holos
|
||||
// cli is expected to never write a Label value to rendered output files,
|
||||
// therefore use a [Label] then the identifier must be unique and internal.
|
||||
// Defined as a type for clarity and type checking.
|
||||
//
|
||||
// A Label is useful to convert a CUE struct to a list, for example producing a list of [APIObject] resources from an [APIObjectMap]. A CUE struct using
|
||||
// Label keys is guaranteed to not lose data when rendering output because a
|
||||
// Label is expected to never be written to the final output.
|
||||
type Label string
|
||||
|
||||
// Kind is a kubernetes api object kind. Defined as a type for clarity and type checking.
|
||||
type Kind string
|
||||
|
||||
// APIObject represents the most basic generic form of a single kubernetes api
|
||||
// object. Represented as a JSON object internally for compatibility between
|
||||
// tools, for example loading from CUE.
|
||||
type APIObject structpb.Struct
|
||||
|
||||
// APIObjectMap represents the marshalled yaml representation of kubernetes api
|
||||
// objects. Do not produce an APIObjectMap directly, instead use [APIObjects]
|
||||
// to produce the marshalled yaml representation from CUE data, then provide the
|
||||
// result to [HolosComponent].
|
||||
type APIObjectMap map[Kind]map[Label]string
|
||||
|
||||
// APIObjects represents Kubernetes API objects defined directly from CUE code.
|
||||
// Useful to mix in resources to any kind of [HolosComponent], for example
|
||||
// adding an ExternalSecret resource to a [HelmChart].
|
||||
//
|
||||
// [Kind] must be the resource kind, e.g. Deployment or Service.
|
||||
//
|
||||
// [Label] is an arbitrary internal identifier to uniquely identify the resource
|
||||
// within the context of a `holos` command. Holos will never write the
|
||||
// intermediate label to rendered output.
|
||||
//
|
||||
// Refer to [HolosComponent] which accepts an [APIObjectMap] field provided by
|
||||
// [APIObjects].
|
||||
type APIObjects struct {
|
||||
APIObjects map[Kind]map[Label]APIObject `json:"apiObjects"`
|
||||
APIObjectMap APIObjectMap `json:"apiObjectMap"`
|
||||
}
|
||||
96
api/core/v1alpha2/buildplan.go
Normal file
@@ -0,0 +1,96 @@
|
||||
package v1alpha2
|
||||
|
||||
// FilePath represents a file path.
|
||||
type FilePath string
|
||||
|
||||
// FileContent represents file contents.
|
||||
type FileContent string
|
||||
|
||||
// FileContentMap represents a mapping of file paths to file contents. Paths
|
||||
// are relative to the `holos` output "deploy" directory, and may contain
|
||||
// sub-directories.
|
||||
type FileContentMap map[FilePath]FileContent
|
||||
|
||||
// BuildPlan represents a build plan for the holos cli to execute. The purpose
|
||||
// of a BuildPlan is to define one or more [HolosComponent] kinds. For example a
|
||||
// [HelmChart], [KustomizeBuild], or [KubernetesObjects].
|
||||
//
|
||||
// A BuildPlan usually has an additional empty [KubernetesObjects] for the
|
||||
// purpose of using the [HolosComponent] DeployFiles field to deploy an ArgoCD
|
||||
// or Flux gitops resource for the holos component.
|
||||
type BuildPlan struct {
|
||||
Kind string `json:"kind" cue:"\"BuildPlan\""`
|
||||
APIVersion string `json:"apiVersion" cue:"string | *\"v1alpha2\""`
|
||||
Spec BuildPlanSpec `json:"spec"`
|
||||
}
|
||||
|
||||
// BuildPlanSpec represents the specification of the build plan.
|
||||
type BuildPlanSpec struct {
|
||||
// Disabled causes the holos cli to take no action over the [BuildPlan].
|
||||
Disabled bool `json:"disabled,omitempty"`
|
||||
// Components represents multiple [HolosComponent] kinds to manage.
|
||||
Components BuildPlanComponents `json:"components,omitempty"`
|
||||
}
|
||||
|
||||
type BuildPlanComponents struct {
|
||||
Resources map[Label]KubernetesObjects `json:"resources,omitempty"`
|
||||
KubernetesObjectsList []KubernetesObjects `json:"kubernetesObjectsList,omitempty"`
|
||||
HelmChartList []HelmChart `json:"helmChartList,omitempty"`
|
||||
KustomizeBuildList []KustomizeBuild `json:"kustomizeBuildList,omitempty"`
|
||||
}
|
||||
|
||||
// HolosComponent defines the fields common to all holos component kinds. Every
|
||||
// holos component kind should embed HolosComponent.
|
||||
type HolosComponent struct {
|
||||
// Kind is a string value representing the resource this object represents.
|
||||
Kind string `json:"kind"`
|
||||
// APIVersion represents the versioned schema of this representation of an object.
|
||||
APIVersion string `json:"apiVersion" cue:"string | *\"v1alpha2\""`
|
||||
// Metadata represents data about the holos component such as the Name.
|
||||
Metadata Metadata `json:"metadata"`
|
||||
|
||||
// APIObjectMap holds the marshalled representation of api objects. Useful to
|
||||
// mix in resources to each HolosComponent type, for example adding an
|
||||
// ExternalSecret to a HelmChart HolosComponent. Refer to [APIObjects].
|
||||
APIObjectMap APIObjectMap `json:"apiObjectMap,omitempty"`
|
||||
|
||||
// DeployFiles represents file paths relative to the cluster deploy directory
|
||||
// with the value representing the file content. Intended for defining the
|
||||
// ArgoCD Application resource or Flux Kustomization resource from within CUE,
|
||||
// but may be used to render any file related to the build plan from CUE.
|
||||
DeployFiles FileContentMap `json:"deployFiles,omitempty"`
|
||||
|
||||
// Kustomize represents a kubectl kustomize build post-processing step.
|
||||
Kustomize `json:"kustomize,omitempty"`
|
||||
|
||||
// Skip causes holos to take no action regarding this component.
|
||||
Skip bool `json:"skip" cue:"bool | *false"`
|
||||
}
|
||||
|
||||
// Metadata represents data about the holos component such as the Name.
|
||||
type Metadata struct {
|
||||
// Name represents the name of the holos component.
|
||||
Name string `json:"name"`
|
||||
// Namespace is the primary namespace of the holos component. A holos
|
||||
// component may manage resources in multiple namespaces, in this case
|
||||
// consider setting the component namespace to default.
|
||||
//
|
||||
// This field is optional because not all resources require a namespace,
|
||||
// particularly CRD's and DeployFiles functionality.
|
||||
// +optional
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
}
|
||||
|
||||
// Kustomize represents resources necessary to execute a kustomize build.
|
||||
// Intended for at least two use cases:
|
||||
//
|
||||
// 1. Process a [KustomizeBuild] [HolosComponent] which represents raw yaml
|
||||
// file resources in a holos component directory.
|
||||
// 2. Post process a [HelmChart] [HolosComponent] to inject istio, patch jobs,
|
||||
// add custom labels, etc...
|
||||
type Kustomize struct {
|
||||
// KustomizeFiles holds file contents for kustomize, e.g. patch files.
|
||||
KustomizeFiles FileContentMap `json:"kustomizeFiles,omitempty"`
|
||||
// ResourcesFile is the file name used for api objects in kustomization.yaml
|
||||
ResourcesFile string `json:"resourcesFile,omitempty"`
|
||||
}
|
||||
11
api/core/v1alpha2/constants.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package v1alpha2
|
||||
|
||||
const (
|
||||
APIVersion = "v1alpha2"
|
||||
BuildPlanKind = "BuildPlan"
|
||||
HelmChartKind = "HelmChart"
|
||||
// ChartDir is the directory name created in the holos component directory to cache a chart.
|
||||
ChartDir = "vendor"
|
||||
// ResourcesFile is the file name used to store component output when post-processing with kustomize.
|
||||
ResourcesFile = "resources.yaml"
|
||||
)
|
||||
44
api/core/v1alpha2/core.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package v1alpha2
|
||||
|
||||
import "google.golang.org/protobuf/types/known/structpb"
|
||||
|
||||
type PlatformMetadata struct {
|
||||
// Name represents the Platform name.
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// Platform represents a platform to manage. A Platform resource informs holos
|
||||
// which components to build. The platform resource also acts as a container
|
||||
// for the platform model form values provided by the PlatformService. The
|
||||
// primary use case is to collect the cluster names, cluster types, platform
|
||||
// model, and holos components to build into one resource.
|
||||
type Platform struct {
|
||||
// Kind is a string value representing the resource this object represents.
|
||||
Kind string `json:"kind" cue:"\"Platform\""`
|
||||
// APIVersion represents the versioned schema of this representation of an object.
|
||||
APIVersion string `json:"apiVersion" cue:"string | *\"v1alpha2\""`
|
||||
// Metadata represents data about the object such as the Name.
|
||||
Metadata PlatformMetadata `json:"metadata"`
|
||||
|
||||
// Spec represents the specification.
|
||||
Spec PlatformSpec `json:"spec"`
|
||||
}
|
||||
|
||||
// PlatformSpec represents the specification of a Platform. Think of a platform
|
||||
// specification as a list of platform components to apply to a list of
|
||||
// kubernetes clusters combined with the user-specified Platform Model.
|
||||
type PlatformSpec struct {
|
||||
// Model represents the platform model holos gets from from the
|
||||
// PlatformService.GetPlatform rpc method and provides to CUE using a tag.
|
||||
Model structpb.Struct `json:"model"`
|
||||
// Components represents a list of holos components to manage.
|
||||
Components []PlatformSpecComponent `json:"components"`
|
||||
}
|
||||
|
||||
// PlatformSpecComponent represents a holos component to build or render.
|
||||
type PlatformSpecComponent struct {
|
||||
// Path is the path of the component relative to the platform root.
|
||||
Path string `json:"path"`
|
||||
// Cluster is the cluster name to provide when rendering the component.
|
||||
Cluster string `json:"cluster"`
|
||||
}
|
||||
26
api/core/v1alpha2/doc.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Package v1alpha2 contains the core API contract between the holos cli and CUE
|
||||
// configuration code. Platform designers, operators, and software developers
|
||||
// use this API to write configuration in CUE which `holos` loads. The overall
|
||||
// shape of the API defines imperative actions `holos` should carry out to
|
||||
// render the complete yaml that represents a Platform.
|
||||
//
|
||||
// [Platform] defines the complete configuration of a platform. With the holos
|
||||
// reference platform this takes the shape of one management cluster and at
|
||||
// least two workload cluster. Each cluster has multiple [HolosComponent]
|
||||
// resources applied to it.
|
||||
//
|
||||
// Each holos component path, e.g. `components/namespaces` produces exactly one
|
||||
// [BuildPlan] which in turn contains a set of [HolosComponent] kinds.
|
||||
//
|
||||
// The primary kinds of [HolosComponent] are:
|
||||
//
|
||||
// 1. [HelmChart] to render config from a helm chart.
|
||||
// 2. [KustomizeBuild] to render config from [Kustomize]
|
||||
// 3. [KubernetesObjects] to render [APIObjects] defined directly in CUE
|
||||
// configuration.
|
||||
//
|
||||
// Note that Holos operates as a data pipeline, so the output of a [HelmChart]
|
||||
// may be provided to [Kustomize] for post-processing.
|
||||
package v1alpha2
|
||||
|
||||
//go:generate ../../../hack/gendoc
|
||||
38
api/core/v1alpha2/helm.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package v1alpha2
|
||||
|
||||
// HelmChart represents a holos component which wraps around an upstream helm
|
||||
// chart. Holos orchestrates helm by providing values obtained from CUE,
|
||||
// renders the output using `helm template`, then post-processes the helm output
|
||||
// yaml using the general functionality provided by [HolosComponent], for
|
||||
// example [Kustomize] post-rendering and mixing in additional kubernetes api
|
||||
// objects.
|
||||
type HelmChart struct {
|
||||
HolosComponent `json:",inline"`
|
||||
Kind string `json:"kind" cue:"\"HelmChart\""`
|
||||
|
||||
// Chart represents a helm chart to manage.
|
||||
Chart Chart `json:"chart"`
|
||||
// ValuesContent represents the values.yaml file holos passes to the `helm
|
||||
// template` command.
|
||||
ValuesContent string `json:"valuesContent"`
|
||||
// EnableHooks enables helm hooks when executing the `helm template` command.
|
||||
EnableHooks bool `json:"enableHooks" cue:"bool | *false"`
|
||||
}
|
||||
|
||||
// Chart represents a helm chart.
|
||||
type Chart struct {
|
||||
// Name represents the chart name.
|
||||
Name string `json:"name"`
|
||||
// Version represents the chart version.
|
||||
Version string `json:"version"`
|
||||
// Release represents the chart release when executing helm template.
|
||||
Release string `json:"release"`
|
||||
// Repository represents the repository to fetch the chart from.
|
||||
Repository Repository `json:"repository,omitempty"`
|
||||
}
|
||||
|
||||
// Repository represents a helm chart repository.
|
||||
type Repository struct {
|
||||
Name string `json:"name"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
10
api/core/v1alpha2/kubernetesobjects.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package v1alpha2
|
||||
|
||||
const KubernetesObjectsKind = "KubernetesObjects"
|
||||
|
||||
// KubernetesObjects represents a [HolosComponent] composed of Kubernetes API
|
||||
// objects provided directly from CUE using [APIObjects].
|
||||
type KubernetesObjects struct {
|
||||
HolosComponent `json:",inline"`
|
||||
Kind string `json:"kind" cue:"\"KubernetesObjects\""`
|
||||
}
|
||||
8
api/core/v1alpha2/kustomizebuild.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package v1alpha2
|
||||
|
||||
// KustomizeBuild represents a [HolosComponent] that renders plain yaml files in
|
||||
// the holos component directory using `kubectl kustomize build`.
|
||||
type KustomizeBuild struct {
|
||||
HolosComponent `json:",inline"`
|
||||
Kind string `json:"kind" cue:"\"KustomizeBuild\""`
|
||||
}
|
||||
37
api/meta/v1alpha2/meta.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package v1alpha2
|
||||
|
||||
// TypeMeta describes an individual object in an API response or request with
|
||||
// strings representing the type of the object and its API schema version.
|
||||
// Structures that are versioned or persisted should inline TypeMeta.
|
||||
type TypeMeta struct {
|
||||
// Kind is a string value representing the resource this object represents.
|
||||
Kind string `json:"kind"`
|
||||
// APIVersion defines the versioned schema of this representation of an object.
|
||||
APIVersion string `json:"apiVersion" cue:"string | *\"v1alpha2\""`
|
||||
}
|
||||
|
||||
func (tm *TypeMeta) GetKind() string {
|
||||
return tm.Kind
|
||||
}
|
||||
|
||||
func (tm *TypeMeta) GetAPIVersion() string {
|
||||
return tm.APIVersion
|
||||
}
|
||||
|
||||
// Discriminator discriminates the kind of an api object.
|
||||
type Discriminator interface {
|
||||
// GetKind returns Kind.
|
||||
GetKind() string
|
||||
// GetAPIVersion returns APIVersion.
|
||||
GetAPIVersion() string
|
||||
}
|
||||
|
||||
// ObjectMeta represents metadata of a holos component object. The fields are a
|
||||
// copy of upstream kubernetes api machinery but are holos objects distinct from
|
||||
// kubernetes api objects.
|
||||
type ObjectMeta struct {
|
||||
// Name uniquely identifies the holos component instance and must be suitable as a file name.
|
||||
Name string `json:"name,omitempty"`
|
||||
// Namespace confines a holos component to a single namespace via kustomize if set.
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
}
|
||||
@@ -16,6 +16,10 @@ type BuildPlan struct {
|
||||
type BuildPlanSpec struct {
|
||||
Disabled bool `json:"disabled,omitempty" yaml:"disabled,omitempty"`
|
||||
Components BuildPlanComponents `json:"components,omitempty" yaml:"components,omitempty"`
|
||||
// DeployFiles keys represent file paths relative to the cluster deploy
|
||||
// directory. Map values represent the string encoded file contents. Used to
|
||||
// write the argocd Application, but may be used to render any file from CUE.
|
||||
DeployFiles FileContentMap `json:"deployFiles,omitempty" yaml:"deployFiles,omitempty"`
|
||||
}
|
||||
|
||||
type BuildPlanComponents struct {
|
||||
|
||||
@@ -20,3 +20,11 @@ type HolosComponent struct {
|
||||
func (hc *HolosComponent) NewResult() *Result {
|
||||
return &Result{HolosComponent: *hc}
|
||||
}
|
||||
|
||||
func (hc *HolosComponent) GetAPIVersion() string {
|
||||
return hc.APIVersion
|
||||
}
|
||||
|
||||
func (hc *HolosComponent) GetKind() string {
|
||||
return hc.Kind
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/holos-run/holos"
|
||||
"github.com/holos-run/holos/internal/errors"
|
||||
@@ -121,6 +122,14 @@ func (hc *HelmChart) helm(ctx context.Context, r *Result, path holos.InstancePat
|
||||
}
|
||||
|
||||
// cacheChart stores a cached copy of Chart in the chart subdirectory of path.
|
||||
//
|
||||
// It is assumed that the only method responsible for writing to chartDir is
|
||||
// cacheChart itself.
|
||||
//
|
||||
// This relies on the atomicity of moving temporary directories into place on
|
||||
// the same filesystem via os.Rename. If a syscall.EEXIST error occurs during
|
||||
// renaming, it indicates that the cached chart already exists, which is an
|
||||
// expected scenario when this function is called concurrently.
|
||||
func cacheChart(ctx context.Context, path holos.InstancePath, chartDir string, chart Chart) error {
|
||||
log := logger.FromContext(ctx)
|
||||
|
||||
@@ -156,11 +165,16 @@ func cacheChart(ctx context.Context, path holos.InstancePath, chartDir string, c
|
||||
dst := filepath.Join(cachePath, item.Name())
|
||||
log.DebugContext(ctx, "rename", "src", src, "dst", dst)
|
||||
if err := os.Rename(src, dst); err != nil {
|
||||
return errors.Wrap(fmt.Errorf("could not rename: %w", err))
|
||||
var linkErr *os.LinkError
|
||||
if errors.As(err, &linkErr) && errors.Is(linkErr.Err, syscall.EEXIST) {
|
||||
log.DebugContext(ctx, "cache already exists", "chart", chart.Name, "chart_version", chart.Version, "path", cachePath)
|
||||
} else {
|
||||
return errors.Wrap(fmt.Errorf("could not rename: %w", err))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
log.InfoContext(ctx, "cached", "chart", chart.Name, "version", chart.Version, "path", cachePath)
|
||||
log.InfoContext(ctx, "cached", "chart", chart.Name, "chart_version", chart.Version, "path", cachePath)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -17,6 +17,10 @@ type Result struct {
|
||||
HolosComponent
|
||||
// accumulatedOutput accumulates rendered api objects.
|
||||
accumulatedOutput string
|
||||
// DeployFiles keys represent file paths relative to the cluster deploy
|
||||
// directory. Map values represent the string encoded file contents. Used to
|
||||
// write the argocd Application, but may be used to render any file from CUE.
|
||||
DeployFiles FileContentMap `json:"deployFiles,omitempty" yaml:"deployFiles,omitempty"`
|
||||
}
|
||||
|
||||
// Continue returns true if Skip is true indicating the result is to be skipped over.
|
||||
@@ -40,11 +44,6 @@ func (r *Result) KustomizationFilename(writeTo string, cluster string) string {
|
||||
return filepath.Join(writeTo, "clusters", cluster, "holos", "components", r.Metadata.Name+"-kustomization.gen.yaml")
|
||||
}
|
||||
|
||||
// KustomizationContent returns the kustomization file contents to write.
|
||||
func (r *Result) KustomizationContent() string {
|
||||
return r.KsContent
|
||||
}
|
||||
|
||||
// AccumulatedOutput returns the accumulated rendered output.
|
||||
func (r *Result) AccumulatedOutput() string {
|
||||
return r.accumulatedOutput
|
||||
@@ -133,6 +132,21 @@ func (r *Result) kustomize(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *Result) WriteDeployFiles(ctx context.Context, path string) error {
|
||||
log := logger.FromContext(ctx)
|
||||
if len(r.DeployFiles) == 0 {
|
||||
return nil
|
||||
}
|
||||
for k, content := range r.DeployFiles {
|
||||
path := filepath.Join(path, k)
|
||||
if err := r.Save(ctx, path, content); err != nil {
|
||||
return errors.Wrap(err)
|
||||
}
|
||||
log.InfoContext(ctx, "wrote deploy file", "path", path, "bytes", len(content))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Save writes the content to the filesystem for git ops.
|
||||
func (r *Result) Save(ctx context.Context, path string, content string) error {
|
||||
log := logger.FromContext(ctx)
|
||||
@@ -141,7 +155,7 @@ func (r *Result) Save(ctx context.Context, path string, content string) error {
|
||||
log.WarnContext(ctx, "could not mkdir", "path", dir, "err", err)
|
||||
return errors.Wrap(err)
|
||||
}
|
||||
// Write the kube api objects
|
||||
// Write the file content
|
||||
if err := os.WriteFile(path, []byte(content), os.FileMode(0644)); err != nil {
|
||||
log.WarnContext(ctx, "could not write", "path", path, "err", err)
|
||||
return errors.Wrap(err)
|
||||
|
||||
@@ -10,7 +10,7 @@ func (tm *TypeMeta) GetKind() string {
|
||||
}
|
||||
|
||||
func (tm *TypeMeta) GetAPIVersion() string {
|
||||
return tm.Kind
|
||||
return tm.APIVersion
|
||||
}
|
||||
|
||||
// Discriminator is an interface to discriminate the kind api object.
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
module: "github.com/holos-run/holos"
|
||||
403
doc/md/api/core/v1alpha2.md
Normal file
@@ -0,0 +1,403 @@
|
||||
<!-- Code generated by gomarkdoc. DO NOT EDIT -->
|
||||
|
||||
# v1alpha2
|
||||
|
||||
```go
|
||||
import "github.com/holos-run/holos/api/core/v1alpha2"
|
||||
```
|
||||
|
||||
Package v1alpha2 contains the core API contract between the holos cli and CUE configuration code. Platform designers, operators, and software developers use this API to write configuration in CUE which \`holos\` loads. The overall shape of the API defines imperative actions \`holos\` should carry out to render the complete yaml that represents a Platform.
|
||||
|
||||
[Platform](<#Platform>) defines the complete configuration of a platform. With the holos reference platform this takes the shape of one management cluster and at least two workload cluster. Each cluster has multiple [HolosComponent](<#HolosComponent>) resources applied to it.
|
||||
|
||||
Each holos component path, e.g. \`components/namespaces\` produces exactly one [BuildPlan](<#BuildPlan>) which in turn contains a set of [HolosComponent](<#HolosComponent>) kinds.
|
||||
|
||||
The primary kinds of [HolosComponent](<#HolosComponent>) are:
|
||||
|
||||
1. [HelmChart](<#HelmChart>) to render config from a helm chart.
|
||||
2. [KustomizeBuild](<#KustomizeBuild>) to render config from [Kustomize](<#Kustomize>)
|
||||
3. [KubernetesObjects](<#KubernetesObjects>) to render [APIObjects](<#APIObjects>) defined directly in CUE configuration.
|
||||
|
||||
Note that Holos operates as a data pipeline, so the output of a [HelmChart](<#HelmChart>) may be provided to [Kustomize](<#Kustomize>) for post\-processing.
|
||||
|
||||
## Index
|
||||
|
||||
- [Constants](<#constants>)
|
||||
- [type APIObject](<#APIObject>)
|
||||
- [type APIObjectMap](<#APIObjectMap>)
|
||||
- [type APIObjects](<#APIObjects>)
|
||||
- [type BuildPlan](<#BuildPlan>)
|
||||
- [type BuildPlanComponents](<#BuildPlanComponents>)
|
||||
- [type BuildPlanSpec](<#BuildPlanSpec>)
|
||||
- [type Chart](<#Chart>)
|
||||
- [type FileContent](<#FileContent>)
|
||||
- [type FileContentMap](<#FileContentMap>)
|
||||
- [type FilePath](<#FilePath>)
|
||||
- [type HelmChart](<#HelmChart>)
|
||||
- [type HolosComponent](<#HolosComponent>)
|
||||
- [type Kind](<#Kind>)
|
||||
- [type KubernetesObjects](<#KubernetesObjects>)
|
||||
- [type Kustomize](<#Kustomize>)
|
||||
- [type KustomizeBuild](<#KustomizeBuild>)
|
||||
- [type Label](<#Label>)
|
||||
- [type Metadata](<#Metadata>)
|
||||
- [type Platform](<#Platform>)
|
||||
- [type PlatformMetadata](<#PlatformMetadata>)
|
||||
- [type PlatformSpec](<#PlatformSpec>)
|
||||
- [type PlatformSpecComponent](<#PlatformSpecComponent>)
|
||||
- [type Repository](<#Repository>)
|
||||
|
||||
|
||||
## Constants
|
||||
|
||||
<a name="APIVersion"></a>
|
||||
|
||||
```go
|
||||
const (
|
||||
APIVersion = "v1alpha2"
|
||||
BuildPlanKind = "BuildPlan"
|
||||
HelmChartKind = "HelmChart"
|
||||
// ChartDir is the directory name created in the holos component directory to cache a chart.
|
||||
ChartDir = "vendor"
|
||||
// ResourcesFile is the file name used to store component output when post-processing with kustomize.
|
||||
ResourcesFile = "resources.yaml"
|
||||
)
|
||||
```
|
||||
|
||||
<a name="KubernetesObjectsKind"></a>
|
||||
|
||||
```go
|
||||
const KubernetesObjectsKind = "KubernetesObjects"
|
||||
```
|
||||
|
||||
<a name="APIObject"></a>
|
||||
## type APIObject {#APIObject}
|
||||
|
||||
APIObject represents the most basic generic form of a single kubernetes api object. Represented as a JSON object internally for compatibility between tools, for example loading from CUE.
|
||||
|
||||
```go
|
||||
type APIObject structpb.Struct
|
||||
```
|
||||
|
||||
<a name="APIObjectMap"></a>
|
||||
## type APIObjectMap {#APIObjectMap}
|
||||
|
||||
APIObjectMap represents the marshalled yaml representation of kubernetes api objects. Do not produce an APIObjectMap directly, instead use [APIObjects](<#APIObjects>) to produce the marshalled yaml representation from CUE data, then provide the result to [HolosComponent](<#HolosComponent>).
|
||||
|
||||
```go
|
||||
type APIObjectMap map[Kind]map[Label]string
|
||||
```
|
||||
|
||||
<a name="APIObjects"></a>
|
||||
## type APIObjects {#APIObjects}
|
||||
|
||||
APIObjects represents Kubernetes API objects defined directly from CUE code. Useful to mix in resources to any kind of [HolosComponent](<#HolosComponent>), for example adding an ExternalSecret resource to a [HelmChart](<#HelmChart>).
|
||||
|
||||
[Kind](<#Kind>) must be the resource kind, e.g. Deployment or Service.
|
||||
|
||||
[Label](<#Label>) is an arbitrary internal identifier to uniquely identify the resource within the context of a \`holos\` command. Holos will never write the intermediate label to rendered output.
|
||||
|
||||
Refer to [HolosComponent](<#HolosComponent>) which accepts an [APIObjectMap](<#APIObjectMap>) field provided by [APIObjects](<#APIObjects>).
|
||||
|
||||
```go
|
||||
type APIObjects struct {
|
||||
APIObjects map[Kind]map[Label]APIObject `json:"apiObjects"`
|
||||
APIObjectMap APIObjectMap `json:"apiObjectMap"`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="BuildPlan"></a>
|
||||
## type BuildPlan {#BuildPlan}
|
||||
|
||||
BuildPlan represents a build plan for the holos cli to execute. The purpose of a BuildPlan is to define one or more [HolosComponent](<#HolosComponent>) kinds. For example a [HelmChart](<#HelmChart>), [KustomizeBuild](<#KustomizeBuild>), or [KubernetesObjects](<#KubernetesObjects>).
|
||||
|
||||
A BuildPlan usually has an additional empty [KubernetesObjects](<#KubernetesObjects>) for the purpose of using the [HolosComponent](<#HolosComponent>) DeployFiles field to deploy an ArgoCD or Flux gitops resource for the holos component.
|
||||
|
||||
```go
|
||||
type BuildPlan struct {
|
||||
Kind string `json:"kind" cue:"\"BuildPlan\""`
|
||||
APIVersion string `json:"apiVersion" cue:"string | *\"v1alpha2\""`
|
||||
Spec BuildPlanSpec `json:"spec"`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="BuildPlanComponents"></a>
|
||||
## type BuildPlanComponents {#BuildPlanComponents}
|
||||
|
||||
|
||||
|
||||
```go
|
||||
type BuildPlanComponents struct {
|
||||
Resources map[Label]KubernetesObjects `json:"resources,omitempty"`
|
||||
KubernetesObjectsList []KubernetesObjects `json:"kubernetesObjectsList,omitempty"`
|
||||
HelmChartList []HelmChart `json:"helmChartList,omitempty"`
|
||||
KustomizeBuildList []KustomizeBuild `json:"kustomizeBuildList,omitempty"`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="BuildPlanSpec"></a>
|
||||
## type BuildPlanSpec {#BuildPlanSpec}
|
||||
|
||||
BuildPlanSpec represents the specification of the build plan.
|
||||
|
||||
```go
|
||||
type BuildPlanSpec struct {
|
||||
// Disabled causes the holos cli to take no action over the [BuildPlan].
|
||||
Disabled bool `json:"disabled,omitempty"`
|
||||
// Components represents multiple [HolosComponent] kinds to manage.
|
||||
Components BuildPlanComponents `json:"components,omitempty"`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="Chart"></a>
|
||||
## type Chart {#Chart}
|
||||
|
||||
Chart represents a helm chart.
|
||||
|
||||
```go
|
||||
type Chart struct {
|
||||
// Name represents the chart name.
|
||||
Name string `json:"name"`
|
||||
// Version represents the chart version.
|
||||
Version string `json:"version"`
|
||||
// Release represents the chart release when executing helm template.
|
||||
Release string `json:"release"`
|
||||
// Repository represents the repository to fetch the chart from.
|
||||
Repository Repository `json:"repository,omitempty"`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="FileContent"></a>
|
||||
## type FileContent {#FileContent}
|
||||
|
||||
FileContent represents file contents.
|
||||
|
||||
```go
|
||||
type FileContent string
|
||||
```
|
||||
|
||||
<a name="FileContentMap"></a>
|
||||
## type FileContentMap {#FileContentMap}
|
||||
|
||||
FileContentMap represents a mapping of file paths to file contents. Paths are relative to the \`holos\` output "deploy" directory, and may contain sub\-directories.
|
||||
|
||||
```go
|
||||
type FileContentMap map[FilePath]FileContent
|
||||
```
|
||||
|
||||
<a name="FilePath"></a>
|
||||
## type FilePath {#FilePath}
|
||||
|
||||
FilePath represents a file path.
|
||||
|
||||
```go
|
||||
type FilePath string
|
||||
```
|
||||
|
||||
<a name="HelmChart"></a>
|
||||
## type HelmChart {#HelmChart}
|
||||
|
||||
HelmChart represents a holos component which wraps around an upstream helm chart. Holos orchestrates helm by providing values obtained from CUE, renders the output using \`helm template\`, then post\-processes the helm output yaml using the general functionality provided by [HolosComponent](<#HolosComponent>), for example [Kustomize](<#Kustomize>) post\-rendering and mixing in additional kubernetes api objects.
|
||||
|
||||
```go
|
||||
type HelmChart struct {
|
||||
HolosComponent `json:",inline"`
|
||||
Kind string `json:"kind" cue:"\"HelmChart\""`
|
||||
|
||||
// Chart represents a helm chart to manage.
|
||||
Chart Chart `json:"chart"`
|
||||
// ValuesContent represents the values.yaml file holos passes to the `helm
|
||||
// template` command.
|
||||
ValuesContent string `json:"valuesContent"`
|
||||
// EnableHooks enables helm hooks when executing the `helm template` command.
|
||||
EnableHooks bool `json:"enableHooks" cue:"bool | *false"`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="HolosComponent"></a>
|
||||
## type HolosComponent {#HolosComponent}
|
||||
|
||||
HolosComponent defines the fields common to all holos component kinds. Every holos component kind should embed HolosComponent.
|
||||
|
||||
```go
|
||||
type HolosComponent struct {
|
||||
// Kind is a string value representing the resource this object represents.
|
||||
Kind string `json:"kind"`
|
||||
// APIVersion represents the versioned schema of this representation of an object.
|
||||
APIVersion string `json:"apiVersion" cue:"string | *\"v1alpha2\""`
|
||||
// Metadata represents data about the holos component such as the Name.
|
||||
Metadata Metadata `json:"metadata"`
|
||||
|
||||
// APIObjectMap holds the marshalled representation of api objects. Useful to
|
||||
// mix in resources to each HolosComponent type, for example adding an
|
||||
// ExternalSecret to a HelmChart HolosComponent. Refer to [APIObjects].
|
||||
APIObjectMap APIObjectMap `json:"apiObjectMap,omitempty"`
|
||||
|
||||
// DeployFiles represents file paths relative to the cluster deploy directory
|
||||
// with the value representing the file content. Intended for defining the
|
||||
// ArgoCD Application resource or Flux Kustomization resource from within CUE,
|
||||
// but may be used to render any file related to the build plan from CUE.
|
||||
DeployFiles FileContentMap `json:"deployFiles,omitempty"`
|
||||
|
||||
// Kustomize represents a kubectl kustomize build post-processing step.
|
||||
Kustomize `json:"kustomize,omitempty"`
|
||||
|
||||
// Skip causes holos to take no action regarding this component.
|
||||
Skip bool `json:"skip" cue:"bool | *false"`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="Kind"></a>
|
||||
## type Kind {#Kind}
|
||||
|
||||
Kind is a kubernetes api object kind. Defined as a type for clarity and type checking.
|
||||
|
||||
```go
|
||||
type Kind string
|
||||
```
|
||||
|
||||
<a name="KubernetesObjects"></a>
|
||||
## type KubernetesObjects {#KubernetesObjects}
|
||||
|
||||
KubernetesObjects represents a [HolosComponent](<#HolosComponent>) composed of Kubernetes API objects provided directly from CUE using [APIObjects](<#APIObjects>).
|
||||
|
||||
```go
|
||||
type KubernetesObjects struct {
|
||||
HolosComponent `json:",inline"`
|
||||
Kind string `json:"kind" cue:"\"KubernetesObjects\""`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="Kustomize"></a>
|
||||
## type Kustomize {#Kustomize}
|
||||
|
||||
Kustomize represents resources necessary to execute a kustomize build. Intended for at least two use cases:
|
||||
|
||||
1. Process a [KustomizeBuild](<#KustomizeBuild>) [HolosComponent](<#HolosComponent>) which represents raw yaml file resources in a holos component directory.
|
||||
2. Post process a [HelmChart](<#HelmChart>) [HolosComponent](<#HolosComponent>) to inject istio, patch jobs, add custom labels, etc...
|
||||
|
||||
```go
|
||||
type Kustomize struct {
|
||||
// KustomizeFiles holds file contents for kustomize, e.g. patch files.
|
||||
KustomizeFiles FileContentMap `json:"kustomizeFiles,omitempty"`
|
||||
// ResourcesFile is the file name used for api objects in kustomization.yaml
|
||||
ResourcesFile string `json:"resourcesFile,omitempty"`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="KustomizeBuild"></a>
|
||||
## type KustomizeBuild {#KustomizeBuild}
|
||||
|
||||
KustomizeBuild represents a [HolosComponent](<#HolosComponent>) that renders plain yaml files in the holos component directory using \`kubectl kustomize build\`.
|
||||
|
||||
```go
|
||||
type KustomizeBuild struct {
|
||||
HolosComponent `json:",inline"`
|
||||
Kind string `json:"kind" cue:"\"KustomizeBuild\""`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="Label"></a>
|
||||
## type Label {#Label}
|
||||
|
||||
Label is an arbitrary unique identifier internal to holos itself. The holos cli is expected to never write a Label value to rendered output files, therefore use a [Label](<#Label>) then the identifier must be unique and internal. Defined as a type for clarity and type checking.
|
||||
|
||||
A Label is useful to convert a CUE struct to a list, for example producing a list of [APIObject](<#APIObject>) resources from an [APIObjectMap](<#APIObjectMap>). A CUE struct using Label keys is guaranteed to not lose data when rendering output because a Label is expected to never be written to the final output.
|
||||
|
||||
```go
|
||||
type Label string
|
||||
```
|
||||
|
||||
<a name="Metadata"></a>
|
||||
## type Metadata {#Metadata}
|
||||
|
||||
Metadata represents data about the holos component such as the Name.
|
||||
|
||||
```go
|
||||
type Metadata struct {
|
||||
// Name represents the name of the holos component.
|
||||
Name string `json:"name"`
|
||||
// Namespace is the primary namespace of the holos component. A holos
|
||||
// component may manage resources in multiple namespaces, in this case
|
||||
// consider setting the component namespace to default.
|
||||
//
|
||||
// This field is optional because not all resources require a namespace,
|
||||
// particularly CRD's and DeployFiles functionality.
|
||||
// +optional
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="Platform"></a>
|
||||
## type Platform {#Platform}
|
||||
|
||||
Platform represents a platform to manage. A Platform resource informs holos which components to build. The platform resource also acts as a container for the platform model form values provided by the PlatformService. The primary use case is to collect the cluster names, cluster types, platform model, and holos components to build into one resource.
|
||||
|
||||
```go
|
||||
type Platform struct {
|
||||
// Kind is a string value representing the resource this object represents.
|
||||
Kind string `json:"kind" cue:"\"Platform\""`
|
||||
// APIVersion represents the versioned schema of this representation of an object.
|
||||
APIVersion string `json:"apiVersion" cue:"string | *\"v1alpha2\""`
|
||||
// Metadata represents data about the object such as the Name.
|
||||
Metadata PlatformMetadata `json:"metadata"`
|
||||
|
||||
// Spec represents the specification.
|
||||
Spec PlatformSpec `json:"spec"`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="PlatformMetadata"></a>
|
||||
## type PlatformMetadata {#PlatformMetadata}
|
||||
|
||||
|
||||
|
||||
```go
|
||||
type PlatformMetadata struct {
|
||||
// Name represents the Platform name.
|
||||
Name string `json:"name"`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="PlatformSpec"></a>
|
||||
## type PlatformSpec {#PlatformSpec}
|
||||
|
||||
PlatformSpec represents the specification of a Platform. Think of a platform specification as a list of platform components to apply to a list of kubernetes clusters combined with the user\-specified Platform Model.
|
||||
|
||||
```go
|
||||
type PlatformSpec struct {
|
||||
// Model represents the platform model holos gets from from the
|
||||
// PlatformService.GetPlatform rpc method and provides to CUE using a tag.
|
||||
Model structpb.Struct `json:"model"`
|
||||
// Components represents a list of holos components to manage.
|
||||
Components []PlatformSpecComponent `json:"components"`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="PlatformSpecComponent"></a>
|
||||
## type PlatformSpecComponent {#PlatformSpecComponent}
|
||||
|
||||
PlatformSpecComponent represents a holos component to build or render.
|
||||
|
||||
```go
|
||||
type PlatformSpecComponent struct {
|
||||
// Path is the path of the component relative to the platform root.
|
||||
Path string `json:"path"`
|
||||
// Cluster is the cluster name to provide when rendering the component.
|
||||
Cluster string `json:"cluster"`
|
||||
}
|
||||
```
|
||||
|
||||
<a name="Repository"></a>
|
||||
## type Repository {#Repository}
|
||||
|
||||
Repository represents a helm chart repository.
|
||||
|
||||
```go
|
||||
type Repository struct {
|
||||
Name string `json:"name"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
```
|
||||
|
||||
Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)
|
||||
3
doc/md/cli.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# CLI
|
||||
|
||||
Use the `holos` command line interface (CLI) to render individual platform components, entire platforms, and push/pull the platform model.
|
||||
47
doc/md/design/rendering.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# Rendering
|
||||
|
||||
:::tip
|
||||
|
||||
This document provides a brief overview of the rendering process, a core design
|
||||
element in Holos.
|
||||
|
||||
:::
|
||||
|
||||
Holos uses the Kubernetes resource model to manage configuration. The `holos`
|
||||
command line interface is the primary method you'll use to manage your platform.
|
||||
Holos uses CUE to provide a unified configuration model of the platform. This
|
||||
unified configuration is built up from components packaged with Helm, Kustomize,
|
||||
CUE, or any other tool that can produce Kubernetes resource manifests as output.
|
||||
|
||||
This process can be thought of as a data **rendering pipeline**. The key
|
||||
concept is that `holos` will always produce fully rendered output, but delegates
|
||||
the _application_ of the configuration to other tools like `kubectl apply`,
|
||||
ArgoCD, or Flux.
|
||||
|
||||
```mermaid
|
||||
---
|
||||
title: Figure 2 - Render Pipeline
|
||||
---
|
||||
graph LR
|
||||
PS[<a href="/docs/api/core/v1alpha2#PlatformSpec">PlatformSpec</a>]
|
||||
BP[<a href="/docs/api/core/v1alpha2#BuildPlan">BuildPlan</a>]
|
||||
HC[<a href="/docs/api/core/v1alpha2#HolosComponent">HolosComponent</a>]
|
||||
|
||||
H[<a href="/docs/api/core/v1alpha2#HelmChart">HelmChart</a>]
|
||||
K[<a href="/docs/api/core/v1alpha2#KustomizeBuild">KustomizeBuild</a>]
|
||||
O[<a href="/docs/api/core/v1alpha2#KubernetesObjects">KubernetesObjects</a>]
|
||||
|
||||
P[<a href="/docs/api/core/v1alpha2#Kustomize">Kustomize</a>]
|
||||
Y[Kubernetes <br>Resources]
|
||||
G[GitOps <br>Resource]
|
||||
|
||||
C[Kube API Server]
|
||||
|
||||
PS --> BP --> HC
|
||||
HC --> H --> P
|
||||
HC --> K --> P
|
||||
HC --> O --> P
|
||||
|
||||
P --> Y --> C
|
||||
P --> G --> C
|
||||
```
|
||||
88
doc/md/glossary.md
Normal file
@@ -0,0 +1,88 @@
|
||||
# Glossary
|
||||
|
||||
This page describes the terms used within the context of Holos.
|
||||
|
||||
## Platform
|
||||
|
||||
In Holos, a Platform is a comprehensive environment configured using the
|
||||
Kubernetes resource model. It extends beyond traditional Kubernetes
|
||||
functionality by integrating cloud resources through Crossplane, allowing for a
|
||||
unified management approach across both Kubernetes and cloud infrastructure. A
|
||||
Platform typically consists of one Management Cluster, which handles control and
|
||||
secret management, and one or more Workload Clusters, where application
|
||||
workloads are deployed and run. This architecture enables a consistent and
|
||||
scalable approach to managing diverse resources and services within the
|
||||
cloud-native ecosystem.
|
||||
|
||||
## Management Cluster
|
||||
|
||||
In the context of Holos, a Management Cluster is a special Kubernetes cluster
|
||||
that hosts Kubernetes controllers. For example, cert-manager, Cluster api, and
|
||||
Crossplane. A management cluster manages a single platform. The primary
|
||||
function of this cluster is to securely store and manage secrets, ensuring the
|
||||
secure handling of sensitive information such as credentials, API keys, and
|
||||
other confidential data. The Management Cluster serves as a centralized and
|
||||
secure control plane for the platform, facilitating the orchestration and
|
||||
management of other components.
|
||||
|
||||
## Workload Cluster
|
||||
|
||||
In Holos, a Workload Cluster is a Kubernetes cluster designed to host and run
|
||||
application workloads. Unlike the Management Cluster, which focuses on control
|
||||
and secret management, Workload Clusters are dedicated to executing the actual
|
||||
applications and services. These clusters can vary in size and configuration
|
||||
based on the specific needs of the applications they support. Workload Clusters
|
||||
leverage Kubernetes' orchestration capabilities to manage the deployment,
|
||||
scaling, and operation of containerized applications, providing a flexible and
|
||||
scalable environment for running production workloads within the platform.
|
||||
|
||||
## Platform Form
|
||||
|
||||
In Holos, a Platform Form is a customizable web form defined by JSON data. Each
|
||||
platform within Holos has a unique Platform Form, which serves as an interface
|
||||
for configuring and managing the platform's settings and resources. Platform
|
||||
engineers can customize the Platform Form by modifying the underlying CUE
|
||||
(Configuration Unified Engine) code, allowing for tailored configurations that
|
||||
meet specific requirements. This flexibility enables platform engineers to
|
||||
create a user-friendly and specific interface for managing the platform's
|
||||
components and operations.
|
||||
|
||||
## Platform Model
|
||||
|
||||
In Holos, the Platform Model represents the collection of values submitted
|
||||
through the Platform Form. It encapsulates the specific configuration details
|
||||
and settings defined by the platform engineers, serving as the blueprint for the
|
||||
platform's setup and operation. The Platform Model is essential for translating
|
||||
the customized options and parameters from the Platform Form into actionable
|
||||
configurations within the Holos ecosystem, ensuring that the platform operates
|
||||
according to the specified requirements and guidelines.
|
||||
|
||||
## Secret Store
|
||||
|
||||
In Holos, a SecretStore is a repository for securely storing and managing
|
||||
sensitive data such as passwords, API keys, and other confidential information.
|
||||
It is compatible with any secret store supported by the External Secrets
|
||||
Operator. By default, the management cluster serves as the SecretStore to
|
||||
minimize dependencies and simplify the architecture. This setup ensures that
|
||||
secrets are managed in a secure and centralized manner, aligning with the
|
||||
overall security framework of the platform.
|
||||
|
||||
## Service Mesh
|
||||
|
||||
In Holos, a Service Mesh is a dedicated infrastructure layer for managing,
|
||||
observing, and securing service-to-service communications within a microservices
|
||||
architecture. It typically includes features such as load balancing, traffic
|
||||
routing, service discovery, and security policies like mutual TLS and access
|
||||
control. The Service Mesh abstracts these functionalities away from the
|
||||
application code, providing a centralized control plane for managing the
|
||||
interactions between microservices. This facilitates better observability,
|
||||
resilience, and security in complex, distributed environments.
|
||||
|
||||
## Zero Trust
|
||||
|
||||
In the context of Holos and broader security practices, Zero Trust is a security
|
||||
model that assumes no implicit trust is granted to any user, system, or
|
||||
component inside or outside the network. Instead, every request for access is
|
||||
treated as potentially malicious, and verification is required at every stage.
|
||||
This model enforces strict identity verification, continuous monitoring, and
|
||||
least-privilege access policies.
|
||||
BIN
doc/md/guides/argocd/argocd-apps-2.png
Normal file
|
After Width: | Height: | Size: 934 KiB |
BIN
doc/md/guides/argocd/argocd-apps.png
Normal file
|
After Width: | Height: | Size: 703 KiB |
BIN
doc/md/guides/argocd/argocd-auto-sync-ok.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
doc/md/guides/argocd/argocd-diff.png
Normal file
|
After Width: | Height: | Size: 1014 KiB |
BIN
doc/md/guides/argocd/argocd-login-signedout.png
Normal file
|
After Width: | Height: | Size: 728 KiB |
BIN
doc/md/guides/argocd/argocd-login.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
doc/md/guides/argocd/argocd-out-of-sync.png
Normal file
|
After Width: | Height: | Size: 1014 KiB |
BIN
doc/md/guides/argocd/argocd-sync-ok.png
Normal file
|
After Width: | Height: | Size: 854 KiB |
BIN
doc/md/guides/argocd/argocd-sync.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
6
doc/md/guides/argocd/index.mdx
Normal file
@@ -0,0 +1,6 @@
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
# ArgoCD
|
||||
|
||||
Coming soon.
|
||||
3
doc/md/guides/backstage/index.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Backstage
|
||||
|
||||
Coming soon.
|
||||
21
doc/md/guides/install.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Install Holos
|
||||
|
||||
Holos is distributed as a single file executable.
|
||||
|
||||
## Releases
|
||||
|
||||
Download `holos` from the [releases](https://github.com/holos-run/holos/releases) page and place the executable into your shell path.
|
||||
|
||||
## Go install
|
||||
|
||||
Alternatively, install directly into your go bin path using:
|
||||
|
||||
```shell
|
||||
go install github.com/holos-run/holos/cmd/holos@latest
|
||||
```
|
||||
|
||||
### What you'll need
|
||||
|
||||
- [helm](https://github.com/helm/helm/releases) to fetch and render Helm chart components.
|
||||
- [kubectl](https://kubernetes.io/docs/tasks/tools/) to [kustomize](https://kustomize.io/) components.
|
||||
|
||||
3
doc/md/guides/observability/index.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Observability
|
||||
|
||||
Coming soon.
|
||||
17
doc/md/guides/overview.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Overview
|
||||
|
||||
<!-- https://kubernetes.io/docs/contribute/style/diagram-guide/ -->
|
||||
|
||||
This tutorial covers the following process of getting started with Holos.
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
A[1. Install <br>holos] -->
|
||||
B[2. Register <br>account] -->
|
||||
C[3. Generate <br>platform] -->
|
||||
D[4. Render <br>platform] -->
|
||||
E[5. Apply <br>config]
|
||||
|
||||
classDef box fill:#fff,stroke:#000,stroke-width:1px,color:#000;
|
||||
class A,B,C,D,E box
|
||||
```
|
||||
62
doc/md/guides/register.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# Registration
|
||||
|
||||
Holos leverages a simple web app to collect and store platform attributes with a web form. Register an account with the web app to create and retrieve the platform model.
|
||||
|
||||
```
|
||||
holos register user
|
||||
```
|
||||
|
||||
:::tip
|
||||
|
||||
Holos allows you to customize all of the sections and fields of your platform model.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
## Generate your Platform
|
||||
|
||||
Generate your platform configuration from the holos reference platform embedded in the `holos` executable. Platform configuration is stored in a git repository.
|
||||
|
||||
```bash
|
||||
mkdir holos-infra
|
||||
cd holos-infra
|
||||
holos generate platform holos
|
||||
```
|
||||
|
||||
The generate command writes many files organized by platform component into the current directory
|
||||
|
||||
TODO: Put a table here describing key elements?
|
||||
|
||||
:::tip
|
||||
|
||||
Take a peek at `holos generate platform --help` to see other platforms embedded in the holos executable.
|
||||
|
||||
:::
|
||||
|
||||
## Push the Platform Form
|
||||
|
||||
```
|
||||
holos push platform form .
|
||||
```
|
||||
|
||||
## Fill in the form
|
||||
|
||||
TODO
|
||||
|
||||
## Pull the Platform Model
|
||||
|
||||
Once the platform model is saved, pull it into the holos-infra repository:
|
||||
|
||||
```
|
||||
holos pull platform model .
|
||||
```
|
||||
|
||||
## Render the Platform
|
||||
|
||||
With the platform model and the platform spec, you're ready to render the complete platform configuration:
|
||||
|
||||
```
|
||||
holos render platform ./platform
|
||||
```
|
||||
|
||||
## Summary
|
||||
BIN
doc/md/guides/try-holos/form-pushed.png
Normal file
|
After Width: | Height: | Size: 624 KiB |
BIN
doc/md/guides/try-holos/form.png
Normal file
|
After Width: | Height: | Size: 116 KiB |
657
doc/md/guides/try-holos/index.mdx
Normal file
@@ -0,0 +1,657 @@
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
# Try Holos Locally
|
||||
|
||||
This guide walks through the process of building and managing a software
|
||||
development platform with Holos. The k3d platform built in this guide is a
|
||||
slimmed down version of the larger, more holistic, Holos reference platform.
|
||||
|
||||
Holos is different from existing tools in a few important ways.
|
||||
|
||||
1. Holos provides a **unified configuration model** purpose built to improve on
|
||||
unmodified Helm charts, Kustomize bases, or anything else that produces
|
||||
structured configuration data.
|
||||
2. Holos all but **eliminates the need to template yaml**, a common source of
|
||||
frustration and errors in production.
|
||||
3. Holos platforms are **composable** and have breadth. The toolchain and
|
||||
techniques scale down to one machine and up to multiple clusters across
|
||||
multiple regions.
|
||||
4. The unified configuration model is well suited to a **Zero Trust security
|
||||
model**. Platform wide policy configuration is easier to manage with Holos.
|
||||
|
||||
---
|
||||
|
||||
This guide assumes commands are run locally. Capitalized terms have specific
|
||||
definitions described in the [Glossary](/docs/glossary).
|
||||
|
||||
## What you'll need {#Requirements}
|
||||
|
||||
You'll need the following tools installed to complete this guide.
|
||||
|
||||
1. [holos](/docs/guides/install) - to build the platform.
|
||||
2. [helm](https://helm.sh/docs/intro/install/) - to render Holos components that wrap upstream Helm charts.
|
||||
3. [k3d](https://k3d.io/#installation) - to provide a k8s api server.
|
||||
4. [OrbStack](https://docs.orbstack.dev/install) or [Docker](https://docs.docker.com/get-docker/) - to use k3d.
|
||||
5. [kubectl](https://kubernetes.io/docs/tasks/tools/) - to interact with the k8s api server.
|
||||
6. [mkcert](https://github.com/FiloSottile/mkcert?tab=readme-ov-file#installation) - to make trusted TLS certificates.
|
||||
7. [jq](https://jqlang.github.io/jq/download/) - to fiddle with JSON output.
|
||||
|
||||
:::note
|
||||
|
||||
Registering an account **is recommended** to try out proper authentication and
|
||||
authorization in Holos, but you can complete this guide without signing up.
|
||||
|
||||
:::
|
||||
|
||||
## Goal {#Goal}
|
||||
|
||||
By the end of this guide you'll have built the foundation of a software
|
||||
development platform. The foundation provides Zero Trust security by
|
||||
holistically integrating off-the-shelf open source software.
|
||||
|
||||
1. Istio is configured to authenticate and authorize requests using an OIDC
|
||||
ID-Token issued by ZITADEL before requests reach backend services.
|
||||
2. The platform provides single sign-on and role based access control for all
|
||||
services running on the platform.
|
||||
|
||||
This guide strives to keep things neat and tidy. All of the resources are
|
||||
located in one k3d cluster and one local Git repository. If you want to clean
|
||||
up at any point, do so with:
|
||||
|
||||
```bash
|
||||
k3d cluster delete workload
|
||||
rm -rf holos-k3d
|
||||
```
|
||||
|
||||
## Sign In or Out {#Sign-In}
|
||||
|
||||
Holos provides integrated authentication and authorization which we'll use in
|
||||
this guide to protect a service. We recommend registering an account to see
|
||||
this in action. Registration also enables you to explore the customizable web
|
||||
form that simplifies complex configuration.
|
||||
|
||||
If you opt-out, the platform will be configured to use a fake identity in place
|
||||
of real id tokens.
|
||||
|
||||
<Tabs groupId="registration">
|
||||
<TabItem value="registered" label="Sign In">
|
||||
```bash
|
||||
holos register user
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="unregistered" label="Opt Out">
|
||||
```bash
|
||||
holos logout
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Create the Platform {#Create-Platform}
|
||||
|
||||
A server-side platform resource in Holos stores the web form used to simplify
|
||||
platform wide configuration.
|
||||
|
||||
First, initialize an empty Git repository:
|
||||
|
||||
```bash
|
||||
mkdir holos-k3d
|
||||
cd holos-k3d
|
||||
git init
|
||||
```
|
||||
|
||||
<Tabs groupId="registration">
|
||||
<TabItem value="registered" label="Signed In">
|
||||
Use `holos` to make the rpc call to create the server-side platform
|
||||
resource.
|
||||
|
||||
```bash
|
||||
holos create platform --name k3d --display-name "Try Holos Locally"
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="unregistered" label="Signed Out">
|
||||
Create a blank `platform.metadata.json` file so subsequent holos commands
|
||||
skip rpc calls.
|
||||
|
||||
```bash
|
||||
touch platform.metadata.json
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Generate the Platform {#Generate-Platform}
|
||||
|
||||
Generate the platform code in the repository root.
|
||||
|
||||
```bash
|
||||
holos generate platform k3d
|
||||
```
|
||||
|
||||
Commit the generated platform config to the repository.
|
||||
|
||||
```bash
|
||||
git add .
|
||||
git commit -m "holos generate platform k3d - $(holos --version)"
|
||||
```
|
||||
|
||||
### Push the Platform Form
|
||||
|
||||
Each Holos platform has a Platform Form used to submit top level, platform-wide
|
||||
configuration values. The purpose of the form is to validate configuration
|
||||
values and simplify complicated configurations and integrations.
|
||||
|
||||
<Tabs groupId="registration">
|
||||
<TabItem value="registered" label="Signed In">
|
||||
Push the Platform Form to publish it. Browse to the printed URL to view the
|
||||
form.
|
||||
|
||||
```bash
|
||||
holos push platform form .
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="unregistered" label="Signed Out">
|
||||
You will update the Platform Model locally in a later step so there's
|
||||
nothing to do in this step. Only signed-in users can push a Platform Form
|
||||
to the Holos web server.
|
||||
|
||||
```bash
|
||||
# holos push platform form .
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
The Platform Form is defined locally in `forms/platform/platform-form.cue`.
|
||||
|
||||
On the web it looks like:
|
||||

|
||||
|
||||
### Update the Platform Model {#Platform-Model}
|
||||
|
||||
Holos needs initial, top level configuration values to render the platform. The
|
||||
Platform Model is the term we use for these values. In this section you will
|
||||
configure role based access control by way of updating the Platform Model.
|
||||
|
||||
In the k3d platform you're building now, role based access control is
|
||||
implemented by asserting against the oidc id token subject. Update the form
|
||||
with the `sub` claim value from your id token. This will ensure only you have
|
||||
access to platform services.
|
||||
|
||||
<Tabs groupId="registration">
|
||||
<TabItem value="registered" label="Signed In">
|
||||
Copy and paste the `sub` value into your Platform Form's Subject field.
|
||||
|
||||
```bash
|
||||
holos login --print-claims --log-level=error | jq -r .sub
|
||||
```
|
||||
|
||||
After pasting the `sub` value, click Submit on the form.
|
||||
</TabItem>
|
||||
<TabItem value="unregistered" label="Signed Out">
|
||||
You don't have an id token when you're signed out, so there's nothing for
|
||||
you to do in this step.
|
||||
|
||||
```bash
|
||||
# holos login --print-claims --log-level=error | jq -r .sub
|
||||
```
|
||||
|
||||
The platform will be configured to assert against the User-Agent header
|
||||
instead.
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Pull the Platform Model {#Pull-the-Platform-Model}
|
||||
|
||||
The Platform Model needs to be pulled into the local Git repository after the
|
||||
form has been submitted. Next, we'll run `holos render` which operates
|
||||
exclusively on local files.
|
||||
|
||||
Holos stores the Platform Model in the `platform.config.json` file. Holos
|
||||
provides this file as input to CUE when rendering the platform. This file is
|
||||
intended to be added to version control.
|
||||
|
||||
<Tabs groupId="registration">
|
||||
<TabItem value="registered" label="Signed In">
|
||||
Pull the updated Platform Model into the local repository.
|
||||
|
||||
```bash
|
||||
holos pull platform model .
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="unregistered" label="Signed Out">
|
||||
The `holos generate platform k3d` command should have created a default Platform
|
||||
Model in `platform.config.json`. As a result there's nothing to do in this
|
||||
step.
|
||||
|
||||
```bash
|
||||
# holos pull platform model .
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
```bash
|
||||
git add platform.config.json
|
||||
git commit -m "Add platform model"
|
||||
```
|
||||
|
||||
## Render the Platform {#Render-the-Platform}
|
||||
|
||||
Holos has everything necessary to render the platform once the
|
||||
`platform.config.json` file and the code from `holos generate` are in the
|
||||
current directory.
|
||||
|
||||
Rendering a platform is the process of iterating over each platform component
|
||||
and rendering it into plain yaml. Holos does not apply the resulting manifests.
|
||||
Other tools like kubectl, ArgoCD, or Flux are responsible for applying the
|
||||
manifests.
|
||||
|
||||
```bash
|
||||
holos render platform ./platform
|
||||
```
|
||||
|
||||
The render command writes the manifest files to the `deploy/` directory. Commit
|
||||
the files so they can be applied via GitOps later.
|
||||
|
||||
```bash
|
||||
git add deploy
|
||||
git commit -m "holos render platform ./platform"
|
||||
```
|
||||
|
||||
:::important
|
||||
|
||||
⚡ Don't blink, this is where Holos actually builds the platform. It usually
|
||||
takes no more than a few seconds.
|
||||
|
||||
Rendering the holos reference platform currently results in about 500K lines of
|
||||
yaml. In contrast, roughly 80K lines are produced by this slimmed down k3d
|
||||
platform.
|
||||
|
||||
We mention this because the scale doesn't matter as much as it does with other
|
||||
tools. Manage millions of lines of configuration with Holos the same way this
|
||||
guide manages thousands. This is made possible by the unique way CUE unifies
|
||||
all configuration into one single model.
|
||||
|
||||
:::
|
||||
|
||||
## Create the Cluster {#Create-Cluster}
|
||||
|
||||
The Workload Cluster is where your applications and services will be deployed.
|
||||
In production this is usually an EKS, GKE, or AKS cluster.
|
||||
|
||||
:::tip
|
||||
|
||||
Holos supports all compliant Kubernetes clusters. Holos was developed and tested
|
||||
on GKE, EKS, Talos, k3s, and Kubeadm clusters.
|
||||
|
||||
:::
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="evaluate" label="Try Holos" default>
|
||||
Use this command when exploring Holos.
|
||||
|
||||
```bash
|
||||
k3d cluster create workload \
|
||||
--port "443:443@loadbalancer" \
|
||||
--k3s-arg "--disable=traefik@server:0"
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="develop" label="Develop Holos">
|
||||
Use this command when developing Holos.
|
||||
|
||||
```bash
|
||||
k3d registry create registry.holos.localhost --port 5100
|
||||
```
|
||||
|
||||
```bash
|
||||
k3d cluster create workload \
|
||||
--registry-use k3d-registry.holos.localhost:5100 \
|
||||
--port "443:443@loadbalancer" \
|
||||
--k3s-arg "--disable=traefik@server:0"
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
Traefik is disabled because Istio provides the same functionality.
|
||||
|
||||
### Local CA {#Local-CA}
|
||||
|
||||
Holos platforms use cert manager to issue tls certificates. The browser and
|
||||
tools we're using need to trust these certificates to work together. In this
|
||||
section we'll create a local trusted certificate authority.
|
||||
|
||||
Admin access is necessary for `mkcert` to install the certificate into your
|
||||
trust stores.
|
||||
|
||||
```bash
|
||||
sudo -v
|
||||
```
|
||||
|
||||
```bash
|
||||
bash ./scripts/local-ca
|
||||
```
|
||||
|
||||
### DNS Setup {#DNS}
|
||||
|
||||
Configure your machine to resolve `*.holos.localhost` to your loopback
|
||||
interface. This is necessary for requests to reach the workload cluster.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="macos" label="macOS" default>
|
||||
Cache sudo credentials.
|
||||
|
||||
Admin access is necessary to setup a local dnsmasq instance and configure
|
||||
macOS's DNS resolver.
|
||||
|
||||
```bash
|
||||
sudo -v
|
||||
```
|
||||
|
||||
Resolve *.holos.localhost DNS queries to 127.0.0.1.
|
||||
|
||||
```bash
|
||||
bash ./scripts/local-dns
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="linux" label="Linux">
|
||||
[NSS-myhostname](http://man7.org/linux/man-pages/man8/nss-myhostname.8.html)
|
||||
ships with many Linux distributions and should resolve *.localhost
|
||||
automatically to 127.0.0.1.
|
||||
|
||||
Otherwise it is installable with:
|
||||
|
||||
```bash
|
||||
sudo apt install libnss-myhostname
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="windows" label="Windows">
|
||||
Ensure the loopback interface has at least the following names in `C:\windows\system32\drivers\etc\hosts`
|
||||
|
||||
```
|
||||
127.0.0.1 httpbin.holos.localhost app.holos.localhost
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Apply the Platform Components {#Apply-Platform-Components}
|
||||
|
||||
Use `kubectl` to apply each platform component. In production, it's common to
|
||||
fully automate this process with ArgoCD, but we use `kubectl` to the same
|
||||
effect.
|
||||
|
||||
### Service Mesh
|
||||
|
||||
The platform service mesh provides an ingress gateway and connectivity useful
|
||||
for observability, reliability, and security.
|
||||
|
||||
#### Namespaces
|
||||
|
||||
With Holos, components are automatically added to the namespaces component,
|
||||
useful for centrally managed policies.
|
||||
|
||||
```bash
|
||||
kubectl apply --server-side=true -f ./deploy/clusters/workload/components/namespaces
|
||||
```
|
||||
|
||||
#### Custom Resource Definitions
|
||||
|
||||
```bash
|
||||
kubectl apply --server-side=true -f ./deploy/clusters/workload/components/gateway-api
|
||||
kubectl apply --server-side=true -f ./deploy/clusters/workload/components/istio-base
|
||||
```
|
||||
|
||||
#### Cert Manager {#cert-manager}
|
||||
|
||||
Apply the cert-manager controller.
|
||||
|
||||
```bash
|
||||
kubectl apply --server-side=true -f ./deploy/clusters/workload/components/cert-manager
|
||||
```
|
||||
|
||||
Apply the ClusterIssuer which issues Certificate resources using the local
|
||||
certificate authority.
|
||||
|
||||
```bash
|
||||
kubectl -n cert-manager wait pod -l app.kubernetes.io/component=webhook --for=condition=Ready
|
||||
kubectl apply --server-side=true -f deploy/clusters/workload/components/local-ca
|
||||
kubectl apply --server-side=true -f deploy/clusters/workload/components/certificates
|
||||
```
|
||||
|
||||
#### Istio {#Istio}
|
||||
|
||||
Istio implements the Service Mesh.
|
||||
|
||||
```bash
|
||||
kubectl apply --server-side=true -f ./deploy/clusters/workload/components/istio-cni
|
||||
kubectl apply --server-side=true -f ./deploy/clusters/workload/components/istiod
|
||||
kubectl apply --server-side=true -f ./deploy/clusters/workload/components/gateway
|
||||
```
|
||||
|
||||
Verify the Gateway is programmed and the listeners have been accepted:
|
||||
|
||||
```bash
|
||||
kubectl -n istio-gateways wait gateway default --for=condition=Accepted
|
||||
```
|
||||
|
||||
#### httpbin {#httpbin}
|
||||
|
||||
httpbin is a simple backend service useful for end-to-end testing.
|
||||
|
||||
```bash
|
||||
kubectl apply --server-side=true -f deploy/clusters/workload/components/httpbin-backend
|
||||
kubectl apply --server-side=true -f deploy/clusters/workload/components/httpbin-routes
|
||||
kubectl -n holos-system wait pod -l app.kubernetes.io/instance=httpbin --for=condition=Ready
|
||||
```
|
||||
|
||||
:::important
|
||||
|
||||
Browse to [https://httpbin.holos.localhost/](https://httpbin.holos.localhost/)
|
||||
to verify end to end connectivity. You should see the httpbin index page.
|
||||
|
||||
:::
|
||||
|
||||
### Authenticating Proxy
|
||||
|
||||
The auth proxy is responsible for authenticating browser requests, handling the
|
||||
oidc authentication flow, and providing a signed id token to the rest of the
|
||||
services in the mesh.
|
||||
|
||||
#### Cookie Secret
|
||||
|
||||
The auth proxy stores session information in an encrypted cookie. Generate a
|
||||
random cookie encryption Secret and apply.
|
||||
|
||||
```bash
|
||||
LC_ALL=C tr -dc A-Za-z0-9 </dev/urandom \
|
||||
| head -c 32 \
|
||||
| kubectl create secret generic "authproxy" \
|
||||
--from-file=cookiesecret=/dev/stdin \
|
||||
--dry-run=client -o yaml \
|
||||
| kubectl apply -n istio-gateways -f-
|
||||
```
|
||||
|
||||
#### Deployment
|
||||
|
||||
The auth proxy Deployment receives requests from web browsers and responds with
|
||||
an authentication decision.
|
||||
|
||||
```bash
|
||||
kubectl apply --server-side=true -f deploy/clusters/workload/components/authproxy
|
||||
kubectl apply --server-side=true -f deploy/clusters/workload/components/authroutes
|
||||
```
|
||||
|
||||
<Tabs groupId="registration">
|
||||
<TabItem value="registered" label="Signed In">
|
||||
Verify authentication is working by visiting
|
||||
[https://httpbin.holos.localhost/holos/authproxy](https://httpbin.holos.localhost/holos/authproxy).
|
||||
The auth proxy should respond with a simple `Authenticated` response.
|
||||
|
||||
Istio will respond with `no healthy upstream` until the pod becomes ready.
|
||||
Wait for the pod to become ready with:
|
||||
|
||||
```bash
|
||||
kubectl -n holos-system wait pod -l app.kubernetes.io/instance=httpbin --for=condition=Ready
|
||||
```
|
||||
|
||||
Once authenticated, visit
|
||||
[https://httpbin.holos.localhost/holos/authproxy/userinfo](https://httpbin.holos.localhost/holos/authproxy/userinfo)
|
||||
which returns a subset of claims from your id token:
|
||||
|
||||
```json
|
||||
{
|
||||
"user": "275552236589843464",
|
||||
"email": "demo@holos.run",
|
||||
"preferredUsername": "demo"
|
||||
}
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="unregistered" label="Signed Out">
|
||||
The auth proxy will always try to sign you in when you are signed out, so
|
||||
there isn't much to do here. Please do take a moment to glance at the
|
||||
Signed In tab to see how this would work if you were signed in.
|
||||
|
||||
The `k3d` platform relies on `https://login.holos.run` to issue id tokens.
|
||||
Authorization has been configured against fake request headers instead of
|
||||
the real `x-oidc-id-token` header.
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Authorization Policy
|
||||
|
||||
Configure authorization policies using attributes of the authenticated request.
|
||||
Authorization policies route web requests through the auth proxy and then
|
||||
validate all requests against the `x-oidc-id-token` header.
|
||||
|
||||
```bash
|
||||
kubectl apply --server-side=true -f deploy/clusters/workload/components/authpolicy
|
||||
```
|
||||
|
||||
Istio make take a few seconds to program the Gateway with the
|
||||
AuthorizationPolicy resources.
|
||||
|
||||
## Try out Zero Trust
|
||||
|
||||
A basic Zero Trust security model is now in place. The platform authenticates
|
||||
and authorizes requests before they reach the backend service.
|
||||
|
||||
### Browser
|
||||
|
||||
<Tabs groupId="registration">
|
||||
<TabItem value="registered" label="Signed In">
|
||||
The platform has been configured to authorize requests with a `x-oidc-id-token` header.
|
||||
|
||||
1. Verify authentication is working by browsing to [https://httpbin.holos.localhost/dump/request](https://httpbin.holos.localhost/dump/request).
|
||||
- Refresh the page a few times.
|
||||
- The `httpbin` backend pods should echo back the `x-oidc-id-token`
|
||||
header injected by the auth proxy.
|
||||
2. Note the `x-oidc-id-token` header is not sent by your browser but is
|
||||
received by the backend service.
|
||||
- This design reduces the risk of exposing id tokens in the browser.
|
||||
- Browser request size remains constant as more claims are added to id
|
||||
tokens.
|
||||
- Reliability improves because id tokens often overflow request header
|
||||
buffers when they pass through middle boxes across the internet.
|
||||
</TabItem>
|
||||
<TabItem value="unregistered" label="Signed Out">
|
||||
The platform has been configured to authorize requests with a `User-Agent: anonymous` header.
|
||||
|
||||
1. Open an incognito window (Cmd+Shift+N) to verify the platform is
|
||||
enforcing the authorization policy.
|
||||
2. Browse to
|
||||
[https://httpbin.holos.localhost/dump/request](https://httpbin.holos.localhost/dump/request)
|
||||
you should be redirected to the sign in page by the auth proxy.
|
||||
- You **do not** need to register or sign in.
|
||||
- This step verifies the platform is redirecting unauthenticated
|
||||
requests to the identity provider.
|
||||
- Navigate back or close and re-open an incognito window.
|
||||
3. Set your `User-Agent` header to `anonymous` using your browser developer tools.
|
||||
- For Chrome the process is described
|
||||
[here](https://developer.chrome.com/docs/devtools/device-mode/override-user-agent#override_the_user_agent_string).
|
||||
- The purpose is to simulate an authenticated request.
|
||||
4. Browse to
|
||||
[https://httpbin.holos.localhost/dump/request](https://httpbin.holos.localhost/dump/request).
|
||||
- The platform should allow the request through to the backend pod.
|
||||
- `httpbin` should echo back your request which should contain `User-Agent: anonymous`.
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Command Line
|
||||
|
||||
Verify unauthenticated requests are blocked by default outside the browser.
|
||||
|
||||
```bash
|
||||
curl -I https://httpbin.holos.localhost/dump/request
|
||||
```
|
||||
|
||||
You should receive a `HTTP/2 302` response that redirects to `location:
|
||||
https://login.holos.run` to start the oauth login flow.
|
||||
|
||||
Next, verify authenticated requests are allowed.
|
||||
|
||||
<Tabs groupId="registration">
|
||||
<TabItem value="registered" label="Signed In">
|
||||
The platform is configured to authenticate the id token present in the
|
||||
`x-oidc-id-token` header.
|
||||
|
||||
💡 It also works with `grpcurl`.
|
||||
|
||||
```bash
|
||||
curl -H x-oidc-id-token:$(holos token) https://httpbin.holos.localhost/dump/request
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="unregistered" label="Signed Out">
|
||||
The platform is configured to authorize any request with `User-Agent:
|
||||
anonymous` in place of validating the oidc id token.
|
||||
|
||||
💡 Take a moment to click the Signed In tab, I don't want you to miss how
|
||||
cool `$(holos token)` is.
|
||||
|
||||
```bash
|
||||
curl -A anonymous https://httpbin.holos.localhost/dump/request
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
You should receive a response showing the request headers the backend received.
|
||||
|
||||
:::tip
|
||||
|
||||
Note how the platform secures both web browser and command line api access to
|
||||
the backend httpbin service. httpbin itself has no authentication or
|
||||
authorization functionality.
|
||||
|
||||
:::
|
||||
|
||||
## Summary
|
||||
|
||||
Thank you for taking the time to try out Holos. In this guide, you built the
|
||||
foundation of a software development platform that:
|
||||
|
||||
1. Provides a unified configuration model with CUE that
|
||||
- Supports unmodified Helm Charts, Kustomize Kustomizations, plain YAML.
|
||||
- Provides a web form to pass top level parameters.
|
||||
2. Reduces errors by eliminating the need to template unstructured text.
|
||||
3. Is composable and scales down to a local machine.
|
||||
4. Provides an way to safely configure broad authentication and authorization
|
||||
policy.
|
||||
|
||||
## Next Steps
|
||||
|
||||
Dive deeper with the following resources that build on the foundation you have now.
|
||||
|
||||
1. Explore the [Rendering Process](/docs/design/rendering) in Holos.
|
||||
2. Dive deeper into the [Platform Manifests](./platform-manifests) rendered in this guide.
|
||||
3. Deploy [ArgoCD](/docs/guides/argocd) onto the foundation you built.
|
||||
4. Deploy [Backstage](/docs/guides/backstage) as a portal to the integrated platform components.
|
||||
|
||||
## Clean-Up
|
||||
|
||||
If you'd like to clean up the resources you created in this guide, remove them
|
||||
with:
|
||||
|
||||
```bash
|
||||
k3d cluster delete workload
|
||||
rm -rf holos-k3d
|
||||
```
|
||||
137
doc/md/guides/try-holos/platform-manifests.md
Normal file
@@ -0,0 +1,137 @@
|
||||
# Platform Manifests
|
||||
|
||||
This document provides an example of how Holos uses CUE and Helm to unify and
|
||||
render the platform configuration. It refers to the manifests rendered in the
|
||||
[Try Holos Locally](/docs/guides/try-holos/) guide.
|
||||
|
||||
Take a moment to review the manifests `holos` rendered to build the platform.
|
||||
|
||||
### ArgoCD Application
|
||||
|
||||
Note the Git URL in the Platform Model is used to derive the ArgoCD
|
||||
`Application` resource for all of the platform components.
|
||||
|
||||
```yaml
|
||||
# deploy/clusters/workload/gitops/namespaces.application.gen.yaml
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: namespaces
|
||||
namespace: argocd
|
||||
spec:
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
project: default
|
||||
source:
|
||||
# highlight-next-line
|
||||
path: /deploy/clusters/workload/components/namespaces
|
||||
# highlight-next-line
|
||||
repoURL: https://github.com/holos-run/holos-k3d.git
|
||||
# highlight-next-line
|
||||
targetRevision: HEAD
|
||||
```
|
||||
|
||||
One ArgoCD `Application` resource is produced for each Holos component by
|
||||
default. The CUE definition which produces the rendered output is defined in
|
||||
`buildplan.cue` around line 222.
|
||||
|
||||
:::tip
|
||||
|
||||
Note how CUE does not use error-prone text templates, the language is well
|
||||
specified and typed which reduces errors when unifying the configuration with
|
||||
the Platform Model in the following `#Argo` definition.
|
||||
|
||||
:::
|
||||
|
||||
```cue
|
||||
// buildplan.cue
|
||||
|
||||
// #Argo represents an argocd Application resource for each component, written
|
||||
// using the #HolosComponent.deployFiles field.
|
||||
#Argo: {
|
||||
ComponentName: string
|
||||
|
||||
Application: app.#Application & {
|
||||
metadata: name: ComponentName
|
||||
metadata: namespace: "argocd"
|
||||
spec: {
|
||||
destination: server: "https://kubernetes.default.svc"
|
||||
project: "default"
|
||||
source: {
|
||||
// highlight-next-line
|
||||
path: "\(_Platform.Model.argocd.deployRoot)/deploy/clusters/\(_ClusterName)/components/\(ComponentName)"
|
||||
// highlight-next-line
|
||||
repoURL: _Platform.Model.argocd.repoURL
|
||||
// highlight-next-line
|
||||
targetRevision: _Platform.Model.argocd.targetRevision
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// deployFiles represents the output files to write along side the component.
|
||||
deployFiles: "clusters/\(_ClusterName)/gitops/\(ComponentName).application.gen.yaml": yaml.Marshal(Application)
|
||||
}
|
||||
```
|
||||
|
||||
### Helm Chart
|
||||
|
||||
The `cert-manger` component renders using the upstream Helm chart. The build
|
||||
plan that defines the helm chart to use along with the values to provide looks
|
||||
like the following.
|
||||
|
||||
:::tip
|
||||
|
||||
Holos fully supports your existing Helm charts. Consider leveraging `holos` as
|
||||
an alternative to umbrella charts.
|
||||
|
||||
:::
|
||||
|
||||
```cue
|
||||
// components/cert-manager/cert-manager.cue
|
||||
package holos
|
||||
|
||||
// Produce a helm chart build plan.
|
||||
(#Helm & Chart).Output
|
||||
|
||||
let Chart = {
|
||||
Name: "cert-manager"
|
||||
Version: "1.14.5"
|
||||
Namespace: "cert-manager"
|
||||
|
||||
Repo: name: "jetstack"
|
||||
Repo: url: "https://charts.jetstack.io"
|
||||
|
||||
// highlight-next-line
|
||||
Values: {
|
||||
installCRDs: true
|
||||
startupapicheck: enabled: false
|
||||
// Must not use kube-system on gke autopilot. GKE Warden blocks access.
|
||||
// highlight-next-line
|
||||
global: leaderElection: namespace: Namespace
|
||||
|
||||
// https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-resource-requests#min-max-requests
|
||||
resources: requests: {
|
||||
cpu: "250m"
|
||||
memory: "512Mi"
|
||||
"ephemeral-storage": "100Mi"
|
||||
}
|
||||
// highlight-next-line
|
||||
webhook: resources: Values.resources
|
||||
// highlight-next-line
|
||||
cainjector: resources: Values.resources
|
||||
// highlight-next-line
|
||||
startupapicheck: resource: Values.resources
|
||||
|
||||
// https://cloud.google.com/kubernetes-engine/docs/how-to/autopilot-spot-pods
|
||||
nodeSelector: {
|
||||
"kubernetes.io/os": "linux"
|
||||
if _ClusterName == "management" {
|
||||
"cloud.google.com/gke-spot": "true"
|
||||
}
|
||||
}
|
||||
webhook: nodeSelector: Values.nodeSelector
|
||||
cainjector: nodeSelector: Values.nodeSelector
|
||||
startupapicheck: nodeSelector: Values.nodeSelector
|
||||
}
|
||||
}
|
||||
```
|
||||
64
doc/md/intro.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# Introduction
|
||||
|
||||
⚡️ Holos will help you build your **software development platform in no time.**
|
||||
|
||||
💸 Building a software development platform is **time consuming and expensive**. Spend more time building features for your customers and less time managing your development platform.
|
||||
|
||||
💥 Already have a platform? Add new features and services to your platform easily with Holos.
|
||||
|
||||
🧐 Holos is a platform builder. It builds a hollistic software development platform composed of best-of-breed cloud native open source projects. Holos is also a tool to make it easier to manage cloud infrastructure by providing a typed alternative to yaml templates.
|
||||
|
||||
## Features
|
||||
|
||||
Holos was built to solve two main problems:
|
||||
|
||||
1. Building a platform usually takes 3 engineers 6-9 months of effort. Holos provides a reference platform that enables you to deploy and customize your platform in a fraction of the time.
|
||||
2. Configuration changes often cause outages. Existing tools like Helm make it difficult to understand the impact a configuration change will have. Holos provides a unique, unified configuration model powered by CUE that makes it safer and easier to roll out configuration changes.
|
||||
|
||||
A core principle of Holos is that organizations gain value from owning the the platform they build on. Avoid vendor lock-in, future price hikes, and expensive licensing changes by building on a solid foundation of open source, cloud native computing foundation backed projects.
|
||||
|
||||
The following features are built into the Holos reference platform.
|
||||
|
||||
:::tip
|
||||
|
||||
Don't see your preferred technology in the stack? Holos is designed to enable you to swap out components of the platform tech stack.
|
||||
|
||||
:::
|
||||
|
||||
- **Continuous Delivery**
|
||||
- Holos builds a GitOps workflow for each application running in the platform.
|
||||
- Developers push changes which are automatically deployed.
|
||||
- Powered by [ArgoCD](https://argo-cd.readthedocs.io/en/stable/)
|
||||
- **Identity and Access Management** (IAM)
|
||||
- Holos builds a standard OIDC identity provider for you.
|
||||
- Integrates with your exisitng IAM and SSO system, or works independently.
|
||||
- Powerful customer identity and access management features.
|
||||
- Role based access control.
|
||||
- Powered by [ZITADEL](https://zitadel.com/)
|
||||
- **Zero Trust**
|
||||
- Authenticate and Authorize users at the platform layer instead of or in addition to the application layer.
|
||||
- Integrated with observability to measure and alert about problems before customers complain.
|
||||
- Powered by [Istio](https://istio.io/)
|
||||
- **Observability**
|
||||
- Holos collects performance and availability metrics automatically, without requiring application changes.
|
||||
- Optional, deeper integration into the application layer.
|
||||
- Distributed Tracing
|
||||
- Logging
|
||||
- Powered by Prometheus, Grafana, Loki, and OpenTelemetry.
|
||||
- **Data Platform**
|
||||
- Integrated management of PostgreSQL
|
||||
- Automatic backups
|
||||
- Automatic restore from backup
|
||||
- Quickly fail over across multiple regions
|
||||
- **Multi-Region**
|
||||
- Holos is designed to operate in multiple regions and multiple clouds.
|
||||
- Keep customer data in the region that makes the most sense for your business.
|
||||
- Easily cut over from one region to another for redundancy and business continuity.
|
||||
|
||||
## Development Status
|
||||
|
||||
Holos is being actively developed by [Open Infrastructure Services](https://openinfrastructure.co). Release can be found [here](https://github.com/holos-run/holos/releases).
|
||||
|
||||
## Adoption
|
||||
|
||||
Organizations who have officially adopted Holos can be found [here](https://github.com/holos-run/holos/blob/main/ADOPTERS.md).
|
||||
28
doc/md/local-development.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# Local Development
|
||||
|
||||
This document captures notes on locally developing Holos.
|
||||
|
||||
Follow the steps in [Try Holos Locally](/docs/guides/try-holos), but take care
|
||||
to select `Develop` tabs when creating the k3d cluster so you have a local
|
||||
registry to push to.
|
||||
|
||||
## Apply Resources
|
||||
|
||||
Work will be done in the `dev-holos` namespace.
|
||||
|
||||
Apply the infrastructure, which should persist when tilt is started / stopped.
|
||||
|
||||
```bash
|
||||
kubectl apply --server-side=true -f ./hack/tilt/k8s/dev-holos-infra
|
||||
```
|
||||
|
||||
This creates the PostgresCluster, service account, etc...
|
||||
|
||||
## Start tilt
|
||||
|
||||
Tilt will build the go executable, build the container, then push it to the
|
||||
local repository associated with k3d.
|
||||
|
||||
```bash
|
||||
./hack/tilt/bin/tilt up
|
||||
```
|
||||
3
doc/md/reference-platform/architecture.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Architecture
|
||||
|
||||
Coming soon.
|
||||
14
doc/md/runbooks/argocd.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# ArgoCD
|
||||
|
||||
Create the deploy key secret in the management cluster.
|
||||
|
||||
```bash
|
||||
tmp="$(mktemp -d)"
|
||||
(cd $tmp && ssh-keygen -t ed25519 -f sshPrivateKey -m pem -C argocd -N '')
|
||||
echo git@github.com:holos-run/holos-infra.git > "${tmp}/url"
|
||||
holos create secret -n argocd --append-hash=false creds-holos-infra --from-file $tmp
|
||||
rm -rf "$tmp"
|
||||
```
|
||||
|
||||
When syncing the secret, the ExternalSecret needs to set the label
|
||||
`argocd.argoproj.io/secret-type: repo-creds`.
|
||||
10
doc/md/runbooks/login/backups.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# ZITADEL Backups
|
||||
|
||||
Refer to [Schedule backups](https://cloudnative-pg.io/documentation/1.23/backup/#scheduled-backups)
|
||||
|
||||
By default ZITADEL is backed up daily to S3. When restoring into a new cluster
|
||||
of the same name, increment the revision variable to create a new blank folder
|
||||
for the new cluster WAL. The cluster will not initialize unless the WAL
|
||||
directory is empty.
|
||||
|
||||
The cluster will recovery from the previous rev.
|
||||
3
doc/md/runbooks/login/failover.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## Overview
|
||||
|
||||
TODO: This runbook needs to be updated to reflect the switch from PGO to CNPG.
|
||||
30
doc/md/runbooks/namespace.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# Namespaces
|
||||
|
||||
Holos follows the [Namespace Sameness - Sig Multicluster Position][1]. A
|
||||
namespace is the same on all clusters within the scope of a platform.
|
||||
|
||||
Namespaces are also security boundaries for role based access control. As such,
|
||||
permission to read a secret in a namespace means the secret is readable on all
|
||||
clusters in the platform.
|
||||
|
||||
When adding a component to a platform, create a namespace using the following
|
||||
process. This ensures a namespace scoped `SecretStore` is created to sync
|
||||
`ExternalSecret` resources from the management cluster.
|
||||
|
||||
1. Add a new project to the `_Projects` struct in `platform.cue`.
|
||||
2. Add the namespace to the `spec.namespaces` field of the project.
|
||||
3. Render the platform
|
||||
4. Apply the `namespaces` component to the management cluster
|
||||
5. Apply the `eso-creds-manager` component to the management cluster to create the `eso-reader` ksa for the namespace `SecretStore`
|
||||
6. Get a timestamp: `STAMP="$(date +%s)"`
|
||||
7. Run the job to populate ecr creds: `kubectl create job -n holos-system --from=cronjob/ecr-creds-manager ecr-creds-manager-$STAMP`
|
||||
8. Wait for the job to complete: `kubectl -n holos-system logs -l job-name=ecr-creds-manager-$STAMP -f`
|
||||
9. Apply the `namespaces` component to the workload clusters
|
||||
10. On the workload cluster, run the job to fetch the eso-reader creds: `kubectl create job -n holos-system --from=cronjob/eso-creds-refresher eso-creds-refresher-${STAMP}`
|
||||
11. Wait for the job to complete: `kubectl -n holos-system logs -l job-name=eso-creds-refresher-${STAMP}`
|
||||
12. Apply the secretstores component to the workload cluster.
|
||||
13. Apply any other cluster specific components which were modified by the `holos render platform ./platform` command.
|
||||
|
||||
Your namespace is created and you have the ability to create secrets in the management cluster and pull them using ExternalSecret resources. (edited)
|
||||
|
||||
[1]: https://github.com/kubernetes/community/blob/dd4c8b704ef1c9c3bfd928c6fa9234276d61ad18/sig-multicluster/namespace-sameness-position-statement.md
|
||||
3
doc/md/runbooks/postgres-backup.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Postgres Full Backup
|
||||
|
||||
Refer to [On-demand backups](https://cloudnative-pg.io/documentation/1.23/backup/#on-demand-backups)
|
||||
31
doc/md/runbooks/workload-identity.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Workload Identity
|
||||
|
||||
When a new workload cluster is provisioned, allow it to access the Management
|
||||
Cluster using workload identity. This is necessary for the
|
||||
`eso-creds-refresher` component and `Job` that executes in each workload
|
||||
cluster, which in turn enables the `SecretStore` in each namespace to sync
|
||||
secrets.
|
||||
|
||||
Build the cluster with Cluster API.
|
||||
See https://github.com/holos-run/holos-infra/blob/main/hack/capi/eks/aws2/aws2-managedmachinepool.yaml#L81-L84
|
||||
|
||||
## Workload Identity Provider
|
||||
Add the Cluster as a workload identity provider to the `holos-ops` gcp project.
|
||||
|
||||
Pool: [holos](https://console.cloud.google.com/iam-admin/workload-identity-pools/pool/holos?organizationId=358674006047&project=holos-ops)
|
||||
Name: `k8s-aws1`, `k8s-aws2`, etc...
|
||||
### Issuer URL:
|
||||
```
|
||||
kubectl create -n default token default | cut -d. -f2 | base64 -d | jq -r .iss
|
||||
```
|
||||
|
||||
### Audience
|
||||
Use the default audience.
|
||||
### Attribute Mapping
|
||||
|
||||
| Google | OIDC |
|
||||
| -------------------------------- | ------------------------------------------------------ |
|
||||
| `google.subject` | `assertion.sub` |
|
||||
| `attribute.service_account_name` | `assertion['kubernetes.io']['serviceaccount']['name']` |
|
||||
| `attribute.uid` | `assertion['kubernetes.io']['serviceaccount']['uid']` |
|
||||
| `attribute.pod` | `assertion['kubernetes.io']['pod']['name']` |
|
||||
20
doc/website/.gitignore
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# Dependencies
|
||||
/node_modules
|
||||
|
||||
# Build
|
||||
/build
|
||||
|
||||
# Generated files
|
||||
.docusaurus
|
||||
.cache-loader
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
34
doc/website/README.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Website
|
||||
|
||||
This website is built using [Docusaurus](https://docusaurus.io/), a modern
|
||||
static website generator.
|
||||
|
||||
## Installation
|
||||
|
||||
```shell
|
||||
npm install
|
||||
```
|
||||
|
||||
### Local Development
|
||||
|
||||
```shell
|
||||
npm run start
|
||||
```
|
||||
|
||||
This command starts a local development server and opens up a browser window.
|
||||
Most changes are reflected live without having to restart the server.
|
||||
|
||||
### Build
|
||||
|
||||
```shell
|
||||
npm run build
|
||||
```
|
||||
|
||||
This command generates static content into the `build` directory and can be
|
||||
served using any static contents hosting service.
|
||||
|
||||
### Deployment
|
||||
|
||||
Deployments are made with Cloudflare Pages. Cloudflare deploys on changes to
|
||||
the main branch, and Pull Requests get comments with links to preview
|
||||
environments.
|
||||
3
doc/website/babel.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
|
||||
};
|
||||
8
doc/website/blog/2024-07-03-welcome/index.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
slug: welcome
|
||||
title: Welcome
|
||||
authors: [jeff]
|
||||
tags: [holos]
|
||||
---
|
||||
|
||||
TODO - Coming Soon
|
||||
17
doc/website/blog/authors.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
jeff:
|
||||
name: Jeff McCune
|
||||
title: Holos maintainer & creator
|
||||
url: https://github.com/jeffmccune
|
||||
image_url: https://github.com/jeffmccune.png
|
||||
|
||||
gary:
|
||||
name: Gary Larizza
|
||||
title: Holos maintainer
|
||||
url: https://github.com/glarizza
|
||||
image_url: https://github.com/glarizza.png
|
||||
|
||||
nate:
|
||||
name: Nate McCurdy
|
||||
title: Holos maintainer
|
||||
url: https://github.com/natemccurdy
|
||||
image_url: https://github.com/natemccurdy.png
|
||||
4
doc/website/blog/tags.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
holos:
|
||||
label: Holos
|
||||
permalink: /holos
|
||||
description: Holos Platform
|
||||
425
doc/website/dist/v1alpha2.html.md
vendored
Normal file
@@ -0,0 +1,425 @@
|
||||
using module mode; GOMOD=/Users/jeff/Holos/holos/go.mod
|
||||
|
||||
...
|
||||
|
||||
<!-- #lowframe -->
|
||||
|
||||
[Go Documentation Server](/pkg/)
|
||||
|
||||
[GoDoc](/pkg/)
|
||||
|
||||
[▽](#)
|
||||
|
||||
Search
|
||||
|
||||
<!-- magnifying glass: -->
|
||||
|
||||
# Package v1alpha2
|
||||
|
||||
<!--
|
||||
Copyright 2009 The Go Authors. All rights reserved.
|
||||
Use of this source code is governed by a BSD-style
|
||||
license that can be found in the LICENSE file.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Note: Static (i.e., not template-generated) href and id
|
||||
attributes start with "pkg-" to make it impossible for
|
||||
them to conflict with generated attributes (some of which
|
||||
correspond to Go identifiers).
|
||||
-->
|
||||
|
||||
* `import "github.com/holos-run/holos/api/core/v1alpha2"`
|
||||
|
||||
- - [Overview](#pkg-overview)
|
||||
- [Index](#pkg-index)
|
||||
|
||||
<!-- The package's Name is printed as title by the top-level template -->
|
||||
|
||||
## Overview ▹
|
||||
|
||||
## Overview ▾
|
||||
|
||||
Package v1alpha2 contains the core API contract between the holos cli and CUE configuration code. Platform designers, operators, and software developers use this API to write configuration in CUE which \`holos\` loads. The overall shape of the API defines imperative actions \`holos\` should carry out to render the complete yaml that represents a Platform.
|
||||
|
||||
[Platform](#Platform) defines the complete configuration of a platform. With the holos reference platform this takes the shape of one management cluster and at least two workload cluster. Each cluster has multiple [HolosComponent](#HolosComponent) resources applied to it.
|
||||
|
||||
Each holos component path, e.g. \`components/namespaces\` produces exactly one [BuildPlan](#BuildPlan) which in turn contains a set of [HolosComponent](#HolosComponent) kinds.
|
||||
|
||||
The primary kinds of [HolosComponent](#HolosComponent) are:
|
||||
|
||||
1. [HelmChart](#HelmChart) to render config from a helm chart.
|
||||
2. [KustomizeBuild](#KustomizeBuild) to render config from [Kustomize](#Kustomize)
|
||||
3. [KubernetesObjects](#KubernetesObjects) to render [APIObjects](#APIObjects) defined directly in CUE configuration.
|
||||
|
||||
Note that Holos operates as a data pipeline, so the output of a [HelmChart](#HelmChart) may be provided to [Kustomize](#Kustomize) for post-processing.
|
||||
|
||||
## Index ▹
|
||||
|
||||
## Index ▾
|
||||
|
||||
<!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
|
||||
|
||||
* * [Constants](#pkg-constants)
|
||||
* [type APIObject](#APIObject)
|
||||
* [type APIObjectMap](#APIObjectMap)
|
||||
* [type APIObjects](#APIObjects)
|
||||
* [type BuildPlan](#BuildPlan)
|
||||
* [type BuildPlanComponents](#BuildPlanComponents)
|
||||
* [type BuildPlanSpec](#BuildPlanSpec)
|
||||
* [type Chart](#Chart)
|
||||
* [type FileContent](#FileContent)
|
||||
* [type FileContentMap](#FileContentMap)
|
||||
* [type FilePath](#FilePath)
|
||||
* [type HelmChart](#HelmChart)
|
||||
* [type HolosComponent](#HolosComponent)
|
||||
* [type Kind](#Kind)
|
||||
* [type KubernetesObjects](#KubernetesObjects)
|
||||
* [type Kustomize](#Kustomize)
|
||||
* [type KustomizeBuild](#KustomizeBuild)
|
||||
* [type Label](#Label)
|
||||
* [type Metadata](#Metadata)
|
||||
* [type Platform](#Platform)
|
||||
* [type PlatformMetadata](#PlatformMetadata)
|
||||
* [type PlatformSpec](#PlatformSpec)
|
||||
* [type PlatformSpecComponent](#PlatformSpecComponent)
|
||||
* [type Repository](#Repository)
|
||||
|
||||
<!-- #manual-nav -->
|
||||
|
||||
### Package files
|
||||
|
||||
[apiobjects.go](/src/github.com/holos-run/holos/api/core/v1alpha2/apiobjects.go) [buildplan.go](/src/github.com/holos-run/holos/api/core/v1alpha2/buildplan.go) [constants.go](/src/github.com/holos-run/holos/api/core/v1alpha2/constants.go) [core.go](/src/github.com/holos-run/holos/api/core/v1alpha2/core.go) [doc.go](/src/github.com/holos-run/holos/api/core/v1alpha2/doc.go) [helm.go](/src/github.com/holos-run/holos/api/core/v1alpha2/helm.go) [kubernetesobjects.go](/src/github.com/holos-run/holos/api/core/v1alpha2/kubernetesobjects.go) [kustomizebuild.go](/src/github.com/holos-run/holos/api/core/v1alpha2/kustomizebuild.go)
|
||||
|
||||
<!-- .expanded -->
|
||||
|
||||
<!-- #pkg-index -->
|
||||
|
||||
## Constants
|
||||
|
||||
```
|
||||
const (
|
||||
APIVersion = "v1alpha2"
|
||||
BuildPlanKind = "BuildPlan"
|
||||
HelmChartKind = "HelmChart"
|
||||
// ChartDir is the directory name created in the holos component directory to cache a chart.
|
||||
ChartDir = "vendor"
|
||||
// ResourcesFile is the file name used to store component output when post-processing with kustomize.
|
||||
ResourcesFile = "resources.yaml"
|
||||
)
|
||||
```
|
||||
|
||||
```
|
||||
const KubernetesObjectsKind = "KubernetesObjects"
|
||||
```
|
||||
|
||||
## type [APIObject](/src/github.com/holos-run/holos/api/core/v1alpha2/apiobjects.go?s=978:1008#L11) [¶](#APIObject)
|
||||
|
||||
APIObject represents the most basic generic form of a single kubernetes api object. Represented as a JSON object internally for compatibility between tools, for example loading from CUE.
|
||||
|
||||
```
|
||||
type APIObject structpb.Struct
|
||||
```
|
||||
|
||||
## type [APIObjectMap](/src/github.com/holos-run/holos/api/core/v1alpha2/apiobjects.go?s=1281:1324#L17) [¶](#APIObjectMap)
|
||||
|
||||
APIObjectMap represents the marshalled yaml representation of kubernetes api objects. Do not produce an APIObjectMap directly, instead use [APIObjects](#APIObjects) to produce the marshalled yaml representation from CUE data, then provide the result to [HolosComponent](#HolosComponent).
|
||||
|
||||
```
|
||||
type APIObjectMap map[Kind]map[Label]string
|
||||
```
|
||||
|
||||
## type [APIObjects](/src/github.com/holos-run/holos/api/core/v1alpha2/apiobjects.go?s=1901:2055#L31) [¶](#APIObjects)
|
||||
|
||||
APIObjects represents Kubernetes API objects defined directly from CUE code. Useful to mix in resources to any kind of [HolosComponent](#HolosComponent), for example adding an ExternalSecret resource to a [HelmChart](#HelmChart).
|
||||
|
||||
[Kind](#Kind) must be the resource kind, e.g. Deployment or Service.
|
||||
|
||||
[Label](#Label) is an arbitrary internal identifier to uniquely identify the resource within the context of a \`holos\` command. Holos will never write the intermediate label to rendered output.
|
||||
|
||||
Refer to [HolosComponent](#HolosComponent) which accepts an [APIObjectMap](#APIObjectMap) field provided by [APIObjects](#APIObjects).
|
||||
|
||||
```
|
||||
type APIObjects struct {
|
||||
APIObjects map[Kind]map[Label]APIObject `json:"apiObjects"`
|
||||
APIObjectMap APIObjectMap `json:"apiObjectMap"`
|
||||
}
|
||||
```
|
||||
|
||||
## type [BuildPlan](/src/github.com/holos-run/holos/api/core/v1alpha2/buildplan.go?s=789:989#L11) [¶](#BuildPlan)
|
||||
|
||||
BuildPlan represents a build plan for the holos cli to execute. The purpose of a BuildPlan is to define one or more [HolosComponent](#HolosComponent) kinds. For example a [HelmChart](#HelmChart), [KustomizeBuild](#KustomizeBuild), or [KubernetesObjects](#KubernetesObjects).
|
||||
|
||||
A BuildPlan usually has an additional empty [KubernetesObjects](#KubernetesObjects) for the purpose of using the [HolosComponent](#HolosComponent) DeployFiles field to deploy an ArgoCD or Flux gitops resource for the holos component.
|
||||
|
||||
```
|
||||
type BuildPlan struct {
|
||||
Kind string `json:"kind" cue:"\"BuildPlan\""`
|
||||
APIVersion string `json:"apiVersion" cue:"string | *\"v1alpha2\""`
|
||||
Spec BuildPlanSpec `json:"spec"`
|
||||
}
|
||||
```
|
||||
|
||||
## type [BuildPlanComponents](/src/github.com/holos-run/holos/api/core/v1alpha2/buildplan.go?s=1335:1715#L25) [¶](#BuildPlanComponents)
|
||||
|
||||
```
|
||||
type BuildPlanComponents struct {
|
||||
Resources map[Label]KubernetesObjects `json:"resources,omitempty"`
|
||||
KubernetesObjectsList []KubernetesObjects `json:"kubernetesObjectsList,omitempty"`
|
||||
HelmChartList []HelmChart `json:"helmChartList,omitempty"`
|
||||
KustomizeBuildList []KustomizeBuild `json:"kustomizeBuildList,omitempty"`
|
||||
}
|
||||
```
|
||||
|
||||
## type [BuildPlanSpec](/src/github.com/holos-run/holos/api/core/v1alpha2/buildplan.go?s=1056:1333#L18) [¶](#BuildPlanSpec)
|
||||
|
||||
BuildPlanSpec represents the specification of the build plan.
|
||||
|
||||
```
|
||||
type BuildPlanSpec struct {
|
||||
// Disabled causes the holos cli to take no action over the [BuildPlan].
|
||||
Disabled bool `json:"disabled,omitempty"`
|
||||
// Components represents multiple [HolosComponent] kinds to manage.
|
||||
Components BuildPlanComponents `json:"components,omitempty"`
|
||||
}
|
||||
```
|
||||
|
||||
## type [Chart](/src/github.com/holos-run/holos/api/core/v1alpha2/helm.go?s=922:1304#L13) [¶](#Chart)
|
||||
|
||||
Chart represents a helm chart.
|
||||
|
||||
```
|
||||
type Chart struct {
|
||||
// Name represents the chart name.
|
||||
Name string `json:"name"`
|
||||
// Version represents the chart version.
|
||||
Version string `json:"version"`
|
||||
// Release represents the chart release when executing helm template.
|
||||
Release string `json:"release"`
|
||||
// Repository represents the repository to fetch the chart from.
|
||||
Repository Repository `json:"repository,omitempty"`
|
||||
}
|
||||
```
|
||||
|
||||
## type [FileContent](/src/github.com/holos-run/holos/api/core/v1alpha2/buildplan.go?s=117:140#L1) [¶](#FileContent)
|
||||
|
||||
FileContent represents file contents.
|
||||
|
||||
```
|
||||
type FileContent string
|
||||
```
|
||||
|
||||
## type [FileContentMap](/src/github.com/holos-run/holos/api/core/v1alpha2/buildplan.go?s=314:358#L2) [¶](#FileContentMap)
|
||||
|
||||
FileContentMap represents a mapping of file paths to file contents. Paths are relative to the \`holos\` output "deploy" directory, and may contain sub-directories.
|
||||
|
||||
```
|
||||
type FileContentMap map[FilePath]FileContent
|
||||
```
|
||||
|
||||
## type [FilePath](/src/github.com/holos-run/holos/api/core/v1alpha2/buildplan.go?s=54:74#L1) [¶](#FilePath)
|
||||
|
||||
FilePath represents a file path.
|
||||
|
||||
```
|
||||
type FilePath string
|
||||
```
|
||||
|
||||
## type [HelmChart](/src/github.com/holos-run/holos/api/core/v1alpha2/helm.go?s=415:886#L1) [¶](#HelmChart)
|
||||
|
||||
HelmChart represents a holos component which wraps around an upstream helm chart. Holos orchestrates helm by providing values obtained from CUE, renders the output using \`helm template\`, then post-processes the helm output yaml using the general functionality provided by [HolosComponent](#HolosComponent), for example [Kustomize](#Kustomize) post-rendering and mixing in additional kubernetes api objects.
|
||||
|
||||
```
|
||||
type HelmChart struct {
|
||||
HolosComponent `json:",inline"`
|
||||
Kind string `json:"kind" cue:"\"HelmChart\""`
|
||||
|
||||
// Chart represents a helm chart to manage.
|
||||
Chart Chart `json:"chart"`
|
||||
// ValuesContent represents the values.yaml file holos passes to the `helm
|
||||
// template` command.
|
||||
ValuesContent string `json:"valuesContent"`
|
||||
// EnableHooks enables helm hooks when executing the `helm template` command.
|
||||
EnableHooks bool `json:"enableHooks" cue:"bool | *false"`
|
||||
}
|
||||
```
|
||||
|
||||
## type [HolosComponent](/src/github.com/holos-run/holos/api/core/v1alpha2/buildplan.go?s=1851:3130#L34) [¶](#HolosComponent)
|
||||
|
||||
HolosComponent defines the fields common to all holos component kinds. Every holos component kind should embed HolosComponent.
|
||||
|
||||
```
|
||||
type HolosComponent struct {
|
||||
// Kind is a string value representing the resource this object represents.
|
||||
Kind string `json:"kind"`
|
||||
// APIVersion represents the versioned schema of this representation of an object.
|
||||
APIVersion string `json:"apiVersion" cue:"string | *\"v1alpha2\""`
|
||||
// Metadata represents data about the holos component such as the Name.
|
||||
Metadata Metadata `json:"metadata"`
|
||||
|
||||
// APIObjectMap holds the marshalled representation of api objects. Useful to
|
||||
// mix in resources to each HolosComponent type, for example adding an
|
||||
// ExternalSecret to a HelmChart HolosComponent. Refer to [APIObjects].
|
||||
APIObjectMap APIObjectMap `json:"apiObjectMap,omitempty"`
|
||||
|
||||
// DeployFiles represents file paths relative to the cluster deploy directory
|
||||
// with the value representing the file content. Intended for defining the
|
||||
// ArgoCD Application resource or Flux Kustomization resource from within CUE,
|
||||
// but may be used to render any file related to the build plan from CUE.
|
||||
DeployFiles FileContentMap `json:"deployFiles,omitempty"`
|
||||
|
||||
// Kustomize represents a kubectl kustomize build post-processing step.
|
||||
Kustomize `json:"kustomize,omitempty"`
|
||||
|
||||
// Skip causes holos to take no action regarding this component.
|
||||
Skip bool `json:"skip" cue:"bool | *false"`
|
||||
}
|
||||
```
|
||||
|
||||
## type [Kind](/src/github.com/holos-run/holos/api/core/v1alpha2/apiobjects.go?s=763:779#L6) [¶](#Kind)
|
||||
|
||||
Kind is a kubernetes api object kind. Defined as a type for clarity and type checking.
|
||||
|
||||
```
|
||||
type Kind string
|
||||
```
|
||||
|
||||
## type [KubernetesObjects](/src/github.com/holos-run/holos/api/core/v1alpha2/kubernetesobjects.go?s=205:336#L1) [¶](#KubernetesObjects)
|
||||
|
||||
KubernetesObjects represents a [HolosComponent](#HolosComponent) composed of Kubernetes API objects provided directly from CUE using [APIObjects](#APIObjects).
|
||||
|
||||
```
|
||||
type KubernetesObjects struct {
|
||||
HolosComponent `json:",inline"`
|
||||
Kind string `json:"kind" cue:"\"KubernetesObjects\""`
|
||||
}
|
||||
```
|
||||
|
||||
## type [Kustomize](/src/github.com/holos-run/holos/api/core/v1alpha2/buildplan.go?s=4065:4360#L81) [¶](#Kustomize)
|
||||
|
||||
Kustomize represents resources necessary to execute a kustomize build. Intended for at least two use cases:
|
||||
|
||||
1. Process a [KustomizeBuild](#KustomizeBuild) [HolosComponent](#HolosComponent) which represents raw yaml file resources in a holos component directory.
|
||||
2. Post process a [HelmChart](#HelmChart) [HolosComponent](#HolosComponent) to inject istio, patch jobs, add custom labels, etc...
|
||||
|
||||
```
|
||||
type Kustomize struct {
|
||||
// KustomizeFiles holds file contents for kustomize, e.g. patch files.
|
||||
KustomizeFiles FileContentMap `json:"kustomizeFiles,omitempty"`
|
||||
// ResourcesFile is the file name used for api objects in kustomization.yaml
|
||||
ResourcesFile string `json:"resourcesFile,omitempty"`
|
||||
}
|
||||
```
|
||||
|
||||
## type [KustomizeBuild](/src/github.com/holos-run/holos/api/core/v1alpha2/kustomizebuild.go?s=165:290#L1) [¶](#KustomizeBuild)
|
||||
|
||||
KustomizeBuild represents a [HolosComponent](#HolosComponent) that renders plain yaml files in the holos component directory using \`kubectl kustomize build\`.
|
||||
|
||||
```
|
||||
type KustomizeBuild struct {
|
||||
HolosComponent `json:",inline"`
|
||||
Kind string `json:"kind" cue:"\"KustomizeBuild\""`
|
||||
}
|
||||
```
|
||||
|
||||
## type [Label](/src/github.com/holos-run/holos/api/core/v1alpha2/apiobjects.go?s=654:671#L3) [¶](#Label)
|
||||
|
||||
Label is an arbitrary unique identifier internal to holos itself. The holos cli is expected to never write a Label value to rendered output files, therefore use a [Label](#Label) then the identifier must be unique and internal. Defined as a type for clarity and type checking.
|
||||
|
||||
A Label is useful to convert a CUE struct to a list, for example producing a list of [APIObject](#APIObject) resources from an [APIObjectMap](#APIObjectMap). A CUE struct using Label keys is guaranteed to not lose data when rendering output because a Label is expected to never be written to the final output.
|
||||
|
||||
```
|
||||
type Label string
|
||||
```
|
||||
|
||||
## type [Metadata](/src/github.com/holos-run/holos/api/core/v1alpha2/buildplan.go?s=3204:3702#L61) [¶](#Metadata)
|
||||
|
||||
Metadata represents data about the holos component such as the Name.
|
||||
|
||||
```
|
||||
type Metadata struct {
|
||||
// Name represents the name of the holos component.
|
||||
Name string `json:"name"`
|
||||
// Namespace is the primary namespace of the holos component. A holos
|
||||
// component may manage resources in multiple namespaces, in this case
|
||||
// consider setting the component namespace to default.
|
||||
//
|
||||
// This field is optional because not all resources require a namespace,
|
||||
// particularly CRD's and DeployFiles functionality.
|
||||
// +optional
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
}
|
||||
```
|
||||
|
||||
## type [Platform](/src/github.com/holos-run/holos/api/core/v1alpha2/core.go?s=546:1027#L5) [¶](#Platform)
|
||||
|
||||
Platform represents a platform to manage. A Platform resource informs holos which components to build. The platform resource also acts as a container for the platform model form values provided by the PlatformService. The primary use case is to collect the cluster names, cluster types, platform model, and holos components to build into one resource.
|
||||
|
||||
```
|
||||
type Platform struct {
|
||||
// Kind is a string value representing the resource this object represents.
|
||||
Kind string `json:"kind" cue:"\"Platform\""`
|
||||
// APIVersion represents the versioned schema of this representation of an object.
|
||||
APIVersion string `json:"apiVersion" cue:"string | *\"v1alpha2\""`
|
||||
// Metadata represents data about the object such as the Name.
|
||||
Metadata PlatformMetadata `json:"metadata"`
|
||||
|
||||
// Spec represents the specification.
|
||||
Spec PlatformSpec `json:"spec"`
|
||||
}
|
||||
```
|
||||
|
||||
## type [PlatformMetadata](/src/github.com/holos-run/holos/api/core/v1alpha2/core.go?s=76:174#L1) [¶](#PlatformMetadata)
|
||||
|
||||
```
|
||||
type PlatformMetadata struct {
|
||||
// Name represents the Platform name.
|
||||
Name string `json:"name"`
|
||||
}
|
||||
```
|
||||
|
||||
## type [PlatformSpec](/src/github.com/holos-run/holos/api/core/v1alpha2/core.go?s=1254:1581#L20) [¶](#PlatformSpec)
|
||||
|
||||
PlatformSpec represents the specification of a Platform. Think of a platform specification as a list of platform components to apply to a list of kubernetes clusters combined with the user-specified Platform Model.
|
||||
|
||||
```
|
||||
type PlatformSpec struct {
|
||||
// Model represents the platform model holos gets from from the
|
||||
// PlatformService.GetPlatform rpc method and provides to CUE using a tag.
|
||||
Model structpb.Struct `json:"model"`
|
||||
// Components represents a list of holos components to manage.
|
||||
Components []PlatformSpecComponent `json:"components"`
|
||||
}
|
||||
```
|
||||
|
||||
## type [PlatformSpecComponent](/src/github.com/holos-run/holos/api/core/v1alpha2/core.go?s=1657:1896#L29) [¶](#PlatformSpecComponent)
|
||||
|
||||
PlatformSpecComponent represents a holos component to build or render.
|
||||
|
||||
```
|
||||
type PlatformSpecComponent struct {
|
||||
// Path is the path of the component relative to the platform root.
|
||||
Path string `json:"path"`
|
||||
// Cluster is the cluster name to provide when rendering the component.
|
||||
Cluster string `json:"cluster"`
|
||||
}
|
||||
```
|
||||
|
||||
## type [Repository](/src/github.com/holos-run/holos/api/core/v1alpha2/helm.go?s=1356:1435#L25) [¶](#Repository)
|
||||
|
||||
Repository represents a helm chart repository.
|
||||
|
||||
```
|
||||
type Repository struct {
|
||||
Name string `json:"name"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
```
|
||||
|
||||
Build version go1.22.4.\
|
||||
Except as [noted](https://developers.google.com/site-policies#restrictions), the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code is licensed under a [BSD license](/LICENSE).\
|
||||
[Terms of Service](https://golang.org/doc/tos.html) | [Privacy Policy](https://www.google.com/intl/en/policies/privacy/)
|
||||
|
||||
<!-- .container -->
|
||||
|
||||
<!-- #page -->
|
||||
204
doc/website/docusaurus.config.ts
Normal file
@@ -0,0 +1,204 @@
|
||||
import { themes as prismThemes } from 'prism-react-renderer';
|
||||
import type { Config } from '@docusaurus/types';
|
||||
import type * as Preset from '@docusaurus/preset-classic';
|
||||
|
||||
const config: Config = {
|
||||
title: 'Holos',
|
||||
tagline: 'The Platform Operating System',
|
||||
favicon: 'img/favicon.ico',
|
||||
|
||||
// Set the production url of your site here
|
||||
url: 'https://holos.run',
|
||||
// Set the /<baseUrl>/ pathname under which your site is served
|
||||
// For GitHub pages deployment, it is often '/<projectName>/'
|
||||
baseUrl: '/',
|
||||
trailingSlash: true,
|
||||
|
||||
// GitHub pages deployment config.
|
||||
// If you aren't using GitHub pages, you don't need these.
|
||||
organizationName: 'holos-run', // Usually your GitHub org/user name.
|
||||
projectName: 'holos', // Usually your repo name.
|
||||
|
||||
onBrokenLinks: 'throw',
|
||||
onBrokenMarkdownLinks: 'throw',
|
||||
|
||||
// Even if you don't use internationalization, you can use this field to set
|
||||
// useful metadata like html lang. For example, if your site is Chinese, you
|
||||
// may want to replace "en" with "zh-Hans".
|
||||
i18n: {
|
||||
defaultLocale: 'en',
|
||||
locales: ['en'],
|
||||
},
|
||||
|
||||
// https://docusaurus.io/docs/markdown-features/diagrams
|
||||
markdown: {
|
||||
mermaid: true
|
||||
},
|
||||
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-client-redirects',
|
||||
{
|
||||
redirects: [
|
||||
{
|
||||
to: "/docs/guides/try-holos/",
|
||||
from: "/docs/tutorial/local/k3d/"
|
||||
}
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
|
||||
themes: ['@docusaurus/theme-mermaid'],
|
||||
presets: [
|
||||
[
|
||||
'classic',
|
||||
{
|
||||
docs: {
|
||||
path: "../md",
|
||||
// Remove this to remove the "edit this page" links.
|
||||
editUrl: 'https://github.com/holos-run/holos/edit/main/doc/md/',
|
||||
showLastUpdateAuthor: true,
|
||||
showLastUpdateTime: true,
|
||||
sidebarPath: './sidebars.ts',
|
||||
},
|
||||
blog: {
|
||||
path: "blog",
|
||||
blogSidebarCount: "ALL",
|
||||
blogSidebarTitle: "All posts",
|
||||
feedOptions: {
|
||||
type: 'all',
|
||||
copyright: `Copyright © ${new Date().getFullYear()}, The Holos Authors.`,
|
||||
},
|
||||
showReadingTime: false,
|
||||
},
|
||||
theme: {
|
||||
customCss: './src/css/custom.css',
|
||||
},
|
||||
} satisfies Preset.Options,
|
||||
],
|
||||
],
|
||||
|
||||
themeConfig: {
|
||||
// Replace with your project's social card
|
||||
image: 'img/holos-social-card.png',
|
||||
docs: {
|
||||
sidebar: {
|
||||
autoCollapseCategories: false,
|
||||
}
|
||||
},
|
||||
navbar: {
|
||||
title: '',
|
||||
logo: {
|
||||
src: 'img/logo.svg',
|
||||
srcDark: 'img/logo-dark.svg',
|
||||
},
|
||||
items: [
|
||||
{
|
||||
type: 'doc',
|
||||
docId: 'guides/try-holos/index',
|
||||
position: 'left',
|
||||
label: 'Try Holos',
|
||||
},
|
||||
{
|
||||
type: 'doc',
|
||||
docId: 'intro',
|
||||
position: 'left',
|
||||
label: 'Docs',
|
||||
},
|
||||
{
|
||||
type: 'docSidebar',
|
||||
sidebarId: 'api',
|
||||
position: 'left',
|
||||
label: 'API',
|
||||
},
|
||||
{ to: '/blog', label: 'Blog', position: 'left' },
|
||||
{
|
||||
"href": "https://pkg.go.dev/github.com/holos-run/holos?tab=doc",
|
||||
"label": "GoDoc",
|
||||
"position": "left",
|
||||
"className": "header-godoc-link",
|
||||
},
|
||||
{
|
||||
href: 'https://github.com/holos-run/holos',
|
||||
label: 'GitHub',
|
||||
position: 'right',
|
||||
},
|
||||
],
|
||||
},
|
||||
footer: {
|
||||
style: 'dark',
|
||||
links: [
|
||||
{
|
||||
title: 'Docs',
|
||||
items: [
|
||||
{
|
||||
label: 'Try Holos Locally',
|
||||
to: '/docs/guides/try-holos',
|
||||
},
|
||||
{
|
||||
label: 'Documentation',
|
||||
to: '/docs/intro',
|
||||
},
|
||||
{
|
||||
label: 'API Reference',
|
||||
to: '/docs/api/core/v1alpha2',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Community',
|
||||
items: [
|
||||
{
|
||||
label: 'Discuss',
|
||||
href: 'https://github.com/orgs/holos-run/discussions',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'More',
|
||||
items: [
|
||||
{
|
||||
label: 'Blog',
|
||||
to: '/blog',
|
||||
},
|
||||
{
|
||||
label: 'GitHub',
|
||||
href: 'https://github.com/holos-run/holos',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
copyright: `Copyright © ${new Date().getFullYear()} The Holos Authors.`,
|
||||
},
|
||||
prism: {
|
||||
// Refer to https://docusaurus.io/docs/api/themes/configuration#theme
|
||||
theme: prismThemes.github,
|
||||
darkTheme: prismThemes.dracula,
|
||||
// Refer to https://docusaurus.io/docs/next/markdown-features/code-blocks#supported-languages
|
||||
additionalLanguages: ['protobuf', 'cue', 'bash', 'diff', 'json'],
|
||||
magicComments: [
|
||||
{
|
||||
className: 'theme-code-block-highlighted-line',
|
||||
line: 'highlight-next-line',
|
||||
block: { start: 'highlight-start', end: 'highlight-end' },
|
||||
},
|
||||
{
|
||||
className: 'code-block-error-message',
|
||||
line: 'highlight-next-line-error-message',
|
||||
},
|
||||
{
|
||||
className: 'code-block-info-line',
|
||||
line: 'highlight-next-line-info',
|
||||
block: { start: 'highlight-info-start', end: 'highlight-info-end' },
|
||||
},
|
||||
],
|
||||
},
|
||||
mermaid: {
|
||||
// Refer to https://mermaid.js.org/config/theming.html
|
||||
theme: { light: 'neutral', dark: 'dark' },
|
||||
},
|
||||
} satisfies Preset.ThemeConfig,
|
||||
};
|
||||
|
||||
export default config;
|
||||
17787
doc/website/package-lock.json
generated
Normal file
52
doc/website/package.json
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "website",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
"start": "docusaurus start",
|
||||
"build": "docusaurus build",
|
||||
"swizzle": "docusaurus swizzle",
|
||||
"deploy": "docusaurus deploy",
|
||||
"clear": "docusaurus clear",
|
||||
"serve": "docusaurus serve",
|
||||
"write-translations": "docusaurus write-translations",
|
||||
"write-heading-ids": "docusaurus write-heading-ids",
|
||||
"typecheck": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "3.4.0",
|
||||
"@docusaurus/plugin-client-redirects": "^3.4.0",
|
||||
"@docusaurus/preset-classic": "3.4.0",
|
||||
"@docusaurus/theme-mermaid": "^3.4.0",
|
||||
"@mdx-js/react": "^3.0.0",
|
||||
"clsx": "^2.0.0",
|
||||
"prism-react-renderer": "^2.3.0",
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "^3.4.0",
|
||||
"@docusaurus/tsconfig": "^3.4.0",
|
||||
"@docusaurus/types": "^3.4.0",
|
||||
"@wcj/html-to-markdown-cli": "^2.1.1",
|
||||
"cspell": "^8.10.4",
|
||||
"html-to-markdown": "^1.0.0",
|
||||
"typescript": "~5.2.2"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.5%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 3 chrome version",
|
||||
"last 3 firefox version",
|
||||
"last 5 safari version"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0"
|
||||
}
|
||||
}
|
||||
53
doc/website/sidebars.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';
|
||||
|
||||
/**
|
||||
* Creating a sidebar enables you to:
|
||||
- create an ordered group of docs
|
||||
- render a sidebar for each doc of that group
|
||||
- provide next/previous navigation
|
||||
|
||||
The sidebars can be generated from the filesystem, or explicitly defined here.
|
||||
|
||||
Create as many sidebars as you want.
|
||||
*/
|
||||
const sidebars: SidebarsConfig = {
|
||||
doc: [
|
||||
'intro',
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Guides',
|
||||
collapsed: false,
|
||||
items: [
|
||||
'guides/install',
|
||||
'guides/try-holos/index',
|
||||
'guides/try-holos/platform-manifests',
|
||||
'guides/argocd/index',
|
||||
'guides/backstage/index',
|
||||
'guides/observability/index',
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Design',
|
||||
collapsed: false,
|
||||
items: [
|
||||
'design/rendering',
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Reference Platform',
|
||||
collapsed: false,
|
||||
items: [
|
||||
'reference-platform/architecture',
|
||||
],
|
||||
},
|
||||
'glossary',
|
||||
],
|
||||
api: [
|
||||
'api/core/v1alpha2',
|
||||
'cli',
|
||||
],
|
||||
};
|
||||
|
||||
export default sidebars;
|
||||
72
doc/website/src/components/HomepageFeatures/index.tsx
Normal file
@@ -0,0 +1,72 @@
|
||||
import clsx from 'clsx';
|
||||
import Heading from '@theme/Heading';
|
||||
import styles from './styles.module.css';
|
||||
|
||||
type FeatureItem = {
|
||||
title: string;
|
||||
Svg: React.ComponentType<React.ComponentProps<'svg'>>;
|
||||
description: JSX.Element;
|
||||
};
|
||||
|
||||
const FeatureList: FeatureItem[] = [
|
||||
{
|
||||
title: 'Zero Trust Security',
|
||||
Svg: require('@site/static/img/base00/undraw_security_on_re_e491.svg').default,
|
||||
description: (
|
||||
<>
|
||||
Spend more time on your business features and less time rebuilding
|
||||
authentication and authorization. Holos provides zero trust security
|
||||
with no code needed to protect your services.
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'Multi-Cloud',
|
||||
Svg: require('@site/static/img/base00/undraw_cloud_hosting_7xb1.svg').default,
|
||||
description: (
|
||||
<>
|
||||
Avoid vendor lock in, downtime, and price hikes. Holos is designed to
|
||||
easily deploy workloads into multiple clouds and multiple regions.
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'Developer Portal',
|
||||
Svg: require('@site/static/img/base00/undraw_data_trends_re_2cdy.svg').default,
|
||||
description: (
|
||||
<>
|
||||
Ship high quality code quickly, provide a great developer experience,
|
||||
and maintain control over your infrastructure with the integrated
|
||||
Backstage developer portal.
|
||||
</>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
function Feature({ title, Svg, description }: FeatureItem) {
|
||||
return (
|
||||
<div className={clsx('col col--4')}>
|
||||
<div className="text--center">
|
||||
<Svg className={styles.featureSvg} role="img" />
|
||||
</div>
|
||||
<div className="text--center padding-horiz--md">
|
||||
<Heading as="h3">{title}</Heading>
|
||||
<p>{description}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function HomepageFeatures(): JSX.Element {
|
||||
return (
|
||||
<section className={styles.features}>
|
||||
<div className="container">
|
||||
<div className="row">
|
||||
{FeatureList.map((props, idx) => (
|
||||
<Feature key={idx} {...props} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
.features {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 2rem 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.featureSvg {
|
||||
height: 200px;
|
||||
width: 200px;
|
||||
}
|
||||
55
doc/website/src/css/custom.css
Normal file
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Any CSS included here will be global. The classic template
|
||||
* bundles Infima by default. Infima is a CSS framework designed to
|
||||
* work well for content-centric websites.
|
||||
*/
|
||||
|
||||
/* You can override the default Infima variables here. */
|
||||
:root {
|
||||
--ifm-link-color: #268bd2;
|
||||
--docusaurus-highlighted-code-line-bg: #eee8d5;
|
||||
|
||||
/* Solarized Base03 */
|
||||
--ifm-color-primary: #002b36;
|
||||
/* Solarized Base3 */
|
||||
--ifm-color-primary-light-background: #fdf6e3;
|
||||
|
||||
/* Solarized Base00 */
|
||||
--ifm-color-primary-dark: #657b83;
|
||||
/* Solarized Base01 */
|
||||
--ifm-color-primary-darker: #586e75;
|
||||
/* Solarized Base02 */
|
||||
--ifm-color-primary-darkest: #073642;
|
||||
/* Solarized Base0 */
|
||||
--ifm-color-primary-light: #839496;
|
||||
/* Solarized Base1 */
|
||||
--ifm-color-primary-lighter: #93a1a1;
|
||||
/* Solarized Base2 */
|
||||
--ifm-color-primary-lightest: #eee8d5;
|
||||
--ifm-code-font-size: 95%;
|
||||
}
|
||||
|
||||
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
||||
[data-theme='dark'] {
|
||||
--ifm-link-color: #268bd2;
|
||||
--docusaurus-highlighted-code-line-bg: #073642;
|
||||
|
||||
/* Solarized Base3 */
|
||||
--ifm-color-primary: #fdf6e3;
|
||||
/* Solarized Base03 */
|
||||
--ifm-color-primary-light-background: #002b36;
|
||||
|
||||
/* Solarized Base02 */
|
||||
--ifm-color-primary-dark: #073642;
|
||||
/* Solarized Base01 */
|
||||
--ifm-color-primary-darker: #586e75;
|
||||
/* Solarized Base00 */
|
||||
--ifm-color-primary-darkest: #657b83;
|
||||
/* Solarized Base2 */
|
||||
--ifm-color-primary-light: #eee8d5;
|
||||
/* Solarized Base1 */
|
||||
--ifm-color-primary-lighter: #93a1a1;
|
||||
/* Solarized Base0 */
|
||||
--ifm-color-primary-lightest: #839496;
|
||||
--ifm-code-font-size: 95%;
|
||||
}
|
||||
23
doc/website/src/pages/index.module.css
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* CSS files with the .module.css suffix will be treated as CSS modules
|
||||
* and scoped locally.
|
||||
*/
|
||||
|
||||
.heroBanner {
|
||||
padding: 4rem 0;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 996px) {
|
||||
.heroBanner {
|
||||
padding: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
48
doc/website/src/pages/index.tsx
Normal file
@@ -0,0 +1,48 @@
|
||||
import clsx from 'clsx';
|
||||
import Link from '@docusaurus/Link';
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import Layout from '@theme/Layout';
|
||||
import HomepageFeatures from '@site/src/components/HomepageFeatures';
|
||||
import Heading from '@theme/Heading';
|
||||
|
||||
import styles from './index.module.css';
|
||||
|
||||
function HomepageHeader() {
|
||||
const { siteConfig } = useDocusaurusContext();
|
||||
return (
|
||||
<header className={clsx('hero hero--primary', styles.heroBanner)}>
|
||||
<div className="container">
|
||||
<Heading as="h1" className="hero__title">
|
||||
{siteConfig.title}
|
||||
</Heading>
|
||||
<p className="hero__subtitle">{siteConfig.tagline}</p>
|
||||
<p className="projectDesc">
|
||||
Holos is a holistic software development platform built from the most
|
||||
popular open source projects.<br /> Build your developer platform in
|
||||
no time.
|
||||
</p>
|
||||
<div className={styles.buttons}>
|
||||
<Link
|
||||
className="button button--secondary button--lg"
|
||||
to="/docs/intro">
|
||||
Get Started
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Home(): JSX.Element {
|
||||
const { siteConfig } = useDocusaurusContext();
|
||||
return (
|
||||
<Layout
|
||||
title={`Hello from ${siteConfig.title}`}
|
||||
description="Holos provides a software development platform that holistically integrates the most popular cloud native projects.">
|
||||
<HomepageHeader />
|
||||
<main>
|
||||
<HomepageFeatures />
|
||||
</main>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
7
doc/website/src/pages/markdown-page.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
title: Markdown page example
|
||||
---
|
||||
|
||||
# Markdown page example
|
||||
|
||||
You don't need React to write simple standalone pages.
|
||||
0
doc/website/static/.nojekyll
Normal file
1
doc/website/static/img/backstage-logo-teal.svg
Normal file
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 9.4 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 28 KiB |