From 35d10eeb3bdcfc8e1d8a0816c8658037c77ff0ce Mon Sep 17 00:00:00 2001 From: Gary Larizza Date: Thu, 7 Nov 2024 10:50:08 -0800 Subject: [PATCH] Fix markdown links --- .../{4-local-cluster => 4-local-cluster.mdx} | 0 doc/md/tutorial/2-setup.mdx | 22 +++--- doc/md/tutorial/3-hello-holos.mdx | 69 +++++++++++++++++++ 3 files changed, 82 insertions(+), 9 deletions(-) rename doc/md/topics/{4-local-cluster => 4-local-cluster.mdx} (100%) diff --git a/doc/md/topics/4-local-cluster b/doc/md/topics/4-local-cluster.mdx similarity index 100% rename from doc/md/topics/4-local-cluster rename to doc/md/topics/4-local-cluster.mdx diff --git a/doc/md/tutorial/2-setup.mdx b/doc/md/tutorial/2-setup.mdx index b51fa7cf..35321c90 100644 --- a/doc/md/tutorial/2-setup.mdx +++ b/doc/md/tutorial/2-setup.mdx @@ -21,7 +21,7 @@ Holos is distributed as a single file executable that can be installed in a coup ### Releases -Download `holos` from the [releases](https://github.com/holos-run/holos/releases) page and place the executable into your shell path. +Download `holos` from the [releases] page and place the executable into your shell path. ### Go install @@ -38,15 +38,13 @@ Kubernetes cluster to start using the tool or understand its workflow. However, you will need a cluster eventually to apply the rendered manifests and verify that they achieve the desired end state. -We recommend using [k3d](https://k3d.io/) to set up a minimal Kubernetes cluster with -[Orbstack](https://docs.orbstack.dev/install) or -[Docker](https://docs.docker.com/get-started/get-docker/). To simplify this, -we've created [the Local Cluster guide](../topics/4-local-cluster.mdx) which -automates the process, ensuring proper DNS and TLS certificates, and includes a -script to reset the cluster to a known good state. +We recommend using [K3d] to set up a minimal Kubernetes cluster with [Orbstack] +or [Docker]. To simplify this, we've created [the K3d local cluster +guide][localcluster] which automates the process, ensuring proper DNS and TLS +certificates, and includes a script to reset the cluster to a known good state. When you're ready to experiment with a live Kubernetes cluster, refer to [the -Local Cluster guide](../topics/4-local-cluster.mdx). +k3d local cluster guide][localcluster]. # Initialize a new Platform @@ -77,9 +75,15 @@ capabilities of your platform. # Next Steps Now that you've got Holos and its prerequisites installed, continue on to the -[Hello Holos page](./3-hello-holos.mdx) where we will guide you through the +[Hello Holos page][helloholos] where we will guide you through the process of creating your first Component and modeling a Helm chart. +[K3d]: https://k3d.io/ +[Orbstack]: https://docs.orbstack.dev/install +[Docker]: https://docs.docker.com/get-started/get-docker/ +[localcluster]: ../topics/4-local-cluster.mdx +[helloholos]: ./3-hello-holos.mdx [helm]: https://github.com/helm/helm/releases [kubectl]: https://kubernetes.io/docs/tasks/tools/ +[releases]: https://github.com/holos-run/holos/releases [kustomize]: https://kustomize.io/ \ No newline at end of file diff --git a/doc/md/tutorial/3-hello-holos.mdx b/doc/md/tutorial/3-hello-holos.mdx index dd75a80a..8bf94c56 100644 --- a/doc/md/tutorial/3-hello-holos.mdx +++ b/doc/md/tutorial/3-hello-holos.mdx @@ -1 +1,70 @@ +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Hello Holos + +One of the first exercises you perform when learning a new programming language +is to print out the "Hello World!" greeting. For Holos, our "Hello Holos" +exercise involves modeling the [podinfo Helm chart][podinfo] that produces a +similar greeting message from a Kubernetes Pod. + +By the end of this tutorial you will gain the understanding of how to model +an individual Holos Component using a Helm chart as its source. + +# The code + +### Podinfo Helm Chart + +Let's start by creating a directory for `podinfo`, touching an empty CUE file, +and then populating it with the CUE code below: + + + +```bash +mkdir -p projects/tutorial/components/podinfo +touch projects/tutorial/components/podinfo/podinfo.cue +``` +```cue showLineNumbers +package holos + +// Produce a helm chart build plan. +holos: HelmChart.BuildPlan + +HelmChart: #Helm & { + Name: "podinfo" + Chart: { + version: "6.6.2" + repository: { + name: "podinfo" + url: "https://stefanprodan.github.io/podinfo" + } + } +} +``` + + + +### Register the podinfo component + +Now let's register the code modeling the `podinfo` Helm chart as a Holos +Component and assign it to a cluser. For this we will need a create new file in +the `platform` directory with the following contents: + + + +```bash +touch plaform/podinfo.cue +``` +```cue showLineNumbers +package holos + +Platform: Components: podinfo: { + name: "podinfo" + path: "projects/tutorial/components/podinfo" +} +``` + + + + +[podinfo]: https://github.com/stefanprodan/podinfo