This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/examples/kubernetes-app/main.cue
Tom Chauveau 32d523aa71 tests(stdlib/k8s/helm): test basic helm chart
tests(stdlib/k8s/helm): add verification
style(tests/): rename helper into verify to confirm that deployments works

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-04-15 14:24:42 +02:00

54 lines
1.1 KiB
CUE

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 & {
sourceInline: yaml.Marshal(kubeSrc)
namespace: "test"
kubeconfig: cluster.kubeconfig
}
// Example of a `helm install` using a local chart
// Fill using:
// --input-dir helmChart.chartSource=./testdata/mychart
helmChart: helm.#Chart & {
name: "test-helm"
namespace: "test"
kubeconfig: cluster.kubeconfig
chartSource: dagger.#Artifact
}