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:
parent
00f7e63c4a
commit
6a442fae6c
@ -159,23 +159,7 @@ kubectl delete -f k8s/
|
|||||||
|
|
||||||
Create a file named `todoapp.cue` and add the following configuration to it.
|
Create a file named `todoapp.cue` and add the following configuration to it.
|
||||||
|
|
||||||
```cue title="todoapp/kube/todoapp.cue"
|
```cue file=tests/kube-kind/basic/todoapp.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
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This defines a `todoApp` variable containing the Kubernetes objects used to create a todoapp deployment. It also
|
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
|
- `kubeconfig` a generic value created to embed this string `kubeconfig` value
|
||||||
|
|
||||||
```cue title="todoapp/kube/config.cue"
|
```cue file=tests/kube-kind/config.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
|
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
16
docs/learn/tests/kube-kind/basic/todoapp.cue
Normal file
16
docs/learn/tests/kube-kind/basic/todoapp.cue
Normal 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
|
||||||
|
}
|
8
docs/learn/tests/kube-kind/config.cue
Normal file
8
docs/learn/tests/kube-kind/config.cue
Normal 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
|
Reference in New Issue
Block a user