Update kubernetes documentation to directly use cue files

Previously, we were embedding cue files directly in the doc, now we
display it from real cue file that we also use to test our doc.

I've add the first step of the kubernetes documentation adapted for
kind

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau 2021-08-13 16:34:02 +02:00 committed by Guillaume de Rouville
parent 00f7e63c4a
commit 6a442fae6c
3 changed files with 26 additions and 26 deletions

View File

@ -159,23 +159,7 @@ kubectl delete -f k8s/
Create a file named `todoapp.cue` and add the following configuration to it.
```cue title="todoapp/kube/todoapp.cue"
package main
import (
"alpha.dagger.io/dagger"
"alpha.dagger.io/kubernetes"
)
// input: kubernetes objects directory to deploy to
// set with `dagger input dir manifest ./k8s -e kube`
manifest: dagger.#Artifact & dagger.#Input
// Deploy the manifest to a kubernetes cluster
todoApp: kubernetes.#Resources & {
"kubeconfig": kubeconfig
source: manifest
}
```cue file=tests/kube-kind/basic/todoapp.cue title="todoapp/kube/todoapp.cue"
```
This defines a `todoApp` variable containing the Kubernetes objects used to create a todoapp deployment. It also
@ -193,15 +177,7 @@ The following `config.cue` defines:
- `kubeconfig` a generic value created to embed this string `kubeconfig` value
```cue title="todoapp/kube/config.cue"
package main
import (
"alpha.dagger.io/dagger"
)
// set with `dagger input text kubeconfig -f "$HOME"/.kube/config -e kube`
kubeconfig: string & dagger.#Input
```cue file=tests/kube-kind/config.cue title="todoapp/kube/config.cue"
```
</TabItem>

View File

@ -0,0 +1,16 @@
package main
import (
"alpha.dagger.io/dagger"
"alpha.dagger.io/kubernetes"
)
// input: kubernetes objects directory to deploy to
// set with `dagger input dir manifest ./k8s -e kube`
manifest: dagger.#Artifact & dagger.#Input
// Deploy the manifest to a kubernetes cluster
todoApp: kubernetes.#Resources & {
"kubeconfig": kubeconfig
source: manifest
}

View File

@ -0,0 +1,8 @@
package main
import (
"alpha.dagger.io/dagger"
)
// set with `dagger input text kubeconfig -f "$HOME"/.kube/config -e kube`
kubeconfig: string & dagger.#Input