From d6f89052d933cdc32d1232dbbdcb757126d1ff3e Mon Sep 17 00:00:00 2001 From: Jeff McCune Date: Thu, 31 Oct 2024 16:20:54 -0700 Subject: [PATCH] website: update helm guide to apply patches (#291) Updated the helm guide to apply patches while still showing the diff in the documentation markdown. The only gotcha is it creates orig files. --- doc/md/guides/helm.mdx | 87 +++++++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 39 deletions(-) diff --git a/doc/md/guides/helm.mdx b/doc/md/guides/helm.mdx index 99047a43..c86e2f80 100644 --- a/doc/md/guides/helm.mdx +++ b/doc/md/guides/helm.mdx @@ -461,8 +461,9 @@ values into both charts to configure them in lock step. -```txt -projects/blackbox.schema.cue +```bash +mkdir -p projects +touch projects/blackbox.schema.cue ``` ```cue showLineNumbers package holos @@ -498,9 +499,7 @@ Add the CUE configuration to manage the prometheus Helm Chart component. ```bash mkdir -p projects/platform/components/prometheus -``` -```txt -projects/platform/components/prometheus/prometheus.cue +touch projects/platform/components/prometheus/prometheus.cue ``` ```cue showLineNumbers package holos @@ -527,8 +526,9 @@ the platform directory. -```txt -platform/prometheus.cue +```bash +mkdir -p platform +touch platform/prometheus.cue ``` ```cue showLineNumbers package holos @@ -553,8 +553,8 @@ holos render platform ./platform ```txt cached prometheus 25.27.0 -rendered prometheus for cluster local in 1.900449291s -rendered platform in 1.900581125s +rendered prometheus for cluster local in 1.600449291s +rendered platform in 1.600581125s ``` @@ -2041,9 +2041,7 @@ Add the CUE configuration to manage the blackbox Helm Chart component. ```bash mkdir -p projects/platform/components/blackbox -``` -```txt -projects/platform/components/blackbox/blackbox.cue +touch projects/platform/components/blackbox/blackbox.cue ``` ```cue showLineNumbers package holos @@ -2070,8 +2068,9 @@ _Helm: #Helm & { Register the blackbox chart with the platform by adding the following file to the platform directory. -```txt -platform/blackbox.cue +```bash +mkdir -p platform +touch platform/blackbox.cue ``` ```cue showLineNumbers package holos @@ -4168,12 +4167,8 @@ lock step. -```bash -git diff -``` - - ```diff +patch -p1 < + +```txt +patching file 'projects/platform/components/blackbox/values.cue' +patching file 'projects/platform/components/prometheus/values.cue' ``` @@ -4498,12 +4500,8 @@ render platform` command fails immediately with a clear validation error. -```bash -git diff -``` - - ```diff +patch -p1 < + +```txt +patching file 'projects/blackbox.schema.cue' ``` @@ -4539,6 +4542,13 @@ could not run: could not render component: exit status 1 at builder/v1alpha4/bui ![VS Code out of bound error](img/helm-editor-constraints.png) +Undo the invalid change. + +```bash +git restore projects/blackbox.schema.cue +rm -f projects/blackbox.schema.cue.orig +``` + ### Httpbin Kustomization We need to manage [httpbin] so we can achieve the goal of probing a simple @@ -4556,10 +4566,7 @@ components. ```bash mkdir -p projects/platform/components/httpbin -``` - -```txt -projects/platform/components/httpbin/httpbin.cue +touch projects/platform/components/httpbin/httpbin.cue ``` ```cue showLineNumbers package holos @@ -4595,7 +4602,8 @@ Register the component with the platform. ```txt -platform/httpbin.cue +mkdir -p platform +touch platform/httpbin.cue ``` ```cue showLineNumbers package holos @@ -4765,6 +4773,7 @@ deployment.apps/httpbin created Port forward to the prometheus web interface. ```bash +kubectl wait --for=condition=Available deployment/prometheus-server --timeout=300s kubectl -n default port-forward svc/prometheus-server 8081:80 ```