example: added simple kubernetes example
Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
parent
57dfa96bee
commit
f03018d230
41
examples/kubernetes/main.cue
Normal file
41
examples/kubernetes/main.cue
Normal file
@ -0,0 +1,41 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/yaml"
|
||||
"dagger.io/aws"
|
||||
"dagger.io/aws/eks"
|
||||
"dagger.io/kubernetes"
|
||||
)
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
cluster: eks.#KubeConfig & {
|
||||
config: awsConfig
|
||||
clusterName: *"dagger-example-eks-cluster" | string
|
||||
}
|
||||
|
||||
apply: kubernetes.#Apply & {
|
||||
source: yaml.Marshal(kubeSrc)
|
||||
namespace: "test"
|
||||
kubeconfig: cluster.kubeconfig
|
||||
}
|
Reference in New Issue
Block a user