Docs: update and polish kubernetes-app and monitoring examples
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
53
examples/kubernetes-app/main.cue
Normal file
53
examples/kubernetes-app/main.cue
Normal file
@@ -0,0 +1,53 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/yaml"
|
||||
"dagger.io/dagger"
|
||||
"dagger.io/aws"
|
||||
"dagger.io/aws/eks"
|
||||
"dagger.io/kubernetes"
|
||||
"dagger.io/kubernetes/helm"
|
||||
)
|
||||
|
||||
kubeSrc: {
|
||||
apiVersion: "v1"
|
||||
kind: "Pod"
|
||||
metadata: name: "kube-test"
|
||||
spec: {
|
||||
restartPolicy: "Never"
|
||||
containers: [{
|
||||
name: "test"
|
||||
image: "hello-world"
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
// Fill using:
|
||||
// --input-string awsConfig.accessKey=XXX
|
||||
// --input-string awsConfig.secretKey=XXX
|
||||
awsConfig: aws.#Config & {
|
||||
region: *"us-east-2" | string
|
||||
}
|
||||
|
||||
// Take the kubeconfig from the EKS cluster
|
||||
cluster: eks.#KubeConfig & {
|
||||
config: awsConfig
|
||||
clusterName: *"dagger-example-eks-cluster" | string
|
||||
}
|
||||
|
||||
// Example of a simple `kubectl apply` using a simple config
|
||||
kubeApply: kubernetes.#Apply & {
|
||||
source: yaml.Marshal(kubeSrc)
|
||||
namespace: "test"
|
||||
kubeconfig: cluster.kubeconfig
|
||||
}
|
||||
|
||||
// Example of a `helm install` using a local chart
|
||||
// Fill using:
|
||||
// --input-dir helmChart.chart=./testdata/mychart
|
||||
helmChart: helm.#Chart & {
|
||||
name: "test-helm"
|
||||
namespace: "test"
|
||||
kubeconfig: cluster.kubeconfig
|
||||
chart: dagger.#Artifact
|
||||
}
|
Reference in New Issue
Block a user