Add test for kube-aws cue-manifest part
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
committed by
Guillaume de Rouville
parent
5fcaaa6cfe
commit
f24af776db
29
docs/learn/tests/kube-aws/cue-manifest/manifest.cue
Normal file
29
docs/learn/tests/kube-aws/cue-manifest/manifest.cue
Normal file
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/yaml"
|
||||
)
|
||||
|
||||
// Define and generate kubernetes deployment to deploy to kubernetes cluster
|
||||
#AppManifest: {
|
||||
// Name of the application
|
||||
name: string
|
||||
|
||||
// Image to deploy to
|
||||
image: string
|
||||
|
||||
// Define a kubernetes deployment object
|
||||
deployment: #Deployment & {
|
||||
"name": name
|
||||
"image": image
|
||||
}
|
||||
|
||||
// Define a kubernetes service object
|
||||
service: #Service & {
|
||||
"name": name
|
||||
ports: http: deployment.port
|
||||
}
|
||||
|
||||
// Merge definitions and convert them back from CUE to YAML
|
||||
manifest: yaml.MarshalStream([deployment.manifest, service.manifest])
|
||||
}
|
Reference in New Issue
Block a user