Skip to content

Commit

Permalink
docs: add clusters topic (#343)
Browse files Browse the repository at this point in the history
Previously we didn't have good documentation on how to manage multiple
sets of clusters.

This patch adds a clusters topic in the structures category.  Each one
of the environments, projects, owners, etc... structures follow the same
pattern as #Clusters and #ClusterSets, so it makes sense to put them
into a dedicated sidebar category for specific CUE structures.
  • Loading branch information
jeffmccune committed Nov 17, 2024
1 parent c9c8c13 commit 20fb39e
Show file tree
Hide file tree
Showing 13 changed files with 617 additions and 74 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"Cmds",
"CNCF",
"CODEOWNERS",
"componentconfig",
"configdir",
"configmap",
"configmapargs",
Expand Down
16 changes: 16 additions & 0 deletions doc/md/common/example-component-integrate.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Integrate the `podinfo` component into the platform.

```bash
cat <<EOF >platform/podinfo.cue
```
```cue showLineNumbers
package holos
Platform: Components: podinfo: {
name: "podinfo"
path: "components/podinfo"
}
```
```bash
EOF
```
34 changes: 34 additions & 0 deletions doc/md/common/example-component.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Create a directory for the example `podinfo` component we'll use to render
platform manifests.

```bash
mkdir -p components/podinfo
```

Create the CUE configuration for the example `podinfo` component.

```bash
cat <<EOF >components/podinfo/podinfo.cue
```
```cue showLineNumbers
package holos
holos: Component.BuildPlan
Component: #Helm & {
Name: "podinfo"
Chart: {
version: "6.6.2"
repository: {
name: "podinfo"
url: "https://stefanprodan.github.io/podinfo"
}
}
Values: ui: {
message: string | *"Hello World" @tag(message, type=string)
}
}
```
```bash
EOF
```
2 changes: 1 addition & 1 deletion doc/md/topics/architecture.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Architecture diagrams.
slug: architecture
sidebar_position: 90
sidebar_position: 100
---

import RenderPlatformDiagram from '@site/src/diagrams/render-platform-sequence.mdx';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ sidebar_position: 110

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CommonComponent from '../../common/example-component.mdx';
import CommonComponentIntegrate from '../../common/example-component-integrate.mdx';

# ArgoCD Application

Expand All @@ -30,62 +32,10 @@ mkdir holos-argocd-application && cd holos-argocd-application
holos init platform v1alpha5
```

### Creating a component
### Creating an example Component

Create a directory for the `podinfo` component. Create an empty file and then
add the following CUE configuration to it.

<Tabs groupId="1D2C6013-3D19-4516-8147-5A6EE214CAFF">
<TabItem value="components/podinfo/podinfo.cue" label="Podinfo Helm Chart">
```bash
mkdir -p components/podinfo
touch components/podinfo/podinfo.cue
```
```bash
cat <<EOF >components/podinfo/podinfo.cue
```
```cue showLineNumbers
package holos
holos: Component.BuildPlan
Component: #Helm & {
Name: "podinfo"
Chart: {
version: "6.6.2"
repository: {
name: "podinfo"
url: "https://stefanprodan.github.io/podinfo"
}
}
}
```
```bash
EOF
```
</TabItem>
</Tabs>

Integrate the `podinfo` component into the platform.

<Tabs groupId="tutorial-hello-register-podinfo-component">
<TabItem value="platform/podinfo.cue" label="Register Podinfo">
```bash
cat <<EOF >platform/podinfo.cue
```
```cue showLineNumbers
package holos
Platform: Components: podinfo: {
name: "podinfo"
path: "components/podinfo"
}
```
```bash
EOF
```
</TabItem>
</Tabs>
<CommonComponent />
<CommonComponentIntegrate />

## Adding ArgoCD Application

Expand Down Expand Up @@ -267,8 +217,8 @@ spec:
[podinfo]: https://github.com/stefanprodan/podinfo
[CUE Module]: https://cuelang.org/docs/reference/modules/
[CUE Tags]: https://cuelang.org/docs/howto/inject-value-into-evaluation-using-tag-attribute/
[Platform]: ../api/author.md#Platform
[Component Parameters]: ../topics/component-parameters.mdx
[Application]: https://argo-cd.readthedocs.io/en/stable/user-guide/application-specification/
[ComponentConfig]: ../api/author.md#ComponentConfig
[Artifact]: ../api/core.md#Artifact
[Component Parameters]: ../component-parameters.mdx
[Platform]: ../../api/author.md#Platform
[ComponentConfig]: ../../api/author.md#ComponentConfig
[Artifact]: ../../api/core.md#Artifact
19 changes: 19 additions & 0 deletions doc/md/topics/gitops/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
slug: .
title: GitOps
description: Managing resources with GitOps.
sidebar_position: 120
---
import DocCardList from '@theme/DocCardList';

# GitOps

This section has self contained articles covering how to manage resources using
GitOps tooling like [ArgoCD] and [Flux].

---

<DocCardList />

[ArgoCD]: https://argo-cd.readthedocs.io/en/stable/
[Flux]: https://fluxcd.io/
2 changes: 1 addition & 1 deletion doc/md/topics/local-cluster.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Build a local cluster for use with Holos.
slug: local-cluster
sidebar_position: 100
sidebar_position: 50
---

import Tabs from '@theme/Tabs';
Expand Down
Loading

0 comments on commit 20fb39e

Please sign in to comment.